Re: [Orgmode] Prefixing a function call with C-digit

2009-09-09 Thread Carsten Dominik


On Sep 8, 2009, at 8:14 PM, Raffi R wrote:


Dear org users,

I'd like to write some advice or a wrapper function for org-export
such that it defaults to a heading level of 0.


Why don't you just set the variable org-export-headline-levels ?



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

HTH

- Carsten




Thank you very much,
- Raffi.


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode




___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Prefixing a function call with C-digit

2009-09-09 Thread Peter Westlake
On Wed, 09 Sep 2009 14:39 +0200, Carsten Dominik
carsten.domi...@gmail.com 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.


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Prefixing a function call with C-digit

2009-09-09 Thread Raffi R
Thank you very much!

On Wed, Sep 9, 2009 at 10:23 AM, Peter Westlakepeter.westl...@pobox.com wrote:
 On Wed, 09 Sep 2009 14:39 +0200, Carsten Dominik
 carsten.domi...@gmail.com 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.


 ___
 Emacs-orgmode mailing list
 Remember: use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Prefixing a function call with C-digit

2009-09-08 Thread Raffi R
Dear org users,

I'd like to write some advice or a wrapper function for org-export
such that it defaults to a heading level of 0.

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.

Thank you very much,
- Raffi.


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Prefixing a function call with C-digit

2009-09-08 Thread Haroldo Stenger
Raffi,

Off the top of mi mind, you pass arguments to commands by issueing C-u
parameter command keychord

best,
haroldo

2009/9/8 Raffi R raf...@gmail.com

 Dear org users,

 I'd like to write some advice or a wrapper function for org-export
 such that it defaults to a heading level of 0.

 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.

 Thank you very much,
 - Raffi.


 ___
 Emacs-orgmode mailing list
 Remember: use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode

___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Prefixing a function call with C-digit

2009-09-08 Thread Raffi R
Ordinarily that is the case, but for org-export the convention seems
to be C-digit, which passes the digit as an argument to the next
function called (in this case, org-export).

On Tue, Sep 8, 2009 at 8:42 PM, Haroldo Stengerharold.sten...@gmail.com wrote:
 Raffi,

 Off the top of mi mind, you pass arguments to commands by issueing C-u
 parameter command keychord

 best,
 haroldo

 2009/9/8 Raffi R raf...@gmail.com

 Dear org users,

 I'd like to write some advice or a wrapper function for org-export
 such that it defaults to a heading level of 0.

 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.

 Thank you very much,
 - Raffi.


 ___
 Emacs-orgmode mailing list
 Remember: use `Reply All' to send replies to the list.
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode




___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode