emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Agenda: How to bulk mark regex w/spaces?
@ 2020-02-11 16:19 Nathan Neff
  2020-02-11 23:22 ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Nathan Neff @ 2020-02-11 16:19 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 584 bytes --]

Hello all,

I'm trying to use org-agenda-bulk-mark-regexp and trying to search for
headings having "Pre Class".

None of the combinations have worked so far (I've tried with quotes
and without quotes in the prompt)

Pre Class
Pre\sClass
Pre\\sClass
Pre.*Class
{Pre Class}

It appears that the function is simply using the
(re-search-forward) function, and I've tried simply calling
:(re-search-forward "Pre Class") in the agenda, and the text is indeed
found.

Therefore, I'm wondering if the prompt for the regex is somehow mangling
the input to the function itself?

Thanks,
--Nate

[-- Attachment #2: Type: text/html, Size: 915 bytes --]

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

* Re: Agenda: How to bulk mark regex w/spaces?
  2020-02-11 16:19 Agenda: How to bulk mark regex w/spaces? Nathan Neff
@ 2020-02-11 23:22 ` Bastien
  2020-02-12 17:49   ` Nathan Neff
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2020-02-11 23:22 UTC (permalink / raw)
  To: Nathan Neff; +Cc: emacs-orgmode

Hi Nathan,

Nathan Neff <nathan.neff@gmail.com> writes:

> I'm trying to use org-agenda-bulk-mark-regexp and trying to search
> for
> headings having "Pre Class".
>
> None of the combinations have worked so far (I've tried with quotes
> and without quotes in the prompt)

There is nothing special with the regexps you need to enter with
`org-agenda-bulk-mark-regexp', you can use the same syntax you would
use for, e.g., C-u C-s in Emacs.

Note that only the text of the headline is considered, not part of
the agenda line that are not the heading itself (e.g. todo keywords,
tags, etc.)

> Pre Class

should work

> Pre\sClass

=> Pre\s-Class should work

> Pre\\sClass

nope

> Pre.*Class

should work

> {Pre Class}

nope.

HTH,

-- 
 Bastien

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

* Re: Agenda: How to bulk mark regex w/spaces?
  2020-02-11 23:22 ` Bastien
@ 2020-02-12 17:49   ` Nathan Neff
  2020-02-12 17:51     ` Nathan Neff
  2020-02-12 19:01     ` Bastien
  0 siblings, 2 replies; 6+ messages in thread
From: Nathan Neff @ 2020-02-12 17:49 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2030 bytes --]

Hi Bastien,

I'm using emacs -u NONE with emacs 27.0.50
and Org mode version 9.2.5

And I'm not seeing this expected behavior.

I have the following simple foo.org file for my agenda:
* TODO Foo
* TODO Pre Class
* TODO Again

I'm using the built-in agenda view for TODO entries ("t")
and I'm searching using

Pre\sClass
{Pre\sClass}
Pre Class
"Pre Class"

And the entry is not *marked* in the agenda, but there are messages
saying "1 entries marked for bulk action"

If I search for "Pre Clas" and "Pre\sCl" etc. the entries are marked.

If I search for "Class" (no quotes) then there's no match.  However, if I
search for "Cla" (no quotes) then there is a match and the heading is
marked.

So, it appears there's a problem *if the match ends on the last character
of the heading*.

In fact, I can replicate the problem by searching in the agenda manually by
searching for "Class"
(no quotes) :) and then calling (call-interactively 'org-agenda-bulk-mark)
- the mark is not made and
there's a message "user-error: Nothing to mark at point"

Not sure how to fix it but wanted to show my awesome debugging skills :)))

Thanks,
--Nate

Thanks,
--Nate



On Tue, Feb 11, 2020 at 5:22 PM Bastien <bzg@gnu.org> wrote:

> Hi Nathan,
>
> Nathan Neff <nathan.neff@gmail.com> writes:
>
> > I'm trying to use org-agenda-bulk-mark-regexp and trying to search
> > for
> > headings having "Pre Class".
> >
> > None of the combinations have worked so far (I've tried with quotes
> > and without quotes in the prompt)
>
> There is nothing special with the regexps you need to enter with
> `org-agenda-bulk-mark-regexp', you can use the same syntax you would
> use for, e.g., C-u C-s in Emacs.
>
> Note that only the text of the headline is considered, not part of
> the agenda line that are not the heading itself (e.g. todo keywords,
> tags, etc.)
>
> > Pre Class
>
> should work
>
> > Pre\sClass
>
> => Pre\s-Class should work
>
> > Pre\\sClass
>
> nope
>
> > Pre.*Class
>
> should work
>
> > {Pre Class}
>
> nope.
>
> HTH,
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 3279 bytes --]

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

