unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Info tooltip for *Menu items
       [not found] <001f01c52984$24a12690$0200a8c0@sedrcw11488>
@ 2005-03-16  6:42 ` David Hunter
  2005-03-18 15:46   ` Juri Linkov
  0 siblings, 1 reply; 2+ messages in thread
From: David Hunter @ 2005-03-16  6:42 UTC (permalink / raw)
  Cc: bug-gnu-emacs

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.
-Dave

*** info.el	16 Mar 2005 00:34:14 -0500	1.420
--- info.el	16 Mar 2005 00:34:59 -0500	
***************
*** 3793,3801 ****
                (add-text-properties
                 (match-beginning 1) (match-end 1)
                 (list
!                 '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)
                (add-text-properties
--- 3793,3801 ----
                (add-text-properties
                 (match-beginning 1) (match-end 1)
                 (list
!                 '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)
                (add-text-properties

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Info tooltip for *Menu items
  2005-03-16  6:42 ` Info tooltip for *Menu items David Hunter
@ 2005-03-18 15:46   ` Juri Linkov
  0 siblings, 0 replies; 2+ messages in thread
From: Juri Linkov @ 2005-03-18 15:46 UTC (permalink / raw)
  Cc: lennart.borgman.073, bug-gnu-emacs

David Hunter <hunterd42@comcast.net> writes:
> 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...)))).

Thanks for the patch.  Due to provider's mail server problems
I just now started to receive Wednesday's messages.  Since
I was not able to see your patch until now, I already fixed this bug,
but slightly differently: I retained the condition for testing
for match-end for the case if for some reasons (match-end 3) is nil,
so code will not display "mouse-2: go to " in this case.

Could you debug and find fixes for other unfixed Emacs bugs?

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-18 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <001f01c52984$24a12690$0200a8c0@sedrcw11488>
2005-03-16  6:42 ` Info tooltip for *Menu items David Hunter
2005-03-18 15:46   ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).