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