Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

longlines mode in Emacs

Tags:

emacs

elisp

I recently discovered longlines mode in Emacs (after having been a regular user for 5 yrs!). So I set in my .emacs file

(add-hook 'text-mode-hook 'turn-on-auto-fill) 
(add-hook 'text-mode-hook 'longlines-mode)

(do I still need auto-fill? I can't tell...) which also sets org-mode to operate in longlines-mode as well. This seems to mess up the table construction functionality so I'd like to disable longlines mode for org-mode (which appears to incorporate text-mode-hooks) but keep it enabled for text (.txt) files.

I wonder if anyone has a solution to this? I am slowly picking up bits of Emacs Lisp but have not studied up on manipulating mode-hooks yet...

Thanks much! -Stephen

like image 358
hatmatrix Avatar asked Aug 11 '09 21:08

hatmatrix


2 Answers

Try visual-line-mode, which supplants longlines-mode since Emacs-23.1.

like image 118
huaiyuan Avatar answered Oct 10 '22 14:10

huaiyuan


You should be able to explicitly disable longlines-mode in org-mode by adding a hook to org-mode-hook:

(add-hook 'org-mode-hook
          '(lambda ()
             (longlines-mode -1)))

Edit: Thanks to Török Gábor for pointing out my elisp fail :-)

like image 41
Sean Bright Avatar answered Oct 10 '22 14:10

Sean Bright