[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ZMACS Lisp-Mode-Hook
I was looking back over my lispm-init file, and noticed a kludge for which
I have long been procrastinating on finding the "real" solution.
I wanted to set it up so that whenever I edit a lisp file, I automatically
get auto-fill-lisp-comments mode and electric-character-style-lock.
There is no "if-appropriate" function for these, so I first tried
(login-forms
...
(setq zwei:lisp-mode-hook
'(lambda ()
(zwei:com-auto-fill-lisp-comments-mode)
(zwei:com-electric-character-style-lock)) )
...
)
This, of course, does not work because these functions are toggles:
turning on the mode if it is off, and turning it off if already on.
So every time you go edit a non-lisp file and come back, the modes
get turned off until you do "m-x lisp mode". So I made a hack:
(login-forms
...
(setq zwei:lisp-mode-hook
'(lambda ()
(setq zwei:*numeric-arg-p* t)
(zwei:com-auto-fill-lisp-comments-mode)
(setq zwei:*numeric-arg-p* t)
(zwei:com-electric-character-style-lock)) )
...
)
This works, as though you used, for instance,
"m-1 m-x auto fill lisp comments mode". However, this is certainly not
the correct approach, but I couldn't find anything to indicate what was.
Any suggestions?
- Marty Hall
-------------------------------------------------------------------
hall@aplcen.apl.jhu.edu Artificial Intelligence Lab
hall%aplcen.apl.jhu.edu@cunyvm.bitnet AAI Corp
..!uunet!aplcen!hall PO Box 126
(301) 683-6455 Hunt Valley, MD 21030