aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-12-28 19:31:17 +0000
committerRichard M. Stallman1996-12-28 19:31:17 +0000
commita6dccb5154ff3a536709e540de0dfb8e39e38ef5 (patch)
treea62c98cd51339147261587e66ec35c315736c6fc
parentbf5d92c5e3c9eccf0adbf150c70bc4e656c7aa01 (diff)
downloademacs-a6dccb5154ff3a536709e540de0dfb8e39e38ef5.tar.gz
emacs-a6dccb5154ff3a536709e540de0dfb8e39e38ef5.zip
(skeleton-marks): New variable.
(skeleton-insert, skeleton-internal-1): Set skeleton-marks.
-rw-r--r--lisp/skeleton.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/skeleton.el b/lisp/skeleton.el
index 9a1ec8d16de..d10f2b5a896 100644
--- a/lisp/skeleton.el
+++ b/lisp/skeleton.el
@@ -100,6 +100,11 @@ skeleton elements.")
100(defvar skeleton-debug nil 100(defvar skeleton-debug nil
101 "*If non-nil `define-skeleton' will override previous definition.") 101 "*If non-nil `define-skeleton' will override previous definition.")
102 102
103(defvar skeleton-marks nil
104 "Variable used to keep the list of positions marked with @ after
105skeleton insertion. The list is in the reverse order of the insertion
106order. This list is reseted before skeleton insertion.")
107
103;; reduce the number of compiler warnings 108;; reduce the number of compiler warnings
104(defvar skeleton) 109(defvar skeleton)
105(defvar skeleton-modified) 110(defvar skeleton-modified)
@@ -250,6 +255,7 @@ If ELEMENT is a string or a character it gets inserted (see also
250 \\n go to next line and indent according to mode 255 \\n go to next line and indent according to mode
251 _ interesting point, interregion here, point after termination 256 _ interesting point, interregion here, point after termination
252 > indent line (or interregion if > _) according to major mode 257 > indent line (or interregion if > _) according to major mode
258 @ add position to `skeleton-marks'
253 & do next ELEMENT if previous moved point 259 & do next ELEMENT if previous moved point
254 | do next ELEMENT if previous didn't move point 260 | do next ELEMENT if previous didn't move point
255 -num delete num preceding characters (see `skeleton-untabify') 261 -num delete num preceding characters (see `skeleton-untabify')
@@ -299,6 +305,7 @@ When done with skeleton, but before going back to `_'-point call
299 (setq skeleton-regions (cdr skeleton-regions))) 305 (setq skeleton-regions (cdr skeleton-regions)))
300 (let ((beg (point)) 306 (let ((beg (point))
301 skeleton-modified skeleton-point resume: help input v1 v2) 307 skeleton-modified skeleton-point resume: help input v1 v2)
308 (setq skeleton-marks nil)
302 (unwind-protect 309 (unwind-protect
303 (eval `(let ,skeleton-further-elements 310 (eval `(let ,skeleton-further-elements
304 (skeleton-internal-list skeleton str))) 311 (skeleton-internal-list skeleton str)))
@@ -431,6 +438,8 @@ automatically, and you are prompted to fill in the variable parts.")))
431 ((eq element '|) 438 ((eq element '|)
432 (or skeleton-modified 439 (or skeleton-modified
433 (setq skeleton (cdr skeleton)))) 440 (setq skeleton (cdr skeleton))))
441 ((eq element '@)
442 (setq skeleton-marks (cons (point) skeleton-marks)))
434 ((eq 'quote (car-safe element)) 443 ((eq 'quote (car-safe element))
435 (eval (nth 1 element))) 444 (eval (nth 1 element)))
436 ((or (stringp (car-safe element)) 445 ((or (stringp (car-safe element))