aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael Kifer2001-12-24 05:50:31 +0000
committerMichael Kifer2001-12-24 05:50:31 +0000
commitb9fe4732f60bef14008aa9c4735d45f23fd8f670 (patch)
treea1143820e91e6ead088b0b85b24f9388cceace95 /lisp
parentea8d3061370eb3c02cc659eb0b013a358de853b2 (diff)
downloademacs-b9fe4732f60bef14008aa9c4735d45f23fd8f670.tar.gz
emacs-b9fe4732f60bef14008aa9c4735d45f23fd8f670.zip
2001-12-24 Michael Kifer <kifer@cs.sunysb.edu>
* viper-cmd.el (viper-change-state): Got rid of make-local-hook. (viper-special-read-and-insert-char): Make C-m work right in the r comand. (viper-buffer-search-enable): Fixed format string. * viper-ex.el (ex-token-alist): Use ex-set-visited-file-name instead of viper-info-on-file. (ex-set-visited-file-name): New function. * viper.el (viper-emacs-state-mode-list): Added mail-mode. * ediff-mult.el (ediff-meta-mark-equal-files): Added optional action argument. * ediff-init.el: Fixed some doc strings. * ediff-util.el (ediff-after-quit-hook-internal): New variable. Got rid of make-local-hook. * ediff-wind.el (ediff-setup-control-frame): Got rid of make-local-hook.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog24
-rw-r--r--lisp/ediff-init.el4
-rw-r--r--lisp/ediff-mult.el17
-rw-r--r--lisp/ediff-util.el19
-rw-r--r--lisp/ediff-wind.el6
-rw-r--r--lisp/emulation/viper-cmd.el40
-rw-r--r--lisp/emulation/viper-ex.el21
-rw-r--r--lisp/emulation/viper.el1
8 files changed, 105 insertions, 27 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1043fa7b798..0060322637d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,27 @@
12001-12-24 Michael Kifer <kifer@cs.sunysb.edu>
2
3 * viper-cmd.el (viper-change-state): Got rid of make-local-hook.
4 (viper-special-read-and-insert-char): Make C-m work right in the r
5 comand.
6 (viper-buffer-search-enable): Fixed format string.
7
8 * viper-ex.el (ex-token-alist): Use ex-set-visited-file-name
9 instead of viper-info-on-file.
10 (ex-set-visited-file-name): New function.
11
12 * viper.el (viper-emacs-state-mode-list): Added mail-mode.
13
14 * ediff-mult.el (ediff-meta-mark-equal-files): Added optional
15 action argument.
16
17 * ediff-init.el: Fixed some doc strings.
18
19 * ediff-util.el (ediff-after-quit-hook-internal): New variable.
20 Got rid of make-local-hook.
21
22 * ediff-wind.el (ediff-setup-control-frame): Got rid of
23 make-local-hook.
24
12001-12-23 Richard M. Stallman <rms@gnu.org> 252001-12-23 Richard M. Stallman <rms@gnu.org>
2 26
3 * term/x-win.el (x-handle-geometry): Put height and width 27 * term/x-win.el (x-handle-geometry): Put height and width
diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el
index cbc57655ac2..336f360f31a 100644
--- a/lisp/ediff-init.el
+++ b/lisp/ediff-init.el
@@ -590,7 +590,7 @@ highlighted using ASCII flags."
590Actually, Ediff restores the scope of visibility that existed at startup.") 590Actually, Ediff restores the scope of visibility that existed at startup.")
591 591
592(defcustom ediff-keep-variants t 592(defcustom ediff-keep-variants t
593 "*nil means that non-modified variant buffers should be removed at the end of the session after some interrogation. 593 "*nil means prompt to remove unmodified buffers A/B/C at session end.
594Supplying a prefix argument to the quit command `q' temporarily reverses the 594Supplying a prefix argument to the quit command `q' temporarily reverses the
595meaning of this variable." 595meaning of this variable."
596 :type 'boolean 596 :type 'boolean
@@ -1241,7 +1241,7 @@ This property can be toggled interactively."
1241 1241
1242(defcustom ediff-autostore-merges 'group-jobs-only 1242(defcustom ediff-autostore-merges 'group-jobs-only
1243 "*Save the results of merge jobs automatically. 1243 "*Save the results of merge jobs automatically.
1244nil means don't save automatically. t means always save. Anything but nil or t 1244nil means don't save automatically. t means always save. Anything else
1245means save automatically only if the merge job is part of a group of jobs, such 1245means save automatically only if the merge job is part of a group of jobs, such
1246as `ediff-merge-directory' or `ediff-merge-directory-revisions'." 1246as `ediff-merge-directory' or `ediff-merge-directory-revisions'."
1247 :type '(choice (const nil) (const t) (const group-jobs-only)) 1247 :type '(choice (const nil) (const t) (const group-jobs-only))
diff --git a/lisp/ediff-mult.el b/lisp/ediff-mult.el
index 8b0860e5c8a..ac779849353 100644
--- a/lisp/ediff-mult.el
+++ b/lisp/ediff-mult.el
@@ -2110,10 +2110,17 @@ If this is a session registry buffer then just bury it."
2110 (ediff-update-meta-buffer (current-buffer) 'must-redraw)) 2110 (ediff-update-meta-buffer (current-buffer) 'must-redraw))
2111 2111
2112 2112
2113(defun ediff-meta-mark-equal-files () 2113;; ACTION is ?h, ?m, ?=: to mark for hiding, mark for operation, or simply
2114 "Run though the session list and mark identical files. 2114;; indicate which are equal files
2115This is used only for sessions that involve 2 or 3 files at the same time." 2115(defun ediff-meta-mark-equal-files (&optional action)
2116 "Run through the session list and mark identical files.
2117This is used only for sessions that involve 2 or 3 files at the same time.
2118ACTION is an optional argument that can be ?h, ?m, ?=, to mark for hiding, mark
2119for operation, or simply indicate which are equal files. If it is nil, then
2120last-command-char is used to decide which action to take."
2116 (interactive) 2121 (interactive)
2122 (if (null action)
2123 (setq action last-command-char))
2117 (let ((list (cdr ediff-meta-list)) 2124 (let ((list (cdr ediff-meta-list))
2118 marked1 marked2 marked3 2125 marked1 marked2 marked3
2119 fileinfo1 fileinfo2 fileinfo3 elt) 2126 fileinfo1 fileinfo2 fileinfo3 elt)
@@ -2138,9 +2145,9 @@ This is used only for sessions that involve 2 or 3 files at the same time."
2138 (or (ediff-mark-if-equal fileinfo2 fileinfo3) 2145 (or (ediff-mark-if-equal fileinfo2 fileinfo3)
2139 (setq marked3 nil)))) 2146 (setq marked3 nil))))
2140 (if (and marked1 marked2 marked3) 2147 (if (and marked1 marked2 marked3)
2141 (cond ((eq last-command-char ?h) 2148 (cond ((eq action ?h)
2142 (ediff-mark-session-for-hiding elt 'mark)) 2149 (ediff-mark-session-for-hiding elt 'mark))
2143 ((eq last-command-char ?m) 2150 ((eq action ?m)
2144 (ediff-mark-session-for-operation elt 'mark)) 2151 (ediff-mark-session-for-operation elt 'mark))
2145 )) 2152 ))
2146 (setq list (cdr list))) 2153 (setq list (cdr list)))
diff --git a/lisp/ediff-util.el b/lisp/ediff-util.el
index 8d0f7395149..22925c1fc03 100644
--- a/lisp/ediff-util.el
+++ b/lisp/ediff-util.el
@@ -40,6 +40,8 @@
40(defvar mark-active) 40(defvar mark-active)
41(defvar ediff-emacs-p) 41(defvar ediff-emacs-p)
42 42
43(defvar ediff-after-quit-hook-internal nil)
44
43(eval-when-compile 45(eval-when-compile
44 (let ((load-path (cons (expand-file-name ".") load-path))) 46 (let ((load-path (cons (expand-file-name ".") load-path)))
45 (or (featurep 'ediff-init) 47 (or (featurep 'ediff-init)
@@ -294,8 +296,6 @@ to invocation.")
294 (make-local-variable 'ediff-window-setup-function) 296 (make-local-variable 'ediff-window-setup-function)
295 (make-local-variable 'ediff-keep-variants) 297 (make-local-variable 'ediff-keep-variants)
296 298
297 (make-local-hook 'ediff-after-quit-hook-internal)
298
299 ;; unwrap set up parameters passed as argument 299 ;; unwrap set up parameters passed as argument
300 (while setup-parameters 300 (while setup-parameters
301 (set (car (car setup-parameters)) (cdr (car setup-parameters))) 301 (set (car (car setup-parameters)) (cdr (car setup-parameters)))
@@ -317,9 +317,11 @@ to invocation.")
317 (if (string-match "buffer" (symbol-name ediff-job-name)) 317 (if (string-match "buffer" (symbol-name ediff-job-name))
318 (setq ediff-keep-variants t)) 318 (setq ediff-keep-variants t))
319 319
320 (make-local-hook 'pre-command-hook) 320 (if ediff-xemacs-p
321 (make-local-hook 'pre-command-hook))
322
321 (if (ediff-window-display-p) 323 (if (ediff-window-display-p)
322 (add-hook 'pre-command-hook 'ediff-spy-after-mouse nil t)) 324 (add-hook 'pre-command-hook 'ediff-spy-after-mouse nil 'local))
323 (setq ediff-mouse-pixel-position (mouse-pixel-position)) 325 (setq ediff-mouse-pixel-position (mouse-pixel-position))
324 326
325 ;; adjust for merge jobs 327 ;; adjust for merge jobs
@@ -3845,7 +3847,10 @@ Mail anyway? (y or n) ")
3845 "Toggle profiling Ediff commands." 3847 "Toggle profiling Ediff commands."
3846 (interactive) 3848 (interactive)
3847 (ediff-barf-if-not-control-buffer) 3849 (ediff-barf-if-not-control-buffer)
3848 (make-local-hook 'post-command-hook) 3850
3851 (if ediff-xemacs-p
3852 (make-local-hook 'post-command-hook))
3853
3849 (let ((pre-hook 'pre-command-hook) 3854 (let ((pre-hook 'pre-command-hook)
3850 (post-hook 'post-command-hook)) 3855 (post-hook 'post-command-hook))
3851 (if (not (equal ediff-command-begin-time '(0 0 0))) 3856 (if (not (equal ediff-command-begin-time '(0 0 0)))
@@ -3853,8 +3858,8 @@ Mail anyway? (y or n) ")
3853 (remove-hook post-hook 'ediff-calc-command-time) 3858 (remove-hook post-hook 'ediff-calc-command-time)
3854 (setq ediff-command-begin-time '(0 0 0)) 3859 (setq ediff-command-begin-time '(0 0 0))
3855 (message "Ediff profiling disabled")) 3860 (message "Ediff profiling disabled"))
3856 (add-hook pre-hook 'ediff-save-time t t) 3861 (add-hook pre-hook 'ediff-save-time t 'local)
3857 (add-hook post-hook 'ediff-calc-command-time nil t) 3862 (add-hook post-hook 'ediff-calc-command-time nil 'local)
3858 (message "Ediff profiling enabled")))) 3863 (message "Ediff profiling enabled"))))
3859 3864
3860(defun ediff-print-diff-vector (diff-vector-var) 3865(defun ediff-print-diff-vector (diff-vector-var)
diff --git a/lisp/ediff-wind.el b/lisp/ediff-wind.el
index 1a18bead505..4a0928997bd 100644
--- a/lisp/ediff-wind.el
+++ b/lisp/ediff-wind.el
@@ -1018,8 +1018,10 @@ into icons, regardless of the window manager."
1018 1018
1019 (if ediff-xemacs-p 1019 (if ediff-xemacs-p
1020 (ediff-with-current-buffer ctl-buffer 1020 (ediff-with-current-buffer ctl-buffer
1021 (make-local-hook 'select-frame-hook) 1021 (if ediff-xemacs-p
1022 (add-hook 'select-frame-hook 'ediff-xemacs-select-frame-hook nil t) 1022 (make-local-hook 'select-frame-hook))
1023 (add-hook
1024 'select-frame-hook 'ediff-xemacs-select-frame-hook nil 'local)
1023 )) 1025 ))
1024 1026
1025 (ediff-with-current-buffer ctl-buffer 1027 (ediff-with-current-buffer ctl-buffer
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 0df2022ae04..70347ce2aee 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -298,10 +298,12 @@
298 ;; desirable that viper-pre-command-sentinel is the last hook and 298 ;; desirable that viper-pre-command-sentinel is the last hook and
299 ;; viper-post-command-sentinel is the first hook. 299 ;; viper-post-command-sentinel is the first hook.
300 300
301 (make-local-hook 'viper-after-change-functions) 301 (if viper-xemacs-p
302 (make-local-hook 'viper-before-change-functions) 302 (progn
303 (make-local-hook 'viper-post-command-hooks) 303 (make-local-hook 'viper-after-change-functions)
304 (make-local-hook 'viper-pre-command-hooks) 304 (make-local-hook 'viper-before-change-functions)
305 (make-local-hook 'viper-post-command-hooks)
306 (make-local-hook 'viper-pre-command-hooks)))
305 307
306 (remove-hook 'post-command-hook 'viper-post-command-sentinel) 308 (remove-hook 'post-command-hook 'viper-post-command-sentinel)
307 (add-hook 'post-command-hook 'viper-post-command-sentinel) 309 (add-hook 'post-command-hook 'viper-post-command-sentinel)
@@ -786,9 +788,15 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to
786 ;; key translation. (Such left-overs are possible if the user 788 ;; key translation. (Such left-overs are possible if the user
787 ;; types a regular key.) 789 ;; types a regular key.)
788 (let (unread-command-events) 790 (let (unread-command-events)
789 ;; The next 2 cmds are intended to prevent the input method 791 ;; The next cmd and viper-set-unread-command-events
792 ;; are intended to prevent the input method
790 ;; from swallowing ^M, ^Q and other special characters 793 ;; from swallowing ^M, ^Q and other special characters
791 (setq ch (read-char)) 794 (setq ch (read-char))
795 ;; replace ^M with the newline
796 (if (eq ch ?\C-m) (setq ch ?\n))
797 ;; Make sure ^V and ^Q work as quotation chars
798 (if (memq ch '(?\C-v ?\C-q))
799 (setq ch (read-char)))
792 (viper-set-unread-command-events ch) 800 (viper-set-unread-command-events ch)
793 (quail-input-method nil) 801 (quail-input-method nil)
794 802
@@ -806,6 +814,11 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to
806 ;; quail-input-method 814 ;; quail-input-method
807 (let (unread-command-events) 815 (let (unread-command-events)
808 (setq ch (read-char)) 816 (setq ch (read-char))
817 ;; replace ^M with the newline
818 (if (eq ch ?\C-m) (setq ch ?\n))
819 ;; Make sure ^V and ^Q work as quotation chars
820 (if (memq ch '(?\C-v ?\C-q))
821 (setq ch (read-char)))
809 (viper-set-unread-command-events ch) 822 (viper-set-unread-command-events ch)
810 (quail-start-translation nil) 823 (quail-start-translation nil)
811 824
@@ -818,9 +831,19 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to
818 )) 831 ))
819 ((and (boundp 'iso-accents-mode) iso-accents-mode) 832 ((and (boundp 'iso-accents-mode) iso-accents-mode)
820 (setq ch (aref (read-key-sequence nil) 0)) 833 (setq ch (aref (read-key-sequence nil) 0))
834 ;; replace ^M with the newline
835 (if (eq ch ?\C-m) (setq ch ?\n))
836 ;; Make sure ^V and ^Q work as quotation chars
837 (if (memq ch '(?\C-v ?\C-q))
838 (setq ch (aref (read-key-sequence nil) 0)))
821 (insert ch)) 839 (insert ch))
822 (t 840 (t
823 (setq ch (read-char)) 841 (setq ch (read-char))
842 ;; replace ^M with the newline
843 (if (eq ch ?\C-m) (setq ch ?\n))
844 ;; Make sure ^V and ^Q work as quotation chars
845 (if (memq ch '(?\C-v ?\C-q))
846 (setq ch (read-char)))
824 (insert ch)) 847 (insert ch))
825 ) 848 )
826 (setq last-command-event 849 (setq last-command-event
@@ -2554,12 +2577,9 @@ These keys are ESC, RET, and LineFeed"
2554 (or (eq viper-intermediate-command 'viper-repeat) 2577 (or (eq viper-intermediate-command 'viper-repeat)
2555 (viper-special-read-and-insert-char)) 2578 (viper-special-read-and-insert-char))
2556 2579
2557 ;; Is this needed?
2558 (if (eq char ?\C-m) (setq char ?\n))
2559
2560 (delete-char 1 t) 2580 (delete-char 1 t)
2561
2562 (setq char (if com viper-d-char (viper-char-at-pos 'backward))) 2581 (setq char (if com viper-d-char (viper-char-at-pos 'backward)))
2582
2563 (if com (insert char)) 2583 (if com (insert char))
2564 2584
2565 (setq viper-d-char char) 2585 (setq viper-d-char char)
@@ -3836,7 +3856,7 @@ Null string will repeat previous search."
3836 (define-key viper-vi-basic-map 3856 (define-key viper-vi-basic-map
3837 (cond ((viper-characterp viper-buffer-search-char) 3857 (cond ((viper-characterp viper-buffer-search-char)
3838 (char-to-string viper-buffer-search-char)) 3858 (char-to-string viper-buffer-search-char))
3839 (t (error "viper-buffer-search-char: wrong value type, %s" 3859 (t (error "viper-buffer-search-char: wrong value type, %S"
3840 viper-buffer-search-char))) 3860 viper-buffer-search-char)))
3841 'viper-command-argument) 3861 'viper-command-argument)
3842 (aset viper-exec-array viper-buffer-search-char 'viper-exec-buffer-search) 3862 (aset viper-exec-array viper-buffer-search-char 'viper-exec-buffer-search)
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el
index 1ee912eb18c..9b26f468600 100644
--- a/lisp/emulation/viper-ex.el
+++ b/lisp/emulation/viper-ex.el
@@ -115,7 +115,7 @@
115 ("customize" (customize-group "viper")) 115 ("customize" (customize-group "viper"))
116 ("delete" (ex-delete)) 116 ("delete" (ex-delete))
117 ("edit" (ex-edit)) 117 ("edit" (ex-edit))
118 ("file" (viper-info-on-file)) 118 ("file" (ex-set-visited-file-name))
119 ("g" "global") 119 ("g" "global")
120 ("global" (ex-global nil) is-mashed) 120 ("global" (ex-global nil) is-mashed)
121 ("goto" (ex-goto)) 121 ("goto" (ex-goto))
@@ -2232,6 +2232,25 @@ Type 'mak ' (including the space) to run make with no args."
2232 (kill-buffer " *viper-info*"))) 2232 (kill-buffer " *viper-info*")))
2233 )) 2233 ))
2234 2234
2235
2236;; Without arguments displays info on file. With an arg, sets the visited file
2237;; name to that arg
2238(defun ex-set-visited-file-name ()
2239 (viper-get-ex-file)
2240 (if (string= ex-file "")
2241 (viper-info-on-file)
2242 ;; If ex-file is a directory, use the file portion of the buffer
2243 ;; file name (like ex-write). Do this even if ex-file is a
2244 ;; non-existent directory, since set-visited-file-name signals an
2245 ;; error on this condition, too.
2246 (if (and (string= (file-name-nondirectory ex-file) "")
2247 buffer-file-name
2248 (not (file-directory-p buffer-file-name)))
2249 (setq ex-file (concat (file-name-as-directory ex-file)
2250 (file-name-nondirectory buffer-file-name))))
2251 (set-visited-file-name ex-file)))
2252
2253
2235;; display all variables set through :set 2254;; display all variables set through :set
2236(defun ex-show-vars () 2255(defun ex-show-vars ()
2237 (with-output-to-temp-buffer " *viper-info*" 2256 (with-output-to-temp-buffer " *viper-info*"
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index f1d3bb298af..a76dedd3f08 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -426,6 +426,7 @@ widget."
426 tar-mode 426 tar-mode
427 427
428 mh-folder-mode 428 mh-folder-mode
429 mail-mode
429 gnus-group-mode 430 gnus-group-mode
430 gnus-summary-mode 431 gnus-summary-mode
431 432