unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17850: 24.3.91; skeleton-end-hook non-nil default value
@ 2014-06-26  3:24 Leo Liu
  2014-06-26  3:41 ` Leo Liu
  0 siblings, 1 reply; 6+ messages in thread
From: Leo Liu @ 2014-06-26  3:24 UTC (permalink / raw)
  To: 17850


This hook variable has non-nil default which means if someone
accidentally sets it before loading skeleton.el it can have ill effects.

Leo





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#17850: 24.3.91; skeleton-end-hook non-nil default value
  2014-06-26  3:24 bug#17850: 24.3.91; skeleton-end-hook non-nil default value Leo Liu
@ 2014-06-26  3:41 ` Leo Liu
  2014-06-26 13:31   ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Leo Liu @ 2014-06-26  3:41 UTC (permalink / raw)
  To: 17850

Patch:

=== modified file 'lisp/skeleton.el'
--- lisp/skeleton.el	2014-06-24 07:15:26 +0000
+++ lisp/skeleton.el	2014-06-26 03:40:29 +0000
@@ -62,12 +62,8 @@
   "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 @@
               (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)





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#17850: 24.3.91; skeleton-end-hook non-nil default value
  2014-06-26  3:41 ` Leo Liu
@ 2014-06-26 13:31   ` Stefan Monnier
  2014-06-26 14:23     ` Leo Liu
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2014-06-26 13:31 UTC (permalink / raw)
  To: Leo Liu; +Cc: 17850

> -(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 @@
>                (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)

Obviously NAK for 24.3.91, but I'm fine with that in trunk.


        Stefan





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#17850: 24.3.91; skeleton-end-hook non-nil default value
  2014-06-26 13:31   ` Stefan Monnier
@ 2014-06-26 14:23     ` Leo Liu
  2014-06-26 15:43       ` Glenn Morris
  0 siblings, 1 reply; 6+ messages in thread
From: Leo Liu @ 2014-06-26 14:23 UTC (permalink / raw)
  To: 17850-done

Fixed in 24.5

On 2014-06-26 09:31 -0400, Stefan Monnier wrote:
> Obviously NAK for 24.3.91, but I'm fine with that in trunk.

OK and done.

Thanks,
Leo





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#17850: 24.3.91; skeleton-end-hook non-nil default value
  2014-06-26 14:23     ` Leo Liu
@ 2014-06-26 15:43       ` Glenn Morris
  2014-06-26 23:47         ` Leo Liu
  0 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2014-06-26 15:43 UTC (permalink / raw)
  To: 17850; +Cc: sdl.web

Leo Liu wrote:

> Fixed in 24.5

If you just change your wording a little bit (to "Version: 24.5"), the
bug-tracker itself will be able to understand it. :)





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#17850: 24.3.91; skeleton-end-hook non-nil default value
  2014-06-26 15:43       ` Glenn Morris
@ 2014-06-26 23:47         ` Leo Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Leo Liu @ 2014-06-26 23:47 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 17850

On 2014-06-26 11:43 -0400, Glenn Morris wrote:
> If you just change your wording a little bit (to "Version: 24.5"), the
> bug-tracker itself will be able to understand it. :)

Thanks for the tip and I'll do that in future.

Leo





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-06-26 23:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-26  3:24 bug#17850: 24.3.91; skeleton-end-hook non-nil default value Leo Liu
2014-06-26  3:41 ` Leo Liu
2014-06-26 13:31   ` Stefan Monnier
2014-06-26 14:23     ` Leo Liu
2014-06-26 15:43       ` Glenn Morris
2014-06-26 23:47         ` Leo Liu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).