;;; woman.el --- browse UN*X manual pages `wo (without) man'
-;; Copyright (C) 2000-2012 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2013 Free Software Foundation, Inc.
;; Author: Francis J. Wright <F.J.Wright@qmul.ac.uk>
;; Maintainer: FSF
(defun woman-default-faces ()
"Set foreground colors of italic and bold faces to their default values."
+ (declare (obsolete choose-completion-guess-base-position "23.2"))
(interactive)
(face-spec-set 'woman-italic (face-user-default-spec 'woman-italic))
(face-spec-set 'woman-bold (face-user-default-spec 'woman-bold)))
(defun woman-monochrome-faces ()
"Set foreground colors of italic and bold faces to that of the default face.
This is usually either black or white."
+ (declare (obsolete choose-completion-guess-base-position "23.2"))
(interactive)
(set-face-foreground 'woman-italic 'unspecified)
(set-face-foreground 'woman-bold 'unspecified))
((null (cdr files)) (car (car files))) ; only 1 file for topic.
(t
;; Multiple files for topic, so must select 1.
- ;; Unread the command event (TAB = ?\t = 9) that runs the command
- ;; `minibuffer-complete' in order to automatically complete the
- ;; minibuffer contents as far as possible.
- (setq unread-command-events '(9)) ; and delete any type-ahead!
- (completing-read "Manual file: " files nil 1
- (try-completion "" files) 'woman-file-history))))))
+ ;; Run the command `minibuffer-complete' in order to automatically
+ ;; complete the minibuffer contents as far as possible.
+ (minibuffer-with-setup-hook
+ (lambda () (let ((this-command this-command)) (minibuffer-complete)))
+ (completing-read "Manual file: " files nil 1
+ (try-completion "" files) 'woman-file-history)))))))
(defun woman-select (predicate list)
"Select unique elements for which PREDICATE is true in LIST.
(woman-dired-define-keys)
(add-hook 'dired-mode-hook 'woman-dired-define-keys))
+(declare-function dired-get-filename "dired"
+ (&optional localp no-error-if-not-filep))
+
;;;###autoload
(defun woman-dired-find-file ()
"In dired, run the WoMan man-page browser on this file."
(interactive)
- ;; dired-get-filename is defined in dired.el
(woman-find-file (dired-get-filename)))
["Use Full Frame Width" woman-toggle-fill-frame
:active t :style toggle :selected woman-fill-frame]
["Reformat Last Man Page" woman-reformat-last-file t]
- ["Use Monochrome Main Faces" woman-monochrome-faces t]
- ["Use Default Main Faces" woman-default-faces t]
["Make Contents Menu" (woman-imenu t) (not woman-imenu-done)]
"--"
["Describe (Wo)Man Mode" describe-mode t]
(message "Woman fill column set to %s."
(if woman-fill-frame "frame width" woman-fill-column)))
+(declare-function apropos-print "apropos"
+ (do-keys spacing &optional text nosubst))
+
(defun woman-mini-help ()
"Display WoMan commands and user options in an `apropos' buffer."
;; Based on apropos-command in apropos.el
(face-underline-p face))
(let ((face-no-ul (intern (concat face-name "-no-ul"))))
(copy-face face face-no-ul)
- (set-face-underline-p face-no-ul nil)))))))
+ (set-face-underline face-no-ul nil)))))))
;; Preprocessors
;; =============
(set-face-font 'woman-symbol woman-symbol-font
(and (frame-live-p woman-frame) woman-frame)))
- ;; Set syntax and display tables:
+ (setq-local adaptive-fill-mode nil) ; No special "%" "#" etc filling.
+
+ ;; Set syntax and display tables:
(set-syntax-table woman-syntax-table)
(woman-set-buffer-display-table)
(cond
;; ((looking-at "[no]") (setq c t)) ; accept n(roff) and o(dd page)
;; ((looking-at "[te]") (setq c nil)) ; reject t(roff) and e(ven page)
- ((looking-at "[ntoe]")
+ ;; Per groff ".if v" is recognized as false (it means -Tversatec).
+ ((looking-at "[ntoev]")
(setq c (memq (following-char) woman-if-conditions-true)))
;; Unrecognized letter so reject:
((looking-at "[A-Za-z]") (setq c nil)
(let (n)
(forward-char)
(setq n (woman-parse-numeric-arg))
- (skip-syntax-forward " ")
+ (skip-syntax-forward " " (line-end-position))
(if (eq (following-char) ?\))
(forward-char)
(WoMan-warn "Parenthesis confusion in numeric expression!"))
(buffer-substring
(point)
(line-end-position)))
- (skip-syntax-forward "^ ")
+ (skip-syntax-forward "^ " (line-end-position))
0)
(goto-char (match-end 0))
;; Check for scale factor:
((looking-at "[mnuv]")) ; ignore for now
((looking-at "i") (setq n (* n 10))) ; inch
((looking-at "c") (setq n (* n 3.9))) ; cm
- ((looking-at "P") (setq n (* n 1.7))) ; Pica
+ ((let ((case-fold-search nil))
+ (looking-at "P"))
+ (setq n (* n 1.7))) ; Pica
((looking-at "p") (setq n (* n 0.14))) ; point
;; NB: May be immediately followed by + or -, etc.,
;; in which case do nothing and return nil.