emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: stardiviner <numbchild@gmail.com>
Cc: Thierry Banel <tbanelwebmin@free.fr>, emacs-orgmode@gnu.org
Subject: Re: [Feature Request] Add an dispatcher command (keybinding) for inserting dynamic blocks
Date: Thu, 27 Dec 2018 11:59:48 +0100	[thread overview]
Message-ID: <874lazb5gb.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87ftuoznas.fsf@gmail.com> (stardiviner's message of "Sun, 23 Dec 2018 15:59:07 +0800")

Hello,

stardiviner <numbchild@gmail.com> 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	other threads:[~2018-12-27 10:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-16  1:15 [Feature Request] Add an dispatcher command (keybinding) for inserting dynamic blocks stardiviner
2018-11-16 17:59 ` Thierry Banel
2018-11-25 10:09   ` Nicolas Goaziou
2018-12-03  6:43     ` stardiviner
2018-12-20  2:10     ` stardiviner
2018-12-22 22:54       ` Nicolas Goaziou
2018-12-23  6:26         ` stardiviner
2018-12-23  6:28         ` stardiviner
2018-12-23  7:59           ` stardiviner
2018-12-27 10:59             ` Nicolas Goaziou [this message]
2018-12-27 15:25               ` stardiviner
2018-12-30  9:27                 ` Nicolas Goaziou
2019-01-02  0:12                   ` stardiviner
2019-01-02 14:57                     ` Nicolas Goaziou
2019-01-03 12:19                       ` stardiviner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874lazb5gb.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=numbchild@gmail.com \
    --cc=tbanelwebmin@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).