[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Optional arg via lambda
From: |
Thorsten Jolitz |
Subject: |
Re: Optional arg via lambda |
Date: |
Wed, 13 Nov 2013 12:33:56 +0100 |
User-agent: |
Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) |
"Sebastien Vauban" <sva-news@mygooglest.com>
writes:
> Hello,
>
> In my config, I have written this to check whether Org 8 is installed
> when trying to call the "export dispatcher" (bound, here, to `C-x
> C-e').
>
> (define-key org-mode-map
> (kbd "C-c C-e")
> (lambda ()
> (interactive)
> (if (fboundp 'org-export-dispatch)
> (org-export-dispatch)
> (message "Upgrade to Org 8!"))))
>
> However, the above code drops the optional `C-u' which we can use when
> calling `org-export-dispatch'. IOW, `C-u C-x C-e' does the same as
> `C-x C-e'.
>
> I've tried adding an optional arg to the `lambda' and to pass it to
> the funcall of `org-export-dispatch', as shown here:
>
> (define-key org-mode-map
> (kbd "C-c C-e")
> (lambda (&optional arg)
> (interactive)
> (if (fboundp 'org-export-dispatch)
> (progn
> (message "arg: %s" arg)
> (funcall 'org-export-dispatch arg))
> (message "Upgrade to Org 8!"))))
>
> But this does not work: `org-export-dispatch' is well called when
> pressing both `C-x C-e' and `C-u C-x C-e', but the `C-u' is never
> passed along to the original `org-export-dispatch' function.
>
> What am I missing?
does
,------------------------
| (lambda (&optional arg)
| (interactive "P") ...
`------------------------
make a difference?
--
cheers,
Thorsten
- Optional arg via lambda, Sebastien Vauban, 2013/11/13
- Re: Optional arg via lambda,
Thorsten Jolitz <=
- Message not available