From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero 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 05:12:16 +0100 Message-ID: References: Reply-To: Juanma Barranquero , 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 1262924394 13847 80.91.229.12 (8 Jan 2010 04:19:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Jan 2010 04:19:54 +0000 (UTC) Cc: 4366@debbugs.gnu.org To: Allan Gottlieb Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 08 05:19:46 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 1NT6K8-0005pp-F5 for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Jan 2010 05:19:44 +0100 Original-Received: from localhost ([127.0.0.1]:42846 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NT6K8-0003oX-Ak for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Jan 2010 23:19:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NT6K2-0003lZ-Qj for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2010 23:19:38 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NT6Jy-0003eE-73 for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2010 23:19:38 -0500 Original-Received: from [199.232.76.173] (port=54518 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NT6Jx-0003du-Vn for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2010 23:19:34 -0500 Original-Received: from [140.186.70.43] (port=33984 helo=debbugs.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NT6Jx-0001ho-NQ for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2010 23:19:33 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NT6De-0005xE-5V; Thu, 07 Jan 2010 23:13:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Mail-Followup-To: Juanma Barranquero , 4366@debbugs.gnu.org Resent-From: Juanma Barranquero 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 04:13: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.126292397422882 (code B ref 4366); Fri, 08 Jan 2010 04:13:02 +0000 Original-Received: (at 4366) by debbugs.gnu.org; 8 Jan 2010 04:12:54 +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 1NT6DV-0005x1-LQ for submit@debbugs.gnu.org; Thu, 07 Jan 2010 23:12:53 -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 1NT6DI-0005wu-EQ for 4366@debbugs.gnu.org; Thu, 07 Jan 2010 23:12:52 -0500 Original-Received: by fxm26 with SMTP id 26so16810302fxm.39 for <4366@debbugs.gnu.org>; Thu, 07 Jan 2010 20:12:36 -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=IAa87ezbseRSmDKpb2PKoeBxGQBN1FlE2myfKZ/WpaE=; b=XbMBH/OWIVLwRZYsuye8Acw8gzwye8Zk6ek5d2H308g8bXXjDT054VZ2B9YQvAFST9 TucLB/K/7zrnm0dTR9ZscLKivtEW4Yf0rj2j9xpxIHudGdY2aaLoKzLasIpu8+XcsKvI a6WHFUS/N5S/iWtMQLF3TdiJZHO2TIPpJl6A0= 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=dqDm27NPComlfdRqTD7gqNVus8Ym0AFVHJRoLRyaw9Djg2KXxxz6yCuezsQn82+ol8 P3tSNBCZFhQOLwE5GqLV9+Df3xkQrMo88Zzfgxwu9qhWt0pKymnnS64MHfjb468NRgy9 QyIzxtgIOoWRtttdLT1vn3/TENlL8YaWajq+s= Original-Received: by 10.239.193.134 with SMTP id j6mr1218127hbi.26.1262923956157; Thu, 07 Jan 2010 20:12:36 -0800 (PST) In-Reply-To: X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -2.6 (--) Resent-Date: Thu, 07 Jan 2010 23:13: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:34059 Archived-At: 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) [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. Juanma