aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2005-06-10 08:07:29 +0000
committerMiles Bader2005-06-10 08:07:29 +0000
commitb66e857532c79def84bb1f1327be3d05ccc6e466 (patch)
tree0509abdda2ddef81e26f4dc2b21496fc953e79de
parent041a6e47576ec27f40f10954ca5ed73853865eae (diff)
downloademacs-b66e857532c79def84bb1f1327be3d05ccc6e466.tar.gz
emacs-b66e857532c79def84bb1f1327be3d05ccc6e466.zip
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-370
Remove "-face" suffix from woman faces 2005-06-10 Miles Bader <miles@gnu.org> * lisp/woman.el (woman-italic, woman-bold, woman-unknown) (woman-addition, woman-symbol-face): Remove "-face" suffix from face names. (woman-italic-face, woman-bold-face, woman-unknown-face) (woman-addition-face): New backward-compatibility aliases for renamed faces. (woman-default-faces, woman-monochrome-faces, woman-man-buffer) (woman-decode-region, woman-replace-match) (woman-display-extended-fonts, woman-special-characters) (woman-font-alist, woman-change-fonts, woman2-TH, woman2-SH): Use renamed woman faces.
-rw-r--r--lisp/ChangeLog12
-rw-r--r--lisp/woman.el67
2 files changed, 48 insertions, 31 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d03d522b15c..f61d747a7c8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,17 @@
12005-06-10 Miles Bader <miles@gnu.org> 12005-06-10 Miles Bader <miles@gnu.org>
2 2
3 * woman.el (woman-italic, woman-bold, woman-unknown)
4 (woman-addition, woman-symbol-face):
5 Remove "-face" suffix from face names.
6 (woman-italic-face, woman-bold-face, woman-unknown-face)
7 (woman-addition-face):
8 New backward-compatibility aliases for renamed faces.
9 (woman-default-faces, woman-monochrome-faces, woman-man-buffer)
10 (woman-decode-region, woman-replace-match)
11 (woman-display-extended-fonts, woman-special-characters)
12 (woman-font-alist, woman-change-fonts, woman2-TH, woman2-SH):
13 Use renamed woman faces.
14
3 * longlines.el (longlines-visible-face): Face removed. 15 * longlines.el (longlines-visible-face): Face removed.
4 16
5 * diff-mode.el (diff-header, diff-file-header, diff-index) 17 * diff-mode.el (diff-header, diff-file-header, diff-index)
diff --git a/lisp/woman.el b/lisp/woman.el
index 4d92c9ee0c7..6d0d0336001 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -875,49 +875,56 @@ or different fonts."
875;; This is overkill! Troff uses just italic; Nroff uses just underline. 875;; This is overkill! Troff uses just italic; Nroff uses just underline.
876;; You should probably select either italic or underline as you prefer, but 876;; You should probably select either italic or underline as you prefer, but
877;; not both, although italic and underline work together perfectly well! 877;; not both, although italic and underline work together perfectly well!
878(defface woman-italic-face 878(defface woman-italic
879 `((((min-colors 88) (background light)) 879 `((((min-colors 88) (background light))
880 (:slant italic :underline t :foreground "red1")) 880 (:slant italic :underline t :foreground "red1"))
881 (((background light)) (:slant italic :underline t :foreground "red")) 881 (((background light)) (:slant italic :underline t :foreground "red"))
882 (((background dark)) (:slant italic :underline t))) 882 (((background dark)) (:slant italic :underline t)))
883 "Face for italic font in man pages." 883 "Face for italic font in man pages."
884 :group 'woman-faces) 884 :group 'woman-faces)
885;; backward-compatibility alias
886(put 'woman-italic-face 'face-alias 'woman-italic)
885 887
886(defface woman-bold-face 888(defface woman-bold
887 '((((min-colors 88) (background light)) (:weight bold :foreground "blue1")) 889 '((((min-colors 88) (background light)) (:weight bold :foreground "blue1"))
888 (((background light)) (:weight bold :foreground "blue")) 890 (((background light)) (:weight bold :foreground "blue"))
889 (((background dark)) (:weight bold :foreground "green2"))) 891 (((background dark)) (:weight bold :foreground "green2")))
890 "Face for bold font in man pages." 892 "Face for bold font in man pages."
891 :group 'woman-faces) 893 :group 'woman-faces)
894;; backward-compatibility alias
895(put 'woman-bold-face 'face-alias 'woman-bold)
892 896
893;; Brown is a good compromise: it is distinguishable from the default 897;; Brown is a good compromise: it is distinguishable from the default
894;; but not enough so to make font errors look terrible. (Files that use 898;; but not enough so to make font errors look terrible. (Files that use
895;; non-standard fonts seem to do so badly or in idiosyncratic ways!) 899;; non-standard fonts seem to do so badly or in idiosyncratic ways!)
896(defface woman-unknown-face 900(defface woman-unknown
897 '((((background light)) (:foreground "brown")) 901 '((((background light)) (:foreground "brown"))
898 (((min-colors 88) (background dark)) (:foreground "cyan1")) 902 (((min-colors 88) (background dark)) (:foreground "cyan1"))
899 (((background dark)) (:foreground "cyan"))) 903 (((background dark)) (:foreground "cyan")))
900 "Face for all unknown fonts in man pages." 904 "Face for all unknown fonts in man pages."
901 :group 'woman-faces) 905 :group 'woman-faces)
906;; backward-compatibility alias
907(put 'woman-unknown-face 'face-alias 'woman-unknown)
902 908
903(defface woman-addition-face 909(defface woman-addition
904 '((t (:foreground "orange"))) 910 '((t (:foreground "orange")))
905 "Face for all WoMan additions to man pages." 911 "Face for all WoMan additions to man pages."
906 :group 'woman-faces) 912 :group 'woman-faces)
913;; backward-compatibility alias
914(put 'woman-addition-face 'face-alias 'woman-addition)
907 915
908(defun woman-default-faces () 916(defun woman-default-faces ()
909 "Set foreground colours of italic and bold faces to their default values." 917 "Set foreground colours of italic and bold faces to their default values."
910 (interactive) 918 (interactive)
911 (face-spec-set 'woman-italic-face 919 (face-spec-set 'woman-italic (face-user-default-spec 'woman-italic))
912 (face-user-default-spec 'woman-italic-face)) 920 (face-spec-set 'woman-bold (face-user-default-spec 'woman-bold)))
913 (face-spec-set 'woman-bold-face (face-user-default-spec 'woman-bold-face)))
914 921
915(defun woman-monochrome-faces () 922(defun woman-monochrome-faces ()
916 "Set foreground colours of italic and bold faces to that of the default face. 923 "Set foreground colours of italic and bold faces to that of the default face.
917This is usually either black or white." 924This is usually either black or white."
918 (interactive) 925 (interactive)
919 (set-face-foreground 'woman-italic-face 'unspecified) 926 (set-face-foreground 'woman-italic 'unspecified)
920 (set-face-foreground 'woman-bold-face 'unspecified)) 927 (set-face-foreground 'woman-bold 'unspecified))
921 928
922;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 929;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
923;; Experimental font support, initially only for MS-Windows. 930;; Experimental font support, initially only for MS-Windows.
@@ -938,7 +945,7 @@ This is usually either black or white."
938 symbol-fonts)) 945 symbol-fonts))
939 946
940(when woman-font-support 947(when woman-font-support
941 (make-face 'woman-symbol-face) 948 (make-face 'woman-symbol)
942 949
943 ;; Set the symbol font only if `woman-use-symbol-font' is true, to 950 ;; Set the symbol font only if `woman-use-symbol-font' is true, to
944 ;; avoid unnecessarily upsetting the line spacing in NTEmacs 20.5! 951 ;; avoid unnecessarily upsetting the line spacing in NTEmacs 20.5!
@@ -1673,24 +1680,24 @@ Do not call directly!"
1673 (goto-char (point-min)) 1680 (goto-char (point-min))
1674 (while (search-forward "__\b\b" nil t) 1681 (while (search-forward "__\b\b" nil t)
1675 (backward-delete-char 4) 1682 (backward-delete-char 4)
1676 (woman-set-face (point) (1+ (point)) 'woman-italic-face)) 1683 (woman-set-face (point) (1+ (point)) 'woman-italic))
1677 (goto-char (point-min)) 1684 (goto-char (point-min))
1678 (while (search-forward "\b\b__" nil t) 1685 (while (search-forward "\b\b__" nil t)
1679 (backward-delete-char 4) 1686 (backward-delete-char 4)
1680 (woman-set-face (1- (point)) (point) 'woman-italic-face)))) 1687 (woman-set-face (1- (point)) (point) 'woman-italic))))
1681 1688
1682 ;; Interpret overprinting to indicate bold face: 1689 ;; Interpret overprinting to indicate bold face:
1683 (goto-char (point-min)) 1690 (goto-char (point-min))
1684 (while (re-search-forward "\\(.\\)\\(\\(+\\1\\)+\\)" nil t) 1691 (while (re-search-forward "\\(.\\)\\(\\(+\\1\\)+\\)" nil t)
1685 (woman-delete-match 2) 1692 (woman-delete-match 2)
1686 (woman-set-face (1- (point)) (point) 'woman-bold-face)) 1693 (woman-set-face (1- (point)) (point) 'woman-bold))
1687 1694
1688 ;; Interpret underlining to indicate italic face: 1695 ;; Interpret underlining to indicate italic face:
1689 ;; (Must be AFTER emboldening to interpret bold _ correctly!) 1696 ;; (Must be AFTER emboldening to interpret bold _ correctly!)
1690 (goto-char (point-min)) 1697 (goto-char (point-min))
1691 (while (search-forward "_" nil t) 1698 (while (search-forward "_" nil t)
1692 (delete-char -2) 1699 (delete-char -2)
1693 (woman-set-face (point) (1+ (point)) 'woman-italic-face)) 1700 (woman-set-face (point) (1+ (point)) 'woman-italic))
1694 1701
1695 ;; Leave any other uninterpreted ^H's in the buffer for now! (They 1702 ;; Leave any other uninterpreted ^H's in the buffer for now! (They
1696 ;; might indicate composite special characters, which could be 1703 ;; might indicate composite special characters, which could be
@@ -1703,7 +1710,7 @@ Do not call directly!"
1703 (goto-char (point-min)) 1710 (goto-char (point-min))
1704 (forward-line) 1711 (forward-line)
1705 (while (re-search-forward "^\\( \\)?\\([A-Z].*\\)" nil t) 1712 (while (re-search-forward "^\\( \\)?\\([A-Z].*\\)" nil t)
1706 (woman-set-face (match-beginning 2) (match-end 2) 'woman-bold-face)))) 1713 (woman-set-face (match-beginning 2) (match-end 2) 'woman-bold))))
1707 ) 1714 )
1708 1715
1709(defun woman-insert-file-contents (filename compressed) 1716(defun woman-insert-file-contents (filename compressed)
@@ -2204,11 +2211,11 @@ Currently set only from '\" t in the first line of the source file.")
2204 2211
2205 ;; Prepare non-underlined versions of underlined faces: 2212 ;; Prepare non-underlined versions of underlined faces:
2206 (woman-non-underline-faces) 2213 (woman-non-underline-faces)
2207 ;; Set font of `woman-symbol-face' to `woman-symbol-font' if 2214 ;; Set font of `woman-symbol' face to `woman-symbol-font' if
2208 ;; `woman-symbol-font' is well defined. 2215 ;; `woman-symbol-font' is well defined.
2209 (and woman-use-symbol-font 2216 (and woman-use-symbol-font
2210 (stringp woman-symbol-font) 2217 (stringp woman-symbol-font)
2211 (set-face-font 'woman-symbol-face woman-symbol-font 2218 (set-face-font 'woman-symbol woman-symbol-font
2212 (and (frame-live-p woman-frame) woman-frame))) 2219 (and (frame-live-p woman-frame) woman-frame)))
2213 2220
2214 ;; Set syntax and display tables: 2221 ;; Set syntax and display tables:
@@ -2293,8 +2300,7 @@ Currently set only from '\" t in the first line of the source file.")
2293 "^" "_"))) 2300 "^" "_")))
2294 (cond (first 2301 (cond (first
2295 (replace-match repl nil t) 2302 (replace-match repl nil t)
2296 (put-text-property (1- (point)) (point) 2303 (put-text-property (1- (point)) (point) 'face 'woman-addition)
2297 'face 'woman-addition-face)
2298 (WoMan-warn 2304 (WoMan-warn
2299 "Initial vertical motion escape \\%s simulated" esc) 2305 "Initial vertical motion escape \\%s simulated" esc)
2300 (WoMan-log 2306 (WoMan-log
@@ -2919,8 +2925,7 @@ map accessory to help construct this alist.")
2919Set NEWTEXT in face FACE if specified." 2925Set NEWTEXT in face FACE if specified."
2920 (woman-delete-match 0) 2926 (woman-delete-match 0)
2921 (insert-before-markers newtext) 2927 (insert-before-markers newtext)
2922 (if face (put-text-property (1- (point)) (point) 2928 (if face (put-text-property (1- (point)) (point) 'face 'woman-symbol))
2923 'face 'woman-symbol-face))
2924 t) 2929 t)
2925 2930
2926(defun woman-special-characters (to) 2931(defun woman-special-characters (to)
@@ -2938,7 +2943,7 @@ Set NEWTEXT in face FACE if specified."
2938 ;; Need symbol font: 2943 ;; Need symbol font:
2939 (if woman-use-symbol-font 2944 (if woman-use-symbol-font
2940 (woman-replace-match (nth 2 replacement) 2945 (woman-replace-match (nth 2 replacement)
2941 'woman-symbol-face)) 2946 'woman-symbol))
2942 ;; Need extended font: 2947 ;; Need extended font:
2943 (if woman-use-extended-font 2948 (if woman-use-extended-font
2944 (woman-replace-match (nth 2 replacement)))))) 2949 (woman-replace-match (nth 2 replacement))))))
@@ -2963,7 +2968,7 @@ Useful for constructing the alist variable `woman-special-characters'."
2963 (while (< i 256) 2968 (while (< i 256)
2964 (insert (format "\\%03o " i) (string i) " " (string i)) 2969 (insert (format "\\%03o " i) (string i) " " (string i))
2965 (put-text-property (1- (point)) (point) 2970 (put-text-property (1- (point)) (point)
2966 'face 'woman-symbol-face) 2971 'face 'woman-symbol)
2967 (insert " ") 2972 (insert " ")
2968 (setq i (1+ i)) 2973 (setq i (1+ i))
2969 (when (= i 128) (setq i 160) (insert "\n")) 2974 (when (= i 128) (setq i 160) (insert "\n"))
@@ -3231,12 +3236,12 @@ If optional arg CONCAT is non-nil then join arguments."
3231 3236
3232(defconst woman-font-alist 3237(defconst woman-font-alist
3233 '(("R" . default) 3238 '(("R" . default)
3234 ("I" . woman-italic-face) 3239 ("I" . woman-italic)
3235 ("B" . woman-bold-face) 3240 ("B" . woman-bold)
3236 ("P" . previous) 3241 ("P" . previous)
3237 ("1" . default) 3242 ("1" . default)
3238 ("2" . woman-italic-face) 3243 ("2" . woman-italic)
3239 ("3" . woman-bold-face) ; used in bash.1 3244 ("3" . woman-bold) ; used in bash.1
3240 ) 3245 )
3241 "Alist of ?roff font indicators and woman font variables and names.") 3246 "Alist of ?roff font indicators and woman font variables and names.")
3242 3247
@@ -3284,9 +3289,9 @@ If optional arg CONCAT is non-nil then join arguments."
3284 (WoMan-warn "Unknown font %s." fontstring) 3289 (WoMan-warn "Unknown font %s." fontstring)
3285 ;; Output this message once only per call ... 3290 ;; Output this message once only per call ...
3286 (setq font-alist 3291 (setq font-alist
3287 (cons (cons fontstring 'woman-unknown-face) 3292 (cons (cons fontstring 'woman-unknown)
3288 font-alist)) 3293 font-alist))
3289 'woman-unknown-face) 3294 'woman-unknown)
3290 ))) 3295 )))
3291 ;; Delete font control line or escape sequence: 3296 ;; Delete font control line or escape sequence:
3292 (cond (beg (delete-region beg (point)) 3297 (cond (beg (delete-region beg (point))
@@ -3747,7 +3752,7 @@ v alters page foot left; m alters page head center.
3747 )) 3752 ))
3748 ;; Embolden heading (point is at end of heading): 3753 ;; Embolden heading (point is at end of heading):
3749 (woman-set-face 3754 (woman-set-face
3750 (save-excursion (beginning-of-line) (point)) (point) 'woman-bold-face) 3755 (save-excursion (beginning-of-line) (point)) (point) 'woman-bold)
3751 (forward-line) 3756 (forward-line)
3752 (delete-blank-lines) 3757 (delete-blank-lines)
3753 (setq woman-left-margin woman-default-indent) 3758 (setq woman-left-margin woman-default-indent)
@@ -3767,7 +3772,7 @@ Format paragraphs upto TO. Set prevailing indent to 5."
3767 ;; Optionally embolden heading (point is at beginning of heading): 3772 ;; Optionally embolden heading (point is at beginning of heading):
3768 (if woman-bold-headings 3773 (if woman-bold-headings
3769 (woman-set-face 3774 (woman-set-face
3770 (point) (save-excursion (end-of-line) (point)) 'woman-bold-face)) 3775 (point) (save-excursion (end-of-line) (point)) 'woman-bold))
3771 (forward-line) 3776 (forward-line)
3772 (setq woman-left-margin woman-default-indent 3777 (setq woman-left-margin woman-default-indent
3773 woman-nofill nil) ; fill output lines 3778 woman-nofill nil) ; fill output lines