aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2016-10-16 18:48:19 -0700
committerPaul Eggert2016-10-16 22:51:51 -0700
commitc06a518b5b0706509252abb03875867b10a92fc7 (patch)
tree06f34f07e642dff4b7c614b55e2fefb96f2c332a
parent032a299b0ed25f067f4133c547a822b283bc4cb8 (diff)
downloademacs-c06a518b5b0706509252abb03875867b10a92fc7.tar.gz
emacs-c06a518b5b0706509252abb03875867b10a92fc7.zip
New face homoglyph
Suggested by Eli Zaretskii, from a feature request by Alan Mackenzie (Bug#24468). * doc/emacs/display.texi (Standard Faces, Text Display): * etc/NEWS: Document this. * etc/themes/dichromacy-theme.el, etc/themes/leuven-theme.el: * etc/themes/light-blue-theme.el, etc/themes/manoj-dark-theme.el: * etc/themes/tango-dark-theme.el, etc/themes/tango-theme.el: * etc/themes/wombat-theme.el: Customize homoglyph to be the same as escape-glyph. * lisp/cus-theme.el (custom-theme--listed-faces): Add homoglyph. * lisp/faces.el (homoglyph): New face. * lisp/startup.el (startup--setup-quote-display): Use it.
-rw-r--r--doc/emacs/display.texi10
-rw-r--r--etc/NEWS4
-rw-r--r--etc/themes/dichromacy-theme.el1
-rw-r--r--etc/themes/leuven-theme.el1
-rw-r--r--etc/themes/light-blue-theme.el1
-rw-r--r--etc/themes/manoj-dark-theme.el1
-rw-r--r--etc/themes/tango-dark-theme.el1
-rw-r--r--etc/themes/tango-theme.el1
-rw-r--r--etc/themes/wombat-theme.el1
-rw-r--r--lisp/cus-theme.el3
-rw-r--r--lisp/faces.el8
-rw-r--r--lisp/startup.el2
12 files changed, 29 insertions, 5 deletions
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index 738d72d046a..492dfc6afd5 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -657,6 +657,10 @@ Whitespace}).
657@item escape-glyph 657@item escape-glyph
658The face for displaying control characters and escape sequences 658The face for displaying control characters and escape sequences
659(@pxref{Text Display}). 659(@pxref{Text Display}).
660@item homoglyph
661The face for displaying lookalike characters, i.e., characters that
662look like but are not the characters being represented
663(@pxref{Text Display}).
660@item nobreak-space 664@item nobreak-space
661The face for displaying no-break space characters (@pxref{Text 665The face for displaying no-break space characters (@pxref{Text
662Display}). 666Display}).
@@ -1520,12 +1524,12 @@ for details.
1520 1524
1521@cindex curly quotes 1525@cindex curly quotes
1522@cindex curved quotes 1526@cindex curved quotes
1523@cindex escape-glyph face 1527@cindex homoglyph face
1524 If the curved quotes @samp{‘}, @samp{’}, @samp{“}, and @samp{”} are 1528 If the curved quotes @samp{‘}, @samp{’}, @samp{“}, and @samp{”} are
1525known to look just like @acronym{ASCII} characters, they are shown 1529known to look just like @acronym{ASCII} characters, they are shown
1526with the @code{escape-glyph} face. Curved quotes that cannot be 1530with the @code{homoglyph} face. Curved quotes that cannot be
1527displayed are shown as their @acronym{ASCII} approximations @samp{`}, 1531displayed are shown as their @acronym{ASCII} approximations @samp{`},
1528@samp{'}, and @samp{"} with the @code{escape-glyph} face. 1532@samp{'}, and @samp{"} with the @code{homoglyph} face.
1529 1533
1530@node Cursor Display 1534@node Cursor Display
1531@section Displaying the Cursor 1535@section Displaying the Cursor
diff --git a/etc/NEWS b/etc/NEWS
index 14450a6bbe5..45d4e505647 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -115,6 +115,10 @@ to control whether to suggest shorter 'M-x' commands or not.
115** Non-breaking hyphens are now displayed with the 'nobreak-hyphen' 115** Non-breaking hyphens are now displayed with the 'nobreak-hyphen'
116face instead of the 'escape-glyph' face. 116face instead of the 'escape-glyph' face.
117 117
118+++
119** Approximations to quotes are now displayed with the new 'homoglyph'
120face instead of the 'escape-glyph' face.
121
118--- 122---
119** 'C-x h' ('mark-whole-buffer') will now avoid marking the prompt 123** 'C-x h' ('mark-whole-buffer') will now avoid marking the prompt
120part of minibuffers. 124part of minibuffers.
diff --git a/etc/themes/dichromacy-theme.el b/etc/themes/dichromacy-theme.el
index f8fae70c51b..1e7c5099938 100644
--- a/etc/themes/dichromacy-theme.el
+++ b/etc/themes/dichromacy-theme.el
@@ -60,6 +60,7 @@ Ansi-Color faces are included.")
60 ;; Escape and prompt faces 60 ;; Escape and prompt faces
61 `(minibuffer-prompt ((,class (:weight bold :foreground ,blue)))) 61 `(minibuffer-prompt ((,class (:weight bold :foreground ,blue))))
62 `(escape-glyph ((,class (:foreground ,vermillion)))) 62 `(escape-glyph ((,class (:foreground ,vermillion))))
63 `(homoglyph ((,class (:foreground ,vermillion))))
63 `(error ((,class (:weight bold :slant italic 64 `(error ((,class (:weight bold :slant italic
64 :foreground ,vermillion)))) 65 :foreground ,vermillion))))
65 `(warning ((,class (:foreground ,orange)))) 66 `(warning ((,class (:foreground ,orange))))
diff --git a/etc/themes/leuven-theme.el b/etc/themes/leuven-theme.el
index 75635eb076d..19d5561e748 100644
--- a/etc/themes/leuven-theme.el
+++ b/etc/themes/leuven-theme.el
@@ -119,6 +119,7 @@ Semantic, and Ansi-Color faces are included -- and much more...")
119 `(minibuffer-prompt ((,class (:weight bold :foreground "black" :background "gold")))) 119 `(minibuffer-prompt ((,class (:weight bold :foreground "black" :background "gold"))))
120 `(minibuffer-noticeable-prompt ((,class (:weight bold :foreground "black" :background "gold")))) 120 `(minibuffer-noticeable-prompt ((,class (:weight bold :foreground "black" :background "gold"))))
121 `(escape-glyph ((,class (:foreground "#008ED1")))) 121 `(escape-glyph ((,class (:foreground "#008ED1"))))
122 `(homoglyph ((,class (:foreground "#008ED1"))))
122 `(error ((,class (:foreground "red")))) 123 `(error ((,class (:foreground "red"))))
123 `(warning ((,class (:weight bold :foreground "orange")))) 124 `(warning ((,class (:weight bold :foreground "orange"))))
124 `(success ((,class (:foreground "green")))) 125 `(success ((,class (:foreground "green"))))
diff --git a/etc/themes/light-blue-theme.el b/etc/themes/light-blue-theme.el
index 8c80a6658d0..a2ed71ae641 100644
--- a/etc/themes/light-blue-theme.el
+++ b/etc/themes/light-blue-theme.el
@@ -48,6 +48,7 @@
48 `(mode-line-inactive ((,class (:inherit mode-line :background "LightGray" :foreground "grey20" :box (:line-width -1 :color "grey75") :weight light)))) 48 `(mode-line-inactive ((,class (:inherit mode-line :background "LightGray" :foreground "grey20" :box (:line-width -1 :color "grey75") :weight light))))
49 ;; Escape and prompt faces 49 ;; Escape and prompt faces
50 `(escape-glyph ((,class (:background "gold" :foreground "blue" :box (:line-width 1 :color "blue" :style released-button))))) 50 `(escape-glyph ((,class (:background "gold" :foreground "blue" :box (:line-width 1 :color "blue" :style released-button)))))
51 `(homoglyph ((,class (:background "gold" :foreground "blue" :box (:line-width 1 :color "blue" :style released-button)))))
51 ;; Font lock faces 52 ;; Font lock faces
52 `(font-lock-builtin-face ((,class (:foreground "#b35caf")))) 53 `(font-lock-builtin-face ((,class (:foreground "#b35caf"))))
53 `(font-lock-constant-face ((,class (:foreground "#00006DE06DE0")))) 54 `(font-lock-constant-face ((,class (:foreground "#00006DE06DE0"))))
diff --git a/etc/themes/manoj-dark-theme.el b/etc/themes/manoj-dark-theme.el
index b5120209d4d..549d11b0bb2 100644
--- a/etc/themes/manoj-dark-theme.el
+++ b/etc/themes/manoj-dark-theme.el
@@ -482,6 +482,7 @@ jarring angry fruit salad look to reduce eye fatigue.")
482 '(epa-validity-medium ((t (:italic t :foreground "PaleTurquoise" :slant italic)))) 482 '(epa-validity-medium ((t (:italic t :foreground "PaleTurquoise" :slant italic))))
483 483
484 '(escape-glyph ((t (:foreground "cyan")))) 484 '(escape-glyph ((t (:foreground "cyan"))))
485 '(homoglyph ((t (:foreground "cyan"))))
485 486
486 '(eshell-ls-archive-face ((t (:bold t :foreground "IndianRed")))) 487 '(eshell-ls-archive-face ((t (:bold t :foreground "IndianRed"))))
487 '(eshell-ls-backup-face ((t (:foreground "Grey")))) 488 '(eshell-ls-backup-face ((t (:foreground "Grey"))))
diff --git a/etc/themes/tango-dark-theme.el b/etc/themes/tango-dark-theme.el
index 9ef0276a894..407c79badf9 100644
--- a/etc/themes/tango-dark-theme.el
+++ b/etc/themes/tango-dark-theme.el
@@ -78,6 +78,7 @@ Semantic, and Ansi-Color faces are included.")
78 ;; Escape and prompt faces 78 ;; Escape and prompt faces
79 `(minibuffer-prompt ((,class (:foreground ,cham-0)))) 79 `(minibuffer-prompt ((,class (:foreground ,cham-0))))
80 `(escape-glyph ((,class (:foreground ,butter-3)))) 80 `(escape-glyph ((,class (:foreground ,butter-3))))
81 `(homoglyph ((,class (:foreground ,butter-3))))
81 `(error ((,class (:foreground ,red-0)))) 82 `(error ((,class (:foreground ,red-0))))
82 `(warning ((,class (:foreground ,orange-1)))) 83 `(warning ((,class (:foreground ,orange-1))))
83 `(success ((,class (:foreground ,cham-1)))) 84 `(success ((,class (:foreground ,cham-1))))
diff --git a/etc/themes/tango-theme.el b/etc/themes/tango-theme.el
index cda546b8f12..a2d7c849c54 100644
--- a/etc/themes/tango-theme.el
+++ b/etc/themes/tango-theme.el
@@ -66,6 +66,7 @@ Semantic, and Ansi-Color faces are included.")
66 ;; Escape and prompt faces 66 ;; Escape and prompt faces
67 `(minibuffer-prompt ((,class (:weight bold :foreground ,blue-3)))) 67 `(minibuffer-prompt ((,class (:weight bold :foreground ,blue-3))))
68 `(escape-glyph ((,class (:foreground ,red-3)))) 68 `(escape-glyph ((,class (:foreground ,red-3))))
69 `(homoglyph ((,class (:foreground ,red-3))))
69 `(error ((,class (:foreground ,red-3)))) 70 `(error ((,class (:foreground ,red-3))))
70 `(warning ((,class (:foreground ,orange-3)))) 71 `(warning ((,class (:foreground ,orange-3))))
71 `(success ((,class (:foreground ,cham-3)))) 72 `(success ((,class (:foreground ,cham-3))))
diff --git a/etc/themes/wombat-theme.el b/etc/themes/wombat-theme.el
index 08ae12f2b13..6768cce08ae 100644
--- a/etc/themes/wombat-theme.el
+++ b/etc/themes/wombat-theme.el
@@ -46,6 +46,7 @@ are included.")
46 ;; Escape and prompt faces 46 ;; Escape and prompt faces
47 `(minibuffer-prompt ((,class (:foreground "#e5786d")))) 47 `(minibuffer-prompt ((,class (:foreground "#e5786d"))))
48 `(escape-glyph ((,class (:foreground "#ddaa6f" :weight bold)))) 48 `(escape-glyph ((,class (:foreground "#ddaa6f" :weight bold))))
49 `(homoglyph ((,class (:foreground "#ddaa6f" :weight bold))))
49 ;; Font lock faces 50 ;; Font lock faces
50 `(font-lock-builtin-face ((,class (:foreground "#e5786d")))) 51 `(font-lock-builtin-face ((,class (:foreground "#e5786d"))))
51 `(font-lock-comment-face ((,class (:foreground "#99968b")))) 52 `(font-lock-comment-face ((,class (:foreground "#99968b"))))
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index 3160e23d9e0..5a20b8ef671 100644
--- a/lisp/cus-theme.el
+++ b/lisp/cus-theme.el
@@ -61,7 +61,8 @@ Do not call this mode function yourself. It is meant for internal use."
61(defvar custom-theme-insert-face-marker nil) 61(defvar custom-theme-insert-face-marker nil)
62 62
63(defvar custom-theme--listed-faces '(default cursor fixed-pitch 63(defvar custom-theme--listed-faces '(default cursor fixed-pitch
64 variable-pitch escape-glyph minibuffer-prompt highlight region 64 variable-pitch escape-glyph homoglyph
65 minibuffer-prompt highlight region
65 shadow secondary-selection trailing-whitespace 66 shadow secondary-selection trailing-whitespace
66 font-lock-builtin-face font-lock-comment-delimiter-face 67 font-lock-builtin-face font-lock-comment-delimiter-face
67 font-lock-comment-face font-lock-constant-face 68 font-lock-comment-face font-lock-constant-face
diff --git a/lisp/faces.el b/lisp/faces.el
index 15090e1f94a..d6ec98b9782 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2470,6 +2470,14 @@ If you set `term-file-prefix' to nil, this function does nothing."
2470 :group 'basic-faces 2470 :group 'basic-faces
2471 :version "22.1") 2471 :version "22.1")
2472 2472
2473(defface homoglyph
2474 '((((background dark)) :foreground "cyan")
2475 (((type pc)) :foreground "magenta")
2476 (t :foreground "brown"))
2477 "Face for lookalike characters."
2478 :group 'basic-faces
2479 :version "25.2")
2480
2473(defface nobreak-space 2481(defface nobreak-space
2474 '((((class color) (min-colors 88)) :inherit escape-glyph :underline t) 2482 '((((class color) (min-colors 88)) :inherit escape-glyph :underline t)
2475 (((class color) (min-colors 8)) :background "magenta") 2483 (((class color) (min-colors 8)) :background "magenta")
diff --git a/lisp/startup.el b/lisp/startup.el
index d5225bdcb30..4a04f9c2d1b 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -870,7 +870,7 @@ If STYLE is nil, display appropriately for the terminal."
870 (if repl 870 (if repl
871 (aset (or standard-display-table 871 (aset (or standard-display-table
872 (setq standard-display-table (make-display-table))) 872 (setq standard-display-table (make-display-table)))
873 char (vector (make-glyph-code repl 'escape-glyph))) 873 char (vector (make-glyph-code repl 'homoglyph)))
874 (when standard-display-table 874 (when standard-display-table
875 (aset standard-display-table char nil))))))) 875 (aset standard-display-table char nil)))))))
876 876