Fix arg usage of format-decode-run-method (Bug#7488).
[bpt/emacs.git] / lisp / woman.el
index 302a964..63c6101 100644 (file)
@@ -1,7 +1,7 @@
 ;;; woman.el --- browse UN*X manual pages `wo (without) man'
 
 ;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-;;   2009  Free Software Foundation, Inc.
+;;   2009, 2010  Free Software Foundation, Inc.
 
 ;; Author: Francis J. Wright <F.J.Wright@qmul.ac.uk>
 ;; Maintainer: FSF
@@ -1507,7 +1507,7 @@ Also make each path-info component into a list.
   ;;   (topic)
   ;;   (topic (path-index) (path-index) ... )
   ;;   (topic (path-index filename) (path-index filename) ... )
-  ;; where the are no duplicates in the value lists.
+  ;; where there are no duplicates in the value lists.
   ;; Topic must match first `word' of filename, so ...
   (let ((topic-regexp
         (concat
@@ -1649,7 +1649,9 @@ decompress the file if appropriate.  See the documentation for the
 
 (defun woman-make-bufname (bufname)
   "Create an unambiguous buffer name from BUFNAME."
-  (let ((dot (string-match "\\." bufname)))
+  ;; See Bug#5038.  Any compression extension has already been removed.
+  ;; Go from eg "host.conf.5" to "5 host.conf".
+  (let ((dot (string-match "\\.[^.]*\\'" bufname)))
     (if dot (setq bufname (concat
                           (substring bufname (1+ dot)) " "
                           (substring bufname 0 dot))))
@@ -3382,7 +3384,10 @@ Format paragraphs upto TO.  Supports special chars.
   "Translate up to marker TO.  Do this last of all transformations."
   (if translations
       (let ((matches (car translations))
-           (alist (cdr translations)))
+           (alist (cdr translations))
+           ;; Translations are case-sensitive, eg ".tr ab" does not
+           ;; affect "A" (bug#6849).
+           (case-fold-search nil))
        (while (re-search-forward matches to t)
          ;; Done like this to retain text properties and
          ;; support translation of special characters:
@@ -3874,10 +3879,14 @@ Optional argument NUMERIC, if non-nil, means the argument is numeric."
   ;; The first two cases below could be merged (maybe)!
   (let ((from (point)))
     ;; Discard zero width filler character used to hide leading dots
-    ;; and zero width characters.  If on a line by itself, consume the
-    ;; newline as well, as this may interfere with (Bug#3651).
-    (while (re-search-forward "\\\\[&|^]\n?" to t)
-      (woman-delete-match 0))
+    ;; and zero width characters.
+    (while (re-search-forward "\\\\[&|^]" to t)
+      (woman-delete-match 0)
+      ;; If on a line by itself, consume newline as well (Bug#3651).
+      (and (eq (char-before (match-beginning 0)) ?\n)
+          (eq (char-after (match-beginning 0)) ?\n)
+          (delete-char 1)))
+
     (goto-char from)
     ;; Interrupt text processing -- CONTINUE current text with the
     ;; next text line (after any control lines, unless processing to