]> code.delx.au - gnu-emacs/blobdiff - lisp/emulation/viper-cmd.el
Pass lambdas to `skeleton-read'
[gnu-emacs] / lisp / emulation / viper-cmd.el
index c39d896f3d3f2e2787f92b7676d277b049336edc..5e1620df57ce455f89fb291c97a03150568a5e4a 100644 (file)
@@ -1,6 +1,6 @@
 ;;; viper-cmd.el --- Vi command support for Viper
 
-;; Copyright (C) 1997-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2015 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: viper
@@ -961,11 +961,11 @@ Suffixes such as .el or .elc should be stripped."
 (defun viper-ESC (arg)
   "Emulate ESC key in Emacs.
 Prevents multiple escape keystrokes if viper-no-multiple-ESC is true.
-If viper-no-multiple-ESC is 'twice double ESC would ding in vi-state.
+If `viper-no-multiple-ESC' is `twice' double ESC would ding in vi-state.
 Other ESC sequences are emulated via the current Emacs's major mode
 keymap.  This is more convenient on TTYs, since this won't block
 function keys such as up, down, etc.  ESC will also will also work as
-a Meta key in this case.  When viper-no-multiple-ESC is nil, ESC works
+a Meta key in this case.  When `viper-no-multiple-ESC' is nil, ESC works
 as a Meta key and any number of multiple escapes are allowed."
   (interactive "P")
   (let (char)
@@ -1896,7 +1896,7 @@ Undo previous insertion and inserts new."
 ;; Quote region by each line with a user supplied string.
 (defun viper-quote-region ()
   (let ((quote-str viper-quote-string)
-       (donot-change-default t))
+       (do-not-change-default t))
     (setq quote-str
          (viper-read-string-with-history
           "Quote string: "
@@ -1908,9 +1908,9 @@ Undo previous insertion and inserts new."
                 ((string-match "lisp.*-mode" (symbol-name major-mode)) ";;")
                 ((memq major-mode '(c-mode cc-mode c++-mode)) "//")
                 ((memq major-mode '(sh-mode shell-mode)) "#")
-                (t (setq donot-change-default nil)
+                (t (setq do-not-change-default nil)
                    quote-str))))
-    (or donot-change-default
+    (or do-not-change-default
        (setq viper-quote-string quote-str))
     (viper-enlarge-region (point) (mark t))
     (if (> (point) (mark t)) (exchange-point-and-mark))
@@ -4400,7 +4400,7 @@ and regexp replace."
 ;; etc.
 (defun viper-cycle-through-mark-ring ()
   "Visit previous locations on the mark ring.
-One can use `` and '' to temporarily jump 1 step back."
+One can use \\=`\\=` and '' to temporarily jump 1 step back."
   (let* ((sv-pt (point)))
        ;; if repeated `m,' command, pop the previously saved mark.
        ;; Prev saved mark is actually prev saved point.  It is used if the
@@ -4533,7 +4533,7 @@ One can use `` and '' to temporarily jump 1 step back."
   (interactive)
   (if viper-cted
       (let ((p (point)) (c (current-column)) bol (indent t))
-       (if (looking-back "[0^]")
+       (if (looking-back "[0^]" (1- (point)))
            (progn
              (if (eq ?^ (preceding-char))
                  (setq viper-preserve-indent t))
@@ -4545,7 +4545,7 @@ One can use `` and '' to temporarily jump 1 step back."
        (delete-region (point) p)
        (if indent
            (indent-to (- c viper-shift-width)))
-       (if (or (bolp) (looking-back "[^ \t]"))
+       (if (or (bolp) (looking-back "[^ \t]" (1- (point))))
            (setq viper-cted nil)))))
 
 ;; do smart indent
@@ -4831,6 +4831,7 @@ Please, specify your level now: ")
   (beep 1))
 
 
+;; FIXME Use register-read-with-preview?
 ;; if ENFORCE-BUFFER is not nil, error if CHAR is a marker in another buffer
 (defun viper-register-to-point (char &optional enforce-buffer)
   "Like `jump-to-register', but switches to another buffer in another window."