Org-mode set line breaks

Korey Hinton –> My Blog –> Emacs –> Org-mode set line breaks

March 7, 2014

Emacs Line Truncation

In Emacs you have the ability to toggle line truncation on and off with the following Meta command:

M-x toggle-truncate-lines

You can also set the default behavior with the following code:

Important Note: This won't change Org-mode's line break behavior, for that you must either set it manually with the Meta command above or with an org-mode hook shown in Org-mode Line Truncation Hook.

(setq truncate-lines nil) ;;truncation disabled
(setq truncate-lines t) ;;truncation enabled

The way Emacs uses the term truncated might seem backwards; I expected it to have the opposite behavior. The reason they call it a truncated line is because it doesn't wrap to the next line and instead it is truncated or cut off from your view and you have to move the cursor to the right to be able to see it.

Org-mode Line Truncation Hook

By default org-mode doesn't wrap lines. This default behavior is useful for viewing large org files, but editing files can be more difficult without being able to see the entire paragraph or sentence you are typing.

  • Line Breaks Enabled:
    (add-hook 'org-mode-hook (lambda () (setq truncate-lines nil))) ;;truncation disabled
    
  • Line Breaks Disabled:
    (add-hook 'org-mode-hook (lambda () (setq truncate-lines t))) ;;truncation enabled
    

Date: 2014-04-06T04:26+0000

Author: Korey

Org version 7.9.3f with Emacs version 24

Validate XHTML 1.0