]> git.eshelyaron.com Git - emacs.git/commitdiff
* skeleton.el (skeleton-end-hook): Default to nil and move the
authorLeo Liu <sdl.web@gmail.com>
Thu, 26 Jun 2014 14:21:46 +0000 (22:21 +0800)
committerLeo Liu <sdl.web@gmail.com>
Thu, 26 Jun 2014 14:21:46 +0000 (22:21 +0800)
work to skeleton-insert.

Fixes: debbugs:17850
lisp/ChangeLog
lisp/skeleton.el

index 8ff7e5247e68891ffcd0cbbec733eddf510a1988..f93b1ad8793594d8461c1724693b1ac148154d68 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-26  Leo Liu  <sdl.web@gmail.com>
+
+       * skeleton.el (skeleton-end-hook): Default to nil and move the
+       work to skeleton-insert.  (Bug#17850)
+
 2014-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
 
        * calc/calc-alg.el (math-beforep):
index bb019db502c3655398b88b04a652d513d4de9f29..1c6128a33a5fc1a42834296bf908c5a57476d4be 100644 (file)
@@ -62,12 +62,8 @@ region.")
   "If non-nil, make sure that the skeleton inserted ends with a newline.
 This just influences the way the default `skeleton-end-hook' behaves.")
 
-(defvar skeleton-end-hook
-  (lambda ()
-    (or (eolp) (not skeleton-end-newline) (newline-and-indent)))
+(defvar skeleton-end-hook nil
   "Hook called at end of skeleton but before going to point of interest.
-By default this moves out anything following to next line,
-  unless `skeleton-end-newline' is set to nil.
 The variables `v1' and `v2' are still set when calling this.")
 
 
@@ -268,6 +264,7 @@ When done with skeleton, but before going back to `_'-point call
               (mapcar #'car skeleton-further-elements)
               (mapcar (lambda (x) (eval (cadr x))) skeleton-further-elements)
             (skeleton-internal-list skeleton str))
+       (or (eolp) (not skeleton-end-newline) (newline-and-indent))
        (run-hooks 'skeleton-end-hook)
        (sit-for 0)
        (or (pos-visible-in-window-p beg)