在Linux上的.tcshrc文件中以只读模式为emacs创建别名 [英] Creating an alias for emacs in read-only mode on Linux in my .tcshrc file
问题描述
只是这样你知道这是我的第一篇文章。
Just so you know this is my first ever post.
基本上,我试图在我的.tcshrc文件中添加一个别名我可以在emacs中打开一个文件只读(不必每次都输入blurb)。我找到了这个 - http://superuser.com/questions/204236/how-can-i-open-a-file-read-only-from-command-line-with-emacs-vi-vim - 但自从tcsh不支持函数(我想)我不能使用这种方法。
Basically, I am trying to put in an alias (or something) in my .tcshrc file so that I can open a file in emacs read-only (without having to type the blurb below everytime). I found this - http://superuser.com/questions/204236/how-can-i-open-a-file-read-only-from-command-line-with-emacs-vi-vim - but since tcsh does not support functions (I think) I cannot use this method.
以只读格式打开emac的命令行文本如下:
The command line text for opening emacs in read-only format is this:
emacs * FILE_NAME * -eval'(setq buffer-read-only t)'
emacs *FILE_NAME* --eval '(setq buffer-read-only t)'
任何想法?
b P。
推荐答案
tcsh别名中的引号和括号可能有问题,因此 - funcall toggle- Satish的回答中的只读
可能比 - eval
更容易使用。要在文件名后插入参数,可以使用 \!:1
表达式作为第一个参数:
Quotes and parens in tcsh aliases can be problematic, so --funcall toggle-read-only
in Satish's answer is probably easier to use than --eval
. To insert an argument after the filename, you can use the \!:1
expression for the first argument:
alias emacs-ro emacs \!:1 --funcall toggle-read-only
这篇关于在Linux上的.tcshrc文件中以只读模式为emacs创建别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!