From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs Subject: bug#4366: 23.1; Can't turn off visual-line-mode via html-mode-hook Date: Fri, 8 Jan 2010 08:04:34 +0100 Message-ID: References: Reply-To: Lennart Borgman , 4366@debbugs.gnu.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1262935161 2735 80.91.229.12 (8 Jan 2010 07:19:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Jan 2010 07:19:21 +0000 (UTC) Cc: Allan Gottlieb To: Juanma Barranquero , 4366@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 08 08:19:13 2010 Return-path: Envelope-to: geb-bug-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 1NT97m-0004Pd-Or for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Jan 2010 08:19:11 +0100 Original-Received: from localhost ([127.0.0.1]:40744 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NT97m-00058A-8R for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Jan 2010 02:19:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NT97c-000556-4V for bug-gnu-emacs@gnu.org; Fri, 08 Jan 2010 02:19:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NT97W-0004yd-Sz for bug-gnu-emacs@gnu.org; Fri, 08 Jan 2010 02:18:59 -0500 Original-Received: from [199.232.76.173] (port=55277 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NT97W-0004yR-NG for bug-gnu-emacs@gnu.org; Fri, 08 Jan 2010 02:18:54 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34647) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NT97W-0004hY-GB for bug-gnu-emacs@gnu.org; Fri, 08 Jan 2010 02:18:54 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NT8v4-0007IV-HM; Fri, 08 Jan 2010 02:06:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Mail-Followup-To: Lennart Borgman , 4366@debbugs.gnu.org Resent-From: Lennart Borgman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Jan 2010 07:06:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 4366 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4366-submit@debbugs.gnu.org id=B4366.126293431328037 (code B ref 4366); Fri, 08 Jan 2010 07:06:02 +0000 Original-Received: (at 4366) by debbugs.gnu.org; 8 Jan 2010 07:05:13 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NT8uG-0007IA-Ll for submit@debbugs.gnu.org; Fri, 08 Jan 2010 02:05:12 -0500 Original-Received: from mail-fx0-f226.google.com ([209.85.220.226]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NT8u2-0007Hl-0u for 4366@debbugs.gnu.org; Fri, 08 Jan 2010 02:05:10 -0500 Original-Received: by fxm26 with SMTP id 26so16859389fxm.39 for <4366@debbugs.gnu.org>; Thu, 07 Jan 2010 23:04:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=loN3PYAwR5XCE1JNXQANFWOxJlVEvOmZuRImGLjEiD8=; b=S58ISM6thA9hD9o76UBTTxzL3zcG66kPnUh5peKd9o6B5hO3onXzKgqY5ZS/oXhBrj KdCeAEd6XDKHUmY9KEZhoyCF/q9wq/7ksQUfBbptNAEyNLR15roZnJJdsqSxY5yEXdAw 2Pk7PRy1z3gB5uvOL+fPNzfbuYqGSXbaH3IMI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=hU6yTS1UsYlIvuoX+ZOW/g4r5ZWauoxPdOhDm5aSxP0pCHCcQCE8RzXgf/tTJ+h3Ln VwH9BkSX9NVmx3MrjNtbwaHCkxcDNrUFeNDHio8v3sa7Jj4gP8lRL/lmh0nhHwBCoN7V PgXQJD0oH/D25TjPix0ailrJJ2qH1gxktKdiI= Original-Received: by 10.239.189.68 with SMTP id s4mr73954hbh.188.1262934294071; Thu, 07 Jan 2010 23:04:54 -0800 (PST) In-Reply-To: X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -2.5 (--) Resent-Date: Fri, 08 Jan 2010 02:06:02 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:34063 Archived-At: On Fri, Jan 8, 2010 at 5:12 AM, Juanma Barranquero wrote= : > On Mon, Sep 7, 2009 at 16:14, Allan Gottlieb wrote: > >> 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") =C2=A0 ; 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") =C2=A0 ; non-existent file >> (visual-off-fill-on) >> >> then all is well (mode line shows fill and not wrap). > > That is not a bug. When you do (global-visual-line-mode) =C2=A0[which > should better be (global-visual-line-mode 1), BTW], the function adds > code to several hooks to check for new buffers (find-file-hook, etc.). > > In your first case, the global mode is active (so the hooks are > active); when you run find-file, it creates the buffer, runs > html-mode-hook (disabling visual-line-mode), and finally a hook is run > which activates the mode. > > In the second case, you activate the global mode, run find-file (and > the hooks check that visual mode is active, so do nothing), and > finally run visual-off-fill-on, deactivating the visual-line mode. > > If you want to deactivate the mode automatically after find-file, > there are several ways, like an `after' advice for find-file, or > adding code to the relevant hooks, etc. Hm, maybe someone wants to make a picture that quickly describes the order of the hooks. That would be useful IMO.