On Thu, Jan 05, 2006 at 12:05:24AM +0100, Martin Quinson wrote:
> I received this in the debian bug system. If this emacs mode is really
> useful,
It's definitely useful for emacs+quilt users; I make sure to install
it on any system where I'm using quilt. For example it marks buffers
read-only if they aren't in the top patch, and when you push or pop a
patch interactively it updates all of the open buffers to stay in sync
with the applied set.
If you do incorporate it: I've attached a patch which improves
quilt-mode's handling of new or deleted files.
-Dave Dodge
20050805 Dave Dodge
The @b in quilt-add seems to trigger an emacs problem, where it gets
confused about which buffer you're trying to add (for example it may
prompt in the minibuffer of the wrong window, for some buffer open in
that window). Changing it to just b seems to make the problem go
away.
20050811 Dave Dodge
When adding a new buffer which has no disk file behind it yet,
quilt-add fails to change the buffer to editable. There's a similar
problem when a push/pop operation causes a file to disappear from the
tree, but you still have a buffer open for it. This is because the
editable toggle is done through revert hooks, but the revert-buffer
operation short-circuits and fails when there is no file to revert
from. This change ensures the hooks get run even if the file doesn't
currently exist on-disk.
Index: .emacs.d/quilt.el
===================================================================
--- .emacs.d.orig/quilt.el 2005-02-10 18:41:32.000000000 -0500
+++ .emacs.d/quilt.el 2005-08-11 19:54:37.000000000 -0400
@@ -111,6 +111,13 @@
(force-mode-line-update))
(defun quilt-revert ()
+ (defun revert-or-hook-buffer ()
+ ;; If the file doesn't exist on disk it can't be reverted, but we
+ ;; need the revert hooks to run anyway so that the buffer's
+ ;; editability will update.
+ (if (file-exists-p buffer-file-name)
+ (revert-buffer 't 't)
+ (run-hooks 'after-revert-hook)))
(defun revert (buf)
(save-excursion
(set-buffer buf)
@@ -118,7 +125,7 @@
(quilt-update-modeline))
(if (and (quilt-owned-p buffer-file-name)
(not (buffer-modified-p)))
- (revert-buffer 't 't))))
+ (revert-or-hook-buffer))))
(defun revert-list (buffers)
(if (not (cdr buffers))
nil
@@ -213,7 +220,7 @@
(defun quilt-add (arg)
"Add a file to the current patch"
- (interactive "@b")
+ (interactive "b")
(quilt-cmd (concat "add " (quilt-drop-dir buffer-file-name)))
(quilt-revert))
_______________________________________________
Quilt-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/quilt-dev