emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-grep, and problems
@ 2013-10-10 15:50 François Pinard
  2013-10-10 16:54 ` Suvayu Ali
  2013-10-13 21:43 ` R. Michael Weylandt <michael.weylandt@gmail.com>
  0 siblings, 2 replies; 15+ messages in thread
From: François Pinard @ 2013-10-10 15:50 UTC (permalink / raw)
  To: emacs-orgmode

Hi, Org people.

I recently rewrote my Emacs "org-grep" function, which surely nobody
remember, as when we discussed it here, it was years ago! :-)

The new writing gives nicer results, so I made it available as:

   https://github.com/pinard/org-grep

However, I'm not satisfied.  Maybe someone would be kind enough to
explore and understand some of the problems I see, at least before I
succeed in doing it myself.  The two main problems are:

  - (save-current-buffer ...) or (save-excursion ...) fail to bring the
    cursor back into the current window, seemingly whenever an Org link
    gets followed within the Lisp form.

  - org-reveal leaves the cursor line collapsed.

I can live with these two problems unsolved, as it only requires a few
more manipulations as a user.  They would be nicer solved, of course.

Keep happy, all!

François

P.S. What is proper English: "nobody remember" or "nobody remembers"?

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

* Re: org-grep, and problems
  2013-10-10 15:50 org-grep, and problems François Pinard
@ 2013-10-10 16:54 ` Suvayu Ali
  2013-10-10 18:59   ` Suvayu Ali
  2013-10-13 21:43 ` R. Michael Weylandt <michael.weylandt@gmail.com>
  1 sibling, 1 reply; 15+ messages in thread
From: Suvayu Ali @ 2013-10-10 16:54 UTC (permalink / raw)
  To: emacs-orgmode

On Thu, Oct 10, 2013 at 11:50:47AM -0400, François Pinard wrote:
> 
> I recently rewrote my Emacs "org-grep" function, which surely nobody
> remember, as when we discussed it here, it was years ago! :-)

Looks interesting.  I'll check it out.

> P.S. What is proper English: "nobody remember" or "nobody remembers"?
> 

"no one remembers" maybe?

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: org-grep, and problems
  2013-10-10 16:54 ` Suvayu Ali
@ 2013-10-10 18:59   ` Suvayu Ali
  2013-10-11  1:14     ` François Pinard
  0 siblings, 1 reply; 15+ messages in thread
From: Suvayu Ali @ 2013-10-10 18:59 UTC (permalink / raw)
  To: emacs-orgmode

On Thu, Oct 10, 2013 at 06:54:06PM +0200, Suvayu Ali wrote:
> On Thu, Oct 10, 2013 at 11:50:47AM -0400, François Pinard wrote:
> > 
> > I recently rewrote my Emacs "org-grep" function, which surely nobody
> > remember, as when we discussed it here, it was years ago! :-)
> 
> Looks interesting.  I'll check it out.

No matter what I search for, I get 0 results!  My org-directory points
to the correct location: ~/org.  Not sure what is wrong.

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: org-grep, and problems
  2013-10-10 18:59   ` Suvayu Ali
@ 2013-10-11  1:14     ` François Pinard
  2013-10-11  7:43       ` Suvayu Ali
  0 siblings, 1 reply; 15+ messages in thread
From: François Pinard @ 2013-10-11  1:14 UTC (permalink / raw)
  To: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> No matter what I search for, I get 0 results!  My org-directory points
> to the correct location: ~/org.  Not sure what is wrong.

Annoying!  I just tried resetting org-grep-directories to nil here, as a
way to force the default of org-directory, and it works well for me.

Would you happen to be using Windows?  I only tried it on Linux.  It
surely depend on "find" and "grep" being system commands.  (And I should
document that.)

François

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

* Re: org-grep, and problems
  2013-10-11  1:14     ` François Pinard
@ 2013-10-11  7:43       ` Suvayu Ali
  2013-10-14 23:50         ` François Pinard
  0 siblings, 1 reply; 15+ messages in thread
From: Suvayu Ali @ 2013-10-11  7:43 UTC (permalink / raw)
  To: emacs-orgmode

Hi François,

On Thu, Oct 10, 2013 at 09:14:57PM -0400, François Pinard wrote:
> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> 
> > No matter what I search for, I get 0 results!  My org-directory points
> > to the correct location: ~/org.  Not sure what is wrong.
> 
> Annoying!  I just tried resetting org-grep-directories to nil here, as a
> way to force the default of org-directory, and it works well for me.
> 
> Would you happen to be using Windows?  I only tried it on Linux.  It
> surely depend on "find" and "grep" being system commands.  (And I should
> document that.)

