• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/

Lines Matching defs:woman

0 ;;; woman.el --- browse UN*X manual pages `wo (without) man'
10 ;; Version: see `woman-version'
54 ;; are available in the file woman.status.
58 ;; need to adjust the user option `woman-file-compression-regexp'.
63 ;; user option variables, all of which begin with the prefix `woman-'.
65 ;; command `woman-mini-help', or selecting the WoMan menu option `Mini
76 ;; (autoload 'woman "woman"
78 ;; (autoload 'woman-find-file "woman"
83 ;; reset the Lisp variable `woman-manpath', and you may also want to
84 ;; set the Lisp variable `woman-path'. Please see the online
86 ;; extended command `woman', enter or select a manual entry topic,
91 ;; Or (2): Execute the extended command `woman-find-file' and enter a
97 ;; (autoload 'woman-dired-find-file "woman"
101 ;; (define-key dired-mode-map "W" 'woman-dired-find-file)))
114 ;; behaviour is controlled by the user option `woman-dired-keys'.
122 ;; Juanma Barranquero. If you really want to square the man-woman
126 ;; man() { gnudoit -q '(raise-frame (selected-frame)) (woman' \"$1\" ')' ; }
132 ;; gnudoit -q (raise-frame (selected-frame)) (woman \"%1\")
143 ;; The `woman' command uses the word nearest to point in the current
147 ;; `woman-use-topic-at-point' to t; thanks to Benjamin Riefenstahl for
150 ;; The variable `woman-use-topic-at-point' can be rebound locally,
156 ;; (let ((woman-use-topic-at-point t))
157 ;; (woman)))))
168 ;; (defgroup woman nil
170 ;; :tag "WoMan" :group 'help :load "woman")
173 ;; WoMan currently runs two hooks: `woman-pre-format-hook' immediately
174 ;; before formatting a buffer and `woman-post-format-hook' immediately
179 ;; hooks. `woman-pre-format-hook' might be appropriate for face
180 ;; customization, whereas `woman-post-format-hook' might be
186 ;; variable `woman-imenu' to `t' then WoMan will do it automatically
188 ;; `woman-imenu-title', which is "CONTENTS" by default. By default,
190 ;; this by changing the value of `woman-imenu-generic-expression'.
206 ;; (setq woman-imenu-generic-expression
212 ;; (setq woman-imenu-generic-expression
241 ;; writes a warning to this buffer. If the variable `woman-show-log'
253 ;; resetting the variable `woman-ignore' to `nil' (by default it is
256 ;; Automatic initiation of woman decoding
264 ;; (autoload 'woman-decode-region "woman")
269 ;; woman-decode-region nil nil
283 ;; (a) check that you are running the latest version of woman.el
287 ;; woman.status, also available from my web site.
308 ;; the variable `woman-cache-filename' to save the cache between Emacs
309 ;; sessions. This is recommended only if the command `woman' is too
313 ;; (2) The user option `woman-cache-level' controls the amount of
317 ;; `woman' command (only) to rebuild its topic cache, and to re-save
318 ;; it to `woman-cache-filename' if this variable has a non-nil value.
320 ;; directories or files in the paths specified by `woman-manpath' or
321 ;; `woman-path' change. If WoMan user options that affect the cache
426 (defvar woman-version "0.551 (beta)" "WoMan version information.")
433 (woman
434 ;; `woman' cannot deal with arguments that contain a
445 (defun woman-mapcan (fn x)
452 (defun woman-parse-colon-path (paths)
455 Replace null components by calling `woman-parse-man.conf'.
457 `woman-parse-man.conf'."
463 (mapcar 'woman-Cyg-to-Win (woman-parse-man.conf)))
466 (woman-mapcan ; splice list into list
470 (mapcar 'woman-Cyg-to-Win (woman-parse-man.conf))))
477 (woman-mapcan ; splice list into list
479 (mapcar 'woman-Cyg-to-Win
480 (if x (list x) (woman-parse-man.conf))))
484 (woman-mapcan ; splice list into list
485 (lambda (x) (if x (list x) (woman-parse-man.conf)))
488 (defun woman-Cyg-to-Win (file)
519 (defgroup woman nil
524 (defcustom woman-show-log nil
528 :group 'woman)
530 (defcustom woman-pre-format-hook nil
534 :group 'woman)
536 (defcustom woman-post-format-hook nil
540 :group 'woman)
546 (defgroup woman-interface nil
549 :group 'woman)
551 (defcustom woman-man.conf-path
554 (mapcar 'woman-Cyg-to-Win path)
562 `woman-manpath'."
564 :group 'woman-interface)
566 (defun woman-parse-man.conf ()
569 Look in `woman-man.conf-path' and return a value for `woman-manpath'.
579 (let ((path woman-man.conf-path)
609 (defcustom woman-manpath
610 (or (woman-parse-colon-path (getenv "MANPATH"))
615 selected by the value of `woman-manpath-man-regexp'. Non-directory
626 the user option `woman-man.conf-path'. An empty substring of MANPATH
632 ignored. (Specific directories in `woman-path' are also searched.)
642 :group 'woman-interface)
644 (defcustom woman-manpath-man-regexp "[Mm][Aa][Nn]"
645 "Regexp to match man directories UNDER `woman-manpath' directories.
651 :group 'woman-interface)
653 (defcustom woman-path
661 specified in `woman-manpath'. Each element should be a directory
675 Trailing `/'s are discarded. (The directory trees in `woman-manpath'
679 :group 'woman-interface)
681 (defcustom woman-cache-level 2
690 If the `woman' command is slow to find files then try 3, which may be
692 Run the `woman' command with a prefix argument or delete the cache
693 file `woman-cache-filename' for a change to take effect.
698 :group 'woman-interface)
700 (defcustom woman-cache-filename nil
706 the `woman' command to update and re-write the cache."
710 :group 'woman-interface)
712 (defcustom woman-dired-keys t
720 :group 'woman-interface)
722 (defcustom woman-imenu-generic-expression
729 :group 'woman-interface)
731 (defcustom woman-imenu nil
735 :group 'woman-interface)
737 (defcustom woman-imenu-title "CONTENTS"
741 :group 'woman-interface)
743 (defcustom woman-use-topic-at-point-default nil
744 ;; `woman-use-topic-at-point' may be let-bound when woman is loaded,
746 ;; `woman-file-name' sets it to this value if it is unbound.
747 "*Default value for `woman-use-topic-at-point'."
750 :group 'woman-interface)
752 (defcustom woman-use-topic-at-point woman-use-topic-at-point-default
754 If non-nil the `woman' command uses the word at point automatically,
758 :group 'woman-interface)
760 (defvar woman-file-regexp nil
764 `woman-uncompressed-file-regexp' and `woman-file-compression-regexp'.")
766 (defvar woman-uncompressed-file-regexp) ; for the compiler
767 (defvar woman-file-compression-regexp) ; for the compiler
769 (defun set-woman-file-regexp (symbol value)
770 "Bind SYMBOL to VALUE and set `woman-file-regexp' as per user customizations.
772 `woman-uncompressed-file-regexp' and `woman-file-compression-regexp'."
774 (and (boundp 'woman-uncompressed-file-regexp)
775 (boundp 'woman-file-compression-regexp)
776 (setq woman-file-regexp
777 (concat woman-uncompressed-file-regexp
779 (substring woman-file-compression-regexp 0 -2)
782 (defcustom woman-uncompressed-file-regexp
794 :set 'set-woman-file-regexp
795 :group 'woman-interface)
797 (defcustom woman-file-compression-regexp
809 :set 'set-woman-file-regexp
810 :group 'woman-interface)
812 (defcustom woman-use-own-frame ; window-system
818 :group 'woman-interface)
824 (defgroup woman-formatting nil
827 :group 'woman)
829 (defcustom woman-fill-column 65
832 :group 'woman-formatting)
834 (defcustom woman-fill-frame nil
838 :group 'woman-formatting)
840 (defcustom woman-default-indent 5
844 :group 'woman-formatting)
846 (defcustom woman-bold-headings t
850 :group 'woman-formatting)
852 (defcustom woman-ignore t
857 :group 'woman-formatting)
859 (defcustom woman-preserve-ascii t
863 `woman-escaped-escape-char' and `woman-unpadded-space-char'
869 :group 'woman-formatting)
871 (defcustom woman-emulation 'nroff
876 :group 'woman-formatting)
882 (defgroup woman-faces nil
885 :group 'woman
888 (defcustom woman-fontify
896 :group 'woman-faces)
901 (defface woman-italic
907 :group 'woman-faces)
909 (put 'woman-italic-face 'face-alias 'woman-italic)
911 (defface woman-bold
916 :group 'woman-faces)
918 (put 'woman-bold-face 'face-alias 'woman-bold)
923 (defface woman-unknown
928 :group 'woman-faces)
930 (put 'woman-unknown-face 'face-alias 'woman-unknown)
932 (defface woman-addition
935 :group 'woman-faces)
937 (put 'woman-addition-face 'face-alias 'woman-addition)
939 (defun woman-default-faces ()
942 (face-spec-set 'woman-italic (face-user-default-spec 'woman-italic))
943 (face-spec-set 'woman-bold (face-user-default-spec 'woman-bold)))
945 (defun woman-monochrome-faces ()
949 (set-face-foreground 'woman-italic 'unspecified)
950 (set-face-foreground 'woman-bold 'unspecified))
954 (defconst woman-font-support
958 (defun woman-select-symbol-fonts (fonts)
970 (when woman-font-support
971 (make-face 'woman-symbol)
973 ;; Set the symbol font only if `woman-use-symbol-font' is true, to
976 (defcustom woman-use-extended-font t
979 :group 'woman-faces)
981 (defcustom woman-use-symbol-font nil
986 :group 'woman-faces)
988 (defconst woman-symbol-font-list
989 (or (woman-select-symbol-fonts (x-list-fonts "*" 'default))
990 (woman-select-symbol-fonts (x-list-fonts "*")))
993 (defcustom woman-symbol-font (car woman-symbol-font-list)
1000 woman-symbol-font-list)
1002 :group 'woman-faces)
1007 (defvar woman-use-extended-font nil)
1008 (defvar woman-use-symbol-font nil)
1009 (defvar woman-symbol-font nil)
1016 (defconst woman-justify-list
1019 (defconst woman-adjust-left 0 ; == adjust off, noadjust
1021 (defconst woman-adjust-right 1
1023 (defconst woman-adjust-center 2
1025 (defconst woman-adjust-both 3 ; default -- adj,both
1028 (defvar woman-adjust woman-adjust-both
1030 (defvar woman-adjust-previous woman-adjust
1032 (defvar woman-justify
1033 (nth woman-adjust woman-justify-list) ; use vector?
1035 (defvar woman-justify-previous woman-justify
1038 (defvar woman-left-margin woman-default-indent
1040 (defvar woman-prevailing-indent woman-default-indent
1042 (defvar woman-interparagraph-distance 1
1045 (defvar woman-leave-blank-lines nil
1047 (defconst woman-tab-width 5
1049 (defvar woman-nofill nil
1051 (defvar woman-RS-left-margin nil
1053 (defvar woman-RS-prevailing-indent nil
1055 (defvar woman-nospace nil
1059 (defsubst woman-reset-nospace ()
1060 "Set `woman-nospace' to nil."
1061 (setq woman-nospace nil))
1063 (defconst woman-request-regexp "^[.'][ \t]*\\(\\S +\\) *"
1071 (defvar woman-imenu-done nil
1072 "Buffer-local: set to true if function `woman-imenu' has been called.")
1073 (make-variable-buffer-local 'woman-imenu-done)
1081 (defvar woman-buffer-alist nil
1085 (defvar woman-buffer-number 0
1086 "Ordinal number of current buffer entry in `woman-buffer-alist'.
1089 (defvar woman-if-conditions-true '(?n ?e ?o)
1092 Default is '(?n ?e ?o). Set via `woman-emulation'.")
1100 (defun woman-delete-line (&optional arg)
1118 (defsubst woman-delete-whole-line ()
1121 (woman-delete-line 1))
1123 (defsubst woman-delete-following-space ()
1128 (defsubst woman-delete-match (subexp)
1141 (defvar woman-expanded-directory-path nil
1144 (defvar woman-topic-all-completions nil
1148 (defun woman (&optional topic re-cache)
1152 topic selected from the directories specified in `woman-manpath' and
1153 `woman-path'. The directory expansions and topics are cached for
1162 (let ((file-name (woman-file-name topic re-cache)))
1164 (woman-find-file file-name)
1174 (define-key-after menu-bar-manuals-menu [woman]
1175 '(menu-item "Read Man Page (WoMan)..." woman
1178 (defvar woman-cached-data nil
1180 Set from the cache by `woman-read-directory-cache'.")
1182 (defun woman-cached-data ()
1186 (list woman-cache-level
1188 (dolist (dir woman-manpath (nreverse lst))
1195 (mapcar 'substitute-in-file-name woman-path)))
1197 (defun woman-read-directory-cache ()
1199 It is loaded from the file named by the variable `woman-cache-filename'.
1202 woman-cache-filename
1203 (load woman-cache-filename t nil t) ; file exists
1204 (equal woman-cached-data (woman-cached-data)))) ; cache valid
1206 (defun woman-write-directory-cache ()
1208 It is saved to the file named by the variable `woman-cache-filename'."
1209 (if woman-cache-filename
1221 `(setq woman-cached-data ',(woman-cached-data)))
1223 `(setq woman-expanded-directory-path
1224 ',woman-expanded-directory-path))
1226 `(setq woman-topic-all-completions
1227 ',woman-topic-all-completions))
1228 (write-file woman-cache-filename) ; write CURRENT buffer
1232 (defvaralias 'woman-topic-history 'Man-topic-history)
1233 (defvar woman-file-history nil "File-name read history.")
1235 (defun woman-file-name (topic &optional re-cache)
1237 When `woman' is called interactively, the word at point may be
1239 `woman-use-topic-at-point' is non-nil. Return nil if no file can
1245 (and woman-expanded-directory-path woman-topic-all-completions)
1246 (woman-read-directory-cache)))
1249 (setq woman-expanded-directory-path
1250 (woman-expand-directory-path woman-manpath woman-path))
1252 (setq woman-topic-all-completions
1253 (woman-topic-all-completions woman-expanded-directory-path))
1254 (woman-write-directory-cache))
1262 (and (if (boundp 'woman-use-topic-at-point)
1263 woman-use-topic-at-point
1265 (setq woman-use-topic-at-point woman-use-topic-at-point-default))
1267 (test-completion topic woman-topic-all-completions))
1273 word-at-point woman-topic-all-completions))
1279 woman-topic-all-completions nil 1
1281 'woman-topic-history
1287 ((setq files (woman-file-name-all-completions topic)))
1290 ((setq files (all-completions topic woman-topic-all-completions))
1293 (setq files (woman-file-name-all-completions (car files)))))
1304 (try-completion "" files) 'woman-file-history))))))
1306 (defun woman-select (predicate list)
1326 (defun woman-file-readable-p (dir)
1331 (defun woman-directory-files (head dir)
1340 (WoMan-warn "No directories match `woman-path' entry `%s'!" dir)))
1342 (defun woman-file-accessible-directory-p (dir)
1347 (defun woman-expand-directory-path (woman-manpath woman-path)
1353 (if (not (listp woman-manpath)) (setq woman-manpath (list woman-manpath)))
1354 (if (not (listp woman-path)) (setq woman-path (list woman-path)))
1356 (while woman-manpath
1357 (setq dir (car woman-manpath)
1358 woman-manpath (cdr woman-manpath))
1364 (if (and dir (woman-file-readable-p dir))
1369 (setq dir (woman-canonicalize-dir dir)
1371 dir t woman-manpath-man-regexp)))))
1372 (while woman-path
1373 (setq dir (car woman-path)
1374 woman-path (cdr woman-path))
1376 (null (setq dir (woman-canonicalize-dir dir)
1378 (woman-file-readable-p head))
1381 (nconc dirs (woman-directory-files head dir))
1385 (woman-select 'woman-file-accessible-directory-p dirs)))
1387 (defun woman-canonicalize-dir (dir)
1401 (defsubst woman-not-member (dir path)
1406 (defun woman-topic-all-completions (path)
1410 ;; will be a list of the first `woman-cache-level' elements of the
1412 ;; is re-processed by `woman-topic-all-completions-merge'.
1416 (if (woman-not-member dir path) ; use each directory only once!
1417 (push (woman-topic-all-completions-1 dir path-index)
1423 (woman-topic-all-completions-merge
1426 (defun woman-topic-all-completions-1 (dir path-index)
1430 of the first `woman-cache-level' elements from the following list:
1434 ;; unnecessary. So let us assume that `woman-file-regexp' will
1439 (let (newlst (lst (directory-files dir nil woman-file-regexp t))
1444 woman-file-compression-regexp)))
1453 (and (> woman-cache-level 1)
1456 (and (> woman-cache-level 2)
1460 (defun woman-topic-all-completions-merge (alist)
1470 (if (> woman-cache-level 1)
1479 ;; woman-cache-level = 1 => elements are single-element lists ...
1486 (defun woman-file-name-all-completions (topic)
1489 ;; woman-topic-all-completions is a list of one of the forms:
1499 woman-file-regexp)) ; extension
1500 (topics woman-topic-all-completions)
1501 (path woman-expanded-directory-path)
1521 (if (woman-not-member dir path) ; use each directory only once!
1532 (defun woman-dired-define-key (key)
1533 "Bind the argument KEY to the command `woman-dired-find-file'."
1534 (define-key dired-mode-map key 'woman-dired-find-file))
1536 (defsubst woman-dired-define-key-maybe (key)
1537 "If KEY is undefined in Dired, bind it to command `woman-dired-find-file'."
1540 (woman-dired-define-key key)))
1542 (defun woman-dired-define-keys ()
1543 "Define dired keys to run WoMan according to `woman-dired-keys'."
1544 (if woman-dired-keys
1545 (if (listp woman-dired-keys)
1546 (mapcar 'woman-dired-define-key woman-dired-keys)
1547 (woman-dired-define-key-maybe "w")
1548 (woman-dired-define-key-maybe "W")))
1550 [woman] '("Read Man Page (WoMan)" . woman-dired-find-file) 'view))
1553 (woman-dired-define-keys)
1554 (add-hook 'dired-mode-hook 'woman-dired-define-keys))
1557 (defun woman-dired-find-file ()
1561 (woman-find-file (dired-get-filename)))
1566 (defun woman-tar-extract-file ()
1570 (error "`woman-tar-extract-file' can be used only in `tar-mode'"))
1576 (woman-make-bufname (file-name-nondirectory buffer-file-name)))
1577 (woman-process-buffer)
1583 (define-key tar-mode-map "w" 'woman-tar-extract-file)
1585 [woman] '("Read Man Page (WoMan)" . woman-tar-extract-file) 'view)))
1588 (defvar woman-last-file-name nil
1591 (defun woman-reformat-last-file ()
1594 (if woman-last-file-name
1595 (woman-find-file woman-last-file-name t)
1596 (call-interactively 'woman-find-file)))
1599 (defun woman-find-file (file-name &optional reformat)
1606 `woman' command for further details."
1608 (setq woman-last-file-name
1610 (let ((alist-tail woman-buffer-alist) exists)
1611 (setq woman-buffer-number 0)
1614 woman-buffer-number (1+ woman-buffer-number)))
1622 (not (not (string-match woman-file-compression-regexp bufname)))))
1627 (woman-make-bufname bufname)))
1628 (woman-really-find-file file-name compressed bufname)
1630 (setq woman-buffer-alist
1631 (cons (cons file-name bufname) woman-buffer-alist)
1632 woman-buffer-number 0))
1638 (defun woman-make-bufname (bufname)
1647 (defvar woman-frame nil
1650 (defun woman-really-find-file (filename compressed bufname)
1656 (if woman-use-own-frame
1658 (or (and (frame-live-p woman-frame) woman-frame)
1659 (setq woman-frame (make-frame)))))
1664 (woman-insert-file-contents filename compressed)
1669 (woman-process-buffer)))
1671 (defun woman-process-buffer ()
1672 "The second half of `woman-really-find-file'!"
1678 (woman-decode-buffer)
1681 (woman-man-buffer))
1682 (woman-mode))
1684 (defun woman-man-buffer ()
1687 (if (looking-at "\\s-+") (woman-delete-match 0))
1696 (woman-delete-match 0)))
1716 (woman-set-face (point) (1+ (point)) 'woman-italic))
1720 (woman-set-face (1- (point)) (point) 'woman-italic))))
1725 (woman-delete-match 2)
1726 (woman-set-face (1- (point)) (point) 'woman-bold))
1733 (woman-set-face (point) (1+ (point)) 'woman-italic))
1740 ;; (cf. `woman-imenu-generic-expression'):
1742 (woman-bold-headings
1746 (woman-set-face (match-beginning 2) (match-end 2) 'woman-bold))))
1749 (defun woman-insert-file-contents (filename compressed)
1761 (string-match woman-file-compression-regexp filename))
1780 (defvar woman-mode-map nil "Keymap for woman mode.")
1782 (unless woman-mode-map
1783 (setq woman-mode-map (make-sparse-keymap))
1784 (set-keymap-parent woman-mode-map Man-mode-map)
1786 (define-key woman-mode-map "R" 'woman-reformat-last-file)
1787 (define-key woman-mode-map "w" 'woman)
1788 (define-key woman-mode-map "\en" 'WoMan-next-manpage)
1789 (define-key woman-mode-map "\ep" 'WoMan-previous-manpage)
1790 (define-key woman-mode-map [M-mouse-2] 'woman-follow-word)
1792 ;; We don't need to call `man' when we are in `woman-mode'.
1793 (define-key woman-mode-map [remap man] 'woman)
1794 (define-key woman-mode-map [remap man-follow] 'woman-follow))
1796 (defun woman-follow (topic)
1802 (woman (if (string-match Man-reference-regexp topic)
1806 (defun woman-follow-word (event)
1811 (woman (or (current-word t) "")))
1815 woman-menu ; (SYMBOL MAPS DOC MENU)
1816 ;; That comment was moved after the symbol `woman-menu' to make
1818 woman-mode-map
1821 ["WoMan..." woman t] ; [NAME CALLBACK ENABLE]
1834 ;; ["Toggle Fill Frame Width" woman-toggle-fill-frame t]
1835 ["Use Full Frame Width" woman-toggle-fill-frame
1836 :active t :style toggle :selected woman-fill-frame]
1837 ["Reformat Last Man Page" woman-reformat-last-file t]
1838 ["Use Monochrome Main Faces" woman-monochrome-faces t]
1839 ["Use Default Main Faces" woman-default-faces t]
1840 ["Make Contents Menu" (woman-imenu t) (not woman-imenu-done)]
1843 ["Mini Help" woman-mini-help t]
1845 '(["Customize..." (customize-group 'woman) t]))
1846 ["Show Version" (message "WoMan %s" woman-version) t]
1849 ["View Source" (view-file woman-last-file-name) woman-last-file-name]
1851 ["Extended Font" woman-toggle-use-extended-font
1852 :included woman-font-support
1853 :active t :style toggle :selected woman-use-extended-font]
1854 ["Symbol Font" woman-toggle-use-symbol-font
1855 :included woman-font-support
1856 :active t :style toggle :selected woman-use-symbol-font]
1857 ["Font Map" woman-display-extended-fonts
1858 :included woman-font-support
1859 :active woman-use-symbol-font]
1862 ["nroff" (woman-reset-emulation 'nroff)
1863 :active t :style radio :selected (eq woman-emulation 'nroff)]
1864 ["troff" (woman-reset-emulation 'troff)
1865 :active t :style radio :selected (eq woman-emulation 'troff)]
1869 (defun woman-toggle-use-extended-font ()
1870 "Toggle `woman-use-extended-font' and reformat, for menu use."
1872 (setq woman-use-extended-font (not woman-use-extended-font))
1873 (woman-reformat-last-file))
1875 (defun woman-toggle-use-symbol-font ()
1876 "Toggle `woman-use-symbol-font' and reformat, for menu use."
1878 (setq woman-use-symbol-font (not woman-use-symbol-font))
1879 (woman-reformat-last-file))
1881 (defun woman-reset-emulation (value)
1882 "Reset `woman-emulation' to VALUE and reformat, for menu use."
1884 (setq woman-emulation value)
1885 (woman-reformat-last-file))
1887 (put 'woman-mode 'mode-class 'special)
1889 (defun woman-mode ()
1894 WoMan version: see `woman-version'.
1912 (setq major-mode 'woman-mode
1917 (use-local-map woman-mode-map)
1921 woman-imenu-generic-expression)
1927 (setq woman-imenu-done nil)
1928 (if woman-imenu (woman-imenu))
1932 (run-mode-hooks 'woman-mode-hook))
1934 (defun woman-imenu (&optional redraw)
1938 (if woman-imenu-done
1943 (setq woman-imenu-done t)
1944 (imenu-add-to-menubar woman-imenu-title)
1947 (defun woman-toggle-fill-frame ()
1950 (setq woman-fill-frame (not woman-fill-frame))
1952 (if woman-fill-frame "frame width" woman-fill-column)
1955 (defun woman-mini-help ()
1964 (apropos-internal "woman"
2000 (woman topic)))
2010 ;; key-binding in `woman-mode-map' has been remapped to call `woman'
2017 ;; (if (and (eq major-mode 'woman-mode)
2042 (if (null (cdr woman-buffer-alist))
2044 (if (>= (setq woman-buffer-number (1+ woman-buffer-number))
2045 (length woman-buffer-alist))
2046 (setq woman-buffer-number 0))
2049 (if (< (setq woman-buffer-number (1- woman-buffer-number)) 0)
2050 (setq woman-buffer-number (1- (length woman-buffer-alist))))
2058 (if (null (cdr woman-buffer-alist))
2060 (if (< (setq woman-buffer-number (1- woman-buffer-number)) 0)
2061 (setq woman-buffer-number (1- (length woman-buffer-alist))))
2067 "Switch to buffer corresponding to `woman-buffer-number' and return it.
2069 alist in `woman-buffer-alist' and return nil."
2070 (if (zerop woman-buffer-number)
2071 (let ((buffer (get-buffer (cdr (car woman-buffer-alist)))))
2075 (setq woman-buffer-alist (cdr woman-buffer-alist))
2077 (let* ((prev-ptr (nthcdr (1- woman-buffer-number) woman-buffer-alist))
2083 (if (>= woman-buffer-number (length woman-buffer-alist))
2084 (setq woman-buffer-number 0))
2092 (defconst woman-escaped-escape-char ?
2095 (defconst woman-escaped-escape-string
2096 (char-to-string woman-escaped-escape-char)
2099 (defconst woman-unpadded-space-char ?
2102 (defconst woman-unpadded-space-string
2103 (char-to-string woman-unpadded-space-char)
2106 (defvar woman-syntax-table nil
2109 (if woman-syntax-table
2111 (setq woman-syntax-table (make-syntax-table))
2113 (modify-syntax-entry woman-unpadded-space-char "." woman-syntax-table)
2114 (modify-syntax-entry woman-escaped-escape-char "." woman-syntax-table)
2117 (defun woman-set-buffer-display-table ()
2132 (aset buffer-display-table woman-unpadded-space-char [?\ ])
2133 (aset buffer-display-table woman-escaped-escape-char [?\\]))
2141 (defun woman-decode-buffer ()
2146 (run-hooks 'woman-pre-format-hook)
2158 (woman-decode-region (point-min) (point-max))
2164 (run-hooks 'woman-post-format-hook))
2166 (defvar woman-string-alist ; rebound in woman-decode-region
2174 (defvar woman-negative-vertical-space nil ; rebound in woman-decode-region
2177 (defun woman-pre-process-region (from to)
2186 (replace-match woman-escaped-escape-string t t)
2187 (woman-delete-whole-line)
2193 (replace-match woman-escaped-escape-string t t))
2195 (woman-delete-whole-line)))
2201 (woman-delete-match 0)))
2203 (defun woman-non-underline-faces ()
2209 (if (and (string-match "\\`woman-" face-name)
2237 (defvar woman-emulate-tbl nil
2242 (defun woman-decode-region (from to)
2251 (woman-string-alist woman-string-alist)
2252 (woman-fill-column woman-fill-column)
2253 woman-negative-vertical-space)
2254 (setq woman-left-margin woman-default-indent
2255 woman-prevailing-indent woman-default-indent
2256 woman-interparagraph-distance 1
2257 woman-leave-blank-lines nil
2258 woman-RS-left-margin nil
2259 woman-RS-prevailing-indent nil
2260 woman-adjust woman-adjust-both
2261 woman-justify (nth woman-adjust woman-justify-list)
2262 woman-nofill nil)
2264 (setq woman-if-conditions-true
2265 (cons (string-to-char (symbol-name woman-emulation)) '(?e ?o)))
2268 (woman-non-underline-faces)
2269 ;; Set font of `woman-symbol' face to `woman-symbol-font' if
2270 ;; `woman-symbol-font' is well defined.
2271 (and woman-use-symbol-font
2272 (stringp woman-symbol-font)
2273 (set-face-font 'woman-symbol woman-symbol-font
2274 (and (frame-live-p woman-frame) woman-frame)))
2277 (set-syntax-table woman-syntax-table)
2278 (woman-set-buffer-display-table)
2281 (if (or woman-fill-frame
2282 (not (and (integerp woman-fill-column) (> woman-fill-column 0))))
2283 (setq woman-fill-column (- (window-width) woman-default-indent)))
2290 (setq woman-emulate-tbl t
2295 (woman-delete-line 1)))
2297 (woman-pre-process-region from nil)
2302 ;; Check for macro sets that woman cannot handle. We can only
2316 (woman-mark-horizonal-position)
2319 (setq fill-column woman-fill-column
2320 tab-width woman-tab-width)
2325 (replace-match woman-unpadded-space-string t t))
2331 (woman-delete-match 0))
2349 (woman-strings)
2353 ; (woman-special-characters)
2357 (woman-change-fonts)
2370 (put-text-property (1- (point)) (point) 'face 'woman-addition)
2374 " by TeX `%s' in woman-addition-face!" repl))
2376 (woman-delete-match 0)
2395 ; (N (woman-parse-numeric-arg)) ; distance
2411 ; (insert-char woman-unpadded-space-char N)
2431 (if woman-negative-vertical-space
2432 (woman-negative-vertical-space from))
2434 (if woman-preserve-ascii
2441 (while (search-forward woman-escaped-escape-string nil t)
2444 (while (search-forward woman-unpadded-space-string nil t)
2451 (defun woman-horizontal-escapes (to)
2455 ;; Moved from `woman-decode-region' for version 0.50.
2466 (N (woman-parse-numeric-arg)) ; distance
2482 (insert-char woman-unpadded-space-char N)
2556 (woman-delete-line 1))
2561 (woman-strings to)
2565 (woman-delete-match 0))
2577 (woman-delete-match 0)
2589 (setq c (memq (following-char) woman-if-conditions-true)))
2613 (woman-parse-numeric-arg))))
2618 (woman-if-ignore woman0-if-to request) ; ERROR!
2619 (woman-if-body request woman0-if-to (eq c negated)))
2622 (defun woman-if-body (request to delete) ; should be reversed as `accept'?
2636 (woman-delete-match 0)
2650 (delete (woman-delete-line 1)) ; single-line
2656 (woman-delete-match 0)
2657 (woman-if-body "el" nil (not delete)))))
2662 (woman-delete-match 0)
2663 (woman-if-body "el" nil t))))
2671 (cond (woman-ignore
2672 (woman-delete-match 0)
2674 (woman-if-body "el" nil t))
2681 (defun woman-if-ignore (to request)
2684 (if woman-ignore
2685 (woman-if-body request to t)
2697 (end (progn (woman-forward-arg 'unquote) (point)))
2707 (woman-file-name
2714 (woman-delete-line 1)
2716 (length (woman-insert-file-contents filename 0))
2718 (woman-pre-process-region from to)
2734 (end (progn (woman-forward-arg 'unquote 'concat) (point)))
2740 end (progn (woman-forward-arg 'unquote) (point))
2744 (woman-delete-whole-line))
2760 (defconst woman-unescape-regex
2761 (concat woman-escaped-escape-string
2762 "\\(" woman-escaped-escape-string "\\)?"))
2764 (defsubst woman-unescape (macro)
2768 (while (setq start (string-match woman-unescape-regex macro start))
2780 ;; Modelled on woman-strings. BEWARE: Processing of .am is a hack!
2801 (let ((body (woman-unescape (buffer-substring from (point)))))
2816 (woman-delete-line 1))
2823 (woman-interpolate-macro (cdr macro))
2828 (defun woman-interpolate-macro (macro)
2843 (woman-forward-arg 'unquote 'noskip)
2865 (woman-delete-line 1))
2873 (defun woman-match-name ()
2886 (defun woman-strings (&optional to)
2912 (setq woman-string-alist (cons string woman-string-alist))
2915 (woman-delete-line 1))
2918 (woman-match-name)
2920 (string (assoc stringname woman-string-alist)))
2930 (cond (woman-ignore
2933 (setq woman-string-alist
2935 woman-string-alist))))
2945 (defconst woman-special-characters
2991 Use the WoMan command `woman-display-extended-fonts' or a character
2994 (defsubst woman-replace-match (newtext &optional face)
2997 (woman-delete-match 0)
2999 (if face (put-text-property (1- (point)) (point) 'face 'woman-symbol))
3002 (defun woman-special-characters (to)
3008 (replacement (assoc name woman-special-characters)))
3015 (if woman-use-symbol-font
3016 (woman-replace-match (nth 2 replacement)
3017 'woman-symbol))
3019 (if woman-use-extended-font
3020 (woman-replace-match (nth 2 replacement))))))
3022 (woman-replace-match (cadr replacement)))))
3026 (if woman-ignore (woman-delete-match 0))))
3029 (defun woman-display-extended-fonts ()
3033 Useful for constructing the alist variable `woman-special-characters'."
3042 'face 'woman-symbol)
3057 (defun woman-unquote (to)
3073 (defsubst woman-unquote-args ()
3075 (woman-unquote (save-excursion (end-of-line) (point-marker))))
3083 (re-search-forward woman-request-regexp nil t)
3085 ;; Construct woman function to call:
3092 (woman-delete-match 0)
3128 (woman-unquote-args)
3174 (woman-forward-arg unquote 'concat) ; unquote is bound above
3178 (woman-forward-arg unquote 'concat)) ; unquote is bound above
3182 (defun woman-forward-arg (&optional unquote concat)
3202 (t (woman-delete-following-space)))
3224 (let ((N (if (eolp) 1 (woman-parse-numeric-arg)))) ; woman-get-numeric-arg ?
3225 (woman-delete-whole-line)
3241 (woman-delete-whole-line))
3247 (woman-delete-whole-line))
3255 (woman-delete-whole-line)
3267 (woman-delete-whole-line))
3272 (defalias 'woman1-ps 'woman-delete-whole-line)
3276 (defalias 'woman1-ss 'woman-delete-whole-line)
3280 (defalias 'woman1-cs 'woman-delete-whole-line)
3284 (defalias 'woman1-ne 'woman-delete-whole-line)
3288 (defalias 'woman1-vs 'woman-delete-whole-line)
3292 (defalias 'woman1-bd 'woman-delete-whole-line)
3300 (woman-forward-arg 'unquote 'concat))
3303 (defalias 'woman1-IX 'woman-delete-whole-line)
3310 (defconst woman-font-alist
3312 ("I" . woman-italic)
3313 ("B" . woman-bold)
3316 ("2" . woman-italic)
3317 ("3" . woman-bold) ; used in bash.1
3319 "Alist of ?roff font indicators and woman font variables and names.")
3321 (defun woman-change-fonts ()
3327 (let ((font-alist woman-font-alist) ; for local updating
3352 (woman-match-name))
3366 (cons (cons fontstring 'woman-unknown)
3368 'woman-unknown)
3375 ;; otherwise match woman-request-regexp. The "\\&" which is
3378 (looking-at woman-request-regexp)
3380 (woman-set-face previous-pos (point) current-font)
3393 (woman-set-face previous-pos (point) current-font)
3396 (defun woman-set-face (from to face)
3400 (not woman-fontify)
3423 (defun woman-get-next-char ()
3429 (woman-delete-match 0))
3448 (setq a (woman-get-next-char))
3451 (setq b (woman-get-next-char)))
3468 (defsubst woman-translate (to)
3481 (woman-delete-match 0))
3488 (defvar woman-registers ; these are all read-only
3494 (".j" woman-adjust) ; current adjustment
3497 (".u" (if woman-nofill 0 1)) ; 1/0 in fill/nofill mode
3504 (defun woman-mark-horizonal-position ()
3508 (setq woman-registers
3510 woman-registers))
3511 (woman-delete-match 0)))
3532 (woman-parse-numeric-arg)))
3537 (woman-parse-numeric-arg))))
3538 (oldvalue (assoc name woman-registers)))
3552 (setq woman-registers
3553 (cons (cons name (cons value inc)) woman-registers))
3554 (woman-delete-whole-line)
3561 (defsubst woman-get-numeric-arg ()
3566 (save-excursion (woman-parse-numeric-arg)))
3568 (defun woman-parse-numeric-arg ()
3570 Unlike `woman-get-numeric-arg', leaves point after the argument.
3574 (let ((value (if (looking-at "[+-]") 0 (woman-parse-numeric-value)))
3580 (setq value (funcall op value (woman-parse-numeric-value))))
3585 (setq value (if (funcall op value (woman-parse-numeric-value))
3594 (if (> (woman-parse-numeric-value) 0) 1 0)
3596 (prog1 0 (woman-parse-numeric-value)))
3600 (prog1 1 (woman-parse-numeric-value))
3601 (if (> (woman-parse-numeric-value) 0) 1 0))
3615 (defun woman-parse-numeric-value ()
3627 (setq n (woman-parse-numeric-arg))
3644 (value (assoc name woman-registers)))
3655 woman-registers
3657 woman-registers)))
3716 (woman-registers woman-registers)
3728 (re-search-forward woman-request-regexp nil t)
3730 ;; Construct woman function to call:
3735 (woman-delete-match 0))
3747 woman-ignore) ; ignore all
3750 (beginning-of-line) (woman-delete-line 1))
3758 (set-marker to (woman-find-next-control-line))
3763 woman-left-margin))
3769 (defun woman-find-next-control-line ()
3787 (woman-delete-line 2)))
3796 (woman-set-interparagraph-distance)
3799 (defun woman-set-interparagraph-distance ()
3801 (setq woman-interparagraph-distance
3802 (if (eolp) 1 (woman-get-numeric-arg)))
3804 (woman-delete-line 1)) ; ignore remaining args
3806 (defsubst woman-interparagraph-space ()
3807 "Set variable `woman-leave-blank-lines' from `woman-interparagraph-distance'."
3808 ; (if (> woman-interparagraph-distance 0)
3810 ; (woman-delete-line 1)) ; do not leave blank line
3811 (setq woman-leave-blank-lines woman-interparagraph-distance)
3819 (woman-forward-arg 'unquote 'concat)
3821 (woman-forward-arg 'unquote 'concat)
3832 (woman-forward-arg 'unquote 'concat)
3839 (woman-set-face
3840 (save-excursion (beginning-of-line) (point)) (point) 'woman-bold)
3843 (setq woman-left-margin woman-default-indent)
3844 (setq woman-prevailing-indent woman-default-indent)
3845 (woman2-format-paragraphs to woman-left-margin))
3852 (woman-unquote-args) ; else unquote to end of heading
3855 (woman-leave-blank-lines woman-interparagraph-distance)
3856 (setq woman-leave-blank-lines nil)
3858 (if woman-bold-headings
3859 (woman-set-face
3860 (point) (save-excursion (end-of-line) (point)) 'woman-bold))
3862 (setq woman-left-margin woman-default-indent
3863 woman-nofill nil) ; fill output lines
3864 (setq woman-prevailing-indent woman-default-indent)
3865 (woman2-format-paragraphs to woman-left-margin))
3879 (woman-delete-line 1) ; ignore any arguments
3880 (woman-interparagraph-space)
3881 (setq woman-prevailing-indent woman-default-indent)
3882 (woman2-format-paragraphs to woman-left-margin))
3890 (woman-delete-line 1) ; ignore argument(s)
3891 (setq woman-nospace t)
3897 (woman-delete-line 1) ; ignore argument(s)
3898 (setq woman-nospace nil)
3903 (let ((N (if (eolp) 1 (woman-get-numeric-arg))))
3905 (woman-delete-line 1) ; ignore argument(s)
3906 (setq woman-negative-vertical-space t)
3909 (setq woman-leave-blank-lines N)
3912 (defun woman-negative-vertical-space (from)
3914 ;; Run by woman-decode-region if necessary -- not usually required.
3920 (let ((N (woman-get-numeric-arg))
3922 (woman-delete-whole-line)
3946 (let ((i woman-tab-width))
3982 (woman-delete-match 0))
3988 (woman-delete-match 0))
3993 (woman-translate to)
3995 (woman-special-characters to)
4015 ((eq c ?l) (woman-horizontal-line))
4025 (woman-tab-to-tab-stop))
4035 (setq N (woman-parse-numeric-value))
4041 (defun woman-horizontal-line ()
4049 (N (woman-parse-numeric-arg))
4060 (woman-delete-line 1) ; ignore any arguments
4066 (setq woman-nofill nil)
4067 (woman-delete-line 1) ; ignore any arguments
4071 (if (looking-at "[ \t]*$") (setq woman-leave-blank-lines 1)))
4078 (setq woman-nofill t)
4079 (woman-delete-line 1) ; ignore any arguments
4088 (setq woman-adjust
4089 (cond ((eolp) woman-adjust-previous)
4090 ((eq (following-char) ?l) woman-adjust-left)
4091 ((eq (following-char) ?r) woman-adjust-right)
4092 ((eq (following-char) ?c) woman-adjust-center)
4093 ((memq (following-char) '(?b ?n)) woman-adjust-both)
4094 (t (woman-get-numeric-arg))
4096 woman-justify (nth woman-adjust woman-justify-list))
4097 (woman-delete-line 1) ; ignore any remaining arguments
4103 (setq woman-adjust-previous woman-adjust
4104 woman-justify-previous woman-justify
4105 woman-adjust woman-adjust-left ; fill but do not adjust
4106 woman-justify (nth woman-adjust woman-justify-list))
4107 (woman-delete-line 1) ; ignore any arguments
4112 (defun woman-leave-blank-lines (&optional leave)
4115 non-zero, or if LEAVE is nil and variable `woman-leave-blank-lines' is
4128 (if woman-nospace
4132 (setq leave woman-leave-blank-lines))
4135 (setq woman-leave-blank-lines nil)
4141 (defvar woman-temp-indent nil)
4146 If `woman-nofill' is non-nil then indent without filling or adjusting."
4151 (setq woman-leave-blank-lines 1))
4157 ;; (woman-leave-blank-lines)
4158 (woman-reset-nospace)
4161 (if woman-nofill
4164 (woman-leave-blank-lines)
4165 (cond (woman-temp-indent
4166 (indent-to woman-temp-indent)
4169 (woman-horizontal-escapes to)) ; 7 October 1999
4178 (woman-leave-blank-lines)
4181 (indent-to (or woman-temp-indent left-margin))
4182 (woman-horizontal-escapes to) ; 7 October 1999
4190 ; (setq woman-leave-blank-lines 1))
4191 ; (setq woman-leave-blank-lines nil)))
4196 (setq woman-leave-blank-lines 1))
4210 ;; (fill-region-as-paragraph from (point) woman-justify t)
4216 (if (and woman-temp-indent (< woman-temp-indent left-margin))
4217 (let ((left-margin woman-temp-indent))
4218 (fill-region-as-paragraph from (point) woman-justify)
4223 (fill-region-as-paragraph from (point) woman-justify))
4227 ;;(woman-leave-blank-lines 1)
4230 (setq woman-temp-indent nil)
4232 ;;(setq woman-leave-blank-lines nil)
4244 (woman-leave-blank-lines woman-interparagraph-distance)
4249 (woman-interparagraph-space)
4252 (woman2-format-paragraphs to (+ woman-left-margin
4253 woman-prevailing-indent))
4254 (woman-forward-arg 'unquote)
4257 (woman-leave-blank-lines) ; must be here,
4260 ;; confuses woman, although the man program displays it ok.
4277 (looking-at woman-request-regexp)))))
4280 (defun woman-find-next-control-line-carefully ()
4284 (woman-find-next-control-line)))
4291 (setq woman-leave-blank-lines nil))
4301 (woman-delete-line 1)
4302 (woman-delete-match 0)
4305 (woman-set-interparagraph-distance)))
4306 (set-marker to (woman-find-next-control-line-carefully))
4310 (woman-reset-nospace)
4314 ;; (indent-to woman-left-margin)
4315 (setq left-margin woman-left-margin)
4318 (point) woman-justify)
4322 (woman-delete-match 0)
4323 (woman-set-interparagraph-distance)
4324 (set-marker to (woman-find-next-control-line-carefully))
4330 (setq left-margin (+ woman-left-margin i))
4349 (woman-interparagraph-space)
4350 (setq woman-temp-indent woman-left-margin)
4351 (woman2-format-paragraphs to (+ woman-left-margin i))
4360 (let ((i (woman-get-numeric-arg)))
4361 (woman-delete-line) (or leave-eol (delete-char 1))
4364 (if (> i 0) (setq woman-prevailing-indent i))))
4365 woman-prevailing-indent)
4367 (defmacro woman-push (value stack)
4371 (defmacro woman-pop (variable stack)
4381 (woman-push woman-left-margin woman-RS-left-margin)
4382 (woman-push woman-prevailing-indent woman-RS-prevailing-indent)
4383 (setq woman-left-margin (+ woman-left-margin
4385 woman-prevailing-indent woman-default-indent)
4386 (woman2-format-paragraphs to woman-left-margin))
4391 (woman-pop woman-left-margin woman-RS-left-margin)
4392 (woman-pop woman-prevailing-indent woman-RS-prevailing-indent)
4393 (woman-delete-line 1) ; ignore any arguments
4394 (woman2-format-paragraphs to woman-left-margin))
4400 (defun woman-set-arg (arg &optional previous)
4411 (i (woman-parse-numeric-arg)))
4417 (woman-delete-line 1)) ; ignore any remaining arguments
4420 (defvar woman-ll-fill-column woman-fill-column)
4421 (defvar woman-in-left-margin woman-left-margin)
4426 (woman-set-arg 'fill-column 'woman-ll-fill-column)
4432 (woman-set-arg 'left-margin 'woman-in-left-margin)
4440 (setq woman-temp-indent left-margin)
4441 (woman-set-arg 'woman-temp-indent)
4459 (i (woman-parse-numeric-arg)))
4467 (woman-delete-line 1) ; ignore any remaining arguments
4471 (defsubst woman-get-tab-stop (tab-stop-list)
4475 (defun woman-tab-to-tab-stop ()
4484 (woman-get-tab-stop (car tabs))))
4491 (setq tab (woman-get-tab-stop tab)
4508 (woman-delete-line 1) ; ignore any arguments
4517 (woman-delete-whole-line) ; ignore!
4523 (woman-delete-whole-line)
4535 (insert woman-unpadded-space-char)
4538 (insert-before-markers woman-unpadded-space-char)
4541 pad woman-unpadded-space-char t)
4554 (woman-delete-line 1) ; ignore any arguments
4555 (when woman-emulate-tbl
4559 (if (looking-at ".*;[ \t]*$") (woman-delete-line 1)) ;
4562 (while (not (looking-at ".*\\.[ \t]*$")) (woman-delete-line 1))
4563 (woman-delete-line 1)
4583 (setq woman-nofill t)
4597 (defvar WoMan-current-file nil) ; bound in woman-really-find-file
4654 (if woman-show-log
4663 nil) ; for woman-file-readable-p etc.
4665 (provide 'woman)
4668 ;;; woman.el ends here