* Re: Agenda: How to bulk mark regex w/spaces?
  2020-02-12 17:49   ` Nathan Neff
@ 2020-02-12 17:51     ` Nathan Neff
  2020-02-12 19:01     ` Bastien
  1 sibling, 0 replies; 6+ messages in thread
From: Nathan Neff @ 2020-02-12 17:51 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2559 bytes --]

Whoops sorry wanted to reference the source code:

https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-agenda.el#L10147

I think that the problem is the call to org-agenda-bulk-mark on line 10160
(it doesn't mark
if the point is at the EOL)
https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-agenda.el#L10160

On Wed, Feb 12, 2020 at 11:49 AM Nathan Neff <nathan.neff@gmail.com> wrote:

> Hi Bastien,
>
> I'm using emacs -u NONE with emacs 27.0.50
> and Org mode version 9.2.5
>
> And I'm not seeing this expected behavior.
>
> I have the following simple foo.org file for my agenda:
> * TODO Foo
> * TODO Pre Class
> * TODO Again
>
> I'm using the built-in agenda view for TODO entries ("t")
> and I'm searching using
>
> Pre\sClass
> {Pre\sClass}
> Pre Class
> "Pre Class"
>
> And the entry is not *marked* in the agenda, but there are messages
> saying "1 entries marked for bulk action"
>
> If I search for "Pre Clas" and "Pre\sCl" etc. the entries are marked.
>
> If I search for "Class" (no quotes) then there's no match.  However, if I
> search for "Cla" (no quotes) then there is a match and the heading is
> marked.
>
> So, it appears there's a problem *if the match ends on the last character
> of the heading*.
>
> In fact, I can replicate the problem by searching in the agenda manually
> by searching for "Class"
> (no quotes) :) and then calling (call-interactively 'org-agenda-bulk-mark)
> - the mark is not made and
> there's a message "user-error: Nothing to mark at point"
>
> Not sure how to fix it but wanted to show my awesome debugging skills :)))
>
> Thanks,
> --Nate
>
> Thanks,
> --Nate
>
>
>
> On Tue, Feb 11, 2020 at 5:22 PM Bastien <bzg@gnu.org> wrote:
>
>> Hi Nathan,
>>
>> Nathan Neff <nathan.neff@gmail.com> writes:
>>
>> > I'm trying to use org-agenda-bulk-mark-regexp and trying to search
>> > for
>> > headings having "Pre Class".
>> >
>> > None of the combinations have worked so far (I've tried with quotes
>> > and without quotes in the prompt)
>>
>> There is nothing special with the regexps you need to enter with
>> `org-agenda-bulk-mark-regexp', you can use the same syntax you would
>> use for, e.g., C-u C-s in Emacs.
>>
>> Note that only the text of the headline is considered, not part of
>> the agenda line that are not the heading itself (e.g. todo keywords,
>> tags, etc.)
>>
>> > Pre Class
>>
>> should work
>>
>> > Pre\sClass
>>
>> => Pre\s-Class should work
>>
>> > Pre\\sClass
>>
>> nope
>>
>> > Pre.*Class
>>
>> should work
>>
>> > {Pre Class}
>>
>> nope.
>>
>> HTH,
>>
>> --
>>  Bastien
>>
>

[-- Attachment #2: Type: text/html, Size: 4334 bytes --]

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

* Re: Agenda: How to bulk mark regex w/spaces?
  2020-02-12 17:49   ` Nathan Neff
  2020-02-12 17:51     ` Nathan Neff
@ 2020-02-12 19:01     ` Bastien
  2020-02-12 23:16       ` Nathan Neff
  1 sibling, 1 reply; 6+ messages in thread
From: Bastien @ 2020-02-12 19:01 UTC (permalink / raw)
  To: Nathan Neff; +Cc: emacs-orgmode

Hi Nathan,

thanks for sticking with me on this one!  You're right, it's when the
match happens at the end of the line, I've pushed a fix in maint.

Thanks!

-- 
 Bastien

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

* Re: Agenda: How to bulk mark regex w/spaces?
  2020-02-12 19:01     ` Bastien
@ 2020-02-12 23:16       ` Nathan Neff
  0 siblings, 0 replies; 6+ messages in thread
From: Nathan Neff @ 2020-02-12 23:16 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 385 bytes --]

Thanks Bastien for your hard work - I'm famous!

https://code.orgmode.org/bzg/org-mode/commit/c0d08b7efe740c17a3eec28984161c05e43da5ef

On Wed, Feb 12, 2020 at 1:01 PM Bastien <bzg@gnu.org> wrote:

> Hi Nathan,
>
> thanks for sticking with me on this one!  You're right, it's when the
> match happens at the end of the line, I've pushed a fix in maint.
>
> Thanks!
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 894 bytes --]

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

end of thread, other threads:[~2020-02-12 23:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 16:19 Agenda: How to bulk mark regex w/spaces? Nathan Neff
2020-02-11 23:22 ` Bastien
2020-02-12 17:49   ` Nathan Neff
2020-02-12 17:51     ` Nathan Neff
2020-02-12 19:01     ` Bastien
2020-02-12 23:16       ` Nathan Neff

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