]> code.delx.au - gnu-emacs/blobdiff - lisp/man.el
Add 2009 to copyright years.
[gnu-emacs] / lisp / man.el
index 353a9032992f28e00656346150ad66cb806e7dcd..9c2fa952fd2a06e48731934e59dbe1b720610f86 100644 (file)
@@ -1,7 +1,7 @@
 ;;; man.el --- browse UNIX manual pages -*- coding: iso-8859-1 -*-
 
 ;; Copyright (C) 1993, 1994, 1996, 1997, 2001, 2002, 2003,
-;;   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: Barry A. Warsaw <bwarsaw@cen.com>
 ;; Maintainer: FSF
 
 (defvar Man-notify)
 (defcustom Man-filter-list nil
-  "*Manpage cleaning filter command phrases.
+  "Manpage cleaning filter command phrases.
 This variable contains a list of the following form:
 
 '((command-string phrase-string*)*)
@@ -425,9 +425,9 @@ Otherwise, the value is whatever the function
   'func nil
   'action #'Man-xref-button-action)
 
-(defun Man-xref-button-action (button) 
+(defun Man-xref-button-action (button)
   (let ((target (button-get button 'Man-target-string)))
-    (funcall 
+    (funcall
      (button-get button 'func)
      (cond ((null target)
            (button-label button))
@@ -435,7 +435,7 @@ Otherwise, the value is whatever the function
            (funcall target (button-start button)))
           (t target)))))
 
-(define-button-type 'Man-xref-man-page 
+(define-button-type 'Man-xref-man-page
   :supertype 'Man-abstract-xref-man-page
   'func 'man-follow)
 
@@ -829,6 +829,10 @@ all sections related to a subject, put something appropriate into the
                              (Man-width (frame-width))
                              ((window-width))))))
        (setenv "GROFF_NO_SGR" "1")
+       ;; Since man-db 2.4.3-1, man writes plain text with no escape
+       ;; sequences when stdout is not a tty.  In 2.5.0, the following
+       ;; env-var was added to allow control of this (see Debian Bug#340673).
+       (setenv "MAN_KEEP_FORMATTING" "1")
        (if (fboundp 'start-process)
            (set-process-sentinel
             (start-process manual-program buffer
@@ -1007,7 +1011,7 @@ default type, `Man-xref-man-page' is used for the buttons."
        (Man-highlight-references0 nil Man-apropos-regexp 1
                                   'Man-default-man-entry
                                   (or xref-man-type 'Man-xref-man-page)))
-    (Man-highlight-references0 Man-see-also-regexp Man-reference-regexp 1 
+    (Man-highlight-references0 Man-see-also-regexp Man-reference-regexp 1
                               'Man-default-man-entry
                               (or xref-man-type 'Man-xref-man-page))
     (Man-highlight-references0 Man-synopsis-regexp Man-header-regexp 0 2
@@ -1034,7 +1038,7 @@ default type, `Man-xref-man-page' is used for the buttons."
         (match-end button-pos)
         'type type
         'Man-target-string (cond
-                            ((numberp target) 
+                            ((numberp target)
                              (match-string target))
                             ((functionp target)
                              target)