[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 18:18:46 EDT 2011


On 2011-10-06, at 23:51 , David Reitter wrote:

> On Oct 6, 2011, at 5:42 PM, Marius Hofert wrote:
> > 
> > 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?
> 
> Dude...
>  
> your reply to my explanation, on 9/22/2011: http://permalink.gmane.org/gmane.emacs.macintosh.osx/6502
> 
> > Apart from that, searching for "ess-mode-hook" brought:
> 
> … lots of stuff that you could copy&paste without understanding it, and it's unlikely to work perfectly with newer versions.
> 
> As always, and as explained in my mail above, you should do C-h k, then select the appropriate menu entry (truncate) to find out what the right command is that will enable the functionality you desire.

After searching the web, I found "toggle-truncate-lines". I then looked it up via "C-h f". But from there I haven't found anything useful. I know I can change the behavior via "M-x toggle-truncate-lines" if the .R file is open, but that is a bit tedious. This is how far I got before I wrote to the mailing list.

With C-h k + the menu item "truncate", I found "set-truncate-lines", so I tried:
(add-hook 'ess-mode-hook 'set-truncate-lines)
Again, .R files were opened with word(s) wrap(ped).

Another approach (adapted from http://stackoverflow.com/questions/950340/how-do-you-activate-line-wrapping-in-emacs):
(add-hook 'ess-mode-hook (lambda () (setq truncate-lines t)))
this can also be found here: http://www.emacswiki.org/emacs/TruncateLines and in many other places.
Again, it didn't change the behavior.


Cheers,

Marius

PS: Thanks for the hint with C-h k, I wasn't aware of this before. Together with the Menu bar, the gives a powerful starting point for looking up commands etc.


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