From 32dbd44ca52cba228836c509d36a813abde053f7 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 8 Apr 2014 00:49:30 +0900 Subject: [PATCH] fix cond for terminal title --- emacs.el | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/emacs.el b/emacs.el index 03baa65..d012349 100644 --- a/emacs.el +++ b/emacs.el @@ -20,6 +20,13 @@ (require 'cl nil t)) +;; (add-hook 'after-change-major-mode-hook +;; (lambda () +;; (message "cmm: %S %s" +;; major-mode +;; buffer-file-name))) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; download library from web @@ -331,26 +338,25 @@ found, otherwise returns nil." (setq terminal-title-format '((file-name-nondirectory (directory-file-name default-directory)))) - (when (equal (car (split-string (frame-parameter nil - 'tty-type) - "-")) - "screen") - (if (getenv "SSH_CONNECTION") - ;; TMUX is not set but TERM is screen: - ;; it seems that TMUX is used by locally and ssh to remote host - (setq terminal-title-format - `("em:" - ,user-login-name - "@" - ,(car (split-string system-name - "\\.")) - ":" - (file-name-nondirectory (directory-file-name - default-directory)))) - ;; this wont happen? (TMUX is not set, TERM is screen, not ssh-ed) + (if (and (equal (car (split-string (frame-parameter nil + 'tty-type) + "-")) + "screen") + (not (getenv "SSH_CONNECTION"))) (setq terminal-title-format '((file-name-nondirectory (directory-file-name - default-directory))))))) + default-directory)))) + ;; seems that TMUX is used by locally and ssh to remote host + (setq terminal-title-format + `("em:" + ,user-login-name + "@" + ,(car (split-string system-name + "\\.")) + ":" + (file-name-nondirectory (directory-file-name + default-directory)))))) + ;; this wont happen? (TMUX is not set, TERM is screen, not ssh-ed) (terminal-title-mode)) (setq eol-mnemonic-dos "\\r\\n")