unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: fatiparty--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: Fatiparty <fatiparty@tutanota.com>
Cc: Help Gnu Emacs <help-gnu-emacs@gnu.org>
Subject: Associating an empty replacement value for "\cr"
Date: Tue, 11 Jan 2022 19:57:44 +0100 (CET)	[thread overview]
Message-ID: <Mt9VCCe--3-2@tutanota.com> (raw)
In-Reply-To: <Mt98f-X--3-2@tutanota.com-Mt9DJ3S----2>

> fatiparty--- via Users list for the GNU Emacs text editor
> <help-gnu-emacs@gnu.org> writes:
> 
> > Is this the way to associate an empty replacement value for "\cr". 
> > When I do not place a space after
> > ? I get an error.
> >
> > (defvar texsym-cluster
> >  ("\\alpha" . ?α)  ("\\cr" . ? ))
> 
> How is that var used?
> 
> ?c is the read syntax for a character.  There is no "empty" character of
> course.  Can you use strings instead as replacements?
> 
> Michael.

I have a  keybinding sequence "H-s" that would remove "\cr" text from view 

I am using texsym-cluster in this way

(defun texsym-predicate (start end _match)
  "Prettify mathematical expressions defined by tex syntax.
Matches START with a backslash and END with a word constituent
[a-zA-Z0-9].  Uses the prettify functionality of `prog-mode'."

  (not (or (memq (char-before start) '(?\\))
           (memq (char-syntax (or (char-after end) ?\s)) '(?w))
       (nth 8 (syntax-ppss)))) )

(defun prettify-symbols-cluster ()
  "Set keywords and corresponding glyph."
  (setq-local prettify-symbols-alist texsym-cluster)
  (setq prettify-symbols-compose-predicate 'texsym-predicate))

Jan 12, 2022, 05:19 by help-gnu-emacs@gnu.org:

> Is this the way to associate an empty replacement value for "\cr".  When I do not place a space after
> ? I get an error.
>
> (defvar texsym-cluster
>  ("\\alpha" . ?α)  ("\\cr" . ? ))
>



  parent reply	other threads:[~2022-01-11 18:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 17:19 Associating an empty replacement value for "\cr" fatiparty--- via Users list for the GNU Emacs text editor
2022-01-11 18:17 ` Michael Heerdegen
     [not found] ` <Mt98f-X--3-2@tutanota.com-Mt9DJ3S----2>
2022-01-11 18:57   ` fatiparty--- via Users list for the GNU Emacs text editor [this message]
2022-01-11 19:39     ` Tassilo Horn
     [not found]     ` <87bl0irrg6.fsf@gnu.org-Mt9eINF--J-2>
2022-01-11 19:49       ` fatiparty--- via Users list for the GNU Emacs text editor
2022-01-11 20:05         ` Tassilo Horn
     [not found]       ` <Mt9g-tt--J-2@tutanota.com-Mt9gpIN--7-2>
2022-01-11 20:01         ` fatiparty--- via Users list for the GNU Emacs text editor

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=Mt9VCCe--3-2@tutanota.com \
    --to=help-gnu-emacs@gnu.org \
    --cc=fatiparty@tutanota.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.
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).