From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: hl-line-mode is buffer-local in spite of its documentation Date: Mon, 08 Sep 2003 10:05:13 -0600 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3F5CA8B9.5080908@yahoo.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1063052035 26970 80.91.224.253 (8 Sep 2003 20:13:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 8 Sep 2003 20:13:55 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 08 22:13:53 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19wSOX-0003Am-00 for ; Mon, 08 Sep 2003 22:13:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 19wSO3-0004c6-MW for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Sep 2003 16:13:23 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 19wRCA-0000ie-72 for bug-gnu-emacs@prep.ai.mit.edu; Mon, 08 Sep 2003 14:57:02 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 19wR9B-0006x0-GS for bug-gnu-emacs@prep.ai.mit.edu; Mon, 08 Sep 2003 14:54:00 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.22) id 19wR8L-0006Tn-9t for bug-gnu-emacs@prep.ai.mit.edu; Mon, 08 Sep 2003 14:53:05 -0400 Original-Received: from [130.59.10.2] (helo=chx400.switch.ch) by mx20.gnu.org with esmtp (Exim 4.22) id 19wR7e-0001nf-IM for bug-gnu-emacs@prep.ai.mit.edu; Mon, 08 Sep 2003 14:52:22 -0400 Original-Received: from mail.fu-berlin.de ([160.45.11.165]) by chx400.switch.ch with esmtp (Exim 3.20 #1) id 19wOVw-00011G-00 for gnu-emacs-bug@moderators.isc.org; Mon, 08 Sep 2003 18:05:16 +0200 Original-Received: by mail.fu-berlin.de (Smail3.2.0.98) from Curry.ZEDAT.FU-Berlin.DE (160.45.10.36) with esmtp id ; Mon, 8 Sep 2003 18:05:16 +0200 (MEST) Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.fu-berlin.de with bsmtp id ; Mon, 8 Sep 2003 18:05:15 +0200 (MEST) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: 170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 60 X-Orig-NNTP-Posting-Host: 170.207.51.80 X-Orig-X-Trace: news.uni-berlin.de 1063037114 20306083 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:5762 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:5762 Peter S Galbraith wrote: > hl-line.el says that `hl-line-mode' is a global mode and that: > > ;; You could make variable `hl-line-mode' buffer-local to avoid > ;; highlighting specific buffers. > > but somehow hl-line-mode is always a buffer-local variable after > invoking `emacs21 -q --no-site-file'. The side-effect is that it > doesn't work as expected. If you turn it on, it is enabled in only > that buffer and not globally. That's a documentation bug: *** emacs-21.3/lisp/hl-line.el.orig Sun Aug 26 06:08:58 2001 --- emacs-21.3/lisp/hl-line.el Mon Sep 8 09:58:00 2003 *************** *** 25,31 **** ;;; Commentary: ! ;; Provides a global minor mode (toggled by M-x hl-line-mode) to ;; highlight, on a suitable terminal, the line in the current window ;; on which point is (except in a minibuffer window). Done to satisfy ;; a request for a feature of Lesser Editors. --- 25,32 ---- ;;; Commentary: ! ;; Provides a local minor mode (toggled by M-x hl-line-mode) and ! ;; a global minor mode (toggled by M-x global-hl-line-mode) to ;; highlight, on a suitable terminal, the line in the current window ;; on which point is (except in a minibuffer window). Done to satisfy ;; a request for a feature of Lesser Editors. *************** *** 44,52 **** ;; `hl-line-highlight', on `post-command-hook', activates it again ;; across the window width. - ;; You could make variable `hl-line-mode' buffer-local to avoid - ;; highlighting specific buffers. - ;;; Code: (defgroup hl-line nil --- 45,50 ---- > If you turn it on in a second buffer, > it works in both buffers now, but if you turn it off in one of those > buffers then it doesn't work in either since the hooks are removed > globally. Since hl-line-highlight tests the value of hl-line-mode and hl-line-unhighlight test the value of hl-line-overlay, perhaps it's not necessary to remove them from pre-command-hook and post-command-hook respectively (in hl-line-mode). -- Kevin Rodgers