aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/ediff.el
diff options
context:
space:
mode:
authorMichael Kifer2000-12-25 07:57:37 +0000
committerMichael Kifer2000-12-25 07:57:37 +0000
commit7261ece3c08f89db35cd3f486b02fb71249df240 (patch)
tree1b2420d60d881b4899a571c53ce413192d913d84 /lisp/ediff.el
parent7dfb59f43023d50d5cdfed096953ec276a91f58c (diff)
downloademacs-7261ece3c08f89db35cd3f486b02fb71249df240.tar.gz
emacs-7261ece3c08f89db35cd3f486b02fb71249df240.zip
2000-12-25 Michael Kifer <kifer@cs.sunysb.edu>
* ediff-init.el (ediff-quit-hook,ediff-suspend-hook): changed initialization; use add-hook. (ediff-file-remote-p): use file-local-copy. * ediff-ptch.el (ediff-prompt-for-patch-buffer): improved defaults. * ediff.el (ediff-patch-buffer): bug fix. (ediff-revision): allow selection of the file at the prompt.
Diffstat (limited to 'lisp/ediff.el')
-rw-r--r--lisp/ediff.el32
1 files changed, 23 insertions, 9 deletions
diff --git a/lisp/ediff.el b/lisp/ediff.el
index 7146f564dad..7e68f26708a 100644
--- a/lisp/ediff.el
+++ b/lisp/ediff.el
@@ -1265,7 +1265,11 @@ buffer. If odd -- assume it is in a file."
1265 1265
1266;;;###autoload 1266;;;###autoload
1267(defun ediff-patch-buffer (&optional arg patch-buf) 1267(defun ediff-patch-buffer (&optional arg patch-buf)
1268 "Run Ediff by patching BUFFER-NAME." 1268 "Run Ediff by patching BUFFER-NAME.
1269Without prefix argument: asks if the patch is in some buffer and prompts for
1270the buffer or a file, depending on the answer.
1271With prefix arg=1: assumes the patch is in a file and prompts for the file.
1272With prefix arg=2: assumes the patch is in a buffer and prompts for the buffer."
1269 (interactive "P") 1273 (interactive "P")
1270 (require 'ediff-ptch) 1274 (require 'ediff-ptch)
1271 (setq patch-buf 1275 (setq patch-buf
@@ -1275,7 +1279,7 @@ buffer. If odd -- assume it is in a file."
1275 patch-buf 1279 patch-buf
1276 (read-buffer 1280 (read-buffer
1277 "Which buffer to patch? " 1281 "Which buffer to patch? "
1278 (ediff-prompt-for-patch-buffer)))) 1282 (current-buffer))))
1279 1283
1280 1284
1281;;;###autoload 1285;;;###autoload
@@ -1291,22 +1295,32 @@ buffer. If odd -- assume it is in a file."
1291;;;###autoload 1295;;;###autoload
1292(defun ediff-revision (&optional file startup-hooks) 1296(defun ediff-revision (&optional file startup-hooks)
1293 "Run Ediff by comparing versions of a file. 1297 "Run Ediff by comparing versions of a file.
1294The file is an optional FILE argument or the file visited by the current 1298The file is an optional FILE argument or the file entered at the prompt.
1295buffer. Use `vc.el' or `rcs.el' depending on `ediff-version-control-package'." 1299Default: the file visited by the current buffer.
1300Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
1296 ;; if buffer is non-nil, use that buffer instead of the current buffer 1301 ;; if buffer is non-nil, use that buffer instead of the current buffer
1297 (interactive "P") 1302 (interactive "P")
1298 (if (stringp file) (find-file file)) 1303 (if (not (stringp file))
1304 (setq file
1305 (ediff-read-file-name "Compare revisions for file"
1306 (if ediff-use-last-dir
1307 ediff-last-dir-A
1308 default-directory)
1309 (ediff-get-default-file-name))))
1310 (find-file file)
1311 (if (and (buffer-modified-p)
1312 (y-or-n-p (message "Buffer %s is modified. Save buffer? "
1313 (buffer-name))))
1314 (save-buffer (current-buffer)))
1299 (let (rev1 rev2) 1315 (let (rev1 rev2)
1300 (setq rev1 1316 (setq rev1
1301 (read-string 1317 (read-string
1302 (format "Version 1 to compare (default: %s's latest version): " 1318 (format "Version 1 to compare (default: %s's latest version): "
1303 (if (stringp file) 1319 (file-name-nondirectory file)))
1304 (file-name-nondirectory file) "current buffer")))
1305 rev2 1320 rev2
1306 (read-string 1321 (read-string
1307 (format "Version 2 to compare (default: %s): " 1322 (format "Version 2 to compare (default: %s): "
1308 (if (stringp file) 1323 (file-name-nondirectory file))))
1309 (file-name-nondirectory file) "current buffer"))))
1310 (ediff-load-version-control) 1324 (ediff-load-version-control)
1311 (funcall 1325 (funcall
1312 (intern (format "ediff-%S-internal" ediff-version-control-package)) 1326 (intern (format "ediff-%S-internal" ediff-version-control-package))