all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Allan Gottlieb <gottlieb@nyu.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: trouble turning off visual line mode
Date: Mon, 07 Sep 2009 11:08:40 -0400	[thread overview]
Message-ID: <yu98wgqaj2f.fsf@nyu.edu> (raw)
In-Reply-To: <yu91vmj20x1.fsf@nyu.edu> (Allan Gottlieb's message of "Sun, 06 Sep 2009 17:55:38 -0400")

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




  reply	other threads:[~2009-09-07 15:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-06 21:55 trouble turning off visual line mode Allan Gottlieb
2009-09-07 15:08 ` Allan Gottlieb [this message]
     [not found] <mailman.6141.1252274152.2239.help-gnu-emacs@gnu.org>
2009-09-07  5:13 ` Xah Lee
2009-09-07 14:45   ` Allan Gottlieb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yu98wgqaj2f.fsf@nyu.edu \
    --to=gottlieb@nyu.edu \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.