comparison lisp/vc-dispatcher.el @ 95018:2253b8d4def6

More elimination of buffer name dependencies.
author Eric S. Raymond <esr@snark.thyrsus.com>
date Thu, 15 May 2008 15:01:29 +0000
parents 7be06414cb71
children dacdc18f78bd
comparison
equal deleted inserted replaced
95017:7be06414cb71 95018:2253b8d4def6
133 dispatcher client mode imposes itself." 133 dispatcher client mode imposes itself."
134 :type 'hook 134 :type 'hook
135 :group 'vc) 135 :group 'vc)
136 136
137 (defcustom vc-delete-logbuf-window t 137 (defcustom vc-delete-logbuf-window t
138 "If non-nil, delete the *VC-log* buffer and window after each logical action. 138 "If non-nil, delete the log buffer and window after each logical action.
139 If nil, bury that buffer instead. 139 If nil, bury that buffer instead.
140 This is most useful if you have multiple windows on a frame and would like to 140 This is most useful if you have multiple windows on a frame and would like to
141 preserve the setting." 141 preserve the setting."
142 :type 'boolean 142 :type 'boolean
143 :group 'vc) 143 :group 'vc)
531 (set (make-local-variable 'vc-log-fileset) fileset) 531 (set (make-local-variable 'vc-log-fileset) fileset)
532 (make-local-variable 'vc-log-extra) 532 (make-local-variable 'vc-log-extra)
533 (set-buffer-modified-p nil) 533 (set-buffer-modified-p nil)
534 (setq buffer-file-name nil)) 534 (setq buffer-file-name nil))
535 535
536 (defun vc-start-logentry (files extra comment initial-contents msg action &optional after-hook) 536 (defun vc-start-logentry (files extra comment initial-contents msg logbuf action &optional after-hook)
537 "Accept a comment for an operation on FILES with extra data EXTRA. 537 "Accept a comment for an operation on FILES with extra data EXTRA.
538 If COMMENT is nil, pop up a VC-log buffer, emit MSG, and set the 538 If COMMENT is nil, pop up a LOGBUF buffer, emit MSG, and set the
539 action on close to ACTION. If COMMENT is a string and 539 action on close to ACTION. If COMMENT is a string and
540 INITIAL-CONTENTS is non-nil, then COMMENT is used as the initial 540 INITIAL-CONTENTS is non-nil, then COMMENT is used as the initial
541 contents of the log entry buffer. If COMMENT is a string and 541 contents of the log entry buffer. If COMMENT is a string and
542 INITIAL-CONTENTS is nil, do action immediately as if the user had 542 INITIAL-CONTENTS is nil, do action immediately as if the user had
543 entered COMMENT. If COMMENT is t, also do action immediately with an 543 entered COMMENT. If COMMENT is t, also do action immediately with an
551 (current-buffer) 551 (current-buffer)
552 (if (and files (equal (length files) 1)) 552 (if (and files (equal (length files) 1))
553 (get-file-buffer (car files)) 553 (get-file-buffer (car files))
554 (current-buffer))))) 554 (current-buffer)))))
555 (if (and comment (not initial-contents)) 555 (if (and comment (not initial-contents))
556 (set-buffer (get-buffer-create "*VC-log*")) 556 (set-buffer (get-buffer-create logbuf))
557 (pop-to-buffer (get-buffer-create "*VC-log*"))) 557 (pop-to-buffer (get-buffer-create logbuf)))
558 (set (make-local-variable 'vc-parent-buffer) parent) 558 (set (make-local-variable 'vc-parent-buffer) parent)
559 (set (make-local-variable 'vc-parent-buffer-name) 559 (set (make-local-variable 'vc-parent-buffer-name)
560 (concat " from " (buffer-name vc-parent-buffer))) 560 (concat " from " (buffer-name vc-parent-buffer)))
561 (vc-log-edit files) 561 (vc-log-edit files)
562 (make-local-variable 'vc-log-after-operation-hook) 562 (make-local-variable 'vc-log-after-operation-hook)
585 (with-current-buffer vc-parent-buffer 585 (with-current-buffer vc-parent-buffer
586 (or (vc-dispatcher-browsing) (vc-buffer-sync))) 586 (or (vc-dispatcher-browsing) (vc-buffer-sync)))
587 (unless vc-log-operation 587 (unless vc-log-operation
588 (error "No log operation is pending")) 588 (error "No log operation is pending"))
589 ;; save the parameters held in buffer-local variables 589 ;; save the parameters held in buffer-local variables
590 (let ((log-operation vc-log-operation) 590 (let ((logbuf (current-buffer))
591 (log-operation vc-log-operation)
591 (log-fileset vc-log-fileset) 592 (log-fileset vc-log-fileset)
592 (log-extra vc-log-extra) 593 (log-extra vc-log-extra)
593 (log-entry (buffer-string)) 594 (log-entry (buffer-string))
594 (after-hook vc-log-after-operation-hook) 595 (after-hook vc-log-after-operation-hook)
595 (tmp-vc-parent-buffer vc-parent-buffer)) 596 (tmp-vc-parent-buffer vc-parent-buffer))
601 log-extra 602 log-extra
602 log-entry)) 603 log-entry))
603 ;; Remove checkin window (after the checkin so that if that fails 604 ;; Remove checkin window (after the checkin so that if that fails
604 ;; we don't zap the *VC-log* buffer and the typing therein). 605 ;; we don't zap the *VC-log* buffer and the typing therein).
605 ;; -- IMO this should be replaced with quit-window 606 ;; -- IMO this should be replaced with quit-window
606 (let ((logbuf (get-buffer "*VC-log*"))) 607 (cond ((and logbuf vc-delete-logbuf-window)
607 (cond ((and logbuf vc-delete-logbuf-window) 608 (delete-windows-on logbuf (selected-frame))
608 (delete-windows-on logbuf (selected-frame)) 609 ;; Kill buffer and delete any other dedicated windows/frames.
609 ;; Kill buffer and delete any other dedicated windows/frames. 610 (kill-buffer logbuf))
610 (kill-buffer logbuf)) 611 (logbuf (pop-to-buffer logbuf)
611 (logbuf (pop-to-buffer "*VC-log*") 612 (bury-buffer)
612 (bury-buffer) 613 (pop-to-buffer tmp-vc-parent-buffer)))
613 (pop-to-buffer tmp-vc-parent-buffer))))
614 ;; Now make sure we see the expanded headers 614 ;; Now make sure we see the expanded headers
615 (when log-fileset 615 (when log-fileset
616 (mapc 616 (mapc
617 (lambda (file) (vc-resynch-buffer file vc-keep-workfiles t)) 617 (lambda (file) (vc-resynch-buffer file vc-keep-workfiles t))
618 log-fileset)) 618 log-fileset))