Chinaunix首页 | 论坛 | 博客
  • 博客访问: 518464
  • 博文数量: 174
  • 博客积分: 4177
  • 博客等级: 上校
  • 技术积分: 1827
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-15 14:12
文章分类

全部博文(174)

文章存档

2018年(1)

2017年(1)

2013年(3)

2012年(9)

2010年(12)

2009年(5)

2008年(106)

2007年(37)

我的朋友

分类:

2008-05-25 23:00:42

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 "")  
    6.   )  
     
  2. 处理shell命令输出
    1. (defun zj-display-directory-files ()  
    2.   "执行shell命令并处理它的输出。这里为显示当前目录下的文件"  
    3.   (interactive)  
    4.   (message (shell-command-to-string "ls -l"))  
    5.   )  
     

 

阅读(951) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~