comparison lisp/skeleton.el @ 49299:c7f492d5cd47

(skeleton-internal-list, skeleton-internal-1): Don't treat \n specially in sub-skeletons.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 17 Jan 2003 20:35:48 +0000
parents 984caedead68
children 7d308602f619 d7ddb3e565de
comparison
equal deleted inserted replaced
49298:bb7bf9ff7c97 49299:c7f492d5cd47
379 (column (current-column)) 379 (column (current-column))
380 (line (buffer-substring start (line-end-position))) 380 (line (buffer-substring start (line-end-position)))
381 opoint) 381 opoint)
382 (or str 382 (or str
383 (setq str `(setq str (skeleton-read ',(car skeleton) nil ,recursive)))) 383 (setq str `(setq str (skeleton-read ',(car skeleton) nil ,recursive))))
384 (when (and (eq (cadr skeleton) '\n) 384 (when (and (eq (cadr skeleton) '\n) (not recursive)
385 (save-excursion (skip-chars-backward " \t") (bolp))) 385 (save-excursion (skip-chars-backward " \t") (bolp)))
386 (setq skeleton (cons nil (cons '> (cddr skeleton))))) 386 (setq skeleton (cons nil (cons '> (cddr skeleton)))))
387 (while (setq skeleton-modified (eq opoint (point)) 387 (while (setq skeleton-modified (eq opoint (point))
388 opoint (point) 388 opoint (point)
389 skeleton (cdr skeleton)) 389 skeleton (cdr skeleton))
430 (or (eolp) (newline)) 430 (or (eolp) (newline))
431 (if pos (save-excursion (goto-char pos) (indent-according-to-mode))) 431 (if pos (save-excursion (goto-char pos) (indent-according-to-mode)))
432 (indent-region (line-beginning-position) 432 (indent-region (line-beginning-position)
433 (car skeleton-regions) nil)) 433 (car skeleton-regions) nil))
434 ;; \n as last element only inserts \n if not at eol. 434 ;; \n as last element only inserts \n if not at eol.
435 ((and (null (cdr skeleton)) (eolp)) 435 ((and (null (cdr skeleton)) (not recursive) (eolp))
436 (if pos (indent-according-to-mode))) 436 (if pos (indent-according-to-mode)))
437 (skeleton-newline-indent-rigidly 437 (skeleton-newline-indent-rigidly
438 (let ((pt (point))) 438 (let ((pt (point)))
439 (newline) 439 (newline)
440 (indent-to (save-excursion 440 (indent-to (save-excursion