From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: John Paul Wallington Newsgroups: gmane.emacs.devel Subject: Re: `Info-fontify-node' doesn't bind mouse-events in buffer Date: Thu, 06 Jun 2002 05:20:04 +0100 Sender: emacs-devel-admin@gnu.org Message-ID: NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1023337123 29616 127.0.0.1 (6 Jun 2002 04:18:43 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 6 Jun 2002 04:18:43 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17FojS-0007hZ-00 for ; Thu, 06 Jun 2002 06:18:42 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17Fp4B-0000fA-00 for ; Thu, 06 Jun 2002 06:40:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17Foiq-0008Vk-00; Thu, 06 Jun 2002 00:18:04 -0400 Original-Received: from mail4.svr.pol.co.uk ([195.92.193.211]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17FogB-0008Np-00; Thu, 06 Jun 2002 00:15:19 -0400 Original-Received: from modem-49.cruncher.dialup.pol.co.uk ([62.25.232.49] helo=bundalo.shootybangbang.com) by mail4.svr.pol.co.uk with esmtp (Exim 3.35 #1) id 17FogA-0007nd-00; Thu, 06 Jun 2002 05:15:18 +0100 Original-Received: from jpw by bundalo.shootybangbang.com with local (Exim 3.32 #1 (Debian)) id 17Fokm-0003Wo-00; Thu, 06 Jun 2002 05:20:04 +0100 Original-To: emacs-pretest-bug@gnu.org In-Reply-To: message from John Paul Wallington on 6 Jun 2002 04:38:49 +0100 Original-References: Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:4603 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:4603 Please don't install the patch I sent to emacs-pretest-bug@gnu.org The patch fixed the following symptoms: C-h C-f gives us the FAQ in Info. There are two headers, one in the header-line and one in the buffer. For the header in the buffer, elements have a tooltip and a mouse face, but aren't clickable. Unfortunately, the patch bound both [mouse-2] and [mouse-1]. I have realised it shouldn't bind [mouse-1]. A revised patch follows. What do people think ? 2002-06-06 John Paul Wallington * info.el (Info-fontify-node): Bind mouse events in the buffer. Index: info.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/info.el,v retrieving revision 1.302 diff -u -r1.302 info.el *** info.el 3 Jun 2002 22:57:40 -0000 1.302 --- info.el 6 Jun 2002 04:11:43 -0000 *************** *** 2638,2654 **** 'help-echo (concat "Go to node " (buffer-substring nbeg nend))) ! ;; Don't bind mouse events on the header line if we ! ;; aren't going to display the header line. ! (when Info-use-header-line ! (let ((fun (cdr (assoc tag '(("Prev" . Info-prev) ! ("Next" . Info-next) ! ("Up" . Info-up)))))) ! (when fun ! (let ((keymap (make-sparse-keymap))) (define-key keymap [header-line mouse-1] fun) ! (define-key keymap [header-line mouse-2] fun) ! (put-text-property tbeg nend 'local-map keymap))))) (if (not Info-use-header-line) ;; In case they switched Info-use-header-line off ;; in the middle of an Info session, some text --- 2638,2653 ---- 'help-echo (concat "Go to node " (buffer-substring nbeg nend))) ! (let ((fun (cdr (assoc tag '(("Prev" . Info-prev) ! ("Next" . Info-next) ! ("Up" . Info-up)))))) ! (when fun ! (let ((keymap (make-sparse-keymap))) ! (define-key keymap [mouse-2] fun) ! (when Info-use-header-line (define-key keymap [header-line mouse-1] fun) ! (define-key keymap [header-line mouse-2] fun)) ! (put-text-property tbeg nend 'local-map keymap)))) (if (not Info-use-header-line) ;; In case they switched Info-use-header-line off ;; in the middle of an Info session, some text -- John Paul Wallington