Mercurial > hg > mercurial-crew-with-dirclash
comparison contrib/mq.el @ 4427:b59611e9dd64
mq.el: add hook to run when finishing the edit of a patch.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Tue, 08 May 2007 11:54:39 -0700 |
parents | 807c7b99ff13 |
children | fa51e66117b4 |
comparison
equal
deleted
inserted
replaced
4426:807c7b99ff13 | 4427:b59611e9dd64 |
---|---|
31 :type 'sexp | 31 :type 'sexp |
32 :group 'mercurial) | 32 :group 'mercurial) |
33 | 33 |
34 (defcustom mq-edit-mode-hook nil | 34 (defcustom mq-edit-mode-hook nil |
35 "Hook run after a buffer is populated to edit a patch description." | 35 "Hook run after a buffer is populated to edit a patch description." |
36 :type 'sexp | |
37 :group 'mercurial) | |
38 | |
39 (defcustom mq-edit-finish-hook nil | |
40 "Hook run before a patch description is finished up with." | |
36 :type 'sexp | 41 :type 'sexp |
37 :group 'mercurial) | 42 :group 'mercurial) |
38 | 43 |
39 | 44 |
40 ;;; Internal variables. | 45 ;;; Internal variables. |
235 "Finish editing the description of this patch, and refresh the patch." | 240 "Finish editing the description of this patch, and refresh the patch." |
236 (interactive) | 241 (interactive) |
237 (unless (equal (mq-patch-info "qtop") mq-top) | 242 (unless (equal (mq-patch-info "qtop") mq-top) |
238 (error "Topmost patch has changed!")) | 243 (error "Topmost patch has changed!")) |
239 (hg-sync-buffers hg-root) | 244 (hg-sync-buffers hg-root) |
245 (run-hooks 'mq-edit-finish-hook) | |
240 (mq-refresh-internal hg-root "-m" (buffer-substring (point-min) (point-max))) | 246 (mq-refresh-internal hg-root "-m" (buffer-substring (point-min) (point-max))) |
241 (let ((buf mq-prev-buffer)) | 247 (let ((buf mq-prev-buffer)) |
242 (kill-buffer nil) | 248 (kill-buffer nil) |
243 (switch-to-buffer buf))) | 249 (switch-to-buffer buf))) |
244 | 250 |