emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Oleh Krehel <ohwoeowho@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Unclear org-icompleting-read interface
Date: Thu, 25 Jun 2015 16:23:40 +0200	[thread overview]
Message-ID: <874mlvvpcj.fsf@gmail.com> (raw)
In-Reply-To: <877fqryjyh.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Thu, 25 Jun 2015 15:51:50 +0200")

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Moreover,
> `org-icompleting-read' is not harder to read as `completing-read'
> anyway.

I disagree on this. `completing-read' at least declares its own argument
list. So it's possible to distinguish which argument is which, albeit
with some effort for a large amount of arguments.

For example, in this case there are 5 args, the first two I know by
heart. Not the other three.

    (setq prop (org-icompleting-read
                "Property: " (mapcar 'list (org-buffer-property-keys t nil t))
                nil nil prop))

And the arglist: "&rest args", instead of "prompt collection predicate
require-match initial-input hist def inherit-input-method".

Here's how it would look like for a `cl-defun' variant:

    (org-icompleting-read
     "Property: " (mapcar 'list (org-buffer-property-keys t nil t))
     :initial-input prop)

Down to 3 arguments from 5, and the last one is very easy to understand,
even without eldoc.

In any case this also solves the problem of the argument list:

    (define-obsolete-function-alias
        'org-icompleting-read 'completing-read)

  reply	other threads:[~2015-06-25 14:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 13:15 Unclear org-icompleting-read interface Oleh Krehel
2015-06-25 13:51 ` Nicolas Goaziou
2015-06-25 14:23   ` Oleh Krehel [this message]
2015-06-25 14:36   ` Rasmus
2015-06-25 16:30     ` Nicolas Goaziou
2015-06-25 16:39       ` Rasmus

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=874mlvvpcj.fsf@gmail.com \
    --to=ohwoeowho@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).