[-- Attachment #1: Type: text/plain, Size: 334 bytes --] Hey guys, When I started using org, I used to tag everything with upper-case tags. It just feels noisy now and I started tagging them in lower-case. The agenda tag search (C-a m) makes that distinction, and I'd like to just search for the tag string regardless of case. Is that possible to configure? Thanks in advance, - Marcelo. [-- Attachment #2: Type: text/html, Size: 413 bytes --]
[-- Attachment #1: Type: text/plain, Size: 463 bytes --] *bump*... anyone ? :) On Sat, Oct 8, 2011 at 9:25 PM, Marcelo de Moraes Serpa <celoserpa@gmail.com > wrote: > Hey guys, > > When I started using org, I used to tag everything with upper-case tags. It > just feels noisy now and I started tagging them in lower-case. The agenda > tag search (C-a m) makes that distinction, and I'd like to just search for > the tag string regardless of case. Is that possible to configure? > > Thanks in advance, > > - Marcelo. > [-- Attachment #2: Type: text/html, Size: 786 bytes --]
On 10.10.2011, at 17:48, Marcelo de Moraes Serpa wrote: > *bump*... anyone ? :) > > On Sat, Oct 8, 2011 at 9:25 PM, Marcelo de Moraes Serpa <celoserpa@gmail.com> wrote: > Hey guys, > > When I started using org, I used to tag everything with upper-case tags. It just feels noisy now and I started tagging them in lower-case. The agenda tag search (C-a m) makes that distinction, and I'd like to just search for the tag string regardless of case. Is that possible to configure? No. - Carsten > > Thanks in advance, > > - Marcelo. >
[-- Attachment #1: Type: text/plain, Size: 850 bytes --] @Carsten Thank you for the reply. Would it be hard to add such feature, considering I'm just beginning with elisp? Might be a candidate for my first patch to orgmode :) Thanks, - M On Mon, Oct 10, 2011 at 2:16 PM, Carsten Dominik <carsten.dominik@gmail.com>wrote: > > On 10.10.2011, at 17:48, Marcelo de Moraes Serpa wrote: > > > *bump*... anyone ? :) > > > > On Sat, Oct 8, 2011 at 9:25 PM, Marcelo de Moraes Serpa < > celoserpa@gmail.com> wrote: > > Hey guys, > > > > When I started using org, I used to tag everything with upper-case tags. > It just feels noisy now and I started tagging them in lower-case. The agenda > tag search (C-a m) makes that distinction, and I'd like to just search for > the tag string regardless of case. Is that possible to configure? > > No. > > - Carsten > > > > > Thanks in advance, > > > > - Marcelo. > > > > [-- Attachment #2: Type: text/html, Size: 1426 bytes --]
Hi Marcelo,
On Mon, Oct 10, 2011 at 10:54 PM, Marcelo de Moraes Serpa
<celoserpa@gmail.com> wrote:
> Would it be hard to add such feature, considering I'm just beginning with
> elisp? Might be a candidate for my first patch to orgmode :)
Since you mention lisp, I think you can have an easy solution with a
custom agenda command. As far as I can see there could be two
possibilities, bind `case-fold-search' to t or `downcase' your search
query before performing a regular tags search.
I haven't looked at any code before making these suggestions. So you
will have to figure out which, if any at all, is viable.
HF
--
Suvayu
Open source is the future. It sets us free.
[-- Attachment #1: Type: text/plain, Size: 841 bytes --] Thanks Suvayu, I'll play with it. - Marcelo. On Mon, Oct 10, 2011 at 5:20 PM, suvayu ali <fatkasuvayu+linux@gmail.com>wrote: > Hi Marcelo, > > On Mon, Oct 10, 2011 at 10:54 PM, Marcelo de Moraes Serpa > <celoserpa@gmail.com> wrote: > > Would it be hard to add such feature, considering I'm just beginning with > > elisp? Might be a candidate for my first patch to orgmode :) > > Since you mention lisp, I think you can have an easy solution with a > custom agenda command. As far as I can see there could be two > possibilities, bind `case-fold-search' to t or `downcase' your search > query before performing a regular tags search. > > I haven't looked at any code before making these suggestions. So you > will have to figure out which, if any at all, is viable. > > HF > > -- > Suvayu > > Open source is the future. It sets us free. > [-- Attachment #2: Type: text/html, Size: 1300 bytes --]
suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> Hi Marcelo,
>
> On Mon, Oct 10, 2011 at 10:54 PM, Marcelo de Moraes Serpa
> <celoserpa@gmail.com> wrote:
> > Would it be hard to add such feature, considering I'm just beginning with
> > elisp? Might be a candidate for my first patch to orgmode :)
>
> Since you mention lisp, I think you can have an easy solution with a
> custom agenda command. As far as I can see there could be two
> possibilities, bind `case-fold-search' to t or `downcase' your search
> query before performing a regular tags search.
>
> I haven't looked at any code before making these suggestions. So you
> will have to figure out which, if any at all, is viable.
>
My first thought was advising the function as above but it didn't work
when I tried it, so I did look at the code: org-tags-view calls
org-scan-tags which sets case-fold-search to nil unconditionally, hence
the advice failure (I think). But I also tried to set it to t (in a git
branch) and that too did not work for me - I gave up at that point
(however, I didn't try very hard so it is quite conceivable that I
misunderstood the code or did something wrong.)
Nick
On 11.10.2011, at 02:56, Nick Dokos wrote: > suvayu ali <fatkasuvayu+linux@gmail.com> wrote: > >> Hi Marcelo, >> >> On Mon, Oct 10, 2011 at 10:54 PM, Marcelo de Moraes Serpa >> <celoserpa@gmail.com> wrote: >>> Would it be hard to add such feature, considering I'm just beginning with >>> elisp? Might be a candidate for my first patch to orgmode :) >> >> Since you mention lisp, I think you can have an easy solution with a >> custom agenda command. As far as I can see there could be two >> possibilities, bind `case-fold-search' to t or `downcase' your search >> query before performing a regular tags search. >> >> I haven't looked at any code before making these suggestions. So you >> will have to figure out which, if any at all, is viable. >> > > My first thought was advising the function as above but it didn't work > when I tried it, so I did look at the code: org-tags-view calls > org-scan-tags which sets case-fold-search to nil unconditionally, hence > the advice failure (I think). But I also tried to set it to t (in a git > branch) and that too did not work for me - I gave up at that point > (however, I didn't try very hard so it is quite conceivable that I > misunderstood the code or did something wrong.) Matching tags in the scanner is not using search (which would be influenced by case-fold-search). Instead, it uses membership tests, which is case-insensitive. Here is a patch which does make this match case-insensitive. ----------------------------------------------------------------------- Changes at master Modified lisp/org.el diff --git a/lisp/org.el b/lisp/org.el index b26e1a3..083e7dd 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -12656,7 +12656,9 @@ only lines with a TODO keyword are included in the output." ;; eval matcher only when the todo condition is OK (and (or (not todo-only) (member todo org-not-done-keywords)) - (let ((case-fold-search t)) (eval matcher))) + (let ((case-fold-search t) + (tags-list (mapcar 'downcase tags-list))) + (eval matcher))) ;; Call the skipper, but return t if it does not skip, ;; so that the `and' form continues evaluating ----------------------------------------------------------------------- However, tags are treated case-sensitively also by the functions setting tags. For example, if an entry has the tag :aa:, you can still set a tag :Aa:. To be on the safe side, my suggestion would be to apply a function to your files which would downcase all the tags present in the buffer. Marcelo, maybe this is a nice task to try your elisp on? With perl, it would be a one-liner.... - Carsten
On 10/11/11 8:22 AM, Carsten Dominik wrote:
> (...) To be on the safe side, my suggestion
> would be to apply a function to your files which would
> downcase all the tags present in the buffer.
>
> Marcelo, maybe this is a nice task to try your elisp on?
> With perl, it would be a one-liner....
I have one... but I won't spoil Marcelo's fun if he wants to write his
own; it was indeed a nice task!
:)
Christian