summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-12-28 19:31:17 +0000
committerRichard M. Stallman <rms@gnu.org>1996-12-28 19:31:17 +0000
commit1f40609995c85aea878a6382486c42814e5e86bb (patch)
treecdd66c32a6c40d6b0f2ed51cf04e0419afb4869e
parentea5118bc900e4a3ee1b7ef4eb1277fdddfb7a14c (diff)
downloademacs-1f40609995c85aea878a6382486c42814e5e86bb.tar.gz
(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.")
(defvar skeleton-debug nil
"*If non-nil `define-skeleton' will override previous definition.")
+(defvar skeleton-marks nil
+ "Variable used to keep the list of positions marked with @ after
+skeleton insertion. The list is in the reverse order of the insertion
+order. This list is reseted before skeleton insertion.")
+
;; reduce the number of compiler warnings
(defvar skeleton)
(defvar skeleton-modified)
@@ -250,6 +255,7 @@ If ELEMENT is a string or a character it gets inserted (see also
\\n go to next line and indent according to mode
_ interesting point, interregion here, point after termination
> indent line (or interregion if > _) according to major mode
+ @ add position to `skeleton-marks'
& do next ELEMENT if previous moved point
| do next ELEMENT if previous didn't move point
-num delete num preceding characters (see `skeleton-untabify')
@@ -299,6 +305,7 @@ When done with skeleton, but before going back to `_'-point call
(setq skeleton-regions (cdr skeleton-regions)))
(let ((beg (point))
skeleton-modified skeleton-point resume: help input v1 v2)
+ (setq skeleton-marks nil)
(unwind-protect
(eval `(let ,skeleton-further-elements
(skeleton-internal-list skeleton str)))
@@ -431,6 +438,8 @@ automatically, and you are prompted to fill in the variable parts.")))
((eq element '|)
(or skeleton-modified
(setq skeleton (cdr skeleton))))
+ ((eq element '@)
+ (setq skeleton-marks (cons (point) skeleton-marks)))
((eq 'quote (car-safe element))
(eval (nth 1 element)))
((or (stringp (car-safe element))