;;; viper-macs.el --- functions implementing keyboard macros for Viper
-;; Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1997, 2000-2015 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
;; Package: viper
(defvar viper-custom-file-name)
(defvar viper-current-state)
(defvar viper-fast-keyseq-timeout)
-
-;; loading happens only in non-interactive compilation
-;; in order to spare non-viperized emacs from being viperized
-(if noninteractive
- (eval-when-compile
- (require 'viper-cmd)
- ))
+(require 'viper-mous)
+(require 'viper-ex)
;; end pacifier
(require 'viper-util)
\f
;;; Code
+(declare-function viper-change-state-to-insert "viper-cmd" ())
+
;; Ex map command
(defun ex-map ()
(let ((mod-char "")
))
+(declare-function viper-change-state-to-vi "viper-cmd" ())
+
;; Terminate a Vi kbd macro.
;; optional argument IGNORE, if t, indicates that we are dealing with an
;; existing macro that needs to be registered, but there is no need to
;; Accepts as macro names: strings and vectors.
;; strings must be strings of characters; vectors must be vectors of keys
-;; in canonic form. The canonic form is essentially the form used in XEmacs
+;; in canonical form, which is essentially the form used in XEmacs.
;; More general definitions are inherited by more specific scopes:
;; global->major mode->buffer. More specific definitions override more general
(defun viper-record-kbd-macro (macro-name state macro-body &optional scope)
- "Record a Vi macro. Can be used in `.viper' file to define permanent macros.
+ "Record a Vi macro.
+Can be used in `viper-custom-file-name' to define permanent macros.
MACRO-NAME is a string of characters or a vector of keys. STATE is
either `vi-state' or `insert-state'. It specifies the Viper state in which to
define the macro. MACRO-BODY is a string that represents the keyboard macro.
(error "Can't map an empty macro name"))
;; Macro-name is usually a vector. However, command history or macros
- ;; recorded in ~/.viper may be recorded as strings. So, convert to
- ;; vectors.
+ ;; recorded in viper-custom-file-name may be recorded as strings.
+ ;; So, convert to vectors.
(setq macro-name (viper-fixup-macro macro-name))
(if (viper-char-array-p macro-name)
(setq macro-name (viper-char-array-to-macro macro-name)))
;; if we don't let vector macro-body through %S,
;; the symbols `\.' `\[' etc will be converted into
;; characters, causing invalid read error on recorded
- ;; macros in .viper.
+ ;; macros in viper-custom-file-name.
;; I am not sure is macro-body can still be a string at
;; this point, but I am preserving this option anyway.
(if (vectorp macro-body)
;; in effect
(defun viper-unrecord-kbd-macro (macro-name state)
"Delete macro MACRO-NAME from Viper STATE.
-MACRO-NAME must be a vector of viper-style keys. This command is used by Viper
-internally, but the user can also use it in ~/.viper to delete pre-defined
-macros supplied with Viper. The best way to avoid mistakes in macro names to
-be passed to this function is to use viper-describe-kbd-macros and copy the
-name from there."
+MACRO-NAME must be a vector of viper-style keys. This command is used
+by Viper internally, but you can also use it in `viper-custom-file-name'
+to delete pre-defined macros supplied with Viper. The best way to avoid
+mistakes in macro names to be passed to this function is to use
+`viper-describe-kbd-macros' and copy the name from there."
(let* (state-name keymap
(macro-alist-var
(cond ((eq state 'vi-state)
macro-pair macro-entry)
;; Macro-name is usually a vector. However, command history or macros
- ;; recorded in ~/.viper may appear as strings. So, convert to vectors.
+ ;; recorded in viper-custom-file-name may appear as strings.
+ ;; So, convert to vectors.
(setq macro-name (viper-fixup-macro macro-name))
(if (viper-char-array-p macro-name)
(setq macro-name (viper-char-array-to-macro macro-name)))
(defun viper-global-execute ()
- "Call last keyboad macro for each line in the region."
+ "Call last keyboard macro for each line in the region."
(if (> (point) (mark t)) (exchange-point-and-mark))
(beginning-of-line)
(call-last-kbd-macro)
(call-last-kbd-macro)))
-;; arch-tag: ecd3cc5c-8cd0-4bbe-b2ec-7e75a4b7d0aa
;;; viper-macs.el ends here