* Associating an empty replacement value for "\cr"
@ 2022-01-11 17:19 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>
0 siblings, 2 replies; 7+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-11 17:19 UTC (permalink / raw)
To: Help Gnu Emacs
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" . ? ))
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Associating an empty replacement value for "\cr"
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>
1 sibling, 0 replies; 7+ messages in thread
From: Michael Heerdegen @ 2022-01-11 18:17 UTC (permalink / raw)
To: help-gnu-emacs
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <Mt98f-X--3-2@tutanota.com-Mt9DJ3S----2>]
* Associating an empty replacement value for "\cr"
[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
2022-01-11 19:39 ` Tassilo Horn
[not found] ` <87bl0irrg6.fsf@gnu.org-Mt9eINF--J-2>
0 siblings, 2 replies; 7+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-11 18:57 UTC (permalink / raw)
To: Fatiparty; +Cc: Help Gnu Emacs
> 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" . ? ))
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Associating an empty replacement value for "\cr"
2022-01-11 18:57 ` fatiparty--- via Users list for the GNU Emacs text editor
@ 2022-01-11 19:39 ` Tassilo Horn
[not found] ` <87bl0irrg6.fsf@gnu.org-Mt9eINF--J-2>
1 sibling, 0 replies; 7+ messages in thread
From: Tassilo Horn @ 2022-01-11 19:39 UTC (permalink / raw)
To: fatiparty; +Cc: help-gnu-emacs
fatiparty--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> writes:
> (defun prettify-symbols-cluster ()
> "Set keywords and corresponding glyph."
> (setq-local prettify-symbols-alist texsym-cluster)
> (setq prettify-symbols-compose-predicate 'texsym-predicate))
Ah, so for usage in `prettify-symbols-alist'. I guess you could use a
zero-width space as replacement, i.e., ?\N{ZERO WIDTH SPACE}.
Bye,
Tassilo
^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <87bl0irrg6.fsf@gnu.org-Mt9eINF--J-2>]
* Associating an empty replacement value for "\cr"
[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>
1 sibling, 1 reply; 7+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-11 19:49 UTC (permalink / raw)
To: Tassilo Horn; +Cc: Help Gnu Emacs
--
Sent with Tutanota, the secure & ad-free mailbox.
Jan 12, 2022, 07:39 by tsdh@gnu.org:
> fatiparty--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> writes:
>
>> (defun prettify-symbols-cluster ()
>> "Set keywords and corresponding glyph."
>> (setq-local prettify-symbols-alist texsym-cluster)
>> (setq prettify-symbols-compose-predicate 'texsym-predicate))
>>
>
> Ah, so for usage in `prettify-symbols-alist'. I guess you could use a
> zero-width space as replacement, i.e., ?\N{ZERO WIDTH SPACE}.
>
> Bye,
> Tassilo
>
Would this be the exact code?
("\\cr" . ?\N{ZERO WIDTH SPACE})
^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <Mt9g-tt--J-2@tutanota.com-Mt9gpIN--7-2>]
* Associating an empty replacement value for "\cr"
[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
0 siblings, 0 replies; 7+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-11 20:01 UTC (permalink / raw)
To: Fatiparty; +Cc: Tassilo Horn, Help Gnu Emacs
Jan 12, 2022, 07:49 by help-gnu-emacs@gnu.org:
>
> Jan 12, 2022, 07:39 by tsdh@gnu.org:
>
>> fatiparty--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> writes:
>>
>>> (defun prettify-symbols-cluster ()
>>> "Set keywords and corresponding glyph."
>>> (setq-local prettify-symbols-alist texsym-cluster)
>>> (setq prettify-symbols-compose-predicate 'texsym-predicate))
>>>
>>
>> Ah, so for usage in `prettify-symbols-alist'. I guess you could use a
>> zero-width space as replacement, i.e., ?\N{ZERO WIDTH SPACE}.
>>
>> Bye,
>> Tassilo
>>
> Would this be the exact code?
>
> ("\\cr" . ?\N{ZERO WIDTH SPACE})
>
Ok, I found it in the Elisp Manual {2.4.3.2 General Escape Syntax}.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-01-11 20:05 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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).