emacs 设置frame title为文件路径名
2005-04-07 19:07
204 查看
以前从网站上拉下来一个,不过使用了post-command-hook,参考修改了一下,能够比较及时显示。
;;;Emacs title bar to reflect file name
(defun frame-title-string ()
"Return the file name of current buffer, using ~ if under home directory"
(let
((fname (or
(buffer-file-name (current-buffer))
(buffer-name))))
;;let body
(when (string-match (getenv "HOME") fname)
(setq fname (replace-match "~" t t fname)) )
fname))
;;; Title = 'system-name File: foo.bar'
(setq frame-title-format '("" system-name " File: "(:eval (frame-title-string))))
;;;Emacs title bar to reflect file name
(defun frame-title-string ()
"Return the file name of current buffer, using ~ if under home directory"
(let
((fname (or
(buffer-file-name (current-buffer))
(buffer-name))))
;;let body
(when (string-match (getenv "HOME") fname)
(setq fname (replace-match "~" t t fname)) )
fname))
;;; Title = 'system-name File: foo.bar'
(setq frame-title-format '("" system-name " File: "(:eval (frame-title-string))))
相关文章推荐
- Windows下Emacs配置文件路径设置
- Windows下Emacs设置配置文件路径
- linux操作之:可执行文件,库文件路径设置!
- mantis上传文件设置与存放路径
- vs2015 设置了包含路径还是提示说打不开头文件
- VC/MFC 设置程序与文件关联与双击文件获取文件路径
- 【原创】设置头文件路径, gcc -I 选项写法
- linux redis日志文件路径的设置
- Jmeter如何把CSV文件的路径设置成一个变量,且变量的值是一个相对路径
- linux 下载makefile 文件中设置好库文件的路径后还找不到的情况
- Tomcat下log4j设置文件路径和temp目录
- 修改JFileChooser对话框风格,设置打开对话框的默认文件名,获取改变路径之后的文件保存路径
- django 静态文件路径设置
- VS2008 设置文件路径
- Tomcat下log4j设置文件路径和temp目录
- php判断文件是否存在并设置默认路径
- django设置静态文件路径方法
- 打开ipynb文件——Jupyter Notebook——怎么设置路径
- struts2设置非默认路径的struts.properties以及.properties文件解决方案
- ECLIPSE中设置.CLASS文件的输出路径及“JAVA BUILD PATH”的设置