# Function call inside mode hook has no effect but manual execution of function from buffer works

I use AucTeX as my latex major mode. I have been trying to setup the minor mode latex-pretty-symbols which is available from melpa. I did:

;; Install from package-list-packages
(require 'latex-pretty-symbols)
(lambda () (message "Show that my code ran") (latex-unicode-simplified)))


What's supposed to happen is that font-lock should render \alpha = 1 as α = 1 in a latex buffer.

Unfortunately, this doesn't happen in AucTex. Instead I have to either interactively call latex-unicode-simplified or manually evaluate M-:(latex-unicode-simplified) from the buffer.

Is there a way to programmatically send keystrokes after a mode is loaded? Is there some other way to tell auctex to do what I want ? I have been trying to solve this for 2.5 hours now so any help is welcome.

NB 1: This problem only happens when I use auctex. When I deleted auctex and did (add-hook 'latex-mode-hook 'latex-unicode-simplified) then the problem got resolved. But I can't stop using AucTex.

NB 2: This problem is not resolved through file local variables, I tried to put a % eval: (latex-unicode-simplified) but that did not work

NB 3: The package author is using bitbucket, with issues disabled.

• Incidentally, (add-hook 'LaTeX-mode-hook #'prettify-symbols-mode) should also do the trick if you use Emacs≥25. – Stefan Feb 18 '16 at 13:53
• Regarding NB 3, bitbucket does have issue trackers, but repository managers can disable them. This is the case for that particular repository. – giordano Feb 18 '16 at 14:48
• @Stefan : It seems that to actually make good use of prettify-symbols-mode I would have to write the prettification rules myself. Is there some code with those rules already written? I can understand that latex-pretty-symbols is basically doing that. – Pushpendre Feb 18 '16 at 19:01
• Yes, Emacs≥25 has such rules. – Stefan Feb 19 '16 at 4:16

1. The sharp-quote (#') is used only before functions, not all symbols.
3. Bare lambdas should not be quoted.
(require 'latex-pretty-symbols)