aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
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
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')
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/ediff-init.el18
-rw-r--r--lisp/ediff-ptch.el4
-rw-r--r--lisp/ediff.el32
4 files changed, 49 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3d09a5f17e1..06ff37f90ff 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
12000-12-25 Michael Kifer <kifer@cs.sunysb.edu>
2 * viper-init (viper-restore-cursor-type): added condition-case
3 guard.
4
5 * ediff-init.el (ediff-quit-hook,ediff-suspend-hook): changed
6 initialization; use add-hook.
7 (ediff-file-remote-p): use file-local-copy.
8
9 * ediff-ptch.el (ediff-prompt-for-patch-buffer): improved defaults.
10
11 * ediff.el (ediff-patch-buffer): bug fix.
12 (ediff-revision): allow selection of the file at the prompt.
13
12000-12-23 Stefan Monnier <monnier@cs.yale.edu> 142000-12-23 Stefan Monnier <monnier@cs.yale.edu>
2 15
3 * subr.el (combine-run-hooks): Remove. 16 * subr.el (combine-run-hooks): Remove.
diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el
index 4c1fc9b48a3..8f3d472bd5d 100644
--- a/lisp/ediff-init.el
+++ b/lisp/ediff-init.el
@@ -443,11 +443,11 @@ set local variables that determine how the display looks like."
443 :type 'hook 443 :type 'hook
444 :group 'ediff-hook) 444 :group 'ediff-hook)
445 445
446(defcustom ediff-suspend-hook (list 'ediff-default-suspend-function) 446(defcustom ediff-suspend-hook nil
447 "*Hooks to run in the Ediff control buffer when Ediff is suspended." 447 "*Hooks to run in the Ediff control buffer when Ediff is suspended."
448 :type 'hook 448 :type 'hook
449 :group 'ediff-hook) 449 :group 'ediff-hook)
450(defcustom ediff-quit-hook (list 'ediff-cleanup-mess) 450(defcustom ediff-quit-hook nil
451 "*Hooks to run in the Ediff control buffer after finishing Ediff." 451 "*Hooks to run in the Ediff control buffer after finishing Ediff."
452 :type 'hook 452 :type 'hook
453 :group 'ediff-hook) 453 :group 'ediff-hook)
@@ -1152,6 +1152,9 @@ this variable represents.")
1152(put 'ediff-fine-diff-face-Ancestor 'ediff-help-echo 1152(put 'ediff-fine-diff-face-Ancestor 'ediff-help-echo
1153 "A `refinement' of the current difference region") 1153 "A `refinement' of the current difference region")
1154 1154
1155(add-hook 'ediff-quit-hook 'ediff-cleanup-mess)
1156(add-hook 'ediff-suspend-hook 'ediff-default-suspend-function)
1157
1155 1158
1156;;; Overlays 1159;;; Overlays
1157 1160
@@ -1273,11 +1276,12 @@ This default should work without changes."
1273 1276
1274(or (fboundp 'ediff-file-remote-p) ; user supplied his own function: use it 1277(or (fboundp 'ediff-file-remote-p) ; user supplied his own function: use it
1275 (defun ediff-file-remote-p (file-name) 1278 (defun ediff-file-remote-p (file-name)
1276 (car (cond ((featurep 'efs-auto) (efs-ftp-path file-name)) 1279 (find-file-name-handler file-name 'file-local-copy)))
1277 ((fboundp 'file-remote-p) (file-remote-p file-name)) 1280;;; (or (and (featurep 'efs-auto) (efs-ftp-path file-name))
1278 (t (require 'ange-ftp) 1281;;; (and (featurep 'tramp) (tramp-tramp-file-p file-name))
1279 ;; Can happen only in Emacs, since XEmacs has file-remote-p 1282;;; (and (fboundp 'file-remote-p) (file-remote-p file-name))
1280 (ange-ftp-ftp-name file-name)))))) 1283;;; ;; Can happen only in Emacs, since XEmacs has file-remote-p
1284;;; (and (require 'ange-ftp) (ange-ftp-ftp-name file-name)))))
1281 1285
1282 1286
1283(defsubst ediff-frame-unsplittable-p (frame) 1287(defsubst ediff-frame-unsplittable-p (frame)
diff --git a/lisp/ediff-ptch.el b/lisp/ediff-ptch.el
index 873e45060e0..18b2f75b4df 100644
--- a/lisp/ediff-ptch.el
+++ b/lisp/ediff-ptch.el
@@ -427,7 +427,7 @@ are two possible targets for this patch. However, these files do not exist."
427(defun ediff-prompt-for-patch-buffer () 427(defun ediff-prompt-for-patch-buffer ()
428 (get-buffer 428 (get-buffer
429 (read-buffer 429 (read-buffer
430 "Patch is in buffer: " 430 "Buffer that holds the patch: "
431 (cond ((save-excursion 431 (cond ((save-excursion
432 (goto-char (point-min)) 432 (goto-char (point-min))
433 (re-search-forward ediff-context-diff-label-regexp nil t)) 433 (re-search-forward ediff-context-diff-label-regexp nil t))
@@ -444,7 +444,7 @@ are two possible targets for this patch. However, these files do not exist."
444 (goto-char (point-min)) 444 (goto-char (point-min))
445 (and (re-search-forward ediff-context-diff-label-regexp nil t) 445 (and (re-search-forward ediff-context-diff-label-regexp nil t)
446 (current-buffer))))) 446 (current-buffer)))))
447 (t nil)) 447 (t (other-buffer (current-buffer) 'visible-ok)))
448 'must-match))) 448 'must-match)))
449 449
450 450
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))