unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: bojohan+news@dd.chalmers.se (Johan Bockgård)
Subject: Re: turn-on-*-mode
Date: Wed, 17 May 2006 03:26:20 +0200	[thread overview]
Message-ID: <yoijy7x1jvb7.fsf@linus003.dd.chalmers.se> (raw)
In-Reply-To: 45658.128.165.123.132.1147804509.squirrel@webmail.lanl.gov

"Stuart D. Herring" <herring@lanl.gov> writes:

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

The lexbind branch has this.

,----
| curry is a built-in function in `src/eval.c'.
| (curry fun &rest args)
| 
| Return fun curried with args.
| The result is a function-like object that will append any arguments it
| is called with to args, and call fun with the resulting list of
| arguments.
| 
| For instance:
|   (funcall (curry '+ 3 4 5) 2) is the same as (funcall '+ 3 4 5 2)
| and:
|   (mapcar (curry 'concat "The ") '("a" "b" "c"))
|   => ("The a" "The b" "The c")
`----

-- 
Johan Bockgård

  reply	other threads:[~2006-05-17  1:26 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-15 13:32 turn-on-*-mode Sam Steingold
2006-05-16  4:28 ` turn-on-*-mode Richard Stallman
2006-05-16 12:53   ` turn-on-*-mode Sam Steingold
2006-05-16 13:29     ` turn-on-*-mode Lennart Borgman
2006-05-16 14:52       ` turn-on-*-mode Kim F. Storm
2006-05-16 15:04         ` turn-on-*-mode Sam Steingold
2006-05-16 15:31           ` turn-on-*-mode David Kastrup
2006-05-16 15:40             ` turn-on-*-mode Drew Adams
2006-05-16 16:03               ` turn-on-*-mode Lennart Borgman
2006-05-16 18:35             ` turn-on-*-mode Stuart D. Herring
2006-05-17  1:26               ` Johan Bockgård [this message]
2006-05-17  3:45             ` turn-on-*-mode Richard Stallman
2006-05-17  3:44           ` turn-on-*-mode Richard Stallman
2006-05-30 18:38             ` turn-on-*-mode Reiner Steib
2006-05-30 18:58               ` turn-on-*-mode Sam Steingold
2006-05-30 19:07                 ` turn-on-*-mode Reiner Steib
2006-05-16 15:16         ` turn-on-*-mode Drew Adams
2006-05-16 15:48         ` turn-on-*-mode Reiner Steib
2006-05-17  2:18           ` turn-on-*-mode Miles Bader
2006-05-17 20:08             ` turn-on-*-mode Richard Stallman
2006-05-17 21:24               ` turn-on-*-mode Stefan Monnier
2006-05-19  2:03                 ` turn-on-*-mode Richard Stallman
2006-05-19  3:30                   ` turn-on-*-mode Stefan Monnier
2006-05-16 16:02         ` turn-on-*-mode Kevin Rodgers
2006-05-17 15:28           ` turn-on-*-mode Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yoijy7x1jvb7.fsf@linus003.dd.chalmers.se \
    --to=bojohan+news@dd.chalmers.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).