博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

从零开始

yk.cublog.cn


Emacs Lisp与Shell的交互
Emacs Lisp与Shell的交互[转]
http://jamsa.javaeye.com/blog/169891
关键字: emacs lisp elisp

一直以来对于w3m、tramp、dired等与shell关系密切的mode不是很了解,没有仔细读过代码。但总觉得应该是调用shell命令,再将shell命令的输出重定向到emacs中进行处理。今天在网上看到了相关的方法:

  1. 调用shell命令
    1. (defun zj-open-directory-with-explorer ()  
    2.   "在windows中用explorer浏览当前目录"  
    3.   (interactive)  
    4.   (shell-command "explorer.exe .")  
    5.   (browse-url "www.google.cn")  
    6.   )  
     
  2. 处理shell命令输出
    1. (defun zj-display-directory-files ()  
    2.   "执行shell命令并处理它的输出。这里为显示当前目录下的文件"  
    3.   (interactive)  
    4.   (message (shell-command-to-string "ls -l"))  
    5.   )  
     

 

发表于: 2008-05-25 ,修改于: 2008-05-25 23:00,已浏览114次,有评论0条 推荐 投诉


网友评论

发表评论