changeset 66177:bd98d8a37303

* woman.el (WoMan-xref-man-page): New button type derived from `Man-abstract-xref-man-page'. (woman-mode): Pass `WoMan-xref-man-page' to `Man-highlight-references'. * man.el (Man-abstract-xref-man-page): New button type. (Man-xref-man-page): Make it derived from `Man-abstract-xref-man-page'. (Man-highlight-references): Add new optiolnal argument `xref-man-type'.
author Masatake YAMATO <jet@gyve.org>
date Tue, 18 Oct 2005 04:21:51 +0000
parents cb6cf0328e4d
children 6c46e0e1ba7b
files lisp/ChangeLog lisp/man.el lisp/woman.el
diffstat 3 files changed, 36 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Oct 18 04:14:36 2005 +0000
+++ b/lisp/ChangeLog	Tue Oct 18 04:21:51 2005 +0000
@@ -1,5 +1,17 @@
+2005-10-18  Masatake YAMATO  <jet@gyve.org>
+
+	Fix a bug reported by Sven Joachim <sven_joachim@web.de>.
+	
+	* woman.el (WoMan-xref-man-page): New button type derived
+	from `Man-abstract-xref-man-page'.
+	(woman-mode): Pass `WoMan-xref-man-page' to 
+	`Man-highlight-references'.
+
+	* man.el (Man-abstract-xref-man-page): New button type.
+	(Man-xref-man-page): Make it derived from `Man-abstract-xref-man-page'.
+	(Man-highlight-references): Add new optiolnal argument `xref-man-type'. 
+
 2005-10-18  Nick Roberts  <nickrob@snap.net.nz>
-
 	* progmodes/gud.el (gud-menu-map): Correct condition for fringe.
 
 2005-10-17  Chong Yidong  <cyd@stupidchicken.com>
--- a/lisp/man.el	Tue Oct 18 04:14:36 2005 +0000
+++ b/lisp/man.el	Tue Oct 18 04:21:51 2005 +0000
@@ -415,10 +415,18 @@
   (define-key Man-mode-map "?"    'describe-mode))
 
 ;; buttons
-(define-button-type 'Man-xref-man-page
-  'action (lambda (button) (man-follow (button-label button)))
+(define-button-type 'Man-abstract-xref-man-page
   'follow-link t
-  'help-echo "mouse-2, RET: display this man page")
+  'help-echo "mouse-2, RET: display this man page"
+  'func nil
+  'action (lambda (button) (funcall 
+			    (button-get button 'func)
+			    (button-label button))))
+
+(define-button-type 'Man-xref-man-page 
+  :supertype 'Man-abstract-xref-man-page
+  'func 'man-follow)
+
 
 (define-button-type 'Man-xref-header-file
     'action (lambda (button)
@@ -903,14 +911,17 @@
 			 'face Man-overstrike-face)))
   (message "%s man page formatted" Man-arguments))
 
-(defun Man-highlight-references ()
+(defun Man-highlight-references (&optional xref-man-type)
   "Highlight the references on mouse-over.
 References include items in the SEE ALSO section,
-header file (#include <foo.h>) and files in FILES."
+header file (#include <foo.h>) and files in FILES.
+If XREF-MAN-TYPE is used as the button type for items
+in SEE ALSO section. If it is nil, default type, 
+`Man-xref-man-page' is used."
   (let ((dummy 0))
     (Man-highlight-references0
      Man-see-also-regexp Man-reference-regexp 1 dummy
-     'Man-xref-man-page)
+     (or xref-man-type 'Man-xref-man-page))
     (Man-highlight-references0
      Man-synopsis-regexp Man-header-regexp 0 2
      'Man-xref-header-file)
--- a/lisp/woman.el	Tue Oct 18 04:14:36 2005 +0000
+++ b/lisp/woman.el	Tue Oct 18 04:21:51 2005 +0000
@@ -424,6 +424,11 @@
 (defvar woman-version "0.551 (beta)" "WoMan version information.")
 
 (require 'man)
+(require 'button)
+(define-button-type 'WoMan-xref-man-page 
+  :supertype 'Man-abstract-xref-man-page
+  'func 'woman)
+
 (eval-when-compile			; to avoid compiler warnings
   (require 'dired)
   (require 'apropos))
@@ -1864,7 +1869,7 @@
   (setq woman-imenu-done nil)
   (if woman-imenu (woman-imenu))
   (let (buffer-read-only)
-    (Man-highlight-references))
+    (Man-highlight-references 'WoMan-xref-man-page))
   (set-buffer-modified-p nil)
   (run-mode-hooks 'woman-mode-hook))