[OS X Emacs] Re: enable hard wrap for latex-mode...

Bruno Cadonna cadonna at inf.unibz.it
Mon Mar 23 06:00:29 EDT 2009


David,


David Reitter <david.reitter <at> gmail.com> writes:

> 
> Bruno,
> 
> On Mar 22, 2009, at 8:57 AM, Bruno Cadonna wrote:
> > - to customizations.el the following line is added:
> > '(LaTeX-mode-hook (quote (preview-mode-setup smart-dnd-latex #[nil
> > "\300\301!\207" [TeX-fold-mode t] 2] LaTeX-install-toolbar turn-on- 
> > bib-cite
> > turn-on-reftex turn-on-auto-fill)))
> >
> > - In the customization interface under LaTex-mode-hook the following  
> > appears:
> >
> > LaTeX-mode-hook:
> > '(preview-mode-setup smart-dnd-latex
> > 		     #[nil "\300\301!\207"
> > 			   [TeX-fold-mode t]
> > 			   2]
> > 		     LaTeX-install-toolbar turn-on-bib-cite turn-on-reftex turn-on- 
> > auto-fill)
> >
> >   State: SAVED and set. (mismatch)
> >
> > Note the word "mismatch" in parenthesis!
> >
> > - if I open a .tex file the major mode seems to be "Fundamental" and  
> > the minor
> > modes "Wrap Spc", although in the menu bar the "LaTeX" and "Command"  
> > entry do
> > appear.
> 
> It appears that the "preview" package adds its setup function to this  
> hook when it is loaded, but it isn't loaded until after the hook is  
> executed.  That's the design of AUCTeX, which will only work if you  
> load the preview package prior to using LaTeX.
> 
> Try adding this:
> 
> (autoload 'preview-mode-setup "preview")
> 
> to your Preferences.el file.

Thank you! 
It works now!

I added (autoload 'preview-mode-setup "preview") to my Preferences.el. Moreover,
I added turn-off-word-wrap to the LaTeX-mode-hook because otherwise I had soft
word wrap and hard word wrap enabled simultaneously when I opened .tex files
which was not really a problem since the buffer behaved like only hard wrap were
enabled. I just wanted to eliminate all sources which potentially could lead to
strange behaviour.

For all others that want to have hard word wrap enabled by default only for
latex mode I posted my Preferences.el and customization.el after my signature.

Cheers,
Bruno


customization.el:

custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(LaTeX-mode-hook (quote (preview-mode-setup smart-dnd-latex #[nil
"\300\301!\207" [TeX-fold-mode t
] 2] LaTeX-install-toolbar turn-on-bib-cite turn-on-reftex turn-on-auto-fill
turn-off-word-wrap)))
 '(aquamacs-additional-fontsets nil t)
 '(aquamacs-customization-version-id 172 t)
 '(transient-mark-mode t))
 
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )
 


Preferences.el:

; This is the Aquamacs Preferences file.
;; Add Emacs-Lisp code here that should be executed whenever
;; you start Aquamacs Emacs. If errors occur, Aquamacs will stop
;; evaluating this file and print errors in the *Messags* buffer.
;; Use this file in place of ~/.emacs (which is loaded as well.)

(autoload 'preview-mode-setup "preview")








More information about the MacOSX-Emacs mailing list