emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r116567: Avoid calling tty-setup-hook twice


From: Glenn Morris
Subject: [Emacs-diffs] trunk r116567: Avoid calling tty-setup-hook twice
Date: Wed, 26 Feb 2014 19:40:59 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116567
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/16859
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2014-02-26 14:40:56 -0500
message:
  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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/faces.el                  faces.el-20091113204419-o5vbwnq5f7feedwu-562
  lisp/startup.el                startup.el-20091113204419-o5vbwnq5f7feedwu-260
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-02-26 19:18:49 +0000
+++ b/lisp/ChangeLog    2014-02-26 19:40:56 +0000
@@ -1,5 +1,12 @@
 2014-02-26  Glenn Morris  <address@hidden>
 
+       Avoid calling tty-setup-hook twice, eg if a term file
+       explicitly calls tty-run-terminal-initialization.  (Bug#16859)
+       * faces.el (tty-run-terminal-initialization): Add run-hook argument.
+       (tty-create-frame-with-faces): Use it.
+       * startup.el (command-line): Pass run-hook argument
+       to tty-run-terminal-initialization.
+
        * dired.el (dired-restore-desktop-buffer): Demote errors;
        eg in case a glob match fails.  (Bug#16884)
 

=== modified file 'lisp/faces.el'
--- a/lisp/faces.el     2014-02-25 08:41:47 +0000
+++ b/lisp/faces.el     2014-02-26 19:40:56 +0000
@@ -2080,7 +2080,7 @@
           (unless (terminal-parameter frame 'terminal-initted)
             (set-terminal-parameter frame 'terminal-initted t)
             (set-locale-environment nil frame)
-            (tty-run-terminal-initialization frame))
+            (tty-run-terminal-initialization frame nil t))
          (frame-set-background-mode frame t)
          (face-set-after-frame-default frame parameters)
          (setq success t))
@@ -2110,11 +2110,13 @@
 Specifically, `tty-run-terminal-initialization' runs this.
 This can be used to fine tune the `input-decode-map', for example.")
 
-(defun tty-run-terminal-initialization (frame &optional type)
+(defun tty-run-terminal-initialization (frame &optional type run-hook)
   "Run the special initialization code for the terminal type of FRAME.
 The optional TYPE parameter may be used to override the autodetected
-terminal type to a different value.  As a final step, this runs the
-hook `tty-setup-hook'.
+terminal type to a different value.
+
+If optional argument RUN-HOOK is non-nil, then as a final step,
+this runs the hook `tty-setup-hook'.
 
 If you set `term-file-prefix' to nil, this function does nothing."
   (setq type (or type (tty-type frame)))
@@ -2139,7 +2141,7 @@
        (when (fboundp term-init-func)
          (funcall term-init-func))
        (set-terminal-parameter frame 'terminal-initted term-init-func)
-       (run-hooks 'tty-setup-hook)))))
+       (if run-hook (run-hooks 'tty-setup-hook))))))
 
 ;; Called from C function init_display to initialize faces of the
 ;; dumped terminal frame on startup.

=== modified file 'lisp/startup.el'
--- a/lisp/startup.el   2014-02-25 08:41:47 +0000
+++ b/lisp/startup.el   2014-02-26 19:40:56 +0000
@@ -1286,7 +1286,7 @@
   ;; User init file can set term-file-prefix to nil to prevent this.
   (unless (or noninteractive
               initial-window-system)
-    (tty-run-terminal-initialization (selected-frame)))
+    (tty-run-terminal-initialization (selected-frame) nil t))
 
   ;; Update the out-of-memory error message based on user's key bindings
   ;; for save-some-buffers.


reply via email to

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