From: Nick Dokos <firstname.lastname@example.org> To: email@example.com Subject: Re: [PATCH] org: add property names from #+PROPERTY keywords to completion list Date: Wed, 08 Jul 2020 12:07:52 -0400 [thread overview] Message-ID: <firstname.lastname@example.org> (raw) In-Reply-To: <email@example.com> Kyle Meyer <firstname.lastname@example.org> writes: > Nick Dokos writes: > >> Here's the amended patch: it includes the fixes from Kyle's review, the modification >> he suggested that adds the plain property for each _ALL property to the list >> and a few test cases to the test/org-buffer-property-keys test. > > Thank you for the updates. Applied (bc4fa8a00). > >> - nil))) >> + ;; Get property names from #+PROPERTY keywords as well >> + (mapcar (lambda (s) >> + (nth 0 (split-string s))) >> + (cdar (org-collect-keywords '("PROPERTY")))) >> + nil)) > > I didn't spot it earlier, but this nil (not added by your patch) is > unnecessary. Since the patch is touching the line anyway, I've dropped > it on apply. > >> + bare-props) >> (org-with-wide-buffer >> (goto-char (point-min)) >> (while (re-search-forward org-property-start-re nil t) >> @@ -13132,7 +13137,15 @@ COLUMN formats in the current buffer." >> (let ((p (match-string-no-properties 1 value))) >> (unless (member-ignore-case p org-special-properties) >> (push p props)))))))))) >> - (sort (delete-dups props) (lambda (a b) (string< (upcase a) (upcase b)))))) >> + (sort (delete-dups (append props >> + ;; for each xxx_ALL property, make sure >> + ;; the bare xxx property is also >> + ;; included >> + (dolist (x props bare-props) >> + (if (string-match "_ALL\\b" x) >> + (setq bare-props (cons (substring x 0 -4) >> + bare-props)))))) > > I did a cosmetic rewrite here to use mapcar, which I hope you won't > mind. > BTW, I just thought of a possible problem: the manual says that property keys are case-insensitive (although all the examples I can find spell "_ALL" in upper case, but if I write :PROPERTIES: :foo_all: bar baz :END: I don't think that the code is going to handle it correctly. There are other places that also use "_ALL" without a let of case-fold-search (at least AFAICT). Am I paranoid or is this a problem? -- Nick
next prev parent reply other threads:[~2020-07-08 16:09 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-07 2:01 Nick Dokos 2020-07-07 2:40 ` Nick Dokos 2020-07-07 4:23 ` Kyle Meyer 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 [this message] 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 \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: [PATCH] org: add property names from #+PROPERTY keywords to completion list' \ /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
Code repositories for project(s) associated with this 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).