emacs 中 R 会话中的向后终止
我还有一个关于自定义 emacs 以与 R 会话一起使用的问题。我喜欢使用向后终止功能,但这会删除 R 会话中的命令提示符。我尝试修改该函数
;; Kill to the start of the command line for R
(defun backward-kill-r ()
"Kill chars backward until encountering the end of a line."
(interactive)
(delete-region (point-at-bol) (point)))
但我得到相同的提示删除行为。我猜我可以更改 point-at-bol
来纠正这个问题,但是我需要将其更改为什么呢?谢谢!
I have one more question about customizing emacs for use with an R session. I like to use the backward kill function, but this deletes the command prompt in the R session. I have tried modifying the function
;; Kill to the start of the command line for R
(defun backward-kill-r ()
"Kill chars backward until encountering the end of a line."
(interactive)
(delete-region (point-at-bol) (point)))
But I get the same prompt-deleting behavior. I'm guessing that I can change point-at-bol
to correct this, but what do I need to change it to? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Cc Cu
已经完成了您想要的操作。我发现 Ca Ck 是最简单的方法,因为我使用 Ca(移动到行的开头,这在 iESS 模式下执行正确的操作)和 Ck(kill line)是我的 emacs“肌肉记忆”的一部分。仅供参考,您需要的是
comint-bol
,而不是point-at-bol
,如果您不想使用其中任何一个,它将为您提供所需的行为以上建议。C-c C-u
does what you want already. I findC-a C-k
to be the easiest way to do this though, as I useC-a
(move to the beginning of the line, which does the right thing in iESS mode) andC-k
(kill line) are part of my emacs 'muscle-memory'.FYI, instead of
point-at-bol
you wantcomint-bol
, which will give you the behaviour you're after, if you don't want to use either of the suggestions above.