From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Peter Westlake" Subject: Re: Prefixing a function call with C-digit Date: Wed, 09 Sep 2009 15:23:54 +0100 Message-ID: <1252506234.20644.1333969045@webmail.messagingengine.com> References: <24169F30-7678-4FD6-9A57-00972C639416@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MlO5v-0003g7-U3 for emacs-orgmode@gnu.org; Wed, 09 Sep 2009 10:24:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MlO5r-0003dr-R7 for emacs-orgmode@gnu.org; Wed, 09 Sep 2009 10:24:23 -0400 Received: from [199.232.76.173] (port=59222 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlO5r-0003dc-8A for emacs-orgmode@gnu.org; Wed, 09 Sep 2009 10:24:19 -0400 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:59277) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MlO5q-0007CQ-6Y for emacs-orgmode@gnu.org; Wed, 09 Sep 2009 10:24:18 -0400 Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 49EE3694F3 for ; Wed, 9 Sep 2009 10:23:54 -0400 (EDT) In-Reply-To: <24169F30-7678-4FD6-9A57-00972C639416@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On Wed, 09 Sep 2009 14:39 +0200, "Carsten Dominik" wrote: > > On Sep 8, 2009, at 8:14 PM, Raffi R wrote: ... > > In org-mode normally, I can get this behaviour by pressing C-0 C-x > > C-e. Looking at org.el suggested that I should be able to simply > > provide the 0 as an argument, i.e. using (org-export 0). However, > > org-export seems to ignore that 0. > > (let ((current-prefix-arg 0)) > (call-interactively 'org-export)) This also happens to be the reason a function I was trying to write didn't work! I would never have worked it out for myself - does anyone have time to explain why the original form doesn't work? Here, incidentally, is the function I was writing. It works now! It is intended to be bound to C-c l in the agenda buffer, and was written by imitating org-agenda-refile: (defun org-agenda-store-link (arg) "Store a link to the item at point." (interactive "P") (let* ((marker (or (get-text-property (point) 'org-hd-marker) (org-agenda-error))) (buffer (marker-buffer marker)) (org-link-to-org-use-id t)) (with-current-buffer buffer (save-excursion (save-restriction (widen) (goto-char marker) (let ((current-prefix-arg 0)) (call-interactively 'org-store-link))))))) Is this the right way to do it? Peter.