diff options
| author | Glenn Morris | 2014-02-26 14:40:56 -0500 |
|---|---|---|
| committer | Glenn Morris | 2014-02-26 14:40:56 -0500 |
| commit | 1d491ef203a07bf570436b8f7f47b965eee1cd2b (patch) | |
| tree | a94c47d10224e3e317c9926cfb09313639f48ff9 | |
| parent | 9577b56996868204a5e86e0233a763652b42b788 (diff) | |
| download | emacs-1d491ef203a07bf570436b8f7f47b965eee1cd2b.tar.gz emacs-1d491ef203a07bf570436b8f7f47b965eee1cd2b.zip | |
Avoid calling tty-setup-hook twice
eg if a term file explicitly calls tty-run-terminal-initialization
* lisp/faces.el (tty-run-terminal-initialization): Add run-hook argument.
(tty-create-frame-with-faces): Use it.
* lisp/startup.el (command-line): Pass run-hook argument
to tty-run-terminal-initialization.
Fixes: debbugs:16859
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/faces.el | 12 | ||||
| -rw-r--r-- | lisp/startup.el | 2 |
3 files changed, 15 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4748767f939..510784e459a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2014-02-26 Glenn Morris <rgm@gnu.org> | 1 | 2014-02-26 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | Avoid calling tty-setup-hook twice, eg if a term file | ||
| 4 | explicitly calls tty-run-terminal-initialization. (Bug#16859) | ||
| 5 | * faces.el (tty-run-terminal-initialization): Add run-hook argument. | ||
| 6 | (tty-create-frame-with-faces): Use it. | ||
| 7 | * startup.el (command-line): Pass run-hook argument | ||
| 8 | to tty-run-terminal-initialization. | ||
| 9 | |||
| 3 | * dired.el (dired-restore-desktop-buffer): Demote errors; | 10 | * dired.el (dired-restore-desktop-buffer): Demote errors; |
| 4 | eg in case a glob match fails. (Bug#16884) | 11 | eg in case a glob match fails. (Bug#16884) |
| 5 | 12 | ||
diff --git a/lisp/faces.el b/lisp/faces.el index 985355ade09..e008993b49f 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -2080,7 +2080,7 @@ If PARAMETERS contains a `reverse' parameter, handle that." | |||
| 2080 | (unless (terminal-parameter frame 'terminal-initted) | 2080 | (unless (terminal-parameter frame 'terminal-initted) |
| 2081 | (set-terminal-parameter frame 'terminal-initted t) | 2081 | (set-terminal-parameter frame 'terminal-initted t) |
| 2082 | (set-locale-environment nil frame) | 2082 | (set-locale-environment nil frame) |
| 2083 | (tty-run-terminal-initialization frame)) | 2083 | (tty-run-terminal-initialization frame nil t)) |
| 2084 | (frame-set-background-mode frame t) | 2084 | (frame-set-background-mode frame t) |
| 2085 | (face-set-after-frame-default frame parameters) | 2085 | (face-set-after-frame-default frame parameters) |
| 2086 | (setq success t)) | 2086 | (setq success t)) |
| @@ -2110,11 +2110,13 @@ the above example." | |||
| 2110 | Specifically, `tty-run-terminal-initialization' runs this. | 2110 | Specifically, `tty-run-terminal-initialization' runs this. |
| 2111 | This can be used to fine tune the `input-decode-map', for example.") | 2111 | This can be used to fine tune the `input-decode-map', for example.") |
| 2112 | 2112 | ||
| 2113 | (defun tty-run-terminal-initialization (frame &optional type) | 2113 | (defun tty-run-terminal-initialization (frame &optional type run-hook) |
| 2114 | "Run the special initialization code for the terminal type of FRAME. | 2114 | "Run the special initialization code for the terminal type of FRAME. |
| 2115 | The optional TYPE parameter may be used to override the autodetected | 2115 | The optional TYPE parameter may be used to override the autodetected |
| 2116 | terminal type to a different value. As a final step, this runs the | 2116 | terminal type to a different value. |
| 2117 | hook `tty-setup-hook'. | 2117 | |
| 2118 | If optional argument RUN-HOOK is non-nil, then as a final step, | ||
| 2119 | this runs the hook `tty-setup-hook'. | ||
| 2118 | 2120 | ||
| 2119 | If you set `term-file-prefix' to nil, this function does nothing." | 2121 | If you set `term-file-prefix' to nil, this function does nothing." |
| 2120 | (setq type (or type (tty-type frame))) | 2122 | (setq type (or type (tty-type frame))) |
| @@ -2139,7 +2141,7 @@ If you set `term-file-prefix' to nil, this function does nothing." | |||
| 2139 | (when (fboundp term-init-func) | 2141 | (when (fboundp term-init-func) |
| 2140 | (funcall term-init-func)) | 2142 | (funcall term-init-func)) |
| 2141 | (set-terminal-parameter frame 'terminal-initted term-init-func) | 2143 | (set-terminal-parameter frame 'terminal-initted term-init-func) |
| 2142 | (run-hooks 'tty-setup-hook))))) | 2144 | (if run-hook (run-hooks 'tty-setup-hook)))))) |
| 2143 | 2145 | ||
| 2144 | ;; Called from C function init_display to initialize faces of the | 2146 | ;; Called from C function init_display to initialize faces of the |
| 2145 | ;; dumped terminal frame on startup. | 2147 | ;; dumped terminal frame on startup. |
diff --git a/lisp/startup.el b/lisp/startup.el index 9c9f23ba9a6..531cba2af55 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -1286,7 +1286,7 @@ the `--debug-init' option to view a complete error backtrace." | |||
| 1286 | ;; User init file can set term-file-prefix to nil to prevent this. | 1286 | ;; User init file can set term-file-prefix to nil to prevent this. |
| 1287 | (unless (or noninteractive | 1287 | (unless (or noninteractive |
| 1288 | initial-window-system) | 1288 | initial-window-system) |
| 1289 | (tty-run-terminal-initialization (selected-frame))) | 1289 | (tty-run-terminal-initialization (selected-frame) nil t)) |
| 1290 | 1290 | ||
| 1291 | ;; Update the out-of-memory error message based on user's key bindings | 1291 | ;; Update the out-of-memory error message based on user's key bindings |
| 1292 | ;; for save-some-buffers. | 1292 | ;; for save-some-buffers. |