From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Allan Gottlieb Newsgroups: gmane.emacs.help Subject: Re: trouble turning off visual line mode Date: Mon, 07 Sep 2009 11:08:40 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1252345729 14239 80.91.229.12 (7 Sep 2009 17:48:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Sep 2009 17:48:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 07 17:16:05 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mkfwq-0006oP-SX for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Sep 2009 17:16:05 +0200 Original-Received: from localhost ([127.0.0.1]:50243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mkfwq-00070F-17 for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Sep 2009 11:16:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mkfpx-0002PE-Ez for help-gnu-emacs@gnu.org; Mon, 07 Sep 2009 11:08:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mkfpp-0002JH-Dj for help-gnu-emacs@gnu.org; Mon, 07 Sep 2009 11:08:54 -0400 Original-Received: from [199.232.76.173] (port=46135 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mkfpo-0002J0-Hh for help-gnu-emacs@gnu.org; Mon, 07 Sep 2009 11:08:48 -0400 Original-Received: from smtp.cs.nyu.edu ([128.122.80.33]:45500) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mkfpm-00084H-9S for help-gnu-emacs@gnu.org; Mon, 07 Sep 2009 11:08:47 -0400 Original-Received: from ajglap.localdomain (ool-4578da1c.dyn.optonline.net [69.120.218.28]) (authenticated bits=0) by smtp.cs.nyu.edu (8.14.3/8.13.8) with ESMTP id n87F8jrn013993 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 7 Sep 2009 11:08:45 -0400 (EDT) Original-Received: by ajglap.localdomain (Postfix, from userid 1502) id 34C5119D922; Mon, 7 Sep 2009 11:08:40 -0400 (EDT) In-Reply-To: (Allan Gottlieb's message of "Sun, 06 Sep 2009 17:55:38 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:67940 At Sun, 06 Sep 2009 17:55:38 -0400 Allan Gottlieb 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