comparison lisp/ediff-util.el @ 38514:10482dd382e7

* viper-ex.el (ex-token-list,ex-cmd-execute): Revamped, courtesy of Scott Bronson. (ex-cmd-assoc,ex-compile,ex-cmd-one-letr): New functions. (viper-check-sub,viper-get-ex-command,viper-execute-ex-command): Deleted functions. (viper-get-ex-com-subr,viper-ex,ex-mark): Changed to use the new ex-token-list. (viper-get-ex-address-subr): convert registers to char data type. * viper-util.el (viper-int-to-char,viper-char-equal): new functions. (viper-memq-char): use viper-int-to-char. (viper-file-checked-in-p): use vc-locking-user, if vc doesn't have vc-locking-state. (viper-read-key): use viper-read-key-sequence. * viper.el (viper-major-mode-modifier-list): added inferior-emacs-lisp-mode. (this-major-mode-requires-vi-state): new function that uses simple heuristics to decide if vi state is appropriate. (set-viper-state-in-major-mode): use this-major-mode-requires-vi-state. (viper-non-hook-settings): don't advise read-key-sequence. (viper-read-key-sequence): new function that replaces the previously used advice to read-key-sequence. * viper-cmd.el (viper-test-com-defun,viper-exec-change, viper-exec-Change,viper-execute-com,viper-insert,viper-append, viper-Append,viper-Insert,viper-open-line,viper-Open-line, viper-open-line-at-point,viper-substitute,viper-overwrite, viper-replace-char-subr,viper-forward-word,viper-forward-Word): got rid of the negative character hack. (viper-escape-to-state,viper-replace-state-exit-cmd): use viper-read-key-sequence. (viper-envelop-ESC-key): no need for ad-get-orig-definition. (viper-minibuffer-standard-hook,viper-read-string-with-history): don't override existing minibuffer-setup-hook. (viper-mark-point,viper-goto-mark-subr,viper-brac-function): convert registers to char data type. (viper-autoindent): use viper-indent-line. * viper-keym.el: use viper-exec-key-in-emacs. * viper.texi: Added credits, new commands, like :make. * ediff-util.el: Copyright years. (ediff-choose-syntax-table): New function. (ediff-setup): Use ediff-choose-syntax-table. (ediff-file-checked-out-p,ediff-file-checked-in-p): check if vc-state is available. (ediff-make-temp-file): use ediff-coding-system-for-write. * ediff-init.el (ediff-with-syntax-table): New macro, uses with-syntax-table. (ediff-coding-system-for-read): from ediff-diff.el (ediff-coding-system-for-write): new variable. (ediff-highest-priority): fixed the bug having to do with disappearing overlays. (ediff-file-remote-p): use file-remote-p, if available. (ediff-listable-file): new function. (ediff-file-attributes): use ediff-listable-file. * ediff-mult.el (ediff-meta-insert-file-info1): use ediff-listable-file. * ediff-ptch.el (ediff-prompt-for-patch-file): use ediff-coding-system-for-read. (ediff-patch-file-internal): use ediff-coding-system-for-write. * ediff-diff.el (ediff-coding-system-for-read): moved to ediff-init.el. (ediff-match-diff3-line,ediff-get-diff3-group): improved pattern. * ediff.el: Date of last update, copyright years. * ediff-wind (ediff-setup-control-frame): Nill->nil. * ediff.texi: added clarifications, acknowledgements.
author Michael Kifer <kifer@cs.stonybrook.edu>
date Sat, 21 Jul 2001 05:28:24 +0000
parents 7a94f1c588c4
children 3ce98f3e0608
comparison
equal deleted inserted replaced
38513:144b56521d1d 38514:10482dd382e7
1099 1099
1100 1100
1101 (defsubst ediff-file-checked-out-p (file) 1101 (defsubst ediff-file-checked-out-p (file)
1102 (or (not (featurep 'vc-hooks)) 1102 (or (not (featurep 'vc-hooks))
1103 (and (vc-backend file) 1103 (and (vc-backend file)
1104 (or (memq (vc-state file) '(edited needs-merge)) 1104 (if (fboundp 'vc-state)
1105 (stringp (vc-state file)))))) 1105 (or (memq (vc-state file) '(edited needs-merge))
1106 (stringp (vc-state file)))
1107 ;; XEmacs has no vc-state
1108 (vc-locking-user file))
1109 )))
1106 1110
1107 (defsubst ediff-file-checked-in-p (file) 1111 (defsubst ediff-file-checked-in-p (file)
1108 (and (featurep 'vc-hooks) 1112 (and (featurep 'vc-hooks)
1109 ;; CVS files are considered not checked in 1113 ;; CVS files are considered not checked in
1110 (not (memq (vc-backend file) '(nil CVS))) 1114 (not (memq (vc-backend file) '(nil CVS)))
1111 (not (memq (vc-state file) '(edited needs-merge))) 1115 (if (fboundp 'vc-state)
1112 (not (stringp (vc-state file))))) 1116 (progn
1117 (not (memq (vc-state file) '(edited needs-merge)))
1118 (not (stringp (vc-state file))))
1119 ;; XEmacs has no vc-state
1120 (not (vc-locking-user file)))
1121 ))
1113 1122
1114 (defun ediff-file-compressed-p (file) 1123 (defun ediff-file-compressed-p (file)
1115 (condition-case nil 1124 (condition-case nil
1116 (require 'jka-compr) 1125 (require 'jka-compr)
1117 (error)) 1126 (error))
2969 ;; Also, save buffer from START to END in the file. 2978 ;; Also, save buffer from START to END in the file.
2970 ;; START defaults to (point-min), END to (point-max) 2979 ;; START defaults to (point-min), END to (point-max)
2971 (defun ediff-make-temp-file (buff &optional prefix given-file start end) 2980 (defun ediff-make-temp-file (buff &optional prefix given-file start end)
2972 (let* ((p (ediff-convert-standard-filename (or prefix "ediff"))) 2981 (let* ((p (ediff-convert-standard-filename (or prefix "ediff")))
2973 (short-p p) 2982 (short-p p)
2974 (coding-system-for-write 'no-conversion) 2983 (coding-system-for-write ediff-coding-system-for-write)
2975 f short-f) 2984 f short-f)
2976 (if (and (fboundp 'msdos-long-file-names) 2985 (if (and (fboundp 'msdos-long-file-names)
2977 (not (msdos-long-file-names)) 2986 (not (msdos-long-file-names))
2978 (> (length p) 2)) 2987 (> (length p) 2))
2979 (setq short-p (substring p 0 2))) 2988 (setq short-p (substring p 0 2)))
3462 (make-overlay beg end buff nil 'rear-advance))) 3471 (make-overlay beg end buff nil 'rear-advance)))
3463 3472
3464 ;; never detach 3473 ;; never detach
3465 (ediff-overlay-put 3474 (ediff-overlay-put
3466 overl (if ediff-emacs-p 'evaporate 'detachable) nil) 3475 overl (if ediff-emacs-p 'evaporate 'detachable) nil)
3467 ;; make vip-minibuffer-overlay open-ended 3476 ;; make overlay open-ended
3468 ;; In emacs, it is made open ended at creation time 3477 ;; In emacs, it is made open ended at creation time
3469 (if ediff-xemacs-p 3478 (if ediff-xemacs-p
3470 (progn 3479 (progn
3471 (ediff-overlay-put overl 'start-open nil) 3480 (ediff-overlay-put overl 'start-open nil)
3472 (ediff-overlay-put overl 'end-open nil))) 3481 (ediff-overlay-put overl 'end-open nil)))