From: Allen Li <darkfeline@felesatra.moe>
To: Noam Postavsky <npostavs@gmail.com>
Cc: 36243@debbugs.gnu.org
Subject: bug#36243: 26.2; defining inverse abbrevs include space
Date: Fri, 21 Jun 2019 18:30:40 +0000 [thread overview]
Message-ID: <CADbSrJwd0rtM0CyikQiY4f6-zkZfo_QaxR75ibTGYnYWjhsisA@mail.gmail.com> (raw)
In-Reply-To: <CADbSrJybFVie8Vah4UaUOQFcxF6CxpfWp1aLCS_U=YAccmbsTA@mail.gmail.com>
Any update on this?
On Mon, Jun 17, 2019 at 7:23 PM Allen Li <darkfeline@felesatra.moe> wrote:
>
> Thanks for suggesting skip-syntax-backward, see new patch.
>
> On Mon, Jun 17, 2019 at 7:44 AM Noam Postavsky <npostavs@gmail.com> wrote:
> >
> > Allen Li <darkfeline@felesatra.moe> writes:
> >
> > > Defining an inverse abbrev in a buffer like so (@ is point):
> > >
> > > some text foo @
> > >
> > > C-x a i l find outer otter RET
> > >
> > > defines an abbrev "foo " -> "find outer otter"
> >
> > > * lisp/abbrev.el (inverse-add-abbrev): Skip trailing nonword
> > > characters when defining abbrev.
> >
> > > (defun inverse-add-abbrev (table type arg)
> > > (let (name exp start end)
> > > (save-excursion
> > > - (forward-word (1+ (- arg)))
> > > + (if (<= arg 0)
> > > + (forward-word (1+ (- arg)))
> > > + (forward-word (- arg))
> > > + (forward-word))
> > > (setq end (point))
> > > (backward-word 1)
> >
> > This seems like a somewhat obfuscated way of skipping nonword
> > characters. How about using skip-syntax-backward instead?
next prev parent reply other threads:[~2019-06-21 18:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-16 10:35 bug#36243: 26.2; defining inverse abbrevs include space Allen Li
2019-06-17 14:44 ` Noam Postavsky
2019-06-17 19:23 ` Allen Li
2019-06-21 18:30 ` Allen Li [this message]
2019-06-22 23:35 ` Noam Postavsky
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=CADbSrJwd0rtM0CyikQiY4f6-zkZfo_QaxR75ibTGYnYWjhsisA@mail.gmail.com \
--to=darkfeline@felesatra.moe \
--cc=36243@debbugs.gnu.org \
--cc=npostavs@gmail.com \
/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).