diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2011-04-19 15:44:55 +0200 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2011-04-19 15:44:55 +0200 |
commit | 06b605171f1c9d8b42bd3326a243b8b03d2e4e58 (patch) | |
tree | e96c135042999136bf0e75d113aae306e51983e3 /lisp/woman.el | |
parent | 04c569546ad52f6270d8fc6d4aa0750950a0ac05 (diff) | |
download | emacs-06b605171f1c9d8b42bd3326a243b8b03d2e4e58.tar.gz |
lisp/*.el: Lexical-binding cleanup.
Diffstat (limited to 'lisp/woman.el')
-rw-r--r-- | lisp/woman.el | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/lisp/woman.el b/lisp/woman.el index ac4ace62bf1..eb801b55d4d 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -1086,6 +1086,9 @@ Set by .PD; used by .SH, .SS, .TP, .LP, .PP, .P, .IP, .HP.") (defvar woman-nospace nil "Current no-space mode: nil for normal spacing. Set by `.ns' request; reset by any output or `.rs' request") +;; Used for message logging +(defvar WoMan-current-file nil) ; bound in woman-really-find-file +(defvar WoMan-Log-header-point-max nil) (defsubst woman-reset-nospace () "Set `woman-nospace' to nil." @@ -1281,8 +1284,7 @@ cache to be re-read." ;; completions, but to return only a case-sensitive match. This ;; does not seem to work properly by default, so I re-do the ;; completion if necessary. - (let (files - (default (current-word))) + (let (files) (or (stringp topic) (and (if (boundp 'woman-use-topic-at-point) woman-use-topic-at-point @@ -1367,16 +1369,17 @@ regexp that is the final component of DIR. Log a warning if list is empty." (or (file-accessible-directory-p dir) (WoMan-warn "Ignoring inaccessible `man-page' directory `%s'!" dir))) -(defun woman-expand-directory-path (woman-manpath woman-path) - "Expand the manual directories in WOMAN-MANPATH and WOMAN-PATH. -WOMAN-MANPATH should be a list of general manual directories, while -WOMAN-PATH should be a list of specific manual directory regexps. +(defun woman-expand-directory-path (path-dirs path-regexps) + "Expand the manual directories in PATH-DIRS and PATH-REGEXPS. +PATH-DIRS should be a list of general manual directories (like +`woman-manpath'), while PATH-REGEXPS should be a list of specific +manual directory regexps (like `woman-path'). Ignore any paths that are unreadable or not directories." ;; Allow each path to be a single string or a list of strings: - (if (not (listp woman-manpath)) (setq woman-manpath (list woman-manpath))) - (if (not (listp woman-path)) (setq woman-path (list woman-path))) + (if (not (listp path-dirs)) (setq path-dirs (list path-dirs))) + (if (not (listp path-regexps)) (setq path-regexps (list path-regexps))) (let (head dirs path) - (dolist (dir woman-manpath) + (dolist (dir path-dirs) (when (consp dir) (unless path (setq path (split-string (getenv "PATH") path-separator t))) @@ -1390,7 +1393,7 @@ Ignore any paths that are unreadable or not directories." (setq dir (woman-canonicalize-dir dir) dirs (nconc dirs (directory-files dir t woman-manpath-man-regexp))))) - (dolist (dir woman-path) + (dolist (dir path-regexps) (if (or (null dir) (null (setq dir (woman-canonicalize-dir dir) head (file-name-directory dir))) @@ -1576,6 +1579,8 @@ Also make each path-info component into a list. ;;; tar-mode support +(defvar global-font-lock-mode) ; defined in font-core.el + (defun woman-tar-extract-file () "In tar mode, run the WoMan man-page browser on this file." (interactive) @@ -2243,7 +2248,7 @@ To be called on original buffer and any .so insertions." This applies to text between .TE and .TS directives. Currently set only from '\" t in the first line of the source file.") -(defun woman-decode-region (from to) +(defun woman-decode-region (from _to) "Decode the region between FROM and TO in UN*X man-page source format." ;; Suitable for use in format-alist. ;; But this requires care to control major mode implied font locking. @@ -4364,9 +4369,9 @@ Format paragraphs upto TO." (setq tab-stop-list (reverse tab-stop-list)) (woman2-format-paragraphs to)) -(defsubst woman-get-tab-stop (tab-stop-list) - "If TAB-STOP-LIST is a cons, return its car, else return TAB-STOP-LIST." - (if (consp tab-stop-list) (car tab-stop-list) tab-stop-list)) +(defsubst woman-get-tab-stop (tab-stops) + "If TAB-STOPS is a cons, return its car, else return TAB-STOPS." + (if (consp tab-stops) (car tab-stops) tab-stops)) (defun woman-tab-to-tab-stop () "Insert spaces to next defined tab-stop column. @@ -4484,9 +4489,6 @@ Format paragraphs upto TO." ;; The basis for this logging code was shamelessly pirated from bytecomp.el ;; by Jamie Zawinski <jwz@lucid.com> & Hallvard Furuseth <hbf@ulrik.uio.no> -(defvar WoMan-current-file nil) ; bound in woman-really-find-file -(defvar WoMan-Log-header-point-max nil) - (defun WoMan-log-begin () "Log the beginning of formatting in *WoMan-Log*." (let ((WoMan-current-buffer (buffer-name))) |