emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Nick Dokos <ndokos@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] org: add property names from #+PROPERTY keywords to completion list
Date: Tue, 07 Jul 2020 00:23:09 -0400	[thread overview]
Message-ID: <87v9j054ya.fsf@kyleam.com> (raw)
In-Reply-To: <87o8osxevq.fsf@alphaville.usersys.redhat.com>

Nick Dokos writes:

> Here's a patch to enhance the property name completion list with names from
> #+PROPERTY keyword lines: at the moment, only property names found in property
> drawers are used to populate the completion list.

Thanks for the patch.

> org: add property names from #+PROPERTY keywords to completion list
>
> * lisp/org.el (org-buffer-property-keys): ehhance the completion list

Typo: enhance.  And as a convention nit, it should be capitalized.

> with property names from #+PROPERTY keywords, not just property
> drawers.
>
> See https://emacs.stackexchange.com/questions/59448/ for details.
> ---
>  lisp/org.el | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/lisp/org.el b/lisp/org.el
> index 748c058ca..0e83162e8 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -13084,6 +13084,11 @@ COLUMN formats in the current buffer."
>  	(props (append
>  		(and specials org-special-properties)
>  		(and defaults (cons org-effort-property org-default-properties))
> +		;; Get property names from #+PROPERTY keywords as well
> +		(mapcar (lambda (s)
> +			  (let ((split (split-string s)))
> +			    (nth 0 split)))
> +			(cdar (org-collect-keywords '("PROPERTY"))))
>  		nil)))

IMO the let-binding doesn't add any clarity over

  (nth 0 (split-string s))


I wondered about possible duplicates, but it looks like
org-buffer-property-keys already takes care of that at the end.

I think this patch is a clear improvement as is, but in the context of
completion (and the stack exchange post you link to), isn't the handling
around *_ALL keywords still a bit off?  It seems a caller would want to
complete without the _ALL; to use the example from that post, with
"#+PROPERTY: GENRE_ALL ...", the caller would want to complete "GENRE".
Is it worth providing special handling here?


  parent reply	other threads:[~2020-07-07  4:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07  2:01 [PATCH] org: add property names from #+PROPERTY keywords to completion list Nick Dokos
2020-07-07  2:40 ` Nick Dokos
2020-07-07  4:23 ` Kyle Meyer [this message]
2020-07-07 12:44   ` Nick Dokos
2020-07-07 13:38   ` Nick Dokos
2020-07-07 16:48   ` Nick Dokos
2020-07-08  3:52     ` Kyle Meyer
2020-07-08 15:47       ` Nick Dokos
2020-07-08 16:07       ` Nick Dokos
2020-07-09  4:36         ` [PATCH] agenda: Fold case when retrieving user-configured effort values Kyle Meyer
2020-07-09  7:50           ` Nick Dokos

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=87v9j054ya.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ndokos@gmail.com \
    /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).