[OS X Emacs] How to overwrite global line-wrapping setting for a specific mode?

Marius Hofert marius.hofert at math.ethz.ch
Thu Oct 6 17:42:04 EDT 2011


Dear David,

I searched the archives on http://search.gmane.org/ for "visual line", for "ess-mode-hook", and for "R-mode-hook" but haven't found anything recently on that topic. Do you remember the context?

Apart from that, searching for "ess-mode-hook" brought:
(add-hook 'ess-mode-hook 'turn-on-auto-fill)
(add-hook 'inferior-ess-mode-hook 'turn-on-auto-fill)
But I couldn't figure out how to replace the "auto-fill" mode by "truncate". I tried (without success):
(add-hook 'ess-mode-hook 'truncate-lines)
(add-hook 'inferior-ess-mode-hook 'truncate-lines)
and:
(add-hook 'ess-mode-hook
          #'(lambda () (setq truncate-lines 1)))

Cheers,

Marius

On 2011-10-06, at 22:27 , David Reitter wrote:

> On Oct 6, 2011, at 4:21 PM, Marius Hofert wrote:
> 
>> I work with Aquamacs Distribution 3.xdev on Mac OS X 10.7.1. I use "(global-visual-line-mode 1)" in Preferences.el to set the default to "word wrap" in documents. How can I "locally" overwrite this by "truncate" in R mode? So whenever an .R file is open, it should wrap lines with the option "truncate" rather than "word wrap".
> 
> ess-mode-hook (or R-mode-hook) is your friend.  I have explained it at length in slightly different context on this mailing list, just a few weeks ago.
> 
> 
> 
> --
> http://aquamacs.org -- Aquamacs: Emacs on Mac OS X
> http://aquamacs.org/donate -- Could we help you? Return the favor and support the Aquamacs Project!_____________________________________________________________
> MacOSX-Emacs mailing list
> MacOSX-Emacs at email.esm.psu.edu
> http://email.esm.psu.edu/mailman/listinfo/macosx-emacs
> List Archives: http://dir.gmane.org/gmane.emacs.macintosh.osx





More information about the MacOSX-Emacs mailing list