]> code.delx.au - gnu-emacs/commitdiff
Improve display of tex-verbatim and Info quoted
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 13 May 2016 20:30:33 +0000 (13:30 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 13 May 2016 20:32:29 +0000 (13:32 -0700)
Problem reported by Glenn Morris (Bug#19889).
* doc/emacs/display.texi (Standard Faces):
* doc/lispref/display.texi (Basic Faces):
* etc/NEWS: Mention fixed-pitch-serif.
* lisp/faces.el (face-font-family-alternatives):
New family alias Monospace Serif.
(fixed-pitch-serif): New face, which uses the new family.
* lisp/info.el (Info-quoted):
* lisp/textmodes/tex-mode.el (tex-verbatim): Use the new face.
* test/lisp/legacy/font-parse-tests.el (font-parse-tests--data):
Add test case for Monospace Serif.

doc/emacs/display.texi
doc/lispref/display.texi
etc/NEWS
lisp/faces.el
lisp/info.el
lisp/textmodes/tex-mode.el
test/lisp/legacy/font-parse-tests.el

index 89f5bec3639535f358913cd593ca11e8e1142d87..3f5aac1c2ff1e26e492b5d3b720160dea08aec9e 100644 (file)
@@ -613,6 +613,9 @@ This face underlines text.
 This face forces use of a fixed-width font.  It's reasonable to
 customize this face to use a different fixed-width font, if you like,
 but you should not make it a variable-width font.
+@item fixed-pitch-serif
+This face is like @code{fixed-pitch}, except the font has serifs and
+looks more like traditional typewriting.
 @cindex variable-pitch face
 @item variable-pitch
 This face forces use of a variable-width font.
index 87126f9167a1ce2af41902743b260270271449d8..1956ee5503ed6b864bfa9ed84d54ec398305e9df 100644 (file)
@@ -3017,6 +3017,7 @@ attribute on this face (@pxref{Face Attributes}).
 @itemx bold-italic
 @itemx underline
 @itemx fixed-pitch
+@itemx fixed-pitch-serif
 @itemx variable-pitch
 These have the attributes indicated by their names (e.g., @code{bold}
 has a bold @code{:weight} attribute), with all other attributes
index 31229f11e5dd03fcb3cf1a3202bd1bd17f57e9df..a910eafa62b205e7e18e7614ec2df0070b3da16d 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -470,6 +470,10 @@ ABBR is a time zone abbreviation.  The affected functions are
 'current-time-string', 'current-time-zone', 'decode-time',
 'format-time-string', and 'set-time-zone-rule'.
 
++++
+*** New basic face 'fixed-pitch-serif', for a fixed-width font with serifs.
+The Info-quoted and tex-verbatim faces now default to inheriting from it.
+
 \f
 * Changes in Emacs 25.2 on Non-Free Operating Systems
 
index 71c94e563c763d2b3f5b13dbf78b3f7c44ac0940..4193c1e27e83e2353a8445df28b905048eb550ba 100644 (file)
@@ -98,7 +98,31 @@ a font height that isn't optimal."
 (defcustom face-font-family-alternatives
   (mapcar (lambda (arg) (mapcar 'purecopy arg))
   '(("Monospace" "courier" "fixed")
+
+    ;; Monospace Serif is an Emacs invention, intended to work around
+    ;; portability problems when using Courier.  It should work well
+    ;; when combined with Monospaced and with other standard fonts.
+    ("Monospace Serif"
+
+     ;; This looks good on GNU/Linux.
+     "Courier 10 Pitch"
+     ;; This looks good on MS-Windows and OS X.
+     "Consolas"
+     ;; This looks good on OS X.  "Courier" looks good too, but is
+     ;; jagged on GNU/Linux and so is listed later as "courier".
+     "Courier Std"
+     ;; Although these are anti-aliased, they are a bit faint compared
+     ;; to the above.
+     "FreeMono" "Nimbus Mono L"
+     ;; These are aliased and look jagged.
+     "courier" "fixed"
+     ;; Omit Courier New, as it is the default MS-Windows font and so
+     ;; would look no different, and is pretty faint on other platforms.
+     )
+
+    ;; This is present for backward compatibility.
     ("courier" "CMU Typewriter Text" "fixed")
+
     ("Sans Serif" "helv" "helvetica" "arial" "fixed")
     ("helv" "helvetica" "arial" "fixed")))
   "Alist of alternative font family names.
@@ -2318,6 +2342,11 @@ If you set `term-file-prefix' to nil, this function does nothing."
   "The basic fixed-pitch face."
   :group 'basic-faces)
 
+(defface fixed-pitch-serif
+  '((t :family "Monospace Serif"))
+  "The basic fixed-pitch face with serifs."
+  :group 'basic-faces)
+
 (defface variable-pitch
   '((((type w32))
      ;; This is a kludgy workaround for an issue discussed in
index 6426cfcf9ed93f295e91f56f812ffcf5bf7a01d1..ae46fba25b965dba4c0a35014dde2f1849be694b 100644 (file)
@@ -4236,7 +4236,7 @@ With a zero prefix arg, put the name inside a function call to `info'."
   "Syntax table used in `Info-mode'.")
 
 (defface Info-quoted
-  '((t :family "courier"))
+  '((t :inherit fixed-pitch-serif))
   "Face used for quoted elements.")
 
 (defvar Info-mode-font-lock-keywords
index 973b2d373d5f6e37e3415ea066d6633cb1c152cb..b38b147b3e5008de6b0304ae17494514ee540f5d 100644 (file)
@@ -804,8 +804,7 @@ Not smaller than the value set by `tex-suscript-height-minimum'."
 (defvar tex-math-face 'tex-math)
 
 (defface tex-verbatim
-  ;; '((t :inherit font-lock-string-face))
-  '((t :family "courier"))
+  '((t :inherit fixed-pitch-serif))
   "Face used to highlight TeX verbatim environments."
   :group 'tex)
 (define-obsolete-face-alias 'tex-verbatim-face 'tex-verbatim "22.1")
index 6274253360f846471b6fc7a129229121a52a10d9..9f730d3148c7c427181245f8e33522a55139b0b3 100644 (file)
@@ -32,6 +32,7 @@
 (defvar font-parse-tests--data
   `((" " ,(intern " ") nil nil nil nil)
     ("Monospace" Monospace nil nil nil nil)
+    ("Monospace Serif" ,(intern "Monospace Serif") nil nil nil nil)
     ("Foo1" Foo1 nil nil nil nil)
     ("12" nil 12.0 nil nil nil)
     ("12 " ,(intern "12 ") nil nil nil nil)