I'm on Linux.

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: org-grep, and problems
  2013-10-10 15:50 org-grep, and problems François Pinard
  2013-10-10 16:54 ` Suvayu Ali
@ 2013-10-13 21:43 ` R. Michael Weylandt <michael.weylandt@gmail.com>
  2013-10-14 13:29   ` Suvayu Ali
  2013-10-14 14:42   ` James Harkins
  1 sibling, 2 replies; 15+ messages in thread
From: R. Michael Weylandt <michael.weylandt@gmail.com> @ 2013-10-13 21:43 UTC (permalink / raw)
  To: François Pinard; +Cc: emacs-orgmode@gnu.org



On Oct 10, 2013, at 11:50, François Pinard <pinard@iro.umontreal.ca> wrote:

> 
> P.S. What is proper English: "nobody remember" or "nobody remembers"?
> 

Remembers. 'Nobody' counts as singular, as does 'no one'. English isn't  totally consistent on this matter, however, as 'none' takes a plural verb. 

No one is brave enough to skip the meeting, even though none of the bosses are going to attend. 

M

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

* Re: org-grep, and problems
  2013-10-13 21:43 ` R. Michael Weylandt <michael.weylandt@gmail.com>
@ 2013-10-14 13:29   ` Suvayu Ali
  2013-10-14 14:42   ` James Harkins
  1 sibling, 0 replies; 15+ messages in thread
From: Suvayu Ali @ 2013-10-14 13:29 UTC (permalink / raw)
  To: emacs-orgmode

On Sun, Oct 13, 2013 at 05:43:18PM -0400, R. Michael Weylandt <michael.weylandt@gmail.com> wrote:
> 
> 
> On Oct 10, 2013, at 11:50, François Pinard <pinard@iro.umontreal.ca> wrote:
> 
> > 
> > P.S. What is proper English: "nobody remember" or "nobody remembers"?
> > 
> 
> Remembers. 'Nobody' counts as singular, as does 'no one'. English
> isn't totally consistent on this matter, however, as 'none' takes a
> plural verb.
> 
> No one is brave enough to skip the meeting, even though none of the
> bosses are going to attend.

Actually, I think it is quite consistent.  "Nobody" refers to an
individual, even though the set of possible individuals is infinite;
same goes for "no one".  Where as "none of the ..." refers to the set
collectively.

I think Strunk & White says the same, although I can't quote – I don't
have my copy handy at the moment.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: org-grep, and problems
  2013-10-13 21:43 ` R. Michael Weylandt <michael.weylandt@gmail.com>
  2013-10-14 13:29   ` Suvayu Ali
@ 2013-10-14 14:42   ` James Harkins
  2013-10-14 18:19     ` Jonathan Leech-Pepin
  1 sibling, 1 reply; 15+ messages in thread
From: James Harkins @ 2013-10-14 14:42 UTC (permalink / raw)
  To: emacs-orgmode

R. Michael Weylandt <michael.weylandt <at> gmail.com> <michael.weylandt <at> 
gmail.com> writes:

> On Oct 10, 2013, at 11:50, François Pinard <pinard <at> iro.umontreal.ca> 
wrote:
> 
> > 
> > P.S. What is proper English: "nobody remember" or "nobody remembers"?
> > 
> 
> Remembers. 'Nobody' counts as singular, as does 'no one'. English isn't  
totally consistent on this
> matter, however, as 'none' takes a plural verb. 
> 
> No one is brave enough to skip the meeting, even though none of the bosses 
are going to attend. 

Actually, I think the latter clause is incorrect usage. The verb's subject is 
"none," not "bosses"; since the subject is singular, the verb form should be 
singular as well. It "feels wrong" to have a singular verb immediately after a 
plural noun, but that noun properly belongs to the preposition, not the verb.

I'm voting for "none of the bosses is going to attend."

hjh

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

* Re: org-grep, and problems
  2013-10-14 14:42   ` James Harkins
@ 2013-10-14 18:19     ` Jonathan Leech-Pepin
  2013-10-14 22:17       ` Alan L Tyree
  2013-10-15  4:50       ` James Harkins
  0 siblings, 2 replies; 15+ messages in thread
From: Jonathan Leech-Pepin @ 2013-10-14 18:19 UTC (permalink / raw)
  To: James Harkins; +Cc: Org Mode Mailing List

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

Hello,

On Oct 14, 2013 10:43 AM, "James Harkins" <jamshark70@gmail.com> wrote:
>
> R. Michael Weylandt <michael.weylandt <at> gmail.com> <michael.weylandt
<at>
> gmail.com> writes:
>
> > On Oct 10, 2013, at 11:50, François Pinard <pinard <at> iro.umontreal.ca
>
> wrote:
> >
> > >
> > > P.S. What is proper English: "nobody remember" or "nobody remembers"?
> > >
> >
> > Remembers. 'Nobody' counts as singular, as does 'no one'. English isn't
> totally consistent on this
> > matter, however, as 'none' takes a plural verb.
> >
> > No one is brave enough to skip the meeting, even though none of the
bosses
> are going to attend.
>
> Actually, I think the latter clause is incorrect usage. The verb's
subject is
> "none," not "bosses"; since the subject is singular, the verb form should
be
> singular as well. It "feels wrong" to have a singular verb immediately
after a
> plural noun, but that noun properly belongs to the preposition, not the
verb.
>
> I'm voting for "none of the bosses is going to attend."

None is a bit of an odd case, since it reflects the plurality of the
associated noun.

None of the group is going...
None of the groups are going...
None of the bosses are going to attend.

Some, most, all also follow that pattern:
All of the group is...
All of the bosses are...

Group allows for both the plural and similar case since even one group
still has multiple members (at least it implies such).

Jon

> hjh
>
>

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

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

* Re: org-grep, and problems
  2013-10-14 18:19     ` Jonathan Leech-Pepin
