[Top][All Lists]

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

Re: Info tooltip for *Menu items

From: David Hunter
Subject: Re: Info tooltip for *Menu items
Date: Wed, 16 Mar 2005 01:42:53 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)

Lennart Borgman wrote:
The tooltip I get for *Menu items in Info is only "mouse-1: go to ". Did I
break something or do you see the same as I see?

I see the same in (emacs)Top, for menu entries with empty node names (* Distrib::).  Menu 
entries with non-empty node names (* Files: Basic Files) show useful tooltips 
("mouse-1: go to Basic Files").

I tracked this behavior down to lisp/info.el Info-fontify-node:

     ;; Fontify menu items
               'help-echo (if (match-end 3)
                              (concat "mouse-2: go to " (match-string 3))
                            "mouse-2: go to this node")

When the menu entry has an empty node name, the node name match (match-string 3) is 
"", not nil.  This is submatch 1 of Info-following-node-name-re and is 
guaranteed to be non-nil.  To fix this, the if should test match-string, not match-end.  
The correct test is found 10 lines down in (let ((node (if...)))).

My suggested patch follows.

*** info.el     16 Mar 2005 00:34:14 -0500      1.420
--- info.el     16 Mar 2005 00:34:59 -0500      
*** 3793,3801 ****
                (match-beginning 1) (match-end 1)
!                 'help-echo (if (match-end 3)
!                                (concat "mouse-2: go to " (match-string 3))
!                              "mouse-2: go to this node")
                 'mouse-face 'highlight)))
             (when (or not-fontified-p fontify-visited-p)
--- 3793,3801 ----
                (match-beginning 1) (match-end 1)
!                 'help-echo (if (equal (match-string 3) "")
!                              "mouse-2: go to this node"
!                            (concat "mouse-2: go to " (match-string 3)))
                 'mouse-face 'highlight)))
             (when (or not-fontified-p fontify-visited-p)

reply via email to

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