unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* skeleton.el _ versus @
@ 2003-03-23 23:55 Joe Kelsey
  0 siblings, 0 replies; only message in thread
From: Joe Kelsey @ 2003-03-23 23:55 UTC (permalink / raw)
  Cc: mmm-mode-discuss

In GNU Emacs 21.2.1 (i386--freebsd, X toolkit, Xaw3d scroll bars)
 of 2002-11-08 on zircon.zircon.seattle.wa.us

skeleton.el confuses the roles of _ and @.

_ serves two purposes: mark the "interesting" skeleton-point, and mark
region-skip points, depending on whether or not the skeleton is being
inserted in a plain context, or in a "region" context.

@ serves as a "back-up" setting for skeleton-point and also to mark the
skeleton-positions.

My contention is that the use of @ as a backup to _ in setting
skeleton-point is incorrect.  When a skeleton contains both @ and _
markers, obviously the _ should be used to set the skeleton-point and
the @ should be used to set skeleton-positions when the skeleton is used
in simple insertion mode.

When the skeleton is used in region-list-context mode, there must be
multiple occurrences of _ to mark where the insertion code is supposed
to skip to the end of the next region.  In this case, there probably
aren't any @ markers.  The first _ can serve as skeleton-point.

If a simple skeleton is used without any _ markers, then the user hasn't
thought about where they want point to end up and it doesn't really
matter where it ends up.

I propose the following modification to skeleton.el:

--- lisp/skeleton.el.orig	Sat Jul 14 04:21:08 2001
+++ lisp/skeleton.el	Sun Mar 23 15:28:03 2003
@@ -453,8 +453,7 @@
 	((eq element '|)
 	 (unless skeleton-modified (pop skeleton)))
 	((eq element '@)
-	 (push (point) skeleton-positions)
-	 (unless skeleton-point (setq skeleton-point (point))))
+	 (push (point) skeleton-positions))
 	((eq 'quote (car-safe element))
 	 (eval (nth 1 element)))
 	((or (stringp (car-safe element))

Basically, this removes the setting of skeleton-point from the @
actions.

/Joe

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-23 23:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-23 23:55 skeleton.el _ versus @ Joe Kelsey

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).