emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: prettify-symbols-mode to handle "\alpha-\beta" ...


From: pietru
Subject: Re: prettify-symbols-mode to handle "\alpha-\beta" ...
Date: Sat, 6 Feb 2021 00:44:43 +0100

Currently I am trying to see things work for myself, then finally decide what
to use and improve texinfo later on.

> Sent: Saturday, February 06, 2021 at 11:22 AM
> From: "Gregory Heytings" <gregory@heytings.org>
> To: pietru@caramail.com
> Cc: emacs-devel@gnu.org
> Subject: Re: prettify-symbols-mode to handle "\alpha-\beta" ...
>
> 
> >> (defun texinfo-prettify-symbols-compose-p (start end _match)
> >>    ;; We know the matches all start with a backslash and end with
> >>    ;; a word-element.
> >>    (not (or (memq (char-before start) '(?\\))
> >>             (memq (char-syntax (or (char-after end) ?\s)) '(?w))
> >>             (nth 8 (syntax-ppss)))))
> >> (add-hook 'texinfo-mode-hook
> >>            (lambda ()
> >>              (push '("\\alpha" . ?α) prettify-symbols-alist)
> >>              (push '("\\beta" . ?β) prettify-symbols-alist)
> >>              (setq prettify-symbols-compose-predicate 
> >> 'texinfo-prettify-symbols-compose-p)
> >>              (prettify-symbols-mode)))
> >
> > So I have to add the following defun in prog-mode.el?
> >
> > (defun texinfo-prettify-symbols-compose-p (start end _match)
> >
> 
> I don't know what you're trying to do.  If you're trying to do something 
> just for yourself, just add the above lines in your .emacs file.  If you 
> want to improve texinfo-mode, the defun above should probably go into 
> texinfo.el, with the "(setq prettify-symbols-compose-predicate 
> 'texinfo-prettify-symbols-compose-p)" inside the "(define-derived-mode 
> texinfo-mode ...".



reply via email to

[Prev in Thread] Current Thread [Next in Thread]