@ 2013-10-14 22:17       ` Alan L Tyree
  2013-10-15  4:50       ` James Harkins
  1 sibling, 0 replies; 15+ messages in thread
From: Alan L Tyree @ 2013-10-14 22:17 UTC (permalink / raw)
  To: emacs-orgmode

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

On 15/10/13 05:19, Jonathan Leech-Pepin wrote:
>
> Hello,
>
> On Oct 14, 2013 10:43 AM, "James Harkins" <jamshark70@gmail.com 
> <mailto:jamshark70@gmail.com>> wrote:
> >
> > R. Michael Weylandt <michael.weylandt <at> gmail.com 
> <http://gmail.com>> <michael.weylandt <at>
> > gmail.com <http://gmail.com>> writes:
> >
> > > On Oct 10, 2013, at 11:50, François Pinard <pinard <at> 
> iro.umontreal.ca <http://iro.umontreal.ca>>
> > wrote:
> > >
> > > >
> > > > P.S. What is proper English: "nobody remember" or "nobody 
> remembers"?
> > > >
> > >
> > > Remembers. 'Nobody' counts as singular, as does 'no one'. English 
> isn't
> > totally consistent on this
> > > matter, however, as 'none' takes a plural verb.
> > >
> > > No one is brave enough to skip the meeting, even though none of 
> the bosses
> > are going to attend.
> >
> > Actually, I think the latter clause is incorrect usage. The verb's 
> subject is
> > "none," not "bosses"; since the subject is singular, the verb form 
> should be
> > singular as well. It "feels wrong" to have a singular verb 
> immediately after a
> > plural noun, but that noun properly belongs to the preposition, not 
> the verb.
> >
> > I'm voting for "none of the bosses is going to attend."
>
> None is a bit of an odd case, since it reflects the plurality of the 
> associated noun.
>
> None of the group is going...
> None of the groups are going...
> None of the bosses are going to attend.
>
> Some, most, all also follow that pattern:
> All of the group is...
> All of the bosses are...
>
> Group allows for both the plural and similar case since even one group 
> still has multiple members (at least it implies such).
>
> Jon
>
> > hjh
> >
> >
>
Strunk & White 3rd edition p9:

   With none, use the singular verb when the word means "no one" or "not
    one."

      None of us are perfect.     None of us is perfect.

    A plural verb is commonly used when none suggests more than one thing
    or person.

      None are so fallible as those who are sure they're right.


Alan

-- 
Alan L Tyree                    http://www2.austlii.edu.au/~alan
Tel:  04 2748 6206              sip:typhoon@iptel.org


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

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

* Re: org-grep, and problems
  2013-10-11  7:43       ` Suvayu Ali
@ 2013-10-14 23:50         ` François Pinard
  2013-10-15  9:06           ` Suvayu Ali
  0 siblings, 1 reply; 15+ messages in thread
From: François Pinard @ 2013-10-14 23:50 UTC (permalink / raw)
  To: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

>> > No matter what I search for, I get 0 results!
> I'm on Linux.

Hmph!  As it works nicely for me, I thought it would be useful to
others.  I'm saddened it does not work for you.  How could we proceed so
I try to help on this one?  Write me privately if you feel like it (yet
my replies may lag sometimes, I'm not always available).

François

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

* Re: org-grep, and problems
  2013-10-14 18:19     ` Jonathan Leech-Pepin
  2013-10-14 22:17       ` Alan L Tyree
@ 2013-10-15  4:50       ` James Harkins
  2013-10-16  1:15         ` François Pinard
  1 sibling, 1 reply; 15+ messages in thread
From: James Harkins @ 2013-10-15  4:50 UTC (permalink / raw)
  To: Jonathan Leech-Pepin; +Cc: Org Mode Mailing List

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

On Oct 15, 2013 2:19 AM, "Jonathan Leech-Pepin" <
jonathan.leechpepin@gmail.com> wrote:.
> > I'm voting for "none of the bosses is going to attend."
>
> None is a bit of an odd case, since it reflects the plurality of the
associated noun.

I don't want to drag it out much further as it's well off topic, but... I
did some checking and found (for the most part) that what I said *used* to
be true, but that the usage has been shifting for a good century or two (to
allow "none" to be plural). So I concede that point (and learned something
today, which I like).

From the few grammar sites I checked, it seems that a plural "none" is
definitely accepted in speech and informal writing. One site mentioned that
formal writing may more often call for none to take a singular verb,
regardless of the associated noun. But Facebook, twitter and texting have
basically killed formal writing already, so, soon even that caveat will be
gone.

I did not find any sites claiming that it's mandatory to give "none" a
plural verb if it appears with a plural noun. All of those sites at least
gave lip service to its origin as "not one of" -- e.g. "not one of the
groups is going" -- so my preference for the singular verb is justified,
though not my claim that the other is flat-out incorrect.

Thanks... Glad to learn I can cross that one off my grammar police list.

hjh

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

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

* Re: org-grep, and problems
  2013-10-14 23:50         ` François Pinard
