分页: 1 / 1
[问题] emacs 如何取得root权限?
发表于 : 2007-06-08 6:36
由 xiangyuyu
编辑一些系统文件时
提示没有权限
不知道在不退出emacs的前提下
如何取得root权限呢?
发表于 : 2007-06-08 13:19
由 herberteuler
Tramp
发表于 : 2007-06-08 15:42
由 jiangpeng
sudo emacs

权限
发表于 : 2007-06-12 21:25
由 abnick
不知2楼的Tramp什么意思?
我也遇到了这样的问题,每次要 sudo emacs 重启,很不方便。
请问哪位大侠有更好的解决办法?
发表于 : 2007-06-14 18:18
由 zhan
比如打开 /etc/apt/sources.list
C-x C-f /sudo:[root@]
方括号中是提示,直接回车,又提示 [localhost] 再回车,就会在 echo buffer 出现输入密码的 提示,输入了,就可以了,然后找你要的文件 /etc/apt/sources.list
直接编辑,保存就是了。
发表于 : 2007-06-15 6:10
由 cheneymx
zhan 写了:比如打开 /etc/apt/sources.list
C-x C-f /sudo:[root@]
方括号中是提示,直接回车,又提示 [localhost] 再回车,就会在 echo buffer 出现输入密码的 提示,输入了,就可以了,然后找你要的文件 /etc/apt/sources.list
直接编辑,保存就是了。
... 那我觉得还是重启emacs比较简单吧.
发表于 : 2007-06-15 19:32
由 zhan
看应用了。
再说,这是完全没有配置 tramp 的时候的操作,我个人觉得完全可以配置 tramp 来达到透明的操作。
具体的我还没有看 tramp 的手册,所以不好说。
再说,如果你用 emacs 多半编辑自己的文件,少数是编辑系统文件的话,重启绝对不是一个好的办法。^_^
个人意见....
发表于 : 2007-06-16 0:24
由 herberteuler
cheneymx 写了:zhan 写了:比如打开 /etc/apt/sources.list
C-x C-f /sudo:[root@]
方括号中是提示,直接回车,又提示 [localhost] 再回车,就会在 echo buffer 出现输入密码的 提示,输入了,就可以了,然后找你要的文件 /etc/apt/sources.list
直接编辑,保存就是了。
... 那我觉得还是重启emacs比较简单吧.
Firstly I'm sorry I'm in an English env so input in English.
With tramp, you can visit a directory with C-x d /... then you take the control all over any subdirectories and files in the directory you visited, with the privilege of the user you provide to tramp (not restricted to root of course). And what's more, the directory you type in C-x d ... is not limited to the directories on localhost, it could reside on a remote server. For example, C-x C-f /ssh:user@machine:... And you can even compile with tramp! All the underlying connection is transparent once you have visited files/directories with tramp.
Tramp comes with Emacs >= 22. If you have installed Emacs >= 22, tramp is probably already installed. Type C-h i m tramp RET to read the manual.