emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [Feature Request] Add an dispatcher command (keybinding) for ins


From: Nicolas Goaziou
Subject: Re: [O] [Feature Request] Add an dispatcher command (keybinding) for inserting dynamic blocks
Date: Thu, 27 Dec 2018 11:59:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hello,

stardiviner <address@hidden> writes:

> The re-generated patch is in attachment.

Thank you!

> ---
>  doc/org-manual.org  |  9 ++++++---
>  etc/ORG-NEWS        | 14 ++++++++++++++
>  lisp/org-clock.el   |  5 +++++
>  lisp/org-colview.el |  6 +++++-
>  lisp/org-keys.el    |  6 ++----
>  lisp/org.el         | 46 +++++++++++++++++++++++++++++++++++++++++++++

You forgot to mark removed functions, e.g., `org-clock-report', as
obsolete in "org-compat.el".

>  Org supports /dynamic blocks/ in Org documents.  They are inserted
>  with begin and end markers like any other code block, but the contents
> -are updated automatically by a user function.  For example, {{{kbd(C-c
> -C-x C-r)}}} inserts a dynamic table that updates the work time (see
> -[[*Clocking Work Time]]).
> +are updated automatically by a user function.  You can use dispatch
> +command ~org-dynamic-block-insert-dispatch~, which is bind to
> +keybinding {{{kbd(C-c C-x i)}}} by default.

which is bound to {{{kbd(C-c C-x i)}}} by default.

Don't forget the #+kindex and #+findex entries above.

> +(defcustom org-dynamic-block-parameters nil
> +  "An alist of properties that defines all the Org dynamic blocks."

What is the key of the alist? The possible keywords for the plist? This
should appear in the docstring.

So far, only :function is supported. If there is no plan for extending
that, maybe a plain alist, e.g., ("type" . function) should suffice?
I.e., isn't mimicking `org-link-set-parameters' a bit too much? WDYT?

> +(defun org-dynamic-block-insert-dblock (dblock-type)
> +  "Select and insert an Org type dynamic block DBLOCK-TYPE.

Insert a dynamic block of type DBLOCK-TYPE.

> +This is a dispatching function which prompts for the type of
> +dynamic block to insert."

When used interactively, select the dynamic block types among defined
types, per `org-dynamic-block-set-parameters'.

Also, once we agree on the design, would you mind writing some tests?

Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]