diff options
| author | Leo Liu | 2014-06-26 22:21:46 +0800 |
|---|---|---|
| committer | Leo Liu | 2014-06-26 22:21:46 +0800 |
| commit | 2454874eb232ecc968c973843294ed676a04dc2b (patch) | |
| tree | 1c2a1a943da0557c4877522a62366eecda021265 | |
| parent | dceff1c15aad83623d773ab6bea70be229372584 (diff) | |
| download | emacs-2454874eb232ecc968c973843294ed676a04dc2b.tar.gz emacs-2454874eb232ecc968c973843294ed676a04dc2b.zip | |
* skeleton.el (skeleton-end-hook): Default to nil and move the
work to skeleton-insert.
Fixes: debbugs:17850
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/skeleton.el | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8ff7e5247e6..f93b1ad8793 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-06-26 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * skeleton.el (skeleton-end-hook): Default to nil and move the | ||
| 4 | work to skeleton-insert. (Bug#17850) | ||
| 5 | |||
| 1 | 2014-06-26 Dmitry Antipov <dmantipov@yandex.ru> | 6 | 2014-06-26 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 7 | ||
| 3 | * calc/calc-alg.el (math-beforep): | 8 | * calc/calc-alg.el (math-beforep): |
diff --git a/lisp/skeleton.el b/lisp/skeleton.el index bb019db502c..1c6128a33a5 100644 --- a/lisp/skeleton.el +++ b/lisp/skeleton.el | |||
| @@ -62,12 +62,8 @@ region.") | |||
| 62 | "If non-nil, make sure that the skeleton inserted ends with a newline. | 62 | "If non-nil, make sure that the skeleton inserted ends with a newline. |
| 63 | This just influences the way the default `skeleton-end-hook' behaves.") | 63 | This just influences the way the default `skeleton-end-hook' behaves.") |
| 64 | 64 | ||
| 65 | (defvar skeleton-end-hook | 65 | (defvar skeleton-end-hook nil |
| 66 | (lambda () | ||
| 67 | (or (eolp) (not skeleton-end-newline) (newline-and-indent))) | ||
| 68 | "Hook called at end of skeleton but before going to point of interest. | 66 | "Hook called at end of skeleton but before going to point of interest. |
| 69 | By default this moves out anything following to next line, | ||
| 70 | unless `skeleton-end-newline' is set to nil. | ||
| 71 | The variables `v1' and `v2' are still set when calling this.") | 67 | The variables `v1' and `v2' are still set when calling this.") |
| 72 | 68 | ||
| 73 | 69 | ||
| @@ -268,6 +264,7 @@ When done with skeleton, but before going back to `_'-point call | |||
| 268 | (mapcar #'car skeleton-further-elements) | 264 | (mapcar #'car skeleton-further-elements) |
| 269 | (mapcar (lambda (x) (eval (cadr x))) skeleton-further-elements) | 265 | (mapcar (lambda (x) (eval (cadr x))) skeleton-further-elements) |
| 270 | (skeleton-internal-list skeleton str)) | 266 | (skeleton-internal-list skeleton str)) |
| 267 | (or (eolp) (not skeleton-end-newline) (newline-and-indent)) | ||
| 271 | (run-hooks 'skeleton-end-hook) | 268 | (run-hooks 'skeleton-end-hook) |
| 272 | (sit-for 0) | 269 | (sit-for 0) |
| 273 | (or (pos-visible-in-window-p beg) | 270 | (or (pos-visible-in-window-p beg) |