[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: trouble turning off visual line mode
From: |
Allan Gottlieb |
Subject: |
Re: trouble turning off visual line mode |
Date: |
Mon, 07 Sep 2009 11:08:40 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
At Sun, 06 Sep 2009 17:55:38 -0400 Allan Gottlieb <gottlieb@nyu.edu> wrote:
> I have the following function in my .emacs
>
> ;; Want auto-fill and not visual-line-mode
> ;; Define the function here; add to hook via customize
> (defun ajg-html-visual-off-fill-on ()
> "For html, turn OFF visual-line-mode and turn-ON auto fill"
> (message "ckpt 1")
> (visual-line-mode -1)
> (message "ckpt 2")
> (auto-fill-mode 1)
> (message "ckpt 3")
> )
>
> I have it put in the html-mode-hook via
>
> (custom-set-variables
> ...
> '(html-mode-hook (quote (ajg-alter-electric-html-tag
> ajg-html-visual-off-fill-on)))
> ...
> )
>
> Yet when I visit an html file
> auto-fill-mode is turned on as expected but
> visual-line-mode is *not* turned off.
>
> Any help would be appreciated.
> thanks,
> allan
>
> PS.
>
> All three ckpt msgs are in *Message*, with nothing in between
> The mode line shows wrap and fill
I am pretty sure this is a bug. It involves hooks but does not involve
custom-set-variable as I had erroneously suggested above.
Have /tmp/fun.el contain
(defun visual-off-fill-on ()
"For html, turn OFF visual-line-mode and turn-ON auto fill"
(visual-line-mode 0)
(auto-fill-mode 1))
Start emacs -Q
(load-file "/tmp/fun.el")
(global-visual-line-mode)
(add-hook 'html-mode-hook 'visual-off-fill-on)
(find-file "/tmp/x.html") ; non-existent file
mode line shows fill as expected, but also shows wrap, the bug.
However, if one does instead
Start emacs -Q
(load-file "/tmp/fun.el")
(global-visual-line-mode)
(find-file "/tmp/x.html") ; non-existent file
(visual-off-fill-on)
then all is well (mode line shows fill and not wrap).
I plan on filing a bug report.
allan