emacs-devel
[Top][All Lists]
Advanced

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

Re: locate-with-filter


From: Luc Teirlinck
Subject: Re: locate-with-filter
Date: Tue, 28 Mar 2006 22:09:32 -0600 (CST)

Richard Stallman wrote:

       While grepping, I noticed problems with `list-faces-display' and
       `list-character-sets'.  These say: "Use <mouse-2> or M-x help-follow"
       in their introductory text, even though `M-x help-follow' is bound to
       RET in these buffers.

   How about making them use help-follow-symbol instead of help-follow?
   Wouldn't that make them work right?

No because `help-follow-symbol' does not follow buttons.  It always
displays any available docs, even if the buttons do something
completely unrelated, as is the case with many buttons in the buffers
in question.

The problem is that the "\\[help-follow]" in the docs is not working
right, probably because of the use of
`minor-mode-overriding-map-alist'.  The purpose of \\[...] is to take
user bindings into account.  After the changes you made to
help-follow, binding `help-follow' to anything else but RET does not
work anymore.  Hence, the \\[...] would make no sense even _if_ it
worked correctly.  That is why I suggested to simply hardcode RET in
the docstring and that is what my first two patches below (which I
submitted before) do.  I believe that we must do _something_, because
the current introductory text is quite simply incorrect and misleading.

After these two patches, the only problem that remains is that
rebinding `help-follow' no longer works.  Maybe that problem is not
important enough to worry about.  But I submitted a third patch
(reproduced below) that would fix this problem without any other
change to current behavior.  I could apply that third patch too.  If
not, what about mentioning in the docstrings of `help-follow' and
`help-follow-mouse' that binding them to different keys (than RET or
mouse-{1,2}, respectively) will not work as expected?

Reminder of my patches:

===File ~/faces-diff========================================
*** faces.el    06 Feb 2006 16:01:46 -0600      1.348
--- faces.el    19 Mar 2006 21:21:23 -0600      
***************
*** 1205,1211 ****
          (concat
           "Use "
           (if (display-mouse-p) "\\[help-follow-mouse] or ")
!          "\\[help-follow] on a face name to customize it\n"
           "or on its sample text for a description of the face.\n\n")))
        (setq help-xref-stack nil)
        (dolist (face faces)
--- 1205,1211 ----
          (concat
           "Use "
           (if (display-mouse-p) "\\[help-follow-mouse] or ")
!          "RET on a face name to customize it\n"
           "or on its sample text for a description of the face.\n\n")))
        (setq help-xref-stack nil)
        (dolist (face faces)
============================================================

===File ~/mule-dialog-diff==================================
*** mule-diag.el        24 Sep 2005 09:35:46 -0500      1.98
--- mule-diag.el        19 Mar 2006 21:19:26 -0600      
***************
*** 162,168 ****
         (substitute-command-keys
          (concat "Use "
                  (if (display-mouse-p) "\\[help-follow-mouse] or ")
!                 "\\[help-follow]:\n")))
        (insert "  on a column title to sort by that title,")
        (indent-to 56)
        (insert "+----DIMENSION\n")
--- 162,168 ----
         (substitute-command-keys
          (concat "Use "
                  (if (display-mouse-p) "\\[help-follow-mouse] or ")
!                 "RET:\n")))
        (insert "  on a column title to sort by that title,")
        (indent-to 56)
        (insert "+----DIMENSION\n")
============================================================

===File ~/help-mode-diff====================================
*** help-mode.el        19 Mar 2006 17:03:47 -0600      1.44
--- help-mode.el        19 Mar 2006 21:45:44 -0600      
***************
*** 619,636 ****
      (apply function args)))
  
  ;; The doc string is meant to explain what buttons do.
! (defun help-follow-mouse ()
!   "Follow the cross-reference that you click on."
!   (interactive)
!   (error "No cross-reference here"))
  
  ;; The doc string is meant to explain what buttons do.
! (defun help-follow ()
!   "Follow cross-reference at point.
  
  For the cross-reference format, see `help-make-xrefs'."
!   (interactive)
!   (error "No cross-reference here"))
  
  (defun help-follow-symbol (&optional pos)
    "In help buffer, show docs for symbol at POS, defaulting to point.
--- 619,643 ----
      (apply function args)))
  
  ;; The doc string is meant to explain what buttons do.
! (defun help-follow-mouse (click)
!   "Follow the cross-reference that you CLICK on."
!   (interactive "e")
!   (let* ((start (event-start click))
!        (window (car start))
!        (pos (car (cdr start))))
!     (with-current-buffer (window-buffer window)
!       (help-follow pos))))
  
  ;; The doc string is meant to explain what buttons do.
! (defun help-follow (&optional pos)
!   "Follow cross-reference at POS, defaulting to point.
  
  For the cross-reference format, see `help-make-xrefs'."
!   (interactive "d")
!   (unless pos
!     (setq pos (point)))
!   (unless (push-button pos)
!     (error "No cross-reference here")))
  
  (defun help-follow-symbol (&optional pos)
    "In help buffer, show docs for symbol at POS, defaulting to point.
============================================================




reply via email to

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