将 Emacs 点移动到 Perforce 提交消息的特定文本的开头

发布于 2024-09-06 04:14:26 字数 1124 浏览 4 评论 0原文

如何将 Elisp 中的点移动到 <在此处输入描述> 的开头并删除该文本。我想将其放在我的 ~/.emacs-p4 中,它是通过 P4EDITOR 使用的,

$ echo $P4EDITOR
emacs -nw --no-init-file --no-splash --load ~/.emacs-p4

p4 提交 使用的模板是:

# A Perforce Change Specification.
#
#  Change:      The change number. 'new' on a new changelist.
#  Date:        The date this specification was last modified.
#  Client:      The client on which the changelist was created.  Read-only.
#  User:        The user who created the changelist.
#  Status:      Either 'pending' or 'submitted'. Read-only.
#  Description: Comments about the changelist.  Required.
#  Jobs:        What opened jobs are to be closed by this changelist.
#               You may delete jobs from this list.  (New changelists only.)
#  Files:       What opened files from the default changelist are to be added
#               to this changelist.  You may delete files from this list.
#               (New changelists only.)

Change: new

Client: aflott

User:   aflott

Status: new

Description:
        <enter description here>

How do you move the point in Elisp to the beginning of <enter description here> and kill that text. I'd like to place this in my ~/.emacs-p4, which is used via P4EDITOR,

$ echo $P4EDITOR
emacs -nw --no-init-file --no-splash --load ~/.emacs-p4

The template use for p4 submit is:

# A Perforce Change Specification.
#
#  Change:      The change number. 'new' on a new changelist.
#  Date:        The date this specification was last modified.
#  Client:      The client on which the changelist was created.  Read-only.
#  User:        The user who created the changelist.
#  Status:      Either 'pending' or 'submitted'. Read-only.
#  Description: Comments about the changelist.  Required.
#  Jobs:        What opened jobs are to be closed by this changelist.
#               You may delete jobs from this list.  (New changelists only.)
#  Files:       What opened files from the default changelist are to be added
#               to this changelist.  You may delete files from this list.
#               (New changelists only.)

Change: new

Client: aflott

User:   aflott

Status: new

Description:
        <enter description here>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月光色 2024-09-13 04:14:26

我认为(未经测试)您需要做的就是:

(search-forward "<enter description here>")
(delete-region (line-beginning-position) (line-end-position))

I think (without testing) that all you need to do is:

(search-forward "<enter description here>")
(delete-region (line-beginning-position) (line-end-position))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文