diff options
| author | Juanma Barranquero | 2003-05-18 23:58:08 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2003-05-18 23:58:08 +0000 |
| commit | b7d059497737512bb0598eb71b8b7f7e48d360fc (patch) | |
| tree | 645a18bb59aed0c5e1cbe1a987ab2629148f30ff | |
| parent | 30dc0b2266e9a1a4421d894b399b1a95881d9e61 (diff) | |
| download | emacs-b7d059497737512bb0598eb71b8b7f7e48d360fc.tar.gz emacs-b7d059497737512bb0598eb71b8b7f7e48d360fc.zip | |
(skeleton-internal-1): Allow - as alternate interesting point marker and revert
@ to just setting skeleton-positions.
| -rw-r--r-- | lisp/skeleton.el | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/lisp/skeleton.el b/lisp/skeleton.el index 2e4995ee879..17acbbe4f20 100644 --- a/lisp/skeleton.el +++ b/lisp/skeleton.el | |||
| @@ -262,6 +262,8 @@ If ELEMENT is a string or a character it gets inserted (see also | |||
| 262 | 262 | ||
| 263 | \\n go to next line and indent according to mode | 263 | \\n go to next line and indent according to mode |
| 264 | _ interesting point, interregion here | 264 | _ interesting point, interregion here |
| 265 | - interesting point, no interregion interaction, overrides | ||
| 266 | interesting point set by _ | ||
| 265 | > indent line (or interregion if > _) according to major mode | 267 | > indent line (or interregion if > _) according to major mode |
| 266 | @ add position to `skeleton-positions' | 268 | @ add position to `skeleton-positions' |
| 267 | & do next ELEMENT iff previous moved point | 269 | & do next ELEMENT iff previous moved point |
| @@ -270,8 +272,8 @@ If ELEMENT is a string or a character it gets inserted (see also | |||
| 270 | resume: skipped, continue here if quit is signaled | 272 | resume: skipped, continue here if quit is signaled |
| 271 | nil skipped | 273 | nil skipped |
| 272 | 274 | ||
| 273 | After termination, point will be positioned at the first occurrence | 275 | After termination, point will be positioned at the last occurrence of - |
| 274 | of _ or @ or at the end of the inserted text. | 276 | or at the first occurrence of _ or at the end of the inserted text. |
| 275 | 277 | ||
| 276 | Further elements can be defined via `skeleton-further-elements'. ELEMENT may | 278 | Further elements can be defined via `skeleton-further-elements'. ELEMENT may |
| 277 | itself be a SKELETON with an INTERACTOR. The user is prompted repeatedly for | 279 | itself be a SKELETON with an INTERACTOR. The user is prompted repeatedly for |
| @@ -455,19 +457,20 @@ automatically, and you are prompted to fill in the variable parts."))) | |||
| 455 | (goto-char (pop skeleton-regions)) | 457 | (goto-char (pop skeleton-regions)) |
| 456 | (and (<= (current-column) (current-indentation)) | 458 | (and (<= (current-column) (current-indentation)) |
| 457 | (eq (nth 1 skeleton) '\n) | 459 | (eq (nth 1 skeleton) '\n) |
| 458 | (end-of-line 0))) | 460 | (end-of-line 0))) |
| 459 | (or skeleton-point | 461 | (or skeleton-point |
| 460 | (setq skeleton-point (point))))) | 462 | (setq skeleton-point (point))))) |
| 463 | ((eq element '-) | ||
| 464 | (setq skeleton-point (point))) | ||
| 461 | ((eq element '&) | 465 | ((eq element '&) |
| 462 | (when skeleton-modified (pop skeleton))) | 466 | (when skeleton-modified (pop skeleton))) |
| 463 | ((eq element '|) | 467 | ((eq element '|) |
| 464 | (unless skeleton-modified (pop skeleton))) | 468 | (unless skeleton-modified (pop skeleton))) |
| 465 | ((eq element '@) | 469 | ((eq element '@) |
| 466 | (push (point) skeleton-positions) | 470 | (push (point) skeleton-positions)) |
| 467 | (unless skeleton-point (setq skeleton-point (point)))) | 471 | ((eq 'quote (car-safe element)) |
| 468 | ((eq 'quote (car-safe element)) | 472 | (eval (nth 1 element))) |
| 469 | (eval (nth 1 element))) | 473 | ((or (stringp (car-safe element)) |
| 470 | ((or (stringp (car-safe element)) | ||
| 471 | (consp (car-safe element))) | 474 | (consp (car-safe element))) |
| 472 | (if (symbolp (car-safe (car element))) | 475 | (if (symbolp (car-safe (car element))) |
| 473 | (while (skeleton-internal-list element nil t)) | 476 | (while (skeleton-internal-list element nil t)) |