comparison contrib/mercurial.el @ 1001:ab3939ccbf10

Emacs: update mode lines properly after commit.
author Bryan O'Sullivan <bos@serpentine.com>
date Mon, 22 Aug 2005 03:41:09 -0700
parents 3362b410c219
children 6dfc9cc71f42
comparison
equal deleted inserted replaced
1000:3362b410c219 1001:ab3939ccbf10
616 616
617 (defun hg-commit-finish () 617 (defun hg-commit-finish ()
618 (interactive) 618 (interactive)
619 (goto-char (point-min)) 619 (goto-char (point-min))
620 (search-forward hg-commit-message-start) 620 (search-forward hg-commit-message-start)
621 (let (message files) 621 (let ((root hg-root)
622 message files)
622 (let ((start (point))) 623 (let ((start (point)))
623 (goto-char (point-max)) 624 (goto-char (point-max))
624 (search-backward hg-commit-message-end) 625 (search-backward hg-commit-message-end)
625 (setq message (hg-strip (buffer-substring start (point))))) 626 (setq message (hg-strip (buffer-substring start (point)))))
626 (when (and (= (length message) 0) 627 (when (and (= (length message) 0)
640 (error "Cannot proceed - no files to commit")) 641 (error "Cannot proceed - no files to commit"))
641 (setq message (concat message "\n")) 642 (setq message (concat message "\n"))
642 (apply 'hg-run0 "--cwd" hg-root "commit" "-m" message files) 643 (apply 'hg-run0 "--cwd" hg-root "commit" "-m" message files)
643 (let ((buf hg-prev-buffer)) 644 (let ((buf hg-prev-buffer))
644 (kill-buffer nil) 645 (kill-buffer nil)
645 (switch-to-buffer buf)))) 646 (switch-to-buffer buf))
647 (hg-do-across-repo root
648 (hg-mode-line))))
646 649
647 (defun hg-commit-mode () 650 (defun hg-commit-mode ()
648 "Mode for describing a commit of changes to a Mercurial repository. 651 "Mode for describing a commit of changes to a Mercurial repository.
649 This involves two actions: describing the changes with a commit 652 This involves two actions: describing the changes with a commit
650 message, and choosing the files to commit. 653 message, and choosing the files to commit.