emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* tagging during creation
@ 2007-10-31 12:39 Richard G Riley
  2007-10-31 14:04 ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Richard G Riley @ 2007-10-31 12:39 UTC (permalink / raw)
  To: org-mode


Is it possible to set tags from withing the org-remember entry buffer? I
find myself using tags more and more for filtering and marking items and
would like to apply tags during the task/org-item creation phase.

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

* Re: tagging during creation
  2007-10-31 12:39 tagging during creation Richard G Riley
@ 2007-10-31 14:04 ` Bastien
       [not found]   ` <pszlxzfl9n.fsf@home.net>
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2007-10-31 14:04 UTC (permalink / raw)
  To: emacs-orgmode

Richard G Riley <rileyrgdev@googlemail.com> writes:

> Is it possible to set tags from withing the org-remember entry buffer? I
> find myself using tags more and more for filtering and marking items and
> would like to apply tags during the task/org-item creation phase.

Yes, the usual C-c C-c binding for setting tags is actually used for
sending the note.

Maybe as a workaround you can use a new keybinding for setting tags
through `org-set-tags':

  (define-key org-mode-map "\C-cc" 'org-set-tags)

HTH,

-- 
Bastien

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

* Re: tagging during creation
       [not found]   ` <pszlxzfl9n.fsf@home.net>
@ 2007-10-31 15:17     ` Bastien
  2007-11-04  7:22       ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2007-10-31 15:17 UTC (permalink / raw)
  To: emacs-orgmode

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

Richard G Riley <rileyrgdev@googlemail.com> writes:

>>   (define-key org-mode-map "\C-cc" 'org-set-tags)
>>
>> HTH,
>
> And how to do with the proper tags interface showing "tab for free" etc
> so I can see the existing tags to choose from ? e.g as you currently get
> when you hit C-c C-c C-c in an org file.

`org-set-tags' won't use the fast selection interface unless it knows
about a pre-defined set of available tags.  Since you cannot set this
directly in the org-remember buffer, you need to use `org-tag-alist':

See the manual (info "(org)Setting tags"):

  (setq org-tag-alist '(("@WORK" . ?w) ("@HOME" . ?h) ("Laptop" . ?l)))

I had to make a patch to get this working with Org 5.13h, otherwise Org
would just reinitialize `org-tag-alist' each time org-mode is run, i.e.
each time a new Org buffer is open - including the remember buffer and
regardless of the fact that `org-tag-alist' has been globally defined.

Please try it and give me feedback.  Thanks,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org.el.patch --]
[-- Type: text/x-diff, Size: 583 bytes --]

diff -u /home/guerry/elisp/testing/org/org.el /home/guerry/elisp/testing/bzg/org.el
--- /home/guerry/elisp/testing/org/org.el	2007-10-31 15:05:32.000000000 +0000
+++ /home/guerry/elisp/testing/bzg/org.el	2007-10-31 15:05:44.000000000 +0000
@@ -4173,7 +4173,7 @@
 			  (string-to-char (match-string 2 e)))
 		    tgs))
 	     (t (push (list e) tgs))))
-	  (org-set-local 'org-tag-alist nil)
+	  (org-set-local 'org-tag-alist org-tag-alist)
 	  (while (setq e (pop tgs))
 	    (or (and (stringp (car e))
 		     (assoc (car e) org-tag-alist))

Diff finished.  Wed Oct 31 15:11:13 2007

[-- Attachment #3: Type: text/plain, Size: 13 bytes --]


-- 
Bastien

[-- Attachment #4: Type: text/plain, Size: 204 bytes --]

_______________________________________________
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

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

* Re: tagging during creation
  2007-10-31 15:17     ` Bastien
@ 2007-11-04  7:22       ` Carsten Dominik
  2007-11-04 13:05         ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2007-11-04  7:22 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode


On  31Oct2007, at 4:17 PM, Bastien wrote:

> Richard G Riley <rileyrgdev@googlemail.com> writes:
>
>>>   (define-key org-mode-map "\C-cc" 'org-set-tags)
>>>
>>> HTH,
>>
>> And how to do with the proper tags interface showing "tab for  
>> free" etc
>> so I can see the existing tags to choose from ? e.g as you  
>> currently get
>> when you hit C-c C-c C-c in an org file.
>
> `org-set-tags' won't use the fast selection interface unless it knows
> about a pre-defined set of available tags.  Since you cannot set this
> directly in the org-remember buffer, you need to use `org-tag-alist'
>
> See the manual (info "(org)Setting tags"):
>
>   (setq org-tag-alist '(("@WORK" . ?w) ("@HOME" . ?h) ("Laptop" . ? 
> l)))
>
> I had to make a patch to get this working with Org 5.13h, otherwise  
> Org
> would just reinitialize `org-tag-alist' each time org-mode is run,  
> i.e.
> each time a new Org buffer is open - including the remember buffer and
> regardless of the fact that `org-tag-alist' has been globally defined.
>
> Please try it and give me feedback.  Thanks,
>
> diff -u /home/guerry/elisp/testing/org/org.el /home/guerry/elisp/ 
> testing/bzg/org.el
> --- /home/guerry/elisp/testing/org/org.el	2007-10-31  
> 15:05:32.000000000 +0000
> +++ /home/guerry/elisp/testing/bzg/org.el	2007-10-31  
> 15:05:44.000000000 +0000
> @@ -4173,7 +4173,7 @@
>  			  (string-to-char (match-string 2 e)))
>  		    tgs))
>  	     (t (push (list e) tgs))))
> -	  (org-set-local 'org-tag-alist nil)
> +	  (org-set-local 'org-tag-alist org-tag-alist)
>  	  (while (setq e (pop tgs))
>  	    (or (and (stringp (car e))
>  		     (assoc (car e) org-tag-alist))

I don't think this patch is correct.  This code is only executed when  
there is a #+TAGS
line in the buffer, and then it needs to be executed, to overrule the  
global settings.
If there is no #+TAGS line, the global value will be used.

What exactly are you trying to fix with this patch?

- Carsten

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

* Re: tagging during creation
  2007-11-04  7:22       ` Carsten Dominik
