comparison lisp/emulation/viper-cmd.el @ 19203:58c50205001d

new version
author Michael Kifer <kifer@cs.stonybrook.edu>
date Thu, 07 Aug 1997 04:48:48 +0000
parents dfbef8117c6a
children a3240ad2e954
comparison
equal deleted inserted replaced
19202:e32501a34d5c 19203:58c50205001d
360 (cons 'viper-vi-local-user-minor-mode viper-vi-local-user-map) 360 (cons 'viper-vi-local-user-minor-mode viper-vi-local-user-map)
361 (cons 'viper-vi-kbd-minor-mode viper-vi-kbd-map) 361 (cons 'viper-vi-kbd-minor-mode viper-vi-kbd-map)
362 (cons 'viper-vi-global-user-minor-mode viper-vi-global-user-map) 362 (cons 'viper-vi-global-user-minor-mode viper-vi-global-user-map)
363 (cons 'viper-vi-state-modifier-minor-mode 363 (cons 'viper-vi-state-modifier-minor-mode
364 (if (keymapp 364 (if (keymapp
365 (cdr (assoc major-mode viper-vi-state-modifier-alist))) 365 (cdr (assoc major-mode
366 viper-vi-state-modifier-alist)))
366 (cdr (assoc major-mode viper-vi-state-modifier-alist)) 367 (cdr (assoc major-mode viper-vi-state-modifier-alist))
367 viper-empty-keymap)) 368 viper-empty-keymap))
368 (cons 'viper-vi-diehard-minor-mode viper-vi-diehard-map) 369 (cons 'viper-vi-diehard-minor-mode viper-vi-diehard-map)
369 (cons 'viper-vi-basic-minor-mode viper-vi-basic-map) 370 (cons 'viper-vi-basic-minor-mode viper-vi-basic-map)
370 (cons 'viper-insert-intercept-minor-mode viper-insert-intercept-map) 371 (cons 'viper-insert-intercept-minor-mode
372 viper-insert-intercept-map)
371 (cons 'viper-replace-minor-mode viper-replace-map) 373 (cons 'viper-replace-minor-mode viper-replace-map)
372 ;; viper-insert-minibuffer-minor-mode must come after 374 ;; viper-insert-minibuffer-minor-mode must come after
373 ;; viper-replace-minor-mode 375 ;; viper-replace-minor-mode
374 (cons 'viper-insert-minibuffer-minor-mode 376 (cons 'viper-insert-minibuffer-minor-mode
375 viper-minibuffer-map) 377 viper-minibuffer-map)
378 (cons 'viper-insert-kbd-minor-mode viper-insert-kbd-map) 380 (cons 'viper-insert-kbd-minor-mode viper-insert-kbd-map)
379 (cons 'viper-insert-global-user-minor-mode 381 (cons 'viper-insert-global-user-minor-mode
380 viper-insert-global-user-map) 382 viper-insert-global-user-map)
381 (cons 'viper-insert-state-modifier-minor-mode 383 (cons 'viper-insert-state-modifier-minor-mode
382 (if (keymapp 384 (if (keymapp
383 (cdr 385 (cdr (assoc major-mode
384 (assoc major-mode viper-insert-state-modifier-alist))) 386 viper-insert-state-modifier-alist)))
385 (cdr 387 (cdr (assoc major-mode
386 (assoc major-mode viper-insert-state-modifier-alist)) 388 viper-insert-state-modifier-alist))
387 viper-empty-keymap)) 389 viper-empty-keymap))
388 (cons 'viper-insert-diehard-minor-mode viper-insert-diehard-map) 390 (cons 'viper-insert-diehard-minor-mode viper-insert-diehard-map)
389 (cons 'viper-insert-basic-minor-mode viper-insert-basic-map) 391 (cons 'viper-insert-basic-minor-mode viper-insert-basic-map)
390 (cons 'viper-emacs-intercept-minor-mode 392 (cons 'viper-emacs-intercept-minor-mode
391 viper-emacs-intercept-map) 393 viper-emacs-intercept-map)
572 (error 574 (error
573 (viper-message-conditions conds)))) 575 (viper-message-conditions conds))))
574 576
575 (defsubst viper-downgrade-to-insert () 577 (defsubst viper-downgrade-to-insert ()
576 (setq viper-current-state 'insert-state 578 (setq viper-current-state 'insert-state
577 viper-replace-minor-mode nil) 579 viper-replace-minor-mode nil))
578 )
579 580
580 581
581 582
582 ;; Change to replace state. When the end of replacement region is reached, 583 ;; Change to replace state. When the end of replacement region is reached,
583 ;; replace state changes to insert state. 584 ;; replace state changes to insert state.
3574 (if (and viper-smart-suffix-list (string-match "\\.$" file)) 3575 (if (and viper-smart-suffix-list (string-match "\\.$" file))
3575 (progn 3576 (progn
3576 (while (and (not found) (< count len)) 3577 (while (and (not found) (< count len))
3577 (setq suff (nth count viper-smart-suffix-list) 3578 (setq suff (nth count viper-smart-suffix-list)
3578 count (1+ count)) 3579 count (1+ count))
3579 (if (file-exists-p (format "%s%s" file suff)) 3580 (if (file-exists-p
3581 (format "%s%s" (substitute-in-file-name file) suff))
3580 (progn 3582 (progn
3581 (setq found t) 3583 (setq found t)
3582 (insert suff)))) 3584 (insert suff))))
3583 3585
3584 (if found 3586 (if found
3833 ;; protect against error while inserting "@" and other disasters 3835 ;; protect against error while inserting "@" and other disasters
3834 ;; (e.g., read-only buff) 3836 ;; (e.g., read-only buff)
3835 (condition-case conds 3837 (condition-case conds
3836 (if (or viper-allow-multiline-replace-regions 3838 (if (or viper-allow-multiline-replace-regions
3837 (viper-same-line (viper-replace-start) 3839 (viper-same-line (viper-replace-start)
3838 (viper-replace-end))) 3840 (viper-replace-end)))
3839 (progn 3841 (progn
3840 ;; tabs cause problems in replace, so untabify 3842 ;; tabs cause problems in replace, so untabify
3841 (goto-char (viper-replace-end)) 3843 (goto-char (viper-replace-end))
3842 (insert-before-markers "@") ; put placeholder after the TAB 3844 (insert-before-markers "@") ; put placeholder after the TAB
3843 (untabify (viper-replace-start) (point)) 3845 (untabify (viper-replace-start) (point))