[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/man.el
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/man.el |
Date: |
Tue, 30 Nov 2004 17:32:29 -0500 |
Index: emacs/lisp/man.el
diff -c emacs/lisp/man.el:1.138 emacs/lisp/man.el:1.139
*** emacs/lisp/man.el:1.138 Sun Oct 31 23:44:57 2004
--- emacs/lisp/man.el Tue Nov 30 22:26:26 2004
***************
*** 1,6 ****
;;; man.el --- browse UNIX manual pages -*- coding: iso-8859-1 -*-
! ;; Copyright (C) 1993, 1994, 1996, 1997, 2001, 2003, 2004 Free Software
Foundation, Inc.
;; Author: Barry A. Warsaw <address@hidden>
;; Maintainer: FSF
--- 1,7 ----
;;; man.el --- browse UNIX manual pages -*- coding: iso-8859-1 -*-
! ;; Copyright (C) 1993, 1994, 1996, 1997, 2001, 2003, 2004
! ;; Free Software Foundation, Inc.
;; Author: Barry A. Warsaw <address@hidden>
;; Maintainer: FSF
***************
*** 94,99 ****
--- 95,101 ----
;;; Code:
+ (eval-when-compile (require 'cl))
(require 'assoc)
(require 'button)
***************
*** 153,158 ****
--- 155,165 ----
:type 'face
:group 'man)
+ (defcustom Man-reverse-face 'secondary-selection
+ "*Face to use when fontifying reverse video."
+ :type 'face
+ :group 'man)
+
;; Use the value of the obsolete user option Man-notify, if set.
(defcustom Man-notify-method (if (boundp 'Man-notify) Man-notify 'friendly)
"*Selects the behavior when manpage is ready.
***************
*** 813,825 ****
(interactive)
(message "Please wait: formatting the %s man page..." Man-arguments)
(goto-char (point-min))
! (while (search-forward "\e[1m" nil t)
! (delete-backward-char 4)
! (put-text-property (point)
! (progn (if (search-forward "\e[0m" nil 'move)
! (delete-backward-char 4))
! (point))
! 'face Man-overstrike-face))
(if (< (buffer-size) (position-bytes (point-max)))
;; Multibyte characters exist.
(progn
--- 820,858 ----
(interactive)
(message "Please wait: formatting the %s man page..." Man-arguments)
(goto-char (point-min))
! ;; Fontify ANSI escapes.
! (let ((faces nil)
! (start (point)))
! ;; http://www.isthe.com/chongo/tech/comp/ansi_escapes.html
! ;; suggests many codes, but we only handle:
! ;; ESC [ 00 m reset to normal display
! ;; ESC [ 01 m bold
! ;; ESC [ 04 m underline
! ;; ESC [ 07 m reverse-video
! ;; ESC [ 22 m no-bold
! ;; ESC [ 24 m no-underline
! ;; ESC [ 27 m no-reverse-video
! (while (re-search-forward "\e\\[0?\\([1470]\\|2\\([247]\\)\\)m" nil t)
! (if faces (put-text-property start (match-beginning 0) 'face
! (if (cdr faces) faces (car faces))))
! (setq faces
! (cond
! ((match-beginning 2)
! (delq (case (char-after (match-beginning 2))
! (?2 Man-overstrike-face)
! (?4 Man-underline-face)
! (?7 Man-reverse-face))
! faces))
! ((eq (char-after (match-beginning 1)) ?0) nil)
! (t
! (cons (case (char-after (match-beginning 1))
! (?1 Man-overstrike-face)
! (?4 Man-underline-face)
! (?7 Man-reverse-face))
! faces))))
! (delete-region (match-beginning 0) (match-end 0))
! (setq start (point))))
! ;; Other highlighting.
(if (< (buffer-size) (position-bytes (point-max)))
;; Multibyte characters exist.
(progn
***************
*** 1372,1376 ****
(provide 'man)
! ;;; arch-tag: 587cda76-8e23-4594-b1f3-89b6b09a0d47
;;; man.el ends here
--- 1405,1409 ----
(provide 'man)
! ;; arch-tag: 587cda76-8e23-4594-b1f3-89b6b09a0d47
;;; man.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/man.el,
Stefan Monnier <=