emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-agenda-custom-commands
@ 2009-10-18 14:43 Harald Weis
  2009-10-19 13:36 ` org-agenda-custom-commands Carsten Dominik
  0 siblings, 1 reply; 4+ messages in thread
From: Harald Weis @ 2009-10-18 14:43 UTC (permalink / raw)
  To: emacs-orgmode

Hi All,

I would like to define one entry of the org-agenda-custom-commands
variable like so:
(setq org-agenda-custom-commands
      '(("i" "item" tags-tree
	     (remedy-build-tags-tree-regex "item"))))

where ''item'' is the property key and
where the remedy-build-tags-tree-regex function is defined as follows:

(defun remedy-build-tags-tree-regex (propkey)
      (concat propkey
	  "={"
	  (read-from-minibuffer (concat propkey " : "))
	  "}"))

This would allow me to select the property value interactively.

The org-make-tags-matcher function does not appreciate.
''C-c a'' yields
i	item	: set of 2 commands

Selecting ''i'' produces the following error message in the minibuffer.
Wrong type argument: stringp, (remedy-build-tags-tree-regex "item")

Is there a way to get the desired functionality?

Thank you in advance for any help.
-- 
Harald Weis

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

* Re: org-agenda-custom-commands
  2009-10-18 14:43 org-agenda-custom-commands Harald Weis
@ 2009-10-19 13:36 ` Carsten Dominik
  2009-10-29 19:56   ` org-agenda-custom-commands Harald Weis
  0 siblings, 1 reply; 4+ messages in thread
From: Carsten Dominik @ 2009-10-19 13:36 UTC (permalink / raw)
  To: Harald Weis; +Cc: emacs-orgmode

Well, I guess I could evaluate match before it gets used.  But maybe  
you can also turn this around:  Dinfe a function what will call the  
tree maker directly


(defun my-tree (match)
   (interactive "s")
   (org-match-sparse-tree nil (concat "{" match "}")))

or something like this....

- Carsten

On Oct 18, 2009, at 4:43 PM, Harald Weis wrote:

> Hi All,
>
> I would like to define one entry of the org-agenda-custom-commands
> variable like so:
> (setq org-agenda-custom-commands
>      '(("i" "item" tags-tree
> 	     (remedy-build-tags-tree-regex "item"))))
>
> where ''item'' is the property key and
> where the remedy-build-tags-tree-regex function is defined as follows:
>
> (defun remedy-build-tags-tree-regex (propkey)
>      (concat propkey
> 	  "={"
> 	  (read-from-minibuffer (concat propkey " : "))
> 	  "}"))
>
> This would allow me to select the property value interactively.
>
> The org-make-tags-matcher function does not appreciate.
> ''C-c a'' yields
> i	item	: set of 2 commands
>
> Selecting ''i'' produces the following error message in the  
> minibuffer.
> Wrong type argument: stringp, (remedy-build-tags-tree-regex "item")
>
> Is there a way to get the desired functionality?
>
> Thank you in advance for any help.
> -- 
> Harald Weis
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

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

* Re: org-agenda-custom-commands
  2009-10-19 13:36 ` org-agenda-custom-commands Carsten Dominik
@ 2009-10-29 19:56   ` Harald Weis
  2009-10-30  7:17     ` org-agenda-custom-commands Carsten Dominik
  0 siblings, 1 reply; 4+ messages in thread
From: Harald Weis @ 2009-10-29 19:56 UTC (permalink / raw)
  To: emacs-orgmode

Sorry, I was away for a couple of days.
Many thanks for your proposition which really works fine.
Still, would it be difficult to implement ``evaluating match before it
gets used''?
My user needs to define in his files a great number of
_multi-value_ property keys.    
He also requires for an occur-tree a horribly complicated regular
expression comprising a simple interactive character string.
I understand now that the latter could equally be accomplished with
the org-occur function the same way you've proposed for the
org-match-sparse-tree function, couldn't it?
Yes, it can! I've just tested the following function:
(defun my-occur (match)
  (interactive "s")
  (org-occur (concat "[:]" match "[:]"))) 
Great, it works.

But I still think it could be advantageous to do the whole lot within
the org-agenda-custom-commands variable if the match would be evaluated
before getting used.

Thank you very much indeed.
Harald Weis


