# HG changeset patch # User Roland Winkler # Date 1148248910 0 # Node ID fb7431719e32a5b622336e99219f24c2a9b12b20 # Parent d0c27da524018c4a79a7cf895dc5c3a7aa07e11f (skeleton-transformation, skeleton-filter, skeleton-pair-filter): Make these the aliases for the following variables. (skeleton-transformation-function, skeleton-filter-function) (skeleton-pair-filter-function): Make these the real names. diff -r d0c27da52401 -r fb7431719e32 lisp/skeleton.el --- a/lisp/skeleton.el Sun May 21 21:51:17 2006 +0000 +++ b/lisp/skeleton.el Sun May 21 22:01:50 2006 +0000 @@ -39,14 +39,15 @@ ;; page 3: mirror-mode, an example for setting up paired insertion -(defvar skeleton-transformation 'identity +(defvar skeleton-transformation-function 'identity "*If non-nil, function applied to literal strings before they are inserted. It should take strings and characters and return them transformed, or nil which means no transformation. Typical examples might be `upcase' or `capitalize'.") +(defvaralias 'skeleton-transformation 'skeleton-transformation-function) ; this should be a fourth argument to defvar -(put 'skeleton-transformation 'variable-interactive +(put 'skeleton-transformation-function 'variable-interactive "aTransformation function: ") @@ -75,8 +76,9 @@ ;;;###autoload -(defvar skeleton-filter 'identity +(defvar skeleton-filter-function 'identity "Function for transforming a skeleton proxy's aliases' variable value.") +(defvaralias 'skeleton-filter 'skeleton-filter-function) (defvar skeleton-untabify t "When non-nil untabifies when deleting backwards with element -ARG.") @@ -157,7 +159,7 @@ Optional second argument STR may also be a string which will be the value of `str' whereas the skeleton's interactor is then ignored." - (skeleton-insert (funcall skeleton-filter skeleton) + (skeleton-insert (funcall skeleton-filter-function skeleton) ;; Pretend C-x a e passed its prefix arg to us (if (or arg current-prefix-arg) (prefix-numeric-value (or arg @@ -199,7 +201,7 @@ not needed, a prompt-string or an expression for complex read functions. If ELEMENT is a string or a character it gets inserted (see also -`skeleton-transformation'). Other possibilities are: +`skeleton-transformation-function'). Other possibilities are: \\n go to next line and indent according to mode _ interesting point, interregion here @@ -360,7 +362,7 @@ (backward-delete-char-untabify (- element)) (delete-backward-char (- element))) (insert (if (not literal) - (funcall skeleton-transformation element) + (funcall skeleton-transformation-function element) element)))) ((or (eq element '\n) ; actually (eq '\n 'n) ;; The sequence `> \n' is handled specially so as to indent the first @@ -464,7 +466,7 @@ "*If this is nil, paired insertion is inhibited before or inside a word.") -(defvar skeleton-pair-filter (lambda () nil) +(defvar skeleton-pair-filter-function (lambda () nil) "Attempt paired insertion if this function returns nil, before inserting. This allows for context-sensitive checking whether pairing is appropriate.") @@ -490,7 +492,7 @@ With no ARG, if `skeleton-pair' is non-nil, pairing can occur. If the region is visible the pair is wrapped around it depending on `skeleton-autowrap'. Else, if `skeleton-pair-on-word' is non-nil or we are not before or inside a -word, and if `skeleton-pair-filter' returns nil, pairing is performed. +word, and if `skeleton-pair-filter-function' returns nil, pairing is performed. Pairing is also prohibited if we are right after a quoting character such as backslash. @@ -512,7 +514,7 @@ (and (not mark) (or overwrite-mode (if (not skeleton-pair-on-word) (looking-at "\\w")) - (funcall skeleton-pair-filter)))) + (funcall skeleton-pair-filter-function)))) (self-insert-command (prefix-numeric-value arg)) (skeleton-insert (cons nil skeleton) (if mark -1)))))) @@ -526,13 +528,13 @@ ;; (kill-all-local-variables) ;; (make-local-variable 'skeleton-pair) ;; (make-local-variable 'skeleton-pair-on-word) -;; (make-local-variable 'skeleton-pair-filter) +;; (make-local-variable 'skeleton-pair-filter-function) ;; (make-local-variable 'skeleton-pair-alist) ;; (setq major-mode 'mirror-mode ;; mode-name "Mirror" ;; skeleton-pair-on-word t ;; ;; in the middle column insert one or none if odd window-width -;; skeleton-pair-filter (lambda () +;; skeleton-pair-filter-function (lambda () ;; (if (>= (current-column) ;; (/ (window-width) 2)) ;; ;; insert both on next line