all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Prefix-Arg (non-interactive!) in Info
@ 2010-08-13 14:37 Memnon Anon
  2010-08-13 15:17 ` Eli Zaretskii
  0 siblings, 1 reply; 15+ messages in thread
From: Memnon Anon @ 2010-08-13 14:37 UTC (permalink / raw)
  To: help-gnu-emacs

[ 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



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2010-08-14 22:27 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-13 14:37 Prefix-Arg (non-interactive!) in Info Memnon Anon
2010-08-13 15:17 ` Eli Zaretskii
2010-08-13 15:50   ` Memnon Anon
2010-08-13 16:09     ` Eli Zaretskii
2010-08-13 16:21       ` Drew Adams
2010-08-13 18:36         ` Memnon Anon
2010-08-13 20:33           ` Drew Adams
2010-08-13 17:04       ` Memnon Anon
2010-08-13 17:40         ` Andreas Röhler
2010-08-13 21:04           ` Memnon Anon
2010-08-13 19:33         ` Eli Zaretskii
2010-08-13 20:58           ` [Solved] (was: Prefix-Arg (non-interactive!) in Info) Memnon Anon
2010-08-14  8:05             ` Eli Zaretskii
2010-08-14 21:18               ` [Solved] Memnon Anon
2010-08-14 22:27                 ` [Solved] Eli Zaretskii

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.