emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/man.el,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/man.el,v
Date: Sat, 09 Dec 2006 17:42:28 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      06/12/09 17:42:28

Index: man.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/man.el,v
retrieving revision 1.164
retrieving revision 1.165
diff -u -b -r1.164 -r1.165
--- man.el      2 Sep 2006 23:28:55 -0000       1.164
+++ man.el      9 Dec 2006 17:42:28 -0000       1.165
@@ -428,13 +428,17 @@
   'follow-link t
   'help-echo "mouse-2, RET: display this man page"
   'func nil
-  'action (lambda (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)
-            (let ((func (button-get button 'Man-target-string)))
-              (if func
-                  (if (functionp func) (funcall func) func)
-                (button-label button))))))
+     (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 @@
 ;; ======================================================================
 ;; 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._+:")




reply via email to

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