--- tex-buf.el~ 2017-09-29 01:14:51.554511000 +0900 +++ tex-buf.el 2017-09-29 01:22:41.640439000 +0900 @@ -540,7 +540,16 @@ ;; Now start the process (setq file (funcall file)) (TeX-process-set-variable file 'TeX-command-next TeX-command-Show) - (funcall hook name command file))) + (funcall hook name command file) + + (if (and TeX-view-keep-focus + (string= name "View")) + (cond ((fboundp #'select-frame-set-input-focus) + (select-frame-set-input-focus (selected-frame))) + ((fboundp #'x-focus-frame) + (x-focus-frame (selected-frame))) + ((fboundp #'focus-frame) + (focus-frame (selected-frame))))))) (defvar TeX-command-text) ;Dynamically scoped. (defvar TeX-command-pos) ;Dynamically scoped.