comparison lisp/woman.el @ 50404:019c0ecad8d7

(woman-xref): Removed. (woman-mode): Use `Man-highlight-references' instead of `WoMan-highlight-references'. (WoMan-highlight-references): Removed.
author Juanma Barranquero <lekktu@gmail.com>
date Wed, 02 Apr 2003 21:24:04 +0000
parents 99be3a1e2589
children 695cf19ef79e
comparison
equal deleted inserted replaced
50403:7dc2f9f7086b 50404:019c0ecad8d7
1055 1055
1056 (defvar woman-if-conditions-true '(?n ?e ?o) 1056 (defvar woman-if-conditions-true '(?n ?e ?o)
1057 "List of one-character built-in condition names that are true. 1057 "List of one-character built-in condition names that are true.
1058 Should include ?e, ?o (page even/odd) and either ?n (nroff) or ?t (troff). 1058 Should include ?e, ?o (page even/odd) and either ?n (nroff) or ?t (troff).
1059 Default is '(?n ?e ?o). Set via `woman-emulation'.") 1059 Default is '(?n ?e ?o). Set via `woman-emulation'.")
1060
1061
1062 ;;; Button types:
1063
1064 (define-button-type 'woman-xref
1065 'action (lambda (button) (woman (button-label button)))
1066 'help-echo "RET, mouse-2: display this man page")
1067 1060
1068 1061
1069 ;;; Specialized utility functions: 1062 ;;; Specialized utility functions:
1070 1063
1071 ;;; Fast deletion without saving on the kill ring (cf. simple.el): 1064 ;;; Fast deletion without saving on the kill ring (cf. simple.el):
1867 (setq imenu--last-menubar-index-alist nil) 1860 (setq imenu--last-menubar-index-alist nil)
1868 ;; necessary to avoid re-installing the same imenu: 1861 ;; necessary to avoid re-installing the same imenu:
1869 (setq woman-imenu-done nil) 1862 (setq woman-imenu-done nil)
1870 (if woman-imenu (woman-imenu)) 1863 (if woman-imenu (woman-imenu))
1871 (setq buffer-read-only nil) 1864 (setq buffer-read-only nil)
1872 (WoMan-highlight-references) 1865 (Man-highlight-references)
1873 (setq buffer-read-only t) 1866 (setq buffer-read-only t)
1874 (set-buffer-modified-p nil))) 1867 (set-buffer-modified-p nil)))
1875 1868
1876 (defun woman-imenu (&optional redraw) 1869 (defun woman-imenu (&optional redraw)
1877 "Add a \"Contents\" menu to the menubar. 1870 "Add a \"Contents\" menu to the menubar.
1961 "Report formatting time." 1954 "Report formatting time."
1962 (let* ((time (current-time)) 1955 (let* ((time (current-time))
1963 (time (+ (* (- (car time) (car WoMan-Man-start-time)) 65536) 1956 (time (+ (* (- (car time) (car WoMan-Man-start-time)) 65536)
1964 (- (cadr time) (cadr WoMan-Man-start-time))))) 1957 (- (cadr time) (cadr WoMan-Man-start-time)))))
1965 (message "Man formatting done in %d seconds" time))) 1958 (message "Man formatting done in %d seconds" time)))
1966
1967 (defun WoMan-highlight-references ()
1968 "Highlight the references (in the SEE ALSO section) on mouse-over."
1969 ;; Based on `Man-build-references-alist' in `man'.
1970 (when (Man-find-section Man-see-also-regexp)
1971 (forward-line 1)
1972 (let ((end (save-excursion
1973 (Man-next-section 1)
1974 (point))))
1975 (back-to-indentation)
1976 (while (re-search-forward Man-reference-regexp end t)
1977 ;; Highlight reference when mouse is over it.
1978 ;; (NB: WoMan does not hyphenate!)
1979 (make-text-button (match-beginning 1) (match-end 1)
1980 'type 'woman-xref)))))
1981 1959
1982 1960
1983 ;;; Buffer handling: 1961 ;;; Buffer handling:
1984 1962
1985 (defun WoMan-previous-manpage () 1963 (defun WoMan-previous-manpage ()