unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Displaying a string as another one
@ 2020-03-16 10:05 Marcin Borkowski
  2020-03-16 15:58 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Borkowski @ 2020-03-16 10:05 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Hi all,

I have a buffer with long lines, containing many instances of strings
"\\n" and "\\t" (i.e., a literal backslash followed by "n" or "t").  I'd
like Emacs to display them as a newline and a tab, respectively.  These
instances occur inside strings (i.e., between quotes, which delimit
strings in JavaScript).

I tried
(setq prettify-symbols-alist '(("\\n" . ?\n) ("\\t" . ?\t)))
but this does not seem to work inside strings.

I suspect font-lock could do it, but I'm not sure how (and frankly,
I don't have time now to do many experiments).

Does anyone have a ready-made solution?

TIA,

-- 
Marcin Borkowski
http://mbork.pl



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-21 14:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-16 10:05 Displaying a string as another one Marcin Borkowski
2020-03-16 15:58 ` Stefan Monnier
2020-03-21 14:11   ` Marcin Borkowski

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).