emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* tags/search on specific files
@ 2011-01-09  5:58 knubee
  2011-01-09 11:25 ` Bernt Hansen
  0 siblings, 1 reply; 8+ messages in thread
From: knubee @ 2011-01-09  5:58 UTC (permalink / raw)
  To: emacs-orgmode

i would like to use some org-mode functionality for linking,
tagging, and searching files that are not specified in the
org-mode variables of .emacs file.

i thought that i would be able to create a file, work on it in
org-mode to create links and tags, and then be able to follow
those links and search on those tags.  after working on such a
file, linking works fine. but although running "C-c \" [tag]
does "highlight" lines that have the tag, it also displays all
the other items. (by contrast, "C-c a m" [tag] will display only
the specific tagged items for the agenda file(s) specified in
.emacs)

is there a way to do this that i am missing? either by providing
a file name as an argument or some other command that will return
such a view for the active buffer. (one reason i don't want to
add the specific file to the list of files that org-mode
automatically tracks is that i want to restrict my searching of
tags to specific files. but maybe i am not thinking about this
the right way.)

thanks.

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

* Re: tags/search on specific files
  2011-01-09  5:58 tags/search on specific files knubee
@ 2011-01-09 11:25 ` Bernt Hansen
  2011-01-09 12:21   ` knubee
  0 siblings, 1 reply; 8+ messages in thread
From: Bernt Hansen @ 2011-01-09 11:25 UTC (permalink / raw)
  To: knubee; +Cc: emacs-orgmode

knubee <knubee@gmail.com> writes:

> i would like to use some org-mode functionality for linking,
> tagging, and searching files that are not specified in the
> org-mode variables of .emacs file.
>
> i thought that i would be able to create a file, work on it in
> org-mode to create links and tags, and then be able to follow
> those links and search on those tags.  after working on such a
> file, linking works fine. but although running "C-c \" [tag]
> does "highlight" lines that have the tag, it also displays all
> the other items. (by contrast, "C-c a m" [tag] will display only
> the specific tagged items for the agenda file(s) specified in
> .emacs)
>
> is there a way to do this that i am missing? either by providing
> a file name as an argument or some other command that will return
> such a view for the active buffer. (one reason i don't want to
> add the specific file to the list of files that org-mode
> automatically tracks is that i want to restrict my searching of
> tags to specific files. but maybe i am not thinking about this
> the right way.)
>
> thanks.

Hi knubee,

As long as your file is in org-mode that should work fine.  You can run
an agenda just on the current file in multiple ways:

C-c a 1 m 
  will run the tags match command on the current file only

If you want to use multiple agenda commands you can enable the agenda
restriction lock as follows

  - on the first line of an org-mode file (before the first heading) do
    C-c C-x <
    You do this on a #+STARTUP: line or on a blank line before the first
    heading

All subsequent agenda commands will only consider this one file until
you remove the restriction lock with C-c C-x >

HTH,
Bernt

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

* Re: tags/search on specific files
  2011-01-09 11:25 ` Bernt Hansen
@ 2011-01-09 12:21   ` knubee
  2011-01-09 18:44     ` Matt Lundin
  0 siblings, 1 reply; 8+ messages in thread
From: knubee @ 2011-01-09 12:21 UTC (permalink / raw)
  To: emacs-orgmode

> As long as your file is in org-mode that should work fine.  You can run
> an agenda just on the current file in multiple ways:
> 
> C-c a 1 m 
>   will run the tags match command on the current file only

ah, that does it! thanks.

related question: is there something similar for searching on properties? "C-c / 
p" does highlight the search items for the current file, but doesn't narrow to 
display only those items. although "C-c a" indicates that it will work on 
properties, "C-c a 1 m" only seems to match on tags (and "C-c a 1 p" is not an 
option).

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

* Re: tags/search on specific files
  2011-01-09 12:21   ` knubee
@ 2011-01-09 18:44     ` Matt Lundin
  2011-01-09 22:55       ` knubee
  0 siblings, 1 reply; 8+ messages in thread
From: Matt Lundin @ 2011-01-09 18:44 UTC (permalink / raw)
  To: knubee; +Cc: emacs-orgmode

knubee <knubee@gmail.com> writes:

> related question: is there something similar for searching on properties? "C-c / 
> p" does highlight the search items for the current file, but doesn't narrow to 
> display only those items. although "C-c a" indicates that it will work on 
> properties, "C-c a 1 m" only seems to match on tags (and "C-c a 1 p" is not an 
> option).
>

Please see:

http://orgmode.org/manual/Matching-tags-and-properties.html

and

http://orgmode.org/worg/org-tutorials/advanced-searching.html#property-searches

Best,
Matt

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

* Re: tags/search on specific files
  2011-01-09 18:44     ` Matt Lundin
@ 2011-01-09 22:55       ` knubee
  2011-01-09 23:08         ` Carsten Dominik
  0 siblings, 1 reply; 8+ messages in thread
From: knubee @ 2011-01-09 22:55 UTC (permalink / raw)
  To: emacs-orgmode

> Please see:
> http://orgmode.org/worg/org-tutorials/advanced-searching.html#property-searches

thanks for the pointers to those pages. it is not explicitly stated how to run 
the command just on the current file, but the following seems to work:

C-c a 1 m 
Match: BIB_AUTHOR="Walter Evensong"

this is not intuitively obvious since "C-c / p" will ask for the query in two 
steps: "property" and then "value". so, i would have guessed that there would be 
a similar command "C-c a 1 p" for doing property searches on the current file.

