;;; 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
;; (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
(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))))
"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:
;; 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