diff options
| author | Paul Eggert | 2015-09-01 12:06:00 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-09-01 12:06:25 -0700 |
| commit | 183ad9d59757314f93aed8a9fe512c8fb48a2ed1 (patch) | |
| tree | c1412a43161cd296505f587be5f50a6f1b081cc6 | |
| parent | 1a3518e7c361a9ceaa017c1334a83d14e0651a4e (diff) | |
| download | emacs-183ad9d59757314f93aed8a9fe512c8fb48a2ed1.tar.gz emacs-183ad9d59757314f93aed8a9fe512c8fb48a2ed1.zip | |
terminal-init-w32console mimicks command-line
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’.
| -rw-r--r-- | lisp/startup.el | 17 | ||||
| -rw-r--r-- | lisp/term/w32console.el | 7 |
2 files changed, 11 insertions, 13 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 3e2973981ec..2f90c8d861a 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -803,6 +803,15 @@ to prepare for opening the first frame (e.g. open a connection to an X server)." | |||
| 803 | (defvar server-name) | 803 | (defvar server-name) |
| 804 | (defvar server-process) | 804 | (defvar server-process) |
| 805 | 805 | ||
| 806 | (defun startup--setup-quote-display () | ||
| 807 | "If curved quotes don't work, display ASCII approximations." | ||
| 808 | (dolist (char-repl '((?‘ . ?\`) (?’ . ?\') (?“ . ?\") (?” . ?\"))) | ||
| 809 | (when (not (char-displayable-p (car char-repl))) | ||
| 810 | (unless standard-display-table | ||
| 811 | (setq standard-display-table (make-display-table))) | ||
| 812 | (aset standard-display-table (car char-repl) | ||
| 813 | (vector (make-glyph-code (cdr char-repl) 'shadow)))))) | ||
| 814 | |||
| 806 | (defun command-line () | 815 | (defun command-line () |
| 807 | "A subroutine of `normal-top-level'. | 816 | "A subroutine of `normal-top-level'. |
| 808 | Amongst another things, it parses the command-line arguments." | 817 | Amongst another things, it parses the command-line arguments." |
| @@ -1017,13 +1026,7 @@ please check its value") | |||
| 1017 | '("no" "off" "false" "0"))))) | 1026 | '("no" "off" "false" "0"))))) |
| 1018 | (setq no-blinking-cursor t)) | 1027 | (setq no-blinking-cursor t)) |
| 1019 | 1028 | ||
| 1020 | ;; If curved quotes don't work, display ASCII approximations. | 1029 | (startup--setup-quote-display) |
| 1021 | (dolist (char-repl '((?‘ . ?\`) (?’ . ?\') (?“ . ?\") (?” . ?\"))) | ||
| 1022 | (when (not (char-displayable-p (car char-repl))) | ||
| 1023 | (or standard-display-table | ||
| 1024 | (setq standard-display-table (make-display-table))) | ||
| 1025 | (aset standard-display-table (car char-repl) | ||
| 1026 | (vector (make-glyph-code (cdr char-repl) 'shadow))))) | ||
| 1027 | (setq internal--text-quoting-flag t) | 1030 | (setq internal--text-quoting-flag t) |
| 1028 | 1031 | ||
| 1029 | ;; Re-evaluate predefined variables whose initial value depends on | 1032 | ;; Re-evaluate predefined variables whose initial value depends on |
diff --git a/lisp/term/w32console.el b/lisp/term/w32console.el index 2df137839d0..58856858502 100644 --- a/lisp/term/w32console.el +++ b/lisp/term/w32console.el | |||
| @@ -68,12 +68,7 @@ | |||
| 68 | (if oem-o-cs-p oem-code-page-output-coding oem-code-page-coding)) | 68 | (if oem-o-cs-p oem-code-page-output-coding oem-code-page-coding)) |
| 69 | ;; Since we changed the terminal encoding, we need to repeat | 69 | ;; Since we changed the terminal encoding, we need to repeat |
| 70 | ;; the test for Unicode quotes being displayable. | 70 | ;; the test for Unicode quotes being displayable. |
| 71 | (dolist (char-repl | 71 | (startup--setup-quote-display))) |
| 72 | '((?‘ . [?\`]) (?’ . [?\']) (?“ . [?\"]) (?” . [?\"]))) | ||
| 73 | (when (not (char-displayable-p (car char-repl))) | ||
| 74 | (or standard-display-table | ||
| 75 | (setq standard-display-table (make-display-table))) | ||
| 76 | (aset standard-display-table (car char-repl) (cdr char-repl)))))) | ||
| 77 | (let* ((colors w32-tty-standard-colors) | 72 | (let* ((colors w32-tty-standard-colors) |
| 78 | (color (car colors))) | 73 | (color (car colors))) |
| 79 | (tty-color-clear) | 74 | (tty-color-clear) |