in any case, it might be good to add this and bernt's information about how to 
run an agenda on just the current file into more of the org-mode documentation 
somewhere.

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

* Re: Re: tags/search on specific files
  2011-01-09 22:55       ` knubee
@ 2011-01-09 23:08         ` Carsten Dominik
  2011-01-15  9:03           ` knubee
  0 siblings, 1 reply; 8+ messages in thread
From: Carsten Dominik @ 2011-01-09 23:08 UTC (permalink / raw)
  To: knubee; +Cc: emacs-orgmode


On Jan 9, 2011, at 11:55 PM, knubee wrote:

>> Please see:
>> http://orgmode.org/worg/org-tutorials/advanced-searching.html#property-searches
>
> thanks for the pointers to those pages. it is not explicitly stated  
> how to run
> the command just on the current file, but the following seems to work:
>
> C-c a 1 m
> Match: BIB_AUTHOR="Walter Evensong"
>
> this is not intuitively obvious since "C-c / p" will ask for the  
> query in two
> steps: "property" and then "value". so, i would have guessed that  
> there would be
> a similar command "C-c a 1 p" for doing property searches on the  
> current file.
>
> in any case, it might be good to add this and bernt's information  
> about how to
> run an agenda on just the current file into more of the org-mode  
> documentation
> somewhere.

Hi Knubee,

if you provide a concrete proposal where you looked for this  
information and where you'd consequently have found it, you can  
increase the chances that this will happen greatly.  Maybe even a patch?

- Carsten

>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: tags/search on specific files
  2011-01-09 23:08         ` Carsten Dominik
@ 2011-01-15  9:03           ` knubee
  2011-01-15 19:00             ` Memnon Anon
  0 siblings, 1 reply; 8+ messages in thread
From: knubee @ 2011-01-15  9:03 UTC (permalink / raw)
  To: emacs-orgmode

> > in any case, it might be good to add this and bernt's information  
> > about how to
> > run an agenda on just the current file into more of the org-mode  
> > documentation
> > somewhere.
> 
> Hi Knubee,
> 
> if you provide a concrete proposal where you looked for this  
> information and where you'd consequently have found it, you can  
> increase the chances that this will happen greatly.  Maybe even a patch?

ah, of course!

i tried to find the information by searching the web for different variations of 
"org-mode", "search tags", and "current file". here are three proposed additions 
to the org-mode manual to make it easier to find this information:

1. add to the key-index page of the org-manual:

C-c a 1 m 
  will run the tags match command on the current file only

2. add to the tag searches page of the org-manual, 6.3: 

C-c a 1 m 
  will run the tags match command on the current file only

3. add to the property searches page of the org-manual, 7.3:

C-c a 1 m 
Match: BIB_AUTHOR="Walter Evensong"

  This will run the property match command on the current file only and 
  find all entries that contain "Walter Evensong" in their BIB_AUTHOR field.


as i mentioned in an earlier post, this also results in a feature request:

implement "C-c a 1 p" for doing property searches on the current file -- 
something that would have the tab-completion of "C-c a 1 m". this would reduce 
the need for typing the key/value query by hand.

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

* Re: tags/search on specific files
  2011-01-15  9:03           ` knubee
@ 2011-01-15 19:00             ` Memnon Anon
  0 siblings, 0 replies; 8+ messages in thread
From: Memnon Anon @ 2011-01-15 19:00 UTC (permalink / raw)
  To: emacs-orgmode

knubee <knubee@gmail.com> writes:

> i tried to find the information by searching the web for different variations of 
> "org-mode", "search tags", and "current file". 

May I ask: Why not info?
When searching, I find myself (still) sometimes asking google first, but
each time I draw the conclusion, that asking emacs is actually faster.

I just tried to find the `<' command in the info file using
`i limit' and `i restrict' in "This manual is for Org version
7.01trans." and got 

     Info-index: No `limit' in index
     Info-index: No `restrict' in index

Could these be added to the index for 

,----[ (org) Agenda files ]
| `C-c C-x <'
|      Permanently restrict the agenda to the current subtree.  When with
|      a prefix argument, or with the cursor before the first headline in
|      a file, the agenda scope is set to the entire file.  This
|      restriction remains in effect until removed with `C-c C-x >', or
|      by typing either `<' or `>' in the agenda dispatcher.  If there is
|      a window displaying an agenda view, the new restriction takes
|      effect immediately.  
| 
| `C-c C-x >'
|      Remove the permanent restriction created by `C-c C-x <'.
`----

and

,----[ (org) Agenda dispatcher ]
| `<'
|      Restrict an agenda command to the current buffer(1).  After
|      pressing `<', you still need to press the character selecting the
|      command.
| 
| `< <'
|      If there is an active region, restrict the following agenda
|      command to the region.  Otherwise, restrict it to the current
|      subtree(2).  After pressing `< <', you still need to press the
|      character selecting the command.
`----

?

Memnon

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

end of thread, other threads:[~2011-01-15 19:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-09  5:58 tags/search on specific files knubee
2011-01-09 11:25 ` Bernt Hansen
2011-01-09 12:21   ` knubee
2011-01-09 18:44     ` Matt Lundin
2011-01-09 22:55       ` knubee
2011-01-09 23:08         ` Carsten Dominik
2011-01-15  9:03           ` knubee
2011-01-15 19:00             ` Memnon Anon

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