@ 2013-10-15  9:06           ` Suvayu Ali
  2013-10-16  1:26             ` François Pinard
  0 siblings, 1 reply; 15+ messages in thread
From: Suvayu Ali @ 2013-10-15  9:06 UTC (permalink / raw)
  To: emacs-orgmode

On Mon, Oct 14, 2013 at 07:50:36PM -0400, François Pinard wrote:
> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> 
> >> > No matter what I search for, I get 0 results!
> > I'm on Linux.
> 
> Hmph!  As it works nicely for me, I thought it would be useful to
> others.  I'm saddened it does not work for you.  How could we proceed so
> I try to help on this one?  Write me privately if you feel like it (yet
> my replies may lag sometimes, I'm not always available).

The library seemed interesting, so I was trying it out.  I usually use a
custom shell script from the terminal to search.  I can try debugging
org-grep, but I don't know where I should start.

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: org-grep, and problems
  2013-10-15  4:50       ` James Harkins
@ 2013-10-16  1:15         ` François Pinard
  0 siblings, 0 replies; 15+ messages in thread
From: François Pinard @ 2013-10-16  1:15 UTC (permalink / raw)
  To: emacs-orgmode

James Harkins <jamshark70@gmail.com> writes:

> I don't want to drag it out much further as it's well off topic,

I'm sorry that my little grammar question, in the P.S. of the original
message, generated all that traffic.  I did not know the answers were so
debatable, and was rather expecting a quick and conclusive reply from
any English guy (or girl) around.

Another notable point is that nobody replied to the Org questions in the
original message, yet I quite understand that chasing bugs in someone
else code is not an especially attractive activity :-).

Keep happy all!

François

P.S. Who just upgraded Ubuntu to [...]  Oops!  No more P.S.'es :-)

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

* Re: org-grep, and problems
  2013-10-15  9:06           ` Suvayu Ali
@ 2013-10-16  1:26             ` François Pinard
  0 siblings, 0 replies; 15+ messages in thread
From: François Pinard @ 2013-10-16  1:26 UTC (permalink / raw)
  To: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> I can try debugging org-grep, but I don't know where I should start.

I would either step through org-grep (using C-u C-M-x first over any
line of the org-grep definition within org-grep.el, or add (message ...)
lines within the function before to later check the *Messages* buffer,
and after calling org-grep the normal way to trigger the trace, pay
special attention to the argument given to shell-command.

That command, repeated in a mere shell outside Emacs, should find hits
in your Org files.  If not, I would play with that command to see how it
should have been written to be successful, then amend org-grep so it
generates the proper command.

If everything that should be found gets found, then I'd suspect the code
after shell-command which reformats the output, and step through it to
find where it does it wrong.

The code is small, so the bug does not have much room to hide :-).

François

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

end of thread, other threads:[~2013-10-16  1:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-10 15:50 org-grep, and problems François Pinard
2013-10-10 16:54 ` Suvayu Ali
2013-10-10 18:59   ` Suvayu Ali
2013-10-11  1:14     ` François Pinard
2013-10-11  7:43       ` Suvayu Ali
2013-10-14 23:50         ` François Pinard
2013-10-15  9:06           ` Suvayu Ali
2013-10-16  1:26             ` François Pinard
2013-10-13 21:43 ` R. Michael Weylandt <michael.weylandt@gmail.com>
2013-10-14 13:29   ` Suvayu Ali
2013-10-14 14:42   ` James Harkins
2013-10-14 18:19     ` Jonathan Leech-Pepin
2013-10-14 22:17       ` Alan L Tyree
2013-10-15  4:50       ` James Harkins
2013-10-16  1:15         ` François Pinard

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