unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: Allen Li <darkfeline@felesatra.moe>
Cc: 36243@debbugs.gnu.org
Subject: bug#36243: 26.2; defining inverse abbrevs include space
Date: Mon, 17 Jun 2019 10:44:36 -0400	[thread overview]
Message-ID: <85y320l19n.fsf@gmail.com> (raw)
In-Reply-To: <CADbSrJwLXPMH4fuLVZbO=gn1n2f+7u7+5SozsPiazjK8JhBpPQ@mail.gmail.com> (Allen Li's message of "Sun, 16 Jun 2019 10:35:09 +0000")

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?





  reply	other threads:[~2019-06-17 14:44 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 [this message]
2019-06-17 19:23   ` Allen Li
2019-06-21 18:30     ` Allen Li
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=85y320l19n.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=36243@debbugs.gnu.org \
    --cc=darkfeline@felesatra.moe \
    /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).