emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `Info-fontify-node' doesn't bind mouse-events in buffer


From: John Paul Wallington
Subject: Re: `Info-fontify-node' doesn't bind mouse-events in buffer
Date: Thu, 06 Jun 2002 05:20:04 +0100

Please don't install the patch I sent to address@hidden

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  <address@hidden>

        * 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]