[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using skeletons: how to avoid adding newline?
From: |
Karl Eichwalder |
Subject: |
Re: Using skeletons: how to avoid adding newline? |
Date: |
Sun, 13 Apr 2003 17:15:42 +0200 |
User-agent: |
Gnus/5.090018 (Oort Gnus v0.18) Emacs/21.3.50 (gnu/linux) |
Oliver Scholz <alkibiades@gmx.de> writes:
> Looking at the code of skeleton.el ... this happens because
> `skeleton-end-hook' is run after the insertion.
Thanks for the hint; this seems to do the trick:
(defun ke-wp-make-link ()
"Create [[wikipedia link]]."
(interactive "*")
(let ((skeleton-end-newline nil))
(if mark-active
(skeleton-insert '(nil
"[[" _ "]]")
-1)
(skeleton-insert '(nil
"[[" _ "]]")))))
(global-set-key "\C-c[" 'ke-wp-make-link)
Maybe it's worth to add this information to
http://www.emacswiki.org/cgi-bin/wiki.pl?SkeletonMode
> Setting `skeleton-end-newline' to nil, does help indeed. But I have
> no idea whether this causes trouble elsewhere. Perhaps it is best to
> set it buffer locally?
Yes, this looks like a good idea. Wondering why the default isn't
nil?
--
ke@suse.de (work) / keichwa@gmx.net (home): |
http://www.gnu.franken.de/ke/ | ,__o
Free Translation Project: | _-\_<,
http://www.iro.umontreal.ca/contrib/po/HTML/ | (*)/'(*)