0

Some Emacs *Help* buffers include active cross-references that point to file system paths. One can visit the associated files by following the xref in the usual way, but I want to know how to determine the path that the xref points to without visiting the associated file (i.e. without following the cross-reference).

How can I do this?

IMPORTANT: I want to to do this while using Emacs in text-mode. (IOW, no mouse, no menus, etc.)

PS1: It occurs to me that one simple way to get the information I want is to view the source code underlying the *Help* buffer. (By this I mean the mark-up that identifies the cross-referenced items, and holds their targets.) I have not been able to find how to do this either.

PS2: Somewhere in the docs I found that running M-x visible-mode may display the information I'm after, but when I try it I see no additional information anywhere. Ditto with fiddling with the variable Info-hide-note-references.

4

1 回答 1

0

当点在相应的按钮上时:

(cadr (button-get (button-at (point)) 'help-args))

您可以使用它来收集所有按钮:

(defun ali--help-collect-references ()
  "Collect the positions of visible links in the current `help-mode' buffer."
  (let ((skip (text-property-any (point-min) (point-max)
                                 'button nil))
        candidates)
    (save-excursion
      (while (setq skip (text-property-not-all skip (point-max)
                                               'button nil))
        (goto-char skip)
        (push skip candidates)
        (setq skip (text-property-any (point) (point-max)
                                      'button nil))))
    (nreverse candidates)))
于 2014-11-25T16:29:32.950 回答