From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Martin Marshall <law@martinmarshall.com>
Cc: 68487@debbugs.gnu.org
Subject: bug#68487: [PATCH] Make jump commands usable for all skeletons
Date: Sun, 28 Jan 2024 14:45:37 -0500 [thread overview]
Message-ID: <jwvle89s0y3.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <877ckawckc.fsf@martinmarshall.com> (Martin Marshall's message of "Mon, 15 Jan 2024 15:45:23 -0500")
> diff --git a/lisp/skeleton.el b/lisp/skeleton.el
> index 89cb11b0fe2..24d6ef15e74 100644
> --- a/lisp/skeleton.el
> +++ b/lisp/skeleton.el
> @@ -31,6 +31,8 @@
>
> ;;; Code:
>
> +(require 'expand)
> +
> (eval-when-compile (require 'cl-lib))
>
> ;; page 1: statement skeleton language definition & interpreter
> @@ -139,7 +141,14 @@ define-skeleton
> This is a way of overriding the use of a highlighted region.")
> (interactive "*P\nP")
> (atomic-change-group
> - (skeleton-proxy-new ',skeleton str arg)))))
> + (skeleton-proxy-new ',skeleton str arg))
> + (if expand-in-progress-p
> + ;; `expand-abbrev-hook' will set the markers in this case.
> + (setq expand-list skeleton-positions)
> + (setq expand-index 0
> + expand-pos (expand-list-to-markers skeleton-positions)
> + expand-list nil))
> + t)))
>
> ;;;###autoload
> (defun skeleton-proxy-new (skeleton &optional str arg)
I don't think we want such a tight dependency between `skeleton.el` and
`expand.el` [ Partly to avoid the kind of circular dependencies you
just found yourself in, but also more generally. ]
My suggestion would be to move that code to the `skeleton-end-hook`, but
I see that's where the code started, so I'm obviously missing something:
what make you decide to move the code out of the `skeleton-end-hook` and
into `define-skeleton`?
Stefan
next prev parent reply other threads:[~2024-01-28 19:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-15 20:45 bug#68487: [PATCH] Make jump commands usable for all skeletons Martin Marshall
2024-01-27 9:13 ` Eli Zaretskii
2024-01-27 18:27 ` Martin Marshall
2024-01-27 18:51 ` Eli Zaretskii
2024-01-27 21:48 ` Martin Marshall
2024-01-28 5:52 ` Eli Zaretskii
2024-01-28 18:47 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-28 19:24 ` Eli Zaretskii
2024-01-28 19:45 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-02-05 21:46 ` Martin Marshall
2024-02-06 2:46 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-06 22:11 ` Martin Marshall
2024-02-07 17:13 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-26 1:26 ` Martin Marshall
2024-03-03 4:07 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-14 7:50 ` Eli Zaretskii
2024-03-22 0:05 ` martin
2024-04-06 8:56 ` Eli Zaretskii
2024-04-18 8:58 ` Eli Zaretskii
2024-05-02 8:37 ` Eli Zaretskii
2024-05-18 8:28 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvle89s0y3.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=68487@debbugs.gnu.org \
--cc=law@martinmarshall.com \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).