]> code.delx.au - gnu-emacs/blobdiff - lisp/woman.el
* NEWS: Add paragraphs for CEDET and EIEIO.
[gnu-emacs] / lisp / woman.el
index 32aee3baff8f69128cf1cb757048c83ecca4ae76..e5d5ac1660f8f98a33221aa26c9dfc441863540a 100644 (file)
@@ -1,6 +1,6 @@
 ;;; 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
 ;; package will over-write the WoMan binding to "w", whereas (by
 ;; default) WoMan will not overwrite the `dired-x' binding.)
 
-;; The following is based on suggestions by Guy Gascoigne-Piggford and
-;; Juanma Barranquero.  If you really want to square the man-woman
-;; circle then you might care to define the following bash function in
-;; .bashrc:
-
-;;   man() { gnudoit -q '(raise-frame (selected-frame)) (woman' \"$1\" ')' ; }
-
-;; If you use Microsoft COMMAND.COM then you can create a file called
-;; man.bat somewhere in your path containing the two lines:
-
-;;   @echo off
-;;   gnudoit -q (raise-frame (selected-frame)) (woman \"%1\")
-
-;; and then (e.g. from a command prompt or the Run... option in the
-;; Start menu) just execute
-
-;;   man man_page_name
-
-
 ;; Using the word at point as the default topic
 ;; ============================================
 
 ;; http://cm.bell-labs.com/7thEdMan/
 
 
-;; Acknowledgements
-;; ================
+;; Acknowledgments
+;; ===============
 
 ;; For Heather, Kathryn and Madelyn, the women in my life
 ;; (although they will probably never use it)!
 
 (eval-when-compile                     ; to avoid compiler warnings
   (require 'dired)
-  (require 'cl)
+  (require 'cl-lib)
   (require 'apropos))
 
 (defun woman-mapcan (fn x)
@@ -2210,7 +2191,7 @@ To be called on original buffer and any .so insertions."
                 (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
 ;; =============
@@ -2272,7 +2253,9 @@ Currently set only from '\" t in the first line of the source file.")
         (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)
 
@@ -2550,7 +2533,8 @@ REQUEST is the invoking directive without the leading dot."
     (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)
@@ -3588,7 +3572,7 @@ expression in parentheses.  Leaves point after the value."
       (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!"))
@@ -3640,7 +3624,7 @@ expression in parentheses.  Leaves point after the value."
                        (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:
@@ -3650,7 +3634,9 @@ expression in parentheses.  Leaves point after the value."
             ((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.
@@ -3924,7 +3910,7 @@ Leave 1 blank line.  Format paragraphs upto TO."
 (defun woman2-process-escapes (to &optional numeric)
   "Process remaining escape sequences up to marker TO, preserving point.
 Optional argument NUMERIC, if non-nil, means the argument is numeric."
-  (assert (and (markerp to) (marker-insertion-type to)))
+  (cl-assert (and (markerp to) (marker-insertion-type to)))
   ;; The first two cases below could be merged (maybe)!
   (let ((from (point)))
     ;; Discard zero width filler character used to hide leading dots