unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: rms@gnu.org,  tor.a.s.kringeland@ntnu.no,  emacs-devel@gnu.org,
	juri@linkov.net
Subject: Re: Support for shorthand emoji input
Date: Fri, 03 Dec 2021 08:14:53 -0500	[thread overview]
Message-ID: <jwv35n9deen.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <831r2vqw44.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 02 Dec 2021 09:55:23 +0200")

Eli Zaretskii [2021-12-02 09:55:23] wrote:
> A facility to let users specify text replacements to be done
> on-the-fly as you type.  It should be similar to what the abbrevs do,
> just extended to handle non word-constituent characters, including
> punctuation and symbols.  For example, replacing -- with the em-dash
> character — or 1/2 with ½ or (C) with © or <== with ←.

FWIW, `abbrev.el` already supports abbrevs with non-word-constituents.
This support comes with 2 caveats, admittedly:

- You need to specify a `:regexp` to `define-abbrev-table` which
  describes the form of abbrevs this table should support (and this
  regexp is matched with `looking-back` so it can be a bit tricky to
  get it quite right).
- `self-insert-command` only calls `expand-abbrev` for you when you
  insert a non-word char right after a word-char, so if your abbrev ends
  with a non-word char you can't rely on `self-insert-command` to
  trigger the expansion (unless you add a `post-self-insert-hook` or
  `post-command-hook` or some such).


        Stefan




  parent reply	other threads:[~2021-12-03 13:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 14:35 Support for shorthand emoji input Tor Kringeland
2021-11-30 17:59 ` Juri Linkov
2021-11-30 18:35   ` Eli Zaretskii
2021-12-02  4:30     ` Richard Stallman
2021-12-02  7:55       ` Eli Zaretskii
2021-12-02  9:18         ` Juri Linkov
2021-12-02 10:11           ` Eli Zaretskii
2021-12-03  4:29         ` Richard Stallman
2021-12-03  7:29           ` Eli Zaretskii
2021-12-03 13:14         ` Stefan Monnier [this message]
2021-12-03 13:34           ` Eli Zaretskii
2021-11-30 18:52   ` Tor Kringeland
2021-12-01  4:29   ` Lars Ingebrigtsen
2021-12-01  4:28 ` Lars Ingebrigtsen
2021-12-01 12:39   ` Tor Kringeland
2021-12-01 14:35     ` Lars Ingebrigtsen

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=jwv35n9deen.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=rms@gnu.org \
    --cc=tor.a.s.kringeland@ntnu.no \
    /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).