aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasatake YAMATO2005-10-18 04:21:51 +0000
committerMasatake YAMATO2005-10-18 04:21:51 +0000
commit50071f01ec3b93c87656bc88b9ae796585912855 (patch)
treee9dadb9c1327607053e32f048cc1f407b98d6101
parentae3d4650babcdc8d08b688c3ef76e3b78fa6e84e (diff)
downloademacs-50071f01ec3b93c87656bc88b9ae796585912855.tar.gz
emacs-50071f01ec3b93c87656bc88b9ae796585912855.zip
* 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'.
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/man.el23
-rw-r--r--lisp/woman.el7
3 files changed, 36 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0e5a4ba2501..8486bac69c6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,17 @@
12005-10-18 Nick Roberts <nickrob@snap.net.nz> 12005-10-18 Masatake YAMATO <jet@gyve.org>
2
3 Fix a bug reported by Sven Joachim <sven_joachim@web.de>.
4
5 * woman.el (WoMan-xref-man-page): New button type derived
6 from `Man-abstract-xref-man-page'.
7 (woman-mode): Pass `WoMan-xref-man-page' to
8 `Man-highlight-references'.
2 9
10 * man.el (Man-abstract-xref-man-page): New button type.
11 (Man-xref-man-page): Make it derived from `Man-abstract-xref-man-page'.
12 (Man-highlight-references): Add new optiolnal argument `xref-man-type'.
13
142005-10-18 Nick Roberts <nickrob@snap.net.nz>
3 * progmodes/gud.el (gud-menu-map): Correct condition for fringe. 15 * progmodes/gud.el (gud-menu-map): Correct condition for fringe.
4 16
52005-10-17 Chong Yidong <cyd@stupidchicken.com> 172005-10-17 Chong Yidong <cyd@stupidchicken.com>
diff --git a/lisp/man.el b/lisp/man.el
index 6c8a5a18b44..c54a00d3663 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -415,10 +415,18 @@ Otherwise, the value is whatever the function
415 (define-key Man-mode-map "?" 'describe-mode)) 415 (define-key Man-mode-map "?" 'describe-mode))
416 416
417;; buttons 417;; buttons
418(define-button-type 'Man-xref-man-page 418(define-button-type 'Man-abstract-xref-man-page
419 'action (lambda (button) (man-follow (button-label button)))
420 'follow-link t 419 'follow-link t
421 'help-echo "mouse-2, RET: display this man page") 420 'help-echo "mouse-2, RET: display this man page"
421 'func nil
422 'action (lambda (button) (funcall
423 (button-get button 'func)
424 (button-label button))))
425
426(define-button-type 'Man-xref-man-page
427 :supertype 'Man-abstract-xref-man-page
428 'func 'man-follow)
429
422 430
423(define-button-type 'Man-xref-header-file 431(define-button-type 'Man-xref-header-file
424 'action (lambda (button) 432 'action (lambda (button)
@@ -903,14 +911,17 @@ Same for the ANSI bold and normal escape sequences."
903 'face Man-overstrike-face))) 911 'face Man-overstrike-face)))
904 (message "%s man page formatted" Man-arguments)) 912 (message "%s man page formatted" Man-arguments))
905 913
906(defun Man-highlight-references () 914(defun Man-highlight-references (&optional xref-man-type)
907 "Highlight the references on mouse-over. 915 "Highlight the references on mouse-over.
908References include items in the SEE ALSO section, 916References include items in the SEE ALSO section,
909header file (#include <foo.h>) and files in FILES." 917header file (#include <foo.h>) and files in FILES.
918If XREF-MAN-TYPE is used as the button type for items
919in SEE ALSO section. If it is nil, default type,
920`Man-xref-man-page' is used."
910 (let ((dummy 0)) 921 (let ((dummy 0))
911 (Man-highlight-references0 922 (Man-highlight-references0
912 Man-see-also-regexp Man-reference-regexp 1 dummy 923 Man-see-also-regexp Man-reference-regexp 1 dummy
913 'Man-xref-man-page) 924 (or xref-man-type 'Man-xref-man-page))
914 (Man-highlight-references0 925 (Man-highlight-references0
915 Man-synopsis-regexp Man-header-regexp 0 2 926 Man-synopsis-regexp Man-header-regexp 0 2
916 'Man-xref-header-file) 927 'Man-xref-header-file)
diff --git a/lisp/woman.el b/lisp/woman.el
index bc7ec86e4a7..5e8aff75e7f 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -424,6 +424,11 @@
424(defvar woman-version "0.551 (beta)" "WoMan version information.") 424(defvar woman-version "0.551 (beta)" "WoMan version information.")
425 425
426(require 'man) 426(require 'man)
427(require 'button)
428(define-button-type 'WoMan-xref-man-page
429 :supertype 'Man-abstract-xref-man-page
430 'func 'woman)
431
427(eval-when-compile ; to avoid compiler warnings 432(eval-when-compile ; to avoid compiler warnings
428 (require 'dired) 433 (require 'dired)
429 (require 'apropos)) 434 (require 'apropos))
@@ -1864,7 +1869,7 @@ See `Man-mode' for additional details."
1864 (setq woman-imenu-done nil) 1869 (setq woman-imenu-done nil)
1865 (if woman-imenu (woman-imenu)) 1870 (if woman-imenu (woman-imenu))
1866 (let (buffer-read-only) 1871 (let (buffer-read-only)
1867 (Man-highlight-references)) 1872 (Man-highlight-references 'WoMan-xref-man-page))
1868 (set-buffer-modified-p nil) 1873 (set-buffer-modified-p nil)
1869 (run-mode-hooks 'woman-mode-hook)) 1874 (run-mode-hooks 'woman-mode-hook))
1870 1875