瀏覽代碼

fix title prefs

pull/1/head
10sr 11 年之前
父節點
當前提交
260d207bbb
共有 1 個文件被更改,包括 26 次插入17 次删除
  1. +26
    -17
      emacs.el

+ 26
- 17
emacs.el 查看文件

@@ -305,26 +305,35 @@ found, otherwise returns nil."
;; title and mode-line

(when (fetch-library
"https://raw.github.com/10sr/emacs-lisp/master/terminal-title.el"
t)
"https://raw.github.com/10sr/emacs-lisp/master/terminal-title.el"
t)
(require 'terminal-title nil t)
;; if TERM is not screen use default value
(when (equal (car (split-string (frame-parameter nil
'tty-type)
"-"))
"screen")
(setq terminal-title-format
(if (getenv "SSH_CONNECTION")
`("em:"
,user-login-name
"@"
,(car (split-string system-name
"\\."))
":"
(file-name-nondirectory (directory-file-name
default-directory)))
(if (getenv "TMUX")
;; if use tmux locally just basename of current dir
(setq terminal-title-format
'((file-name-nondirectory (directory-file-name
default-directory))))))
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)
(setq terminal-title-format
'((file-name-nondirectory (directory-file-name
default-directory)))))))
(terminal-title-mode))

(setq eol-mnemonic-dos "\\r\\n")


Loading…
取消
儲存