emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] org-agenda-filter and hyphens in category names
@ 2020-06-05 20:00 Matt Lundin
  2020-09-04 17:21 ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Lundin @ 2020-06-05 20:00 UTC (permalink / raw)
  To: emacs-orgmode

Hi everyone,

I'm just getting around to exploring the function org-agenda-filter
introduced last year. (Due to busyness, I was running an older version
of Org Mode last year for fear of breaking features I relied on.)

I like the tab completion. However, I'm finding that the completion for
categories often fails because of hyphens in my file and category names.
Let's say I have a file named "my-file.org" with active todos. The
function org-agenda-filter will suggest "my-file" as a possible category
completion. However, if I tab complete "my-file," org-agenda-filter
errors out with the following messages:

  ‘+my’ filter ignored because tag/category is not represented
  ‘-file’ filter ignored because tag/category is not represented

The same thing occurs when I put hyphens in filetags.

Looking at the Org Manual, I see that Org Mode restricts tags to
alphanumeric characters, "@", and "_". And org-set-tags-command will
sanitize tag names when entering them, replacing forbidden characters
with ":".

However, there are no guidelines about forbidden characters in
categories. And filetags at the top of file allow for arbitrary
characters. Both org-agenda-filter-by-category ("<") and
org-agenda-filter-by-tag ("\") work with categories and filetags
containing "-" or "+" in the name.

Would it be possible for org-agenda-filter to escape the set of special
characters [-+<>=/] in category and filetag names when offering them for
completion? 

Best,

Matt


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] org-agenda-filter and hyphens in category names
  2020-06-05 20:00 [BUG] org-agenda-filter and hyphens in category names Matt Lundin
@ 2020-09-04 17:21 ` Bastien
  2020-09-04 21:00   ` Samuel Wales
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2020-09-04 17:21 UTC (permalink / raw)
  To: Matt Lundin; +Cc: emacs-orgmode

Hi Matt,

> I'm just getting around to exploring the function org-agenda-filter
> introduced last year. (Due to busyness, I was running an older version
> of Org Mode last year for fear of breaking features I relied on.)
>
> I like the tab completion. However, I'm finding that the completion for
> categories often fails because of hyphens in my file and category names.

Thanks for reporting this.  I pushed a fix in the maint branch which
allows for such category names to be enclosed within double quotes
when the user wants to complete them -- the quotes helps not being
confused by the hyphen when reading the complete filter string, which
might contain other syntacticly meaningful hyphens.

I haven't fixed the case for filetags but shouldn't filetags follow
the same convention than mere tags of not allowing "-" ?

Let me know if I (or the documentation) miss something and if the
fix is good enough for you.

Thanks,

-- 
 Bastien


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] org-agenda-filter and hyphens in category names
  2020-09-04 17:21 ` Bastien
@ 2020-09-04 21:00   ` Samuel Wales
  2020-09-05 15:10     ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Samuel Wales @ 2020-09-04 21:00 UTC (permalink / raw)
  To: Bastien; +Cc: Matt Lundin, emacs-orgmode

i was unaware of this feature, bound to / in maint, so i tried it in
maint before the fix and got a different result.

all of my categories have hyphens, and many of my files.  i suspect on
linux, osx, bsd*, etc., hyphenated filenames are common.

my categories look like e-remember, e-refile, e-jinsei, o-bastien
[just kidding], o-matt-lundin [ditto], etc.  this allows me to have
broad meta-categories like computer, org, extra, medical.

so i tried it with e-, and it completed to e-refile without providing
any choice.  this is just incorrect.  i really like hyphens so i hope
they become first-class if possible.

On 9/4/20, Bastien <bzg@gnu.org> wrote:
> Hi Matt,
>
>> I'm just getting around to exploring the function org-agenda-filter
>> introduced last year. (Due to busyness, I was running an older version
>> of Org Mode last year for fear of breaking features I relied on.)
>>
>> I like the tab completion. However, I'm finding that the completion for
>> categories often fails because of hyphens in my file and category names.
>
> Thanks for reporting this.  I pushed a fix in the maint branch which
> allows for such category names to be enclosed within double quotes
> when the user wants to complete them -- the quotes helps not being
> confused by the hyphen when reading the complete filter string, which
> might contain other syntacticly meaningful hyphens.
>
> I haven't fixed the case for filetags but shouldn't filetags follow
> the same convention than mere tags of not allowing "-" ?
>
> Let me know if I (or the documentation) miss something and if the
> fix is good enough for you.
>
> Thanks,
>
> --
>  Bastien
>
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] org-agenda-filter and hyphens in category names
  2020-09-04 21:00   ` Samuel Wales
@ 2020-09-05 15:10     ` Bastien
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2020-09-05 15:10 UTC (permalink / raw)
  To: Samuel Wales; +Cc: Matt Lundin, emacs-orgmode

Hi Samuel,

regarding hyphens in categories and agenda filtering, you should be
good to go from maint and master.  Please test it and let us know.

All best,

-- 
 Bastien


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-05 15:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-05 20:00 [BUG] org-agenda-filter and hyphens in category names Matt Lundin
2020-09-04 17:21 ` Bastien
2020-09-04 21:00   ` Samuel Wales
2020-09-05 15:10     ` Bastien

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).