aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kifer2001-09-09 22:33:38 +0000
committerMichael Kifer2001-09-09 22:33:38 +0000
commit02f34c7046309acb4772efc0d847a93e752f5b4e (patch)
tree1475778284148b185e5fda55d7e83a86cbbf33f6
parentcfc697a2beffc0b0e50e83609cc86df0ec306330 (diff)
downloademacs-02f34c7046309acb4772efc0d847a93e752f5b4e.tar.gz
emacs-02f34c7046309acb4772efc0d847a93e752f5b4e.zip
2001-09-09 Michael Kifer <kifer@cs.sunysb.edu>
* ediff-init.el (ediff-highest-priority): bug fix. * viper-cmd.el (viper-special-read-and-insert-char): new function that reads a character and uses the current input method or iso-accents when appropriate. * viper.el and all others: corrections to the comment blocks at the top.
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/ediff-init.el27
-rw-r--r--lisp/emulation/viper-cmd.el176
-rw-r--r--lisp/emulation/viper-ex.el2
-rw-r--r--lisp/emulation/viper-init.el2
-rw-r--r--lisp/emulation/viper-keym.el2
-rw-r--r--lisp/emulation/viper-macs.el2
-rw-r--r--lisp/emulation/viper-mous.el2
-rw-r--r--lisp/emulation/viper-util.el2
-rw-r--r--lisp/emulation/viper.el8
10 files changed, 157 insertions, 77 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2ec248e4f0f..78e55abd491 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12001-09-09 Michael Kifer <kifer@cs.sunysb.edu>
2
3 * ediff-init.el (ediff-highest-priority): bug fix.
4
5 * viper-cmd.el (viper-special-read-and-insert-char): new function
6 that reads a character and uses the current input method or
7 iso-accents when appropriate.
8
9 * viper.el and all others: corrections to the comment blocks at
10 the top.
11
12001-09-09 Eli Zaretskii <eliz@is.elta.co.il> 122001-09-09 Eli Zaretskii <eliz@is.elta.co.il>
2 13
3 * info.el (Info-goto-node): Doc fix. 14 * info.el (Info-goto-node): Doc fix.
diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el
index fa8e0e9b794..b701ae6685f 100644
--- a/lisp/ediff-init.el
+++ b/lisp/ediff-init.el
@@ -1202,18 +1202,21 @@ this variable represents.")
1202 (setq pos (next-overlay-change pos))) 1202 (setq pos (next-overlay-change pos)))
1203 (+ 1 ediff-shadow-overlay-priority 1203 (+ 1 ediff-shadow-overlay-priority
1204 (apply 'max 1204 (apply 'max
1205 (mapcar 1205 (cons
1206 (lambda (ovr) 1206 1
1207 (if (and ovr 1207 (mapcar
1208 ;; exclude ediff overlays from priority 1208 (lambda (ovr)
1209 ;; calculation, or else priority will keep 1209 (if (and ovr
1210 ;; increasing 1210 ;; exclude ediff overlays from priority
1211 (null (ediff-overlay-get ovr 'ediff)) 1211 ;; calculation, or else priority will keep
1212 (null (ediff-overlay-get ovr 'ediff-diff-num))) 1212 ;; increasing
1213 ;; use the overlay priority or 0 1213 (null (ediff-overlay-get ovr 'ediff))
1214 (or (ediff-overlay-get ovr 'priority) 0) 1214 (null (ediff-overlay-get ovr 'ediff-diff-num)))
1215 0)) 1215 ;; use the overlay priority or 0
1216 ovr-list) 1216 (or (ediff-overlay-get ovr 'priority) 0)
1217 0))
1218 ovr-list)
1219 )
1217 )) 1220 ))
1218 )))) 1221 ))))
1219 1222
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index d4574779412..a7bfb3bd2b4 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -1,6 +1,9 @@
1;;; viper-cmd.el --- Vi command support for Viper 1;;; viper-cmd.el --- Vi command support for Viper
2
2;; Copyright (C) 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1997 Free Software Foundation, Inc.
3 4
5;; Author: Michael Kifer <kifer@cs.sunysb.edu>
6
4;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
5 8
6;; GNU Emacs is free software; you can redistribute it and/or modify 9;; GNU Emacs is free software; you can redistribute it and/or modify
@@ -758,6 +761,81 @@ Vi's prefix argument will be used. Otherwise, the prefix argument passed to
758 ;; set state in the new buffer 761 ;; set state in the new buffer
759 (viper-set-mode-vars-for viper-current-state)) 762 (viper-set-mode-vars-for viper-current-state))
760 763
764;; This is used in order to allow reading characters according to the input
765;; method. The character is read in emacs and inserted into the buffer.
766;; If an input method is in effect, this might
767;; cause several characters to be combined into one.
768;; Also takes care of the iso-accents mode
769(defun viper-special-read-and-insert-char ()
770 (viper-set-mode-vars-for 'emacs-state)
771 (viper-normalize-minor-mode-map-alist)
772 (if viper-special-input-method
773 (viper-set-input-method t))
774 (if viper-automatic-iso-accents
775 (viper-set-iso-accents-mode t))
776 (condition-case nil
777 (let (viper-vi-kbd-minor-mode
778 viper-insert-kbd-minor-mode
779 viper-emacs-kbd-minor-mode
780 ch)
781 (cond ((and viper-special-input-method
782 viper-emacs-p
783 (fboundp 'quail-input-method))
784 ;; (let ...) is used to restore unread-command-events to the
785 ;; original state. We don't want anything left in there after
786 ;; key translation. (Such left-overs are possible if the user
787 ;; types a regular key.)
788 (let (unread-command-events)
789 ;; The next 2 cmds are intended to prevent the input method
790 ;; from swallowing ^M, ^Q and other special characters
791 (setq ch (read-char))
792 (viper-set-unread-command-events ch)
793 (quail-input-method nil)
794
795 (if (and ch (string= quail-current-str ""))
796 (insert ch)
797 (insert quail-current-str))
798 (setq ch (or ch
799 (aref quail-current-str
800 (1- (length quail-current-str)))))
801 ))
802 ((and viper-special-input-method
803 viper-xemacs-p
804 (fboundp 'quail-start-translation))
805 ;; same as above but for XEmacs, which doesn't have
806 ;; quail-input-method
807 (let (unread-command-events)
808 (setq ch (read-char))
809 (viper-set-unread-command-events ch)
810 (quail-start-translation nil)
811
812 (if (and ch (string= quail-current-str ""))
813 (insert ch)
814 (insert quail-current-str))
815 (setq ch (or ch
816 (aref quail-current-str
817 (1- (length quail-current-str)))))
818 ))
819 ((and (boundp 'iso-accents-mode) iso-accents-mode)
820 (setq ch (aref (read-key-sequence nil) 0))
821 (insert ch))
822 (t
823 (setq ch (read-char))
824 (insert ch))
825 )
826 (setq last-command-event
827 (viper-copy-event (if viper-xemacs-p
828 (character-to-event ch) ch)))
829 ) ; let
830 (error)
831 ) ; condition-case
832
833 (viper-set-input-method nil)
834 (viper-set-iso-accents-mode nil)
835 (viper-set-mode-vars-for viper-current-state)
836 )
837
838
761(defun viper-exec-form-in-vi (form) 839(defun viper-exec-form-in-vi (form)
762 "Execute FORM in Vi state, regardless of the Ccurrent Vi state." 840 "Execute FORM in Vi state, regardless of the Ccurrent Vi state."
763 (let ((buff (current-buffer)) 841 (let ((buff (current-buffer))
@@ -2064,7 +2142,8 @@ problems."
2064 (interactive "P") 2142 (interactive "P")
2065 (viper-set-complex-command-for-undo) 2143 (viper-set-complex-command-for-undo)
2066 (let ((val (viper-p-val arg)) 2144 (let ((val (viper-p-val arg))
2067 (com (viper-getcom arg))) 2145 ;;(com (viper-getcom arg))
2146 )
2068 (viper-set-destructive-command (list 'viper-insert val ?r nil nil nil)) 2147 (viper-set-destructive-command (list 'viper-insert val ?r nil nil nil))
2069 (if (eq viper-intermediate-command 'viper-repeat) 2148 (if (eq viper-intermediate-command 'viper-repeat)
2070 (viper-loop val (viper-yank-last-insertion)) 2149 (viper-loop val (viper-yank-last-insertion))
@@ -2075,7 +2154,8 @@ problems."
2075 (interactive "P") 2154 (interactive "P")
2076 (viper-set-complex-command-for-undo) 2155 (viper-set-complex-command-for-undo)
2077 (let ((val (viper-p-val arg)) 2156 (let ((val (viper-p-val arg))
2078 (com (viper-getcom arg))) 2157 ;;(com (viper-getcom arg))
2158 )
2079 (viper-set-destructive-command (list 'viper-append val ?r nil nil nil)) 2159 (viper-set-destructive-command (list 'viper-append val ?r nil nil nil))
2080 (if (not (eolp)) (forward-char)) 2160 (if (not (eolp)) (forward-char))
2081 (if (eq viper-intermediate-command 'viper-repeat) 2161 (if (eq viper-intermediate-command 'viper-repeat)
@@ -2087,7 +2167,8 @@ problems."
2087 (interactive "P") 2167 (interactive "P")
2088 (viper-set-complex-command-for-undo) 2168 (viper-set-complex-command-for-undo)
2089 (let ((val (viper-p-val arg)) 2169 (let ((val (viper-p-val arg))
2090 (com (viper-getcom arg))) 2170 ;;(com (viper-getcom arg))
2171 )
2091 (viper-set-destructive-command (list 'viper-Append val ?r nil nil nil)) 2172 (viper-set-destructive-command (list 'viper-Append val ?r nil nil nil))
2092 (end-of-line) 2173 (end-of-line)
2093 (if (eq viper-intermediate-command 'viper-repeat) 2174 (if (eq viper-intermediate-command 'viper-repeat)
@@ -2099,7 +2180,8 @@ problems."
2099 (interactive "P") 2180 (interactive "P")
2100 (viper-set-complex-command-for-undo) 2181 (viper-set-complex-command-for-undo)
2101 (let ((val (viper-p-val arg)) 2182 (let ((val (viper-p-val arg))
2102 (com (viper-getcom arg))) 2183 ;;(com (viper-getcom arg))
2184 )
2103 (viper-set-destructive-command (list 'viper-Insert val ?r nil nil nil)) 2185 (viper-set-destructive-command (list 'viper-Insert val ?r nil nil nil))
2104 (back-to-indentation) 2186 (back-to-indentation)
2105 (if (eq viper-intermediate-command 'viper-repeat) 2187 (if (eq viper-intermediate-command 'viper-repeat)
@@ -2111,7 +2193,8 @@ problems."
2111 (interactive "P") 2193 (interactive "P")
2112 (viper-set-complex-command-for-undo) 2194 (viper-set-complex-command-for-undo)
2113 (let ((val (viper-p-val arg)) 2195 (let ((val (viper-p-val arg))
2114 (com (viper-getcom arg))) 2196 ;;(com (viper-getcom arg))
2197 )
2115 (viper-set-destructive-command (list 'viper-open-line val ?r nil nil nil)) 2198 (viper-set-destructive-command (list 'viper-open-line val ?r nil nil nil))
2116 (let ((col (current-indentation))) 2199 (let ((col (current-indentation)))
2117 (if (eq viper-intermediate-command 'viper-repeat) 2200 (if (eq viper-intermediate-command 'viper-repeat)
@@ -2130,7 +2213,8 @@ problems."
2130 (interactive "P") 2213 (interactive "P")
2131 (viper-set-complex-command-for-undo) 2214 (viper-set-complex-command-for-undo)
2132 (let ((val (viper-p-val arg)) 2215 (let ((val (viper-p-val arg))
2133 (com (viper-getcom arg))) 2216 ;;(com (viper-getcom arg))
2217 )
2134 (viper-set-destructive-command (list 'viper-Open-line val ?r nil nil nil)) 2218 (viper-set-destructive-command (list 'viper-Open-line val ?r nil nil nil))
2135 (let ((col (current-indentation))) 2219 (let ((col (current-indentation)))
2136 (if (eq viper-intermediate-command 'viper-repeat) 2220 (if (eq viper-intermediate-command 'viper-repeat)
@@ -2149,7 +2233,8 @@ problems."
2149 (interactive "P") 2233 (interactive "P")
2150 (viper-set-complex-command-for-undo) 2234 (viper-set-complex-command-for-undo)
2151 (let ((val (viper-p-val arg)) 2235 (let ((val (viper-p-val arg))
2152 (com (viper-getcom arg))) 2236 ;;(com (viper-getcom arg))
2237 )
2153 (viper-set-destructive-command 2238 (viper-set-destructive-command
2154 (list 'viper-open-line-at-point val ?r nil nil nil)) 2239 (list 'viper-open-line-at-point val ?r nil nil nil))
2155 (if (eq viper-intermediate-command 'viper-repeat) 2240 (if (eq viper-intermediate-command 'viper-repeat)
@@ -2164,7 +2249,8 @@ problems."
2164 "Substitute characters." 2249 "Substitute characters."
2165 (interactive "P") 2250 (interactive "P")
2166 (let ((val (viper-p-val arg)) 2251 (let ((val (viper-p-val arg))
2167 (com (viper-getcom arg))) 2252 ;;(com (viper-getcom arg))
2253 )
2168 (push-mark nil t) 2254 (push-mark nil t)
2169 (forward-char val) 2255 (forward-char val)
2170 (if (eq viper-intermediate-command 'viper-repeat) 2256 (if (eq viper-intermediate-command 'viper-repeat)
@@ -2389,7 +2475,8 @@ These keys are ESC, RET, and LineFeed"
2389 "Begin overwrite mode." 2475 "Begin overwrite mode."
2390 (interactive "P") 2476 (interactive "P")
2391 (let ((val (viper-p-val arg)) 2477 (let ((val (viper-p-val arg))
2392 (com (viper-getcom arg)) (len)) 2478 ;;(com (viper-getcom arg))
2479 (len))
2393 (viper-set-destructive-command (list 'viper-overwrite val ?r nil nil nil)) 2480 (viper-set-destructive-command (list 'viper-overwrite val ?r nil nil nil))
2394 (if (eq viper-intermediate-command 'viper-repeat) 2481 (if (eq viper-intermediate-command 'viper-repeat)
2395 (progn 2482 (progn
@@ -2461,60 +2548,27 @@ These keys are ESC, RET, and LineFeed"
2461 )) 2548 ))
2462 2549
2463(defun viper-replace-char-subr (com arg) 2550(defun viper-replace-char-subr (com arg)
2464 (let (char) 2551 (let (char inhibit-quit)
2465 (setq char (if (eq viper-intermediate-command 'viper-repeat) 2552 (viper-set-complex-command-for-undo)
2466 viper-d-char 2553 (or (eq viper-intermediate-command 'viper-repeat)
2467 (read-char))) 2554 (viper-special-read-and-insert-char))
2468 (let (inhibit-quit) ; preserve consistency of undo-list and iso-accents 2555
2469 (if (and viper-automatic-iso-accents
2470 (viper-memq-char char '(?' ?\" ?^ ?~)))
2471 ;; get European characters
2472 (progn
2473 (viper-set-iso-accents-mode t)
2474 (viper-set-unread-command-events char)
2475 (setq char (aref (read-key-sequence nil) 0))
2476 (viper-set-iso-accents-mode nil)))
2477 (viper-set-complex-command-for-undo)
2478 (if (eq char ?\C-m) (setq char ?\n)) 2556 (if (eq char ?\C-m) (setq char ?\n))
2479 (if (and viper-special-input-method (fboundp 'quail-start-translation)) 2557
2480 ;; get Intl. characters 2558 (delete-char 1 t)
2481 (progn 2559
2482 (viper-set-input-method t) 2560 (setq char (if com viper-d-char (viper-char-at-pos 'backward)))
2483 (setq last-command-event 2561 (if com (insert char))
2484 (viper-copy-event 2562
2485 (if viper-xemacs-p (character-to-event char) char))) 2563 (setq viper-d-char char)
2486 (delete-char 1 t) 2564
2487 (condition-case nil 2565 (viper-loop (1- (if (> arg 0) arg (- arg)))
2488 (if com 2566 (delete-char 1 t)
2489 (insert char) 2567 (insert char))
2490 (if viper-emacs-p 2568
2491 (quail-start-translation 1)
2492 (quail-start-translation)))
2493 (error))
2494 ;; quail translation failed
2495 (if (and (not (stringp quail-current-str))
2496 (not (viper-characterp quail-current-str)))
2497 (progn
2498 (viper-adjust-undo)
2499 (undo-start)
2500 (undo-more 1)
2501 (viper-set-input-method nil)
2502 (error "Composing character failed, changes undone")))
2503 ;; quail translation seems ok
2504 (or com
2505 ;;(setq char quail-current-str))
2506 (setq char (viper-char-at-pos 'backward)))
2507 (setq viper-d-char char)
2508 (viper-loop (1- (if (> arg 0) arg (- arg)))
2509 (delete-char 1 t)
2510 (insert char))
2511 (viper-set-input-method nil))
2512 (delete-char arg t)
2513 (setq viper-d-char char)
2514 (viper-loop (if (> arg 0) arg (- arg))
2515 (insert char)))
2516 (viper-adjust-undo) 2569 (viper-adjust-undo)
2517 (backward-char arg)))) 2570 (backward-char arg)
2571 ))
2518 2572
2519 2573
2520;; basic cursor movement. j, k, l, h commands. 2574;; basic cursor movement. j, k, l, h commands.
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el
index 398e5a937c6..1ae136a067e 100644
--- a/lisp/emulation/viper-ex.el
+++ b/lisp/emulation/viper-ex.el
@@ -2,6 +2,8 @@
2 2
3;; Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
4 4
5;; Author: Michael Kifer <kifer@cs.sunysb.edu>
6
5;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
6 8
7;; GNU Emacs is free software; you can redistribute it and/or modify 9;; GNU Emacs is free software; you can redistribute it and/or modify
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el
index 0ed9a632473..8f0b99f2972 100644
--- a/lisp/emulation/viper-init.el
+++ b/lisp/emulation/viper-init.el
@@ -2,6 +2,8 @@
2 2
3;; Copyright (C) 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1997 Free Software Foundation, Inc.
4 4
5;; Author: Michael Kifer <kifer@cs.sunysb.edu>
6
5;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
6 8
7;; GNU Emacs is free software; you can redistribute it and/or modify 9;; GNU Emacs is free software; you can redistribute it and/or modify
diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el
index 73155a05798..cad5f34389f 100644
--- a/lisp/emulation/viper-keym.el
+++ b/lisp/emulation/viper-keym.el
@@ -2,6 +2,8 @@
2 2
3;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
4 4
5;; Author: Michael Kifer <kifer@cs.sunysb.edu>
6
5;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
6 8
7;; GNU Emacs is free software; you can redistribute it and/or modify 9;; GNU Emacs is free software; you can redistribute it and/or modify
diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el
index 4eaf843f274..f438dc0613b 100644
--- a/lisp/emulation/viper-macs.el
+++ b/lisp/emulation/viper-macs.el
@@ -2,6 +2,8 @@
2 2
3;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
4 4
5;; Author: Michael Kifer <kifer@cs.sunysb.edu>
6
5;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
6 8
7;; GNU Emacs is free software; you can redistribute it and/or modify 9;; GNU Emacs is free software; you can redistribute it and/or modify
diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el
index b6036656851..cb9ad3ee8d9 100644
--- a/lisp/emulation/viper-mous.el
+++ b/lisp/emulation/viper-mous.el
@@ -2,6 +2,8 @@
2 2
3;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
4 4
5;; Author: Michael Kifer <kifer@cs.sunysb.edu>
6
5;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
6 8
7;; GNU Emacs is free software; you can redistribute it and/or modify 9;; GNU Emacs is free software; you can redistribute it and/or modify
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index f5d4eb355ab..ab63232d849 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -2,6 +2,8 @@
2 2
3;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
4 4
5;; Author: Michael Kifer <kifer@cs.sunysb.edu>
6
5;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
6 8
7;; GNU Emacs is free software; you can redistribute it and/or modify 9;; GNU Emacs is free software; you can redistribute it and/or modify
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index 277ae0c408e..416c6236bef 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -2,13 +2,13 @@
2;; a VI Plan for Emacs Rescue, 2;; a VI Plan for Emacs Rescue,
3;; and a venomous VI PERil. 3;; and a venomous VI PERil.
4;; Viper Is also a Package for Emacs Rebels. 4;; Viper Is also a Package for Emacs Rebels.
5;;
6;; Keywords: emulations
7;; Author: Michael Kifer <kifer@cs.sunysb.edu>
8 5
9;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01 Free Software Foundation, Inc. 6;; Copyright (C) 1994, 95, 96, 97, 98, 99, 2000, 01 Free Software Foundation, Inc.
10 7
11(defconst viper-version "3.11 of July 18, 2001" 8;; Author: Michael Kifer <kifer@cs.sunysb.edu>
9;; Keywords: emulations
10
11(defconst viper-version "3.11.1 of September 9, 2001"
12 "The current version of Viper") 12 "The current version of Viper")
13 13
14;; This file is part of GNU Emacs. 14;; This file is part of GNU Emacs.