hatmatrix
hatmatrix

Reputation: 44862

longlines mode in Emacs

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

Upvotes: 6

Views: 3130

Answers (3)

Liam
Liam

Reputation: 1591

I disable auto-fill mode when using longlines, and now that I'm aware of and using visual-line mode, that too. I think it is unnecessary with either of these for my purposes, and would perhaps conflict with them (inserting hard new lines at the same or different places where longlines/visual line would insert soft newlines).

Upvotes: 0

Sean Bright
Sean Bright

Reputation: 120634

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 :-)

Upvotes: 3

huaiyuan
huaiyuan

Reputation: 26519

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

Upvotes: 11

Related Questions