diff options
author | Miles Bader <miles@gnu.org> | 2006-12-16 01:29:26 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2006-12-16 01:29:26 +0000 |
commit | 4bc5d7668ef47295810f28a14d67b4a9e12a341f (patch) | |
tree | 2e22bd79984f0772c43e294babc07c1508ce95ce /lisp/man.el | |
parent | b44bfd5e9bf3a0e853bc0d4788e4c89a01a70d6a (diff) | |
parent | c3342e8eb3eaf4560210fd030383a940640648f2 (diff) | |
download | emacs-4bc5d7668ef47295810f28a14d67b4a9e12a341f.tar.gz emacs-4bc5d7668ef47295810f28a14d67b4a9e12a341f.tar.bz2 emacs-4bc5d7668ef47295810f28a14d67b4a9e12a341f.zip |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 545-562)
- Update from CVS
- Update from erc--emacs--22
- Merge from gnus--rel--5.10
- erc-iswitchb: Temporarily enable iswitchb mode
* gnus--rel--5.10 (patch 172-176)
- Merge from emacs--devo--0
- Update from CVS
- Update from CVS: lisp/legacy-gnus-agent.el: Add Copyright notice.
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-156
Diffstat (limited to 'lisp/man.el')
-rw-r--r-- | lisp/man.el | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/lisp/man.el b/lisp/man.el index 2351853eeca..40a4e810204 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -428,13 +428,17 @@ Otherwise, the value is whatever the function 'follow-link t 'help-echo "mouse-2, RET: display this man page" 'func nil - 'action (lambda (button) - (funcall - (button-get button 'func) - (let ((func (button-get button 'Man-target-string))) - (if func - (if (functionp func) (funcall func) func) - (button-label button)))))) + 'action #'Man-xref-button-action) + +(defun Man-xref-button-action (button) + (let ((target (button-get button 'Man-target-string))) + (funcall + (button-get button 'func) + (cond ((null target) + (button-label button)) + ((functionp target) + (funcall target (button-start button))) + (t target))))) (define-button-type 'Man-xref-man-page :supertype 'Man-abstract-xref-man-page @@ -636,11 +640,12 @@ a new value." ;; ====================================================================== ;; default man entry: get word under point -(defsubst Man-default-man-entry () - "Make a guess at a default manual entry. -This guess is based on the text surrounding the cursor." +(defsubst Man-default-man-entry (&optional pos) + "Make a guess at a default manual entry based on the text at POS. +If POS is nil, the current point is used." (let (word) (save-excursion + (if pos (goto-char pos)) ;; Default man entry title is any word the cursor is on, or if ;; cursor not on a word, then nearest preceding word. (skip-chars-backward "-a-zA-Z0-9._+:") |