On Mon, Oct 19, 2009 at 03:36:42PM +0200, Carsten Dominik wrote:
> Well, I guess I could evaluate match before it gets used.  But maybe  
> you can also turn this around:  Dinfe a function what will call the  
> tree maker directly
> 
> 
> (defun my-tree (match)
>   (interactive "s")
>   (org-match-sparse-tree nil (concat "{" match "}")))
> 
> or something like this....
> 
> - Carsten
> 
> On Oct 18, 2009, at 4:43 PM, Harald Weis wrote:
> 
> >Hi All,
> >
> >I would like to define one entry of the org-agenda-custom-commands
> >variable like so:
> >(setq org-agenda-custom-commands
> >     '(("i" "item" tags-tree
> >	     (remedy-build-tags-tree-regex "item"))))
> >
> >where ''item'' is the property key and
> >where the remedy-build-tags-tree-regex function is defined as follows:
> >
> >(defun remedy-build-tags-tree-regex (propkey)
> >     (concat propkey
> >	  "={"
> >	  (read-from-minibuffer (concat propkey " : "))
> >	  "}"))
> >
> >This would allow me to select the property value interactively.
> >
> >The org-make-tags-matcher function does not appreciate.
> >''C-c a'' yields
> >i	item	: set of 2 commands
> >
> >Selecting ''i'' produces the following error message in the  
> >minibuffer.
> >Wrong type argument: stringp, (remedy-build-tags-tree-regex "item")
> >
> >Is there a way to get the desired functionality?

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

* Re: org-agenda-custom-commands
  2009-10-29 19:56   ` org-agenda-custom-commands Harald Weis
@ 2009-10-30  7:17     ` Carsten Dominik
  0 siblings, 0 replies; 4+ messages in thread
From: Carsten Dominik @ 2009-10-30  7:17 UTC (permalink / raw)
  To: Harald Weis; +Cc: emacs-orgmode


On Oct 29, 2009, at 8:56 PM, Harald Weis wrote:
>
> But I still think it could be advantageous to do the whole lot within
> the org-agenda-custom-commands variable if the match would be  
> evaluated
> before getting used.

Well, we can try and see if it breaks something.  The latest git version
now does evaluate it, but I have not yet introduced this into the
customize type - so you need to set the command list in Lisp for the
time being.

- Carsten


>
> Thank you very much indeed.
> Harald Weis
>
>
> On Mon, Oct 19, 2009 at 03:36:42PM +0200, Carsten Dominik wrote:
>> Well, I guess I could evaluate match before it gets used.  But maybe
>> you can also turn this around:  Dinfe a function what will call the
>> tree maker directly
>>
>>
>> (defun my-tree (match)
>>  (interactive "s")
>>  (org-match-sparse-tree nil (concat "{" match "}")))
>>
>> or something like this....
>>
>> - Carsten
>>
>> On Oct 18, 2009, at 4:43 PM, Harald Weis wrote:
>>
>>> Hi All,
>>>
>>> I would like to define one entry of the org-agenda-custom-commands
>>> variable like so:
>>> (setq org-agenda-custom-commands
>>>    '(("i" "item" tags-tree
>>> 	     (remedy-build-tags-tree-regex "item"))))
>>>
>>> where ''item'' is the property key and
>>> where the remedy-build-tags-tree-regex function is defined as  
>>> follows:
>>>
>>> (defun remedy-build-tags-tree-regex (propkey)
>>>    (concat propkey
>>> 	  "={"
>>> 	  (read-from-minibuffer (concat propkey " : "))
>>> 	  "}"))
>>>
>>> This would allow me to select the property value interactively.
>>>
>>> The org-make-tags-matcher function does not appreciate.
>>> ''C-c a'' yields
>>> i	item	: set of 2 commands
>>>
>>> Selecting ''i'' produces the following error message in the
>>> minibuffer.
>>> Wrong type argument: stringp, (remedy-build-tags-tree-regex "item")
>>>
>>> Is there a way to get the desired functionality?
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

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

end of thread, other threads:[~2009-10-30  7:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-18 14:43 org-agenda-custom-commands Harald Weis
2009-10-19 13:36 ` org-agenda-custom-commands Carsten Dominik
2009-10-29 19:56   ` org-agenda-custom-commands Harald Weis
2009-10-30  7:17     ` org-agenda-custom-commands Carsten Dominik

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