;;;###autoload
(define-key menu-bar-emerge-menu [emerge-merge-directories]
- '("Merge Directories ..." . emerge-merge-directories))
+ '("Merge Directories..." . emerge-merge-directories))
;;;###autoload
(define-key menu-bar-emerge-menu [emerge-revisions-with-ancestor]
- '("Revisions with Ancestor ..." . emerge-revisions-with-ancestor))
+ '("Revisions with Ancestor..." . emerge-revisions-with-ancestor))
;;;###autoload
(define-key menu-bar-emerge-menu [emerge-revisions]
- '("Revisions ..." . emerge-revisions))
+ '("Revisions..." . emerge-revisions))
;;;###autoload
(define-key menu-bar-emerge-menu [emerge-files-with-ancestor]
- '("Files with Ancestor ..." . emerge-files-with-ancestor))
+ '("Files with Ancestor..." . emerge-files-with-ancestor))
;;;###autoload
(define-key menu-bar-emerge-menu [emerge-files]
- '("Files ..." . emerge-files))
+ '("Files..." . emerge-files))
;;;###autoload
(define-key menu-bar-emerge-menu [emerge-buffers-with-ancestor]
- '("Buffers with Ancestor ..." . emerge-buffers-with-ancestor))
+ '("Buffers with Ancestor..." . emerge-buffers-with-ancestor))
;;;###autoload
(define-key menu-bar-emerge-menu [emerge-buffers]
- '("Buffers ..." . emerge-buffers))
+ '("Buffers..." . emerge-buffers))
;;; Macros
(let (f)
(list current-prefix-arg
(setq f (emerge-read-file-name "File A to merge" emerge-last-dir-A
- nil nil))
- (emerge-read-file-name "File B to merge" emerge-last-dir-B nil f)
+ nil nil t))
+ (emerge-read-file-name "File B to merge" emerge-last-dir-B nil f t)
(and current-prefix-arg
(emerge-read-file-name "Output file" emerge-last-dir-output
- f f)))))
+ f f nil)))))
(emerge-files-internal
file-A file-B startup-hooks
(if file-out
(let (f)
(list current-prefix-arg
(setq f (emerge-read-file-name "File A to merge" emerge-last-dir-A
- nil nil))
- (emerge-read-file-name "File B to merge" emerge-last-dir-B nil f)
+ nil nil t))
+ (emerge-read-file-name "File B to merge" emerge-last-dir-B nil f t)
(emerge-read-file-name "Ancestor file" emerge-last-dir-ancestor
- nil f)
+ nil f t)
(and current-prefix-arg
(emerge-read-file-name "Output file" emerge-last-dir-output
- f f)))))
+ f f nil)))))
(emerge-files-with-ancestor-internal
file-A file-B file-ancestor startup-hooks
(if file-out
;; If there are min-lines lines above and below the region, then don't do
;; anything.
;; If not, recenter the region to make it so.
-;; If that isn't possible, remove context lines balancedly from top and botton
+;; If that isn't possible, remove context lines balancedly from top and bottom
;; so the entire region shows.
;; If that isn't possible, show the top of the region.
;; BEG must be at the beginning of a line.
(setq emerge-fast-mode t)
(setq emerge-edit-mode nil)
(message "Fast mode set")
- ;; force mode line redisplay
- (set-buffer-modified-p (buffer-modified-p)))
+ (force-mode-line-update))
(defun emerge-edit-mode ()
"Set edit mode, for Emerge.
(setq emerge-fast-mode nil)
(setq emerge-edit-mode t)
(message "Edit mode set")
- ;; force mode line redisplay
- (set-buffer-modified-p (buffer-modified-p)))
+ (force-mode-line-update))
(defun emerge-auto-advance (arg)
"Toggle Auto-Advance mode, for Emerge.
(message (if emerge-auto-advance
"Auto-advance set"
"Auto-advance cleared"))
- ;; force mode line redisplay
- (set-buffer-modified-p (buffer-modified-p)))
+ (force-mode-line-update))
(defun emerge-skip-prefers (arg)
"Toggle Skip-Prefers mode, for Emerge.
(message (if emerge-skip-prefers
"Skip-prefers set"
"Skip-prefers cleared"))
- ;; force mode line redisplay
- (set-buffer-modified-p (buffer-modified-p)))
+ (force-mode-line-update))
(defun emerge-copy-as-kill-A ()
"Put the A variant of this difference in the kill ring."
(princ "Ancestor buffer is: ")
(princ (buffer-name))))
(princ "\n")))
- (princ emerge-output-description))))
+ (princ emerge-output-description)
+ (save-excursion
+ (set-buffer standard-output)
+ (help-mode)))))
(defun emerge-join-differences (arg)
"Join the selected difference with the following one.
;; Read a file name, handling all of the various defaulting rules.
(defun emerge-read-file-name (prompt alternative-default-dir default-file
- A-file)
+ A-file must-match)
;; `prompt' should not have trailing ": ", so that it can be modified
;; according to context.
;; If alternative-default-dir is non-nil, it should be used as the default
alternative-default-dir
(concat alternative-default-dir
(file-name-nondirectory A-file))
- 'confirm))
+ (and must-match 'confirm)))
;; If there is a default file, use it.
(default-file
(read-file-name (format "%s (default %s): " prompt default-file)
;; Emerge as the default for this argument.
(and emerge-default-last-directories
alternative-default-dir)
- default-file 'confirm))
+ default-file (and must-match 'confirm)))
(t
(read-file-name (concat prompt ": ")
;; If emerge-default-last-directories is set, use the
;; Emerge as the default for this argument.
(and emerge-default-last-directories
alternative-default-dir)
- nil 'confirm))))
+ nil (and must-match 'confirm)))))
;; Revise the mode line to display which difference we have selected
(prefer-B . " - B*")
(combined . " - comb"))))
""))))
- ;; Force mode-line redisplay
- (set-buffer-modified-p (buffer-modified-p)))
+ (force-mode-line-update))
;; compare two regions in two buffers for containing the same text
(defun emerge-compare-buffers (buffer-x x-begin x-end buffer-y y-begin y-end)
;; a list of variables. The argument is a list of symbols (the names of
;; the variables). A list element can also be a list of two functions,
;; the first of which (when called with no arguments) gets the value, and
-;; the second (when called with a value as an argment) sets the value.
+;; the second (when called with a value as an argument) sets the value.
;; A "function" is anything that funcall can handle as an argument.
(defun emerge-save-variables (vars)
;; minor-mode indicator))
;; (princ (documentation minor-mode)))))
;; (setq minor-modes (cdr minor-modes))))
+;; (save-excursion
+;; (set-buffer standard-output)
+;; (help-mode))
;; (print-help-return-message)))
;; This goes with the redefinition of describe-mode.