emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 9135bd7: Improve display of tex-verbatim and Info


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-25 9135bd7: Improve display of tex-verbatim and Info quoted
Date: Fri, 23 Sep 2016 13:56:17 +0000 (UTC)

branch: emacs-25
commit 9135bd7af7bdf9f805b185a77fe4e6d33dec4009
Author: Paul Eggert <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Improve display of tex-verbatim and Info quoted
    
    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.
    
    This is backport from master
    (cherry picked from commit 36906806ccfc0e53f1d8c365ab0d7151288b7833)
---
 doc/emacs/display.texi             |    3 +++
 doc/lispref/display.texi           |    1 +
 etc/NEWS                           |    5 +++++
 lisp/faces.el                      |   29 +++++++++++++++++++++++++++++
 lisp/info.el                       |    2 +-
 lisp/textmodes/tex-mode.el         |    3 +--
 test/automated/font-parse-tests.el |    1 +
 7 files changed, 41 insertions(+), 3 deletions(-)

diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index 56b643b..391e1a0 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -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.
address@hidden 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.
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 68b48e0..2e316f8 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -3027,6 +3027,7 @@ attribute on this face (@pxref{Face Attributes}).
 @itemx bold-italic
 @itemx underline
 @itemx fixed-pitch
address@hidden 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
diff --git a/etc/NEWS b/etc/NEWS
index a61370b..274226b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -19,9 +19,14 @@ with a prefix argument or by typing C-u C-h C-n.
 * Changes in Emacs 25.2
 This is a bug-fix release with (almost) no new features.
 
+---
 ** `find-library', `help-function-def' and `help-variable-def' now run
 `find-function-after-hook'.
 
++++
+*** 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.
+
 
 * Installation Changes in Emacs 25.1
 
diff --git a/lisp/faces.el b/lisp/faces.el
index fddc036..b1ea0f0 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -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.
@@ -2280,6 +2304,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
diff --git a/lisp/info.el b/lisp/info.el
index 6426cfc..ae46fba 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -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
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 3ac68bd..8545a09 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -801,8 +801,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")
diff --git a/test/automated/font-parse-tests.el 
b/test/automated/font-parse-tests.el
index 6274253..9f730d3 100644
--- a/test/automated/font-parse-tests.el
+++ b/test/automated/font-parse-tests.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]