[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: turn-on-*-mode
From: |
Stuart D. Herring |
Subject: |
Re: turn-on-*-mode |
Date: |
Tue, 16 May 2006 11:35:09 -0700 (PDT) |
User-agent: |
SquirrelMail/1.4.3a-11.EL3 |
> Or maybe we should have something like
>
> (defun add-hook-turn-on (hook mode)
> (add-hook hook `(lambda nil (,mode 1))))
>
> So that one can write
> (add-hook-turn-on 'text-mode-hook 'auto-fill-mode)
Or (somewhat tongue-in-cheek) have
(defun curry (func &rest args)
`(lambda (&rest args2) (apply ',func (append ',args args2))))
So that one can write
(add-hook 'text-mode-hook (curry 'auto-fill-mode 1))
(add-hook 'makefile-mode-hook (curry 'auto-fill-mode -1))
(add-hook 'dired-after-readin-hook (curry 'message "T%ss i%sge%sng%sly!"
"hi" "s " "tti" " sil"))
(add-hook 'pre-command-hook
(let* ((y (curry 'mapc (curry 'apply 'remove-hook)
'((pre-command-hook x) (post-command-hook y))))
(x (curry 'add-hook 'post-command-hook y)))
(funcall #0=(lambda (c) (when (consp c)
(funcall #0# (car c))
(funcall #0# (cdr c))
(if (memq (car c) '(x y))
(setcar c (eval (car c)))))) x)
x))
Too bad there's no IOLFC, eh?
Davis
--
This product is sold by volume, not by mass. If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.
- turn-on-*-mode, Sam Steingold, 2006/05/15
- Re: turn-on-*-mode, Richard Stallman, 2006/05/16
- Re: turn-on-*-mode, Sam Steingold, 2006/05/16
- Re: turn-on-*-mode, Lennart Borgman, 2006/05/16
- Re: turn-on-*-mode, Kim F. Storm, 2006/05/16
- RE: turn-on-*-mode, Drew Adams, 2006/05/16
- Re: turn-on-*-mode, Sam Steingold, 2006/05/16
- Re: turn-on-*-mode, David Kastrup, 2006/05/16
- RE: turn-on-*-mode, Drew Adams, 2006/05/16
- Re: turn-on-*-mode, Lennart Borgman, 2006/05/16
- Re: turn-on-*-mode,
Stuart D. Herring <=
- Re: turn-on-*-mode, Johan Bockgård, 2006/05/16
- Re: turn-on-*-mode, Richard Stallman, 2006/05/16
- Re: turn-on-*-mode, Richard Stallman, 2006/05/16
- Re: turn-on-*-mode, Reiner Steib, 2006/05/30
- Re: turn-on-*-mode, Sam Steingold, 2006/05/30
- Re: turn-on-*-mode, Reiner Steib, 2006/05/30
- Re: turn-on-*-mode, Reiner Steib, 2006/05/16
- Re: turn-on-*-mode, Miles Bader, 2006/05/16
- Re: turn-on-*-mode, Richard Stallman, 2006/05/17
- Re: turn-on-*-mode, Stefan Monnier, 2006/05/17