@ 2007-11-04 13:05         ` Bastien
  2007-11-04 13:46           ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2007-11-04 13:05 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <carsten.dominik@gmail.com> writes:

>> -	  (org-set-local 'org-tag-alist nil)
>> +	  (org-set-local 'org-tag-alist org-tag-alist)
>
> I don't think this patch is correct.  This code is only executed when
> there is a #+TAGS line in the buffer, and then it needs to be
> executed, to overrule the global settings.  If there is no #+TAGS
> line, the global value will be used.

> What exactly are you trying to fix with this patch?

I was trying to address Richard's question:

  Is it possible to set tags from withing the org-remember entry buffer?

The first problem is that remember buffers steal the C-c C-c key.  You
cannot add fast tag selection as usual.  A solution might be to use the
C-x C-s key to process the *remember* buffer and bind C-c C-c back to
org-set-tags.  What do you think?

The second problem was that I thought the global value of org-tag-alist
was ignored in remember buffer but I was wrong.  I messed up while going
back and forth from config to *remember* buffer... sorry for that!

-- 
Bastien

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

* Re: tagging during creation
  2007-11-04 13:05         ` Bastien
@ 2007-11-04 13:46           ` Carsten Dominik
  2007-11-05 10:58             ` Andrew J. Korty
  0 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2007-11-04 13:46 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode


On  4Nov2007, at 2:05 PM, Bastien wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>>> -	  (org-set-local 'org-tag-alist nil)
>>> +	  (org-set-local 'org-tag-alist org-tag-alist)
>>
>> I don't think this patch is correct.  This code is only executed when
>> there is a #+TAGS line in the buffer, and then it needs to be
>> executed, to overrule the global settings.  If there is no #+TAGS
>> line, the global value will be used.
>
>> What exactly are you trying to fix with this patch?
>
> I was trying to address Richard's question:
>
>   Is it possible to set tags from withing the org-remember entry  
> buffer?
>
> The first problem is that remember buffers steal the C-c C-c key.  You
> cannot add fast tag selection as usual.  A solution might be to use  
> the
> C-x C-s key to process the *remember* buffer and bind C-c C-c back to
> org-set-tags.  What do you think?

No, this is not an option, because C-c C-c is the standard remember key.
But you are right, we need a way to set tags.

- Carsten

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

* Re: tagging during creation
  2007-11-04 13:46           ` Carsten Dominik
@ 2007-11-05 10:58             ` Andrew J. Korty
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew J. Korty @ 2007-11-05 10:58 UTC (permalink / raw)
  To: emacs-orgmode

Here's what I use:

 (defun org-set-buffer-todo-tags ()
   "Set tags for all tagless TODO headings in the current buffer."
   (save-excursion
     (goto-char (point-min))
     (while (re-search-forward "\\* \\(?:TODO\\|ACTION\\|WAITING\\) " nil t)
       (let ((tags (org-get-tags)))
         (if (or (not tags) (string= tags ""))
             (org-set-tags))))))
 
 (add-hook 'remember-hook
           (lambda ()
             (define-key (current-local-map) "\x03\x03"
               (lambda ()
                 (interactive)
                 (if (string= (buffer-name (current-buffer)) "*Remember*")
                     (org-set-buffer-todo-tags))
                 (org-ctrl-c-ctrl-c)))))

-- 
Andrew J. Korty, Deputy Information Security Officer
Office of the Vice President for Information Technology and CIO
Indiana University

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

end of thread, other threads:[~2007-11-05 10:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-31 12:39 tagging during creation Richard G Riley
2007-10-31 14:04 ` Bastien
     [not found]   ` <pszlxzfl9n.fsf@home.net>
2007-10-31 15:17     ` Bastien
2007-11-04  7:22       ` Carsten Dominik
2007-11-04 13:05         ` Bastien
2007-11-04 13:46           ` Carsten Dominik
2007-11-05 10:58             ` Andrew J. Korty

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