Перемещение Emacs указывает на начало определенного текста для сообщений коммитов Perforce. - PullRequest
1 голос
/ 22 июня 2010

Как вы перемещаете точку в Elisp к началу <enter description here> и убиваете этот текст. Я хотел бы поместить это в мой ~ / .emacs-p4, который используется через P4EDITOR,

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

Шаблон для p4 submit:

# 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>

1 Ответ

0 голосов
/ 22 июня 2010

Я думаю (без тестирования), что все, что вам нужно сделать, это:

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