[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Prefix-Arg (non-interactive!) in Info
From: |
Memnon Anon |
Subject: |
Prefix-Arg (non-interactive!) in Info |
Date: |
Fri, 13 Aug 2010 16:37:04 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
[ Fairly long mail, questions are at the very bottom.]
Hi,
Someone had a fairly easy question on the orgmode ml:
,----[ Message-ID: <0vhbizzap7.fsf@gmail.com> ]
| I'd like to bind `C-u C-c C-x C-i' to the <f10> key in emacs 23.
`----
So, I thought this should be easy to find in the Info documentation and
started looking through the relevant documentation via the indices, and
plain repeated `C-s' for things like C-u, universal argument etc.
But it was surprisingly difficult to find an answer to a simple
question: How do I non-interactively! pass a prefix argument to a
function?
On the one hand, it strengthened my remembrance, that C-u =
argument of 4, C-u C-u = argument of 16 etc, but I found no way how to
put this into good use; first tries in *scratch* failed.
On the contrary, this FAQ entry suggested another way and put me on the
wrong track for a minute or two:
,----[ (info "(efaq)Replying to the sender of a message") ]
| 12.6 How can I force Rmail to reply to the sender of a message, but not the
other recipients?
|
| Ron Isaacson <isaacson@seas.upenn.edu> says: When you hit <r> to reply
| in Rmail, by default it CCs all of the original recipients (everyone on
! the original `To' and `CC' lists). With a prefix argument (i.e., typing
! `C-u' before <r>), it replies only to the sender. However, going
! through the whole `C-u' business every time you want to reply is a
! pain. This is the best fix I've been able to come up with:
|
| (defun rmail-reply-t ()
| "Reply only to the sender of the current message. (See rmail-reply.)"
| (interactive)
! (rmail-reply t))
| (add-hook 'rmail-mode-hook
| (lambda ()
| (define-key rmail-mode-map "r" 'rmail-reply-t)
| (define-key rmail-mode-map "R" 'rmail-reply)))
`----
( Thinking: "C-u = Argument t?!" Nah, this can not be right, can it?
But this other guy [Message ID: <87ocd71jz6.fsf@gmx.net>]
suggested exactly that ...")
I finally gave up and went to google, where I found the right(?)
solution:
,----[ http://www.emacs.uniyar.ac.ru/doc/em24h/emacs200.htm ]
| (define-key c++-mode-map [(f6)] (definteractive (comment-region '(4))))
| [...]
| definteractive declares an anonymous function at point with the body
! containing a call to comment region with argument '(4), which is the
! Lisp representation for the C-u prefix argument.
`----
Up to now, I was not only able to find such information in Info, I even
found them easily and quicker than with google, so I am wondering:
Did I miss a crucial Info page? (I think so, but ... which?)
If not, is this worth a wishlist bug against the documentation?
If so, where would you suggest to put this information?
Memnon