[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Unclear org-icompleting-read interface
From: |
Oleh Krehel |
Subject: |
Re: [O] Unclear org-icompleting-read interface |
Date: |
Thu, 25 Jun 2015 16:23:40 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Nicolas Goaziou <address@hidden> 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)