]> code.delx.au - gnu-emacs/commitdiff
terminal-init-w32console mimicks command-line
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 1 Sep 2015 19:06:00 +0000 (12:06 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 1 Sep 2015 19:06:25 +0000 (12:06 -0700)
Problem reported by Eli Zaretskii.
* lisp/startup.el (startup--setup-quote-display):
New function, refactored from a part of ‘command-line’.
(command-line): Use it.
* lisp/term/w32console.el (terminal-init-w32console):
Use it, so that this function stays consistent with ‘command-line’.

lisp/startup.el
lisp/term/w32console.el

index 3e2973981ecc514e59d93a84942d3db8f16321f8..2f90c8d861a35aa5ec3ed5c6a714829d48d01d41 100644 (file)
@@ -803,6 +803,15 @@ to prepare for opening the first frame (e.g. open a connection to an X server)."
 (defvar server-name)
 (defvar server-process)
 
+(defun startup--setup-quote-display ()
+  "If curved quotes don't work, display ASCII approximations."
+  (dolist (char-repl '((?‘ . ?\`) (?’ . ?\') (?“ . ?\") (?” . ?\")))
+    (when (not (char-displayable-p (car char-repl)))
+      (unless standard-display-table
+        (setq standard-display-table (make-display-table)))
+      (aset standard-display-table (car char-repl)
+            (vector (make-glyph-code (cdr char-repl) 'shadow))))))
+
 (defun command-line ()
   "A subroutine of `normal-top-level'.
 Amongst another things, it parses the command-line arguments."
@@ -1017,13 +1026,7 @@ please check its value")
                                '("no" "off" "false" "0")))))
     (setq no-blinking-cursor t))
 
-  ;; If curved quotes don't work, display ASCII approximations.
-  (dolist (char-repl '((?‘ . ?\`) (?’ . ?\') (?“ . ?\") (?” . ?\")))
-    (when (not (char-displayable-p (car char-repl)))
-      (or standard-display-table
-          (setq standard-display-table (make-display-table)))
-      (aset standard-display-table (car char-repl)
-            (vector (make-glyph-code (cdr char-repl) 'shadow)))))
+  (startup--setup-quote-display)
   (setq internal--text-quoting-flag t)
 
   ;; Re-evaluate predefined variables whose initial value depends on
index 2df137839d07787dfa1e9880064e0ff1205b96f7..588568585024f429a5b2c1983024d23f320c1eb2 100644 (file)
           (if oem-o-cs-p oem-code-page-output-coding oem-code-page-coding))
           ;; Since we changed the terminal encoding, we need to repeat
           ;; the test for Unicode quotes being displayable.
-          (dolist (char-repl
-                   '((?‘ . [?\`]) (?’ . [?\']) (?“ . [?\"]) (?” . [?\"])))
-            (when (not (char-displayable-p (car char-repl)))
-              (or standard-display-table
-                  (setq standard-display-table (make-display-table)))
-              (aset standard-display-table (car char-repl) (cdr char-repl))))))
+          (startup--setup-quote-display)))
   (let* ((colors w32-tty-standard-colors)
          (color (car colors)))
     (tty-color-clear)