emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* tag or property names with dashes
@ 2010-08-17 19:40 Ilya Shlyakhter
  2010-08-20  7:27 ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: Ilya Shlyakhter @ 2010-08-17 19:40 UTC (permalink / raw)
  To: emacs-orgmode

When doing an agenda tags match for tags or properties with dashes in
their name,
the dashes become negation operators: "my-prop>0" means "entries that
have the tag
'my' and do not have a positive property 'prop'", rather than "entries
that have a positive
property 'my-prop'".  Is there a way to escape the dashes to get the
latter meaning?

thanks,

ilya

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

* Re: tag or property names with dashes
  2010-08-17 19:40 tag or property names with dashes Ilya Shlyakhter
@ 2010-08-20  7:27 ` Carsten Dominik
  2010-08-20 13:36   ` Manish
  0 siblings, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2010-08-20  7:27 UTC (permalink / raw)
  To: Ilya Shlyakhter; +Cc: emacs-orgmode


On Aug 17, 2010, at 9:40 PM, Ilya Shlyakhter wrote:

> When doing an agenda tags match for tags or properties with dashes in
> their name,
> the dashes become negation operators: "my-prop>0" means "entries that
> have the tag
> 'my' and do not have a positive property 'prop'", rather than "entries
> that have a positive
> property 'my-prop'".  Is there a way to escape the dashes to get the
> latter meaning?

Dashes are not valid in TODO keywords and tags, but you are right,  
properties do allow them.  hmmm.  I don't remember why I did allow hem  
- but surely enough I did.

OK, after your next pull you can use "\\-" to mean "-" in the name of  
a property
for matches.

- Carsten

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

* Re: tag or property names with dashes
  2010-08-20  7:27 ` Carsten Dominik
@ 2010-08-20 13:36   ` Manish
  2010-08-20 13:45     ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: Manish @ 2010-08-20 13:36 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Ilya Shlyakhter, emacs-orgmode

On Fri, Aug 20, 2010 at 12:57 PM, Carsten Dominik wrote:
>
> On Aug 17, 2010, at 9:40 PM, Ilya Shlyakhter wrote:
>
>> When doing an agenda tags match for tags or properties with dashes in
>> their name,
>> the dashes become negation operators: "my-prop>0" means "entries that
>> have the tag
>> 'my' and do not have a positive property 'prop'", rather than "entries
>> that have a positive
>> property 'my-prop'".  Is there a way to escape the dashes to get the
>> latter meaning?
>
> Dashes are not valid in TODO keywords and tags, but you are right,
> properties do allow them.  hmmm.  I don't remember why I did allow hem
> - but surely enough I did.
>

Are "#" and "%" are disallowed in the tags?  Can they be made to work please?

Regards
-- Manish

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

* Re: tag or property names with dashes
  2010-08-20 13:36   ` Manish
@ 2010-08-20 13:45     ` Carsten Dominik
  2010-08-20 17:32       ` Manish
  0 siblings, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2010-08-20 13:45 UTC (permalink / raw)
  To: Manish; +Cc: Ilya Shlyakhter, emacs-orgmode


On Aug 20, 2010, at 3:36 PM, Manish wrote:

> On Fri, Aug 20, 2010 at 12:57 PM, Carsten Dominik wrote:
>>
>> On Aug 17, 2010, at 9:40 PM, Ilya Shlyakhter wrote:
>>
>>> When doing an agenda tags match for tags or properties with dashes  
>>> in
>>> their name,
>>> the dashes become negation operators: "my-prop>0" means "entries  
>>> that
>>> have the tag
>>> 'my' and do not have a positive property 'prop'", rather than  
>>> "entries
>>> that have a positive
>>> property 'my-prop'".  Is there a way to escape the dashes to get the
>>> latter meaning?
>>
>> Dashes are not valid in TODO keywords and tags, but you are right,
>> properties do allow them.  hmmm.  I don't remember why I did allow  
>> hem
>> - but surely enough I did.
>>
>
> Are "#" and "%" are disallowed in the tags?  Can they be made to  
> work please?

This is non-trivial and I shy away from the work for now.
Make me a patch and I will look at it.

- Carsten

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

* Re: tag or property names with dashes
  2010-08-20 13:45     ` Carsten Dominik
@ 2010-08-20 17:32       ` Manish
  2010-08-20 19:28         ` Manish
  0 siblings, 1 reply; 9+ messages in thread
From: Manish @ 2010-08-20 17:32 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Ilya Shlyakhter, emacs-orgmode

On Fri, Aug 20, 2010 at 7:15 PM, Carsten Dominik wrote:
>
> On Aug 20, 2010, at 3:36 PM, Manish wrote:
>
>> On Fri, Aug 20, 2010 at 12:57 PM, Carsten Dominik wrote:
>>>
>>> On Aug 17, 2010, at 9:40 PM, Ilya Shlyakhter wrote:
>>>
>>>> When doing an agenda tags match for tags or properties with dashes in
>>>> their name,
>>>> the dashes become negation operators: "my-prop>0" means "entries that
>>>> have the tag
>>>> 'my' and do not have a positive property 'prop'", rather than "entries
>>>> that have a positive
>>>> property 'my-prop'".  Is there a way to escape the dashes to get the
>>>> latter meaning?
>>>
>>> Dashes are not valid in TODO keywords and tags, but you are right,
>>> properties do allow them.  hmmm.  I don't remember why I did allow hem
>>> - but surely enough I did.
>>>
>>
>> Are "#" and "%" are disallowed in the tags?  Can they be made to work please?
>
> This is non-trivial and I shy away from the work for now.
> Make me a patch and I will look at it.

Attempting something that /you/ call non-trivial is nigh impossible for
me. :(

But even if I were to dare.. any hints where I could start?

Thanks
-- Manish

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

* Re: tag or property names with dashes
  2010-08-20 17:32       ` Manish
@ 2010-08-20 19:28         ` Manish
  2010-08-20 19:30           ` Manish
  0 siblings, 1 reply; 9+ messages in thread
From: Manish @ 2010-08-20 19:28 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Ilya Shlyakhter, emacs-orgmode

On Fri, Aug 20, 2010 at 11:02 PM, Manish wrote:
> On Fri, Aug 20, 2010 at 7:15 PM, Carsten Dominik wrote:
>>
>> On Aug 20, 2010, at 3:36 PM, Manish wrote:
>>
[snip: accepting -'s in properties (17 lines)]
>>>
>>> Are "#" and "%" are disallowed in the tags? Can they be made to work
>>> please?
>>
>> This is non-trivial and I shy away from the work for now. Make me a
>> patch and I will look at it.
>
> Attempting something that /you/ call non-trivial is nigh impossible
> for me. :(
>
> But even if I were to dare.. any hints where I could start?
>

Attaching a naive first attempt. With this patch, I have tested special
behavior of ctrl-a/e respecting tags in org files, ascii and HTML
exports, agenda, and tag filtering. LaTeX export was not working so
could not test and do not have the setup for testing Docbook exports.
Please do take a look -- I do not understand the larger
repurcussions/side effects of the changes to all the regexes.

Thanks
-- Manish

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

* Re: tag or property names with dashes
  2010-08-20 19:28         ` Manish
@ 2010-08-20 19:30           ` Manish
  2010-08-30  8:34             ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: Manish @ 2010-08-20 19:30 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Ilya Shlyakhter, emacs-orgmode

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

On Sat, Aug 21, 2010 at 12:58 AM, Manish <mailtomanish.sharma@gmail.com> wrote:
> On Fri, Aug 20, 2010 at 11:02 PM, Manish wrote:
>> On Fri, Aug 20, 2010 at 7:15 PM, Carsten Dominik wrote:
>>>
>>> On Aug 20, 2010, at 3:36 PM, Manish wrote:
>>>
> [snip: accepting -'s in properties (17 lines)]
>>>>
>>>> Are "#" and "%" are disallowed in the tags? Can they be made to work
>>>> please?
>>>
>>> This is non-trivial and I shy away from the work for now. Make me a
>>> patch and I will look at it.
>>
>> Attempting something that /you/ call non-trivial is nigh impossible
>> for me. :(
>>
>> But even if I were to dare.. any hints where I could start?
>>
>
> Attaching a naive first attempt. With this patch, I have tested special
> behavior of ctrl-a/e respecting tags in org files, ascii and HTML
> exports, agenda, and tag filtering. LaTeX export was not working so
> could not test and do not have the setup for testing Docbook exports.
> Please do take a look -- I do not understand the larger
> repurcussions/side effects of the changes to all the regexes.
>
> Thanks
> -- Manish
>

This time _with_ patch.

-- Manish

[-- Attachment #2: 0001-Modified-regexes-to-accept-percent-and-hash-sign-as-.patch --]
[-- Type: text/x-patch, Size: 19989 bytes --]

From 6367e5c0ed5a2b5b806dcd1e9b848f2cfe8ea41d Mon Sep 17 00:00:00 2001
From: Manish Sharma <mailtomanish.sharma@gmail.com>
Date: Sat, 21 Aug 2010 00:45:50 +0530
Subject: [PATCH] Modified regexes to accept percent and hash-sign as valid characters in tags

---
 lisp/org-agenda.el         |   10 ++++----
 lisp/org-archive.el        |    2 +-
 lisp/org-capture.el        |    2 +-
 lisp/org-clock.el          |    2 +-
 lisp/org-colview-xemacs.el |    2 +-
 lisp/org-docbook.el        |    4 +-
 lisp/org-html.el           |    6 ++--
 lisp/org-latex.el          |    2 +-
 lisp/org-remember.el       |    2 +-
 lisp/org.el                |   54 ++++++++++++++++++++++----------------------
 10 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 117b0bb..d76535b 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4023,11 +4023,11 @@ MATCH is being ignored."
 			  "\\)\\>"))
 	 (tags (nth 2 org-stuck-projects))
 	 (tags-re (if (member "*" tags)
-		      (org-re "^\\*+ .*:[[:alnum:]_@]+:[ \t]*$")
+		      (org-re "^\\*+ .*:[[:alnum:]_@#%]+:[ \t]*$")
 		    (if tags
 			(concat "^\\*+ .*:\\("
 				(mapconcat 'identity tags "\\|")
-				(org-re "\\):[[:alnum:]_@:]*[ \t]*$")))))
+				(org-re "\\):[[:alnum:]_@#%:]*[ \t]*$")))))
 	 (gen-re (nth 3 org-stuck-projects))
 	 (re-list
 	  (delq nil
@@ -4986,7 +4986,7 @@ Any match of REMOVE-RE will be removed from TXT."
 	  (setq h (/ m 60) m (- m (* h 60)))
 	  (setq s2 (format "%02d:%02d" h m))))
 
-      (when (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$")
+      (when (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")
 			  txt)
 	;; Tags are in the string
 	(if (or (eq org-agenda-remove-tags t)
@@ -5060,7 +5060,7 @@ Any match of REMOVE-RE will be removed from TXT."
 The modified list may contain inherited tags, and tags matched by
 `org-agenda-hide-tags-regexp' will be removed."
   (when (or add-inherited hide-re)
-    (if (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$") txt)
+    (if (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$") txt)
 	(setq txt (substring txt 0 (match-beginning 0))))
     (setq tags
 	  (delq nil
@@ -6726,7 +6726,7 @@ If FORCE-TAGS is non nil, the car of it returns the new tags."
   (let ((inhibit-read-only t) l c)
     (save-excursion
       (goto-char (if line (point-at-bol) (point-min)))
-      (while (re-search-forward (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$")
+      (while (re-search-forward (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")
 				(if line (point-at-eol) nil) t)
 	(add-text-properties
 	 (match-beginning 2) (match-end 2)
diff --git a/lisp/org-archive.el b/lisp/org-archive.el
index df6c68f..865f4d1 100644
--- a/lisp/org-archive.el
+++ b/lisp/org-archive.el
@@ -268,7 +268,7 @@ this heading."
 	      (progn
 		(if (re-search-forward
 		     (concat "^" (regexp-quote heading)
-			     (org-re "[ \t]*\\(:[[:alnum:]_@:]+:\\)?[ \t]*\\($\\|\r\\)"))
+			     (org-re "[ \t]*\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\($\\|\r\\)"))
 		     nil t)
 		    (goto-char (match-end 0))
 		  ;; Heading not found, just insert it at the end
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index e544964..257548e 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1205,7 +1205,7 @@ The template may still contain \"%?\" for cursor positioning."
 			 'org-tags-history)))
 	      (setq ins (mapconcat 'identity
 				   (org-split-string
-				    ins (org-re "[^[:alnum:]_@]+"))
+				    ins (org-re "[^[:alnum:]_@#%]+"))
 				       ":"))
 	      (when (string-match "\\S-" ins)
 		(or (equal (char-before) ?:) (insert ":"))
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 4fa0397..a20a7c7 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1863,7 +1863,7 @@ the currently selected interval size."
 	    (when (setq time (get-text-property p :org-clock-minutes))
 	      (save-excursion
 		(beginning-of-line 1)
-		(when (and (looking-at (org-re "\\(\\*+\\)[ \t]+\\(.*?\\)\\([ \t]+:[[:alnum:]_@:]+:\\)?[ \t]*$"))
+		(when (and (looking-at (org-re "\\(\\*+\\)[ \t]+\\(.*?\\)\\([ \t]+:[[:alnum:]_@#%:]+:\\)?[ \t]*$"))
 			   (setq level (org-reduced-level
 					(- (match-end 1) (match-beginning 1))))
 			   (<= level maxlevel))
diff --git a/lisp/org-colview-xemacs.el b/lisp/org-colview-xemacs.el
index 35e55f8..e2bf811 100644
--- a/lisp/org-colview-xemacs.el
+++ b/lisp/org-colview-xemacs.el
@@ -685,7 +685,7 @@ Where possible, use the standard interface for changing this line."
 	  (txt (match-string 3))
 	  (post "")
 	  txt2)
-      (if (string-match (org-re "[ \t]+:[[:alnum:]:_@]+:[ \t]*$") txt)
+      (if (string-match (org-re "[ \t]+:[[:alnum:]:_@#%]+:[ \t]*$") txt)
 	  (setq post (match-string 0 txt)
 		txt (substring txt 0 (match-beginning 0))))
       (setq txt2 (read-string "Edit: " txt))
diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el
index 7bb7565..926db24 100644
--- a/lisp/org-docbook.el
+++ b/lisp/org-docbook.el
@@ -1249,7 +1249,7 @@ When TITLE is nil, just close all open levels."
       ;; all levels, so the rest is done only if title is given.
       ;;
       ;; Format tags: put them into a superscript like format.
-      (when (string-match (org-re "\\(:[[:alnum:]_@:]+:\\)[ \t]*$") title)
+      (when (string-match (org-re "\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$") title)
 	(setq title
 	      (replace-match
 	       (if org-export-with-tags
@@ -1273,7 +1273,7 @@ When TITLE is nil, just close all open levels."
 Applies all active conversions.  If there are links in the
 string, don't modify these."
   (let* ((re (concat org-bracket-link-regexp "\\|"
-		     (org-re "[ \t]+\\(:[[:alnum:]_@:]+:\\)[ \t]*$")))
+		     (org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")))
 	 m s l res)
     (while (setq m (string-match re string))
       (setq s (substring string 0 m)
diff --git a/lisp/org-html.el b/lisp/org-html.el
index 450a9de..099b2e3 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -1095,7 +1095,7 @@ lang=\"%s\" xml:lang=\"%s\">
 					 (org-search-todo-below
 					  line lines level))))
 			  (if (string-match
-			       (org-re "[ \t]+:\\([[:alnum:]_@:]+\\):[ \t]*$") txt)
+			       (org-re "[ \t]+:\\([[:alnum:]_@#%:]+\\):[ \t]*$") txt)
 			      (setq txt (replace-match  "&nbsp;&nbsp;&nbsp;<span class=\"tag\"> \\1</span>" t nil txt)))
 			  (if (string-match quote-re0 txt)
 			      (setq txt (replace-match "" t t txt)))
@@ -2164,7 +2164,7 @@ that uses these same face definitions."
   "Prepare STRING for HTML export.  Apply all active conversions.
 If there are links in the string, don't modify these."
   (let* ((re (concat org-bracket-link-regexp "\\|"
-		     (org-re "[ \t]+\\(:[[:alnum:]_@:]+:\\)[ \t]*$")))
+		     (org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")))
 	 m s l res)
     (if (string-match "^[ \t]*\\+-[-+]*\\+[ \t]*$" string)
 	string
@@ -2328,7 +2328,7 @@ When TITLE is nil, just close all open levels."
     (when title
       ;; If title is nil, this means this function is called to close
       ;; all levels, so the rest is done only if title is given
-	(when (string-match (org-re "\\(:[[:alnum:]_@:]+:\\)[ \t]*$") title)
+	(when (string-match (org-re "\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$") title)
 	  (setq title (replace-match
 		       (if org-export-with-tags
 			   (save-match-data
diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index b587666..856f5b8 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -1348,7 +1348,7 @@ links, keywords, lists, tables, fixed-width"
 	  (replace-match "")
 	(replace-match (format "\\textbf{%s}" (match-string 0)) t t)))
     ;; convert tags
-    (when (re-search-forward "\\(:[a-zA-Z0-9_@]+\\)+:" nil t)
+    (when (re-search-forward "\\(:[a-zA-Z0-9_@#%]+\\)+:" nil t)
       (if (or (not org-export-with-tags)
 	      (plist-get remove-list :tags))
 	  (replace-match "")
diff --git a/lisp/org-remember.el b/lisp/org-remember.el
index ee464fe..a9cc11f 100644
--- a/lisp/org-remember.el
+++ b/lisp/org-remember.el
@@ -574,7 +574,7 @@ to be run from that hook to function properly."
 			   'org-tags-completion-function nil nil nil
 			   'org-tags-history)))
 		(setq ins (mapconcat 'identity
-				     (org-split-string ins (org-re "[^[:alnum:]_@]+"))
+				     (org-split-string ins (org-re "[^[:alnum:]_@#%]+"))
 				     ":"))
 		(when (string-match "\\S-" ins)
 		  (or (equal (char-before) ?:) (insert ":"))
diff --git a/lisp/org.el b/lisp/org.el
index e34ec1a..d6a6928 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -3084,7 +3084,7 @@ points to a file, `org-agenda-diary-entry' will be used instead."
 
 (defcustom org-format-latex-options
   '(:foreground default :background default :scale 1.0
-    :html-foreground "Black" :html-background "Transparent" 
+    :html-foreground "Black" :html-background "Transparent"
     :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\["))
   "Options for creating images from LaTeX fragments.
 This is a property list with the following properties:
@@ -4371,7 +4371,7 @@ means to push this value onto the list in the variable.")
 	     ((equal e "{") (push '(:startgroup) tgs))
 	     ((equal e "}") (push '(:endgroup) tgs))
 	     ((equal e "\\n") (push '(:newline) tgs))
-	     ((string-match (org-re "^\\([[:alnum:]_@]+\\)(\\(.\\))$") e)
+	     ((string-match (org-re "^\\([[:alnum:]_@#%]+\\)(\\(.\\))$") e)
 	      (push (cons (match-string 1 e)
 			  (string-to-char (match-string 2 e)))
 		    tgs))
@@ -4415,7 +4415,7 @@ means to push this value onto the list in the variable.")
 	    (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
 		    (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
 		    "\\)\\>\\)?\\(?:[ \t]*\\(\\[#.\\]\\)\\)?[ \t]*\\(.*?\\)"
-		    "\\(?:[ \t]+\\(:[[:alnum:]_@:]+:\\)\\)?[ \t]*$")
+		    "\\(?:[ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ \t]*$")
 	    org-complex-heading-regexp-format
 	    (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
 		    (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
@@ -4433,7 +4433,7 @@ means to push this value onto the list in the variable.")
 	    (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
 		    (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
 		    (org-re
-		     "\\)\\>\\)? *\\(.*?\\([ \t]:[[:alnum:]:_@]+:[ \t]*\\)?$\\)"))
+		     "\\)\\>\\)? *\\(.*?\\([ \t]:[[:alnum:]:_@#%]+:[ \t]*\\)?$\\)"))
 	    org-looking-at-done-regexp
 	    (concat "^" "\\(?:"
 		    (mapconcat 'regexp-quote org-done-keywords "\\|") "\\)"
@@ -5347,7 +5347,7 @@ between words."
 	"\\)\\>")))
 
 (defun org-activate-tags (limit)
-  (if (re-search-forward (org-re "^\\*+.*[ \t]\\(:[[:alnum:]_@:]+:\\)[ \r\n]") limit t)
+  (if (re-search-forward (org-re "^\\*+.*[ \t]\\(:[[:alnum:]_@#%:]+:\\)[ \r\n]") limit t)
       (progn
 	(org-remove-flyspell-overlays-in (match-beginning 1) (match-end 1))
 	(add-text-properties (match-beginning 1) (match-end 1)
@@ -6725,7 +6725,7 @@ This is important for non-interactive uses of the command."
 	      (when hide-previous
 		(show-children)
 		(org-show-entry))
-	      (looking-at ".*?\\([ \t]+\\(:[[:alnum:]_@:]+:\\)\\)?[ \t]*$")
+	      (looking-at ".*?\\([ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ \t]*$")
 	      (setq tags (and (match-end 2) (match-string 2)))
 	      (and (match-end 1)
 		   (delete-region (match-beginning 1) (match-end 1)))
@@ -6761,7 +6761,7 @@ This is important for non-interactive uses of the command."
     (org-back-to-heading t)
     (if (looking-at
 	 (if no-tags
-	     (org-re "\\*+[ \t]+\\([^\n\r]*?\\)\\([ \t]+:[[:alnum:]:_@]+:[ \t]*\\)?$")
+	     (org-re "\\*+[ \t]+\\([^\n\r]*?\\)\\([ \t]+:[[:alnum:]:_@#%]+:[ \t]*\\)?$")
 	   "\\*+[ \t]+\\([^\r\n]*\\)"))
 	(match-string 1) "")))
 
@@ -8451,7 +8451,7 @@ according to FMT (default from `org-email-link-description-format')."
       ;; We are using a headline, clean up garbage in there.
       (if (string-match org-todo-regexp s)
 	  (setq s (replace-match "" t t s)))
-      (if (string-match (org-re ":[[:alnum:]_@:]+:[ \t]*$") s)
+      (if (string-match (org-re ":[[:alnum:]_@#%:]+:[ \t]*$") s)
 	  (setq s (replace-match "" t t s)))
       (setq s (org-trim s))
       (if (string-match (concat "^\\(" org-quote-string "\\|"
@@ -9067,7 +9067,7 @@ application the system uses for this file type."
 	    (setq type (match-string 1) path (match-string 2))
 	    (throw 'match t)))
 	(save-excursion
-	  (when (org-in-regexp (org-re "\\(:[[:alnum:]_@:]+\\):[ \t]*$"))
+	  (when (org-in-regexp (org-re "\\(:[[:alnum:]_@#%:]+\\):[ \t]*$"))
 	    (setq type "tags"
 		  path (match-string 1))
 	    (while (string-match ":" path)
@@ -9421,7 +9421,7 @@ in all files.  If AVOID-POS is given, ignore matches near that position."
       (when (equal (string-to-char s) ?*)
 	;; Anchor on headlines, post may include tags.
 	(setq pre "^\\*+[ \t]+\\(?:\\sw+\\)?[ \t]*"
-	      post (org-re "[ \t]*\\(?:[ \t]+:[[:alnum:]_@:+]:[ \t]*\\)?$")
+	      post (org-re "[ \t]*\\(?:[ \t]+:[[:alnum:]_@#%:+]:[ \t]*\\)?$")
 	      s (substring s 1)))
       (remove-text-properties
        0 (length s)
@@ -10601,7 +10601,7 @@ At all other locations, this simply calls the value of
      (let* ((a nil)
 	    (end (point))
 	    (beg1 (save-excursion
-		    (skip-chars-backward (org-re "[:alnum:]_@"))
+		    (skip-chars-backward (org-re "[:alnum:]_@#%"))
 		    (point)))
 	    (beg (save-excursion
 		   (skip-chars-backward "a-zA-Z0-9_:$")
@@ -12228,7 +12228,7 @@ only lines with a TODO keyword are included in the output."
   (let* ((re (concat "^" outline-regexp " *\\(\\<\\("
 		     (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
 		     (org-re
-		      "\\>\\)\\)? *\\(.*?\\)\\(:[[:alnum:]_@:]+:\\)?[ \t]*$")))
+		      "\\>\\)\\)? *\\(.*?\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*$")))
 	 (props (list 'face 'default
 		      'done-face 'org-agenda-done
 		      'undone-face 'default
@@ -12428,7 +12428,7 @@ also TODO lines."
 
   ;; Parse the string and create a lisp form
   (let ((match0 match)
-	(re (org-re "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL\\([<=>]\\{1,2\\}\\)\\([0-9]+\\)\\|\\(\\(?:[[:alnum:]_]+\\(?:\\\\-\\)*\\)+\\)\\([<>=]\\{1,2\\}\\)\\({[^}]+}\\|\"[^\"]*\"\\|-?[.0-9]+\\(?:[eE][-+]?[0-9]+\\)?\\)\\|[[:alnum:]_@]+\\)"))
+	(re (org-re "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL\\([<=>]\\{1,2\\}\\)\\([0-9]+\\)\\|\\(\\(?:[[:alnum:]_]+\\(?:\\\\-\\)*\\)+\\)\\([<>=]\\{1,2\\}\\)\\({[^}]+}\\|\"[^\"]*\"\\|-?[.0-9]+\\(?:[eE][-+]?[0-9]+\\)?\\)\\|[[:alnum:]_@#%]+\\)"))
 	minus tag mm
 	tagsmatch todomatch tagsmatcher todomatcher kwd matcher
 	orterms term orlist re-p str-p level-p level-op time-p
@@ -12458,7 +12458,7 @@ also TODO lines."
 			   (equal (match-string 1 term) "-"))
 		tag (save-match-data (replace-regexp-in-string
 				      "\\\\-" "-"
-				      (match-string 2 term)))				      
+				      (match-string 2 term)))
 		re-p (equal (string-to-char tag) ?{)
 		level-p (match-end 4)
 		prop-p (match-end 5)
@@ -12637,7 +12637,7 @@ ignore inherited ones."
 		    (while (not (equal lastpos (point)))
 		      (setq lastpos (point))
 		      (when (looking-at
-			     (org-re "[^\r\n]+?:\\([[:alnum:]_@:]+\\):[ \t]*$"))
+			     (org-re "[^\r\n]+?:\\([[:alnum:]_@#%:]+\\):[ \t]*$"))
 			(setq ltags (org-split-string
 				     (org-match-string-no-properties 1) ":"))
 			(when parent
@@ -12664,7 +12664,7 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
   (let (res current)
     (save-excursion
       (org-back-to-heading t)
-      (if (re-search-forward (org-re "[ \t]:\\([[:alnum:]_@:]+\\):[ \t]*$")
+      (if (re-search-forward (org-re "[ \t]:\\([[:alnum:]_@#%:]+\\):[ \t]*$")
 			     (point-at-eol) t)
 	  (progn
 	    (setq current (match-string 1))
@@ -12694,7 +12694,7 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
   ;; Assumes that this is a headline
   (let ((pos (point)) (col (current-column)) ncol tags-l p)
     (beginning-of-line 1)
-    (if	(and (looking-at (org-re ".*?\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$"))
+    (if	(and (looking-at (org-re ".*?\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"))
 	     (< pos (match-beginning 2)))
 	(progn
 	  (setq tags-l (- (match-end 2) (match-beginning 2)))
@@ -12814,7 +12814,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
 
       (if org-tags-sort-function
       	  (setq tags (mapconcat 'identity
-      				(sort (org-split-string tags (org-re "[^[:alnum:]_@]+"))
+      				(sort (org-split-string tags (org-re "[^[:alnum:]_@#%]+"))
       				      org-tags-sort-function) ":")))
 
       (if (string-match "\\`[\t ]*\\'" tags)
@@ -12971,7 +12971,7 @@ Returns the new tags string, or nil to not change the current settings."
     (save-excursion
       (beginning-of-line 1)
       (if (looking-at
-	   (org-re ".*[ \t]\\(:[[:alnum:]_@:]+:\\)[ \t]*$"))
+	   (org-re ".*[ \t]\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"))
 	  (setq ov-start (match-beginning 1)
 		ov-end (match-end 1)
 		ov-prefix "")
@@ -13121,7 +13121,7 @@ Returns the new tags string, or nil to not change the current settings."
 		(org-fast-tag-insert "Current" current c-face)
 		(org-set-current-tags-overlay current ov-prefix)
 		(while (re-search-forward
-			(org-re "\\[.\\] \\([[:alnum:]_@]+\\)") nil t)
+			(org-re "\\[.\\] \\([[:alnum:]_@#%]+\\)") nil t)
 		  (setq tg (match-string 1))
 		  (add-text-properties
 		   (match-beginning 1) (match-end 1)
@@ -13142,7 +13142,7 @@ Returns the new tags string, or nil to not change the current settings."
     (error "Not on a heading"))
   (save-excursion
     (beginning-of-line 1)
-    (if (looking-at (org-re ".*[ \t]\\(:[[:alnum:]_@:]+:\\)[ \t]*$"))
+    (if (looking-at (org-re ".*[ \t]\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"))
 	(org-match-string-no-properties 1)
       "")))
 
@@ -13156,7 +13156,7 @@ Returns the new tags string, or nil to not change the current settings."
     (save-excursion
       (goto-char (point-min))
       (while (re-search-forward
-	      (org-re "[ \t]:\\([[:alnum:]_@:]+\\):[ \t\r\n]") nil t)
+	      (org-re "[ \t]:\\([[:alnum:]_@#%:]+\\):[ \t\r\n]") nil t)
 	(when (equal (char-after (point-at-bol 0)) ?*)
 	  (mapc (lambda (x) (add-to-list 'tags x))
 		(org-split-string (org-match-string-no-properties 1) ":")))))
@@ -15994,14 +15994,14 @@ Some of the options can be changed using the variable
 	      (unless checkdir ; make sure the directory exists
 		(setq checkdir t)
 		(or (file-directory-p todir) (make-directory todir t)))
-	      
+
 	      (unless executables-checked
 		(org-check-external-command
 		 "latex" "needed to convert LaTeX fragments to images")
 		(org-check-external-command
 		 "dvipng" "needed to convert LaTeX fragments to images")
 		(setq executables-checked t))
-	      
+
 	      (unless (file-exists-p movefile)
 		(org-create-formula-image
 		 txt movefile opt forbuffer))
@@ -17316,7 +17316,7 @@ See the individual commands for more information."
     (call-interactively 'org-open-at-point))
    ((and (org-at-heading-p)
 	 (looking-at
-	  (org-re "\\([ \t]+\\(:[[:alnum:]_@:]+:\\)\\)[ \t]*$")))
+	  (org-re "\\([ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)[ \t]*$")))
     (org-show-entry)
     (end-of-line 1)
     (newline))
@@ -18877,7 +18877,7 @@ beyond the end of the headline."
 	       (t 'end-of-line)))
       (let ((pos (point)))
 	(beginning-of-line 1)
-	(if (looking-at (org-re ".*?\\(?:\\([ \t]*\\)\\(:[[:alnum:]_@:]+:\\)?[ \t]*\\)?$"))
+	(if (looking-at (org-re ".*?\\(?:\\([ \t]*\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\)?$"))
 	    (if (eq special t)
 		(if (or (< pos (match-beginning 1))
 			(= pos (match-end 0)))
@@ -18931,7 +18931,7 @@ depending on context."
 		(not (y-or-n-p "Kill hidden subtree along with headline? ")))
 	    (error "C-k aborted - would kill hidden subtree")))
     (call-interactively 'kill-line))
-   ((looking-at (org-re ".*?\\S-\\([ \t]+\\(:[[:alnum:]_@:]+:\\)\\)[ \t]*$"))
+   ((looking-at (org-re ".*?\\S-\\([ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)[ \t]*$"))
     (kill-region (point) (match-beginning 1))
     (org-set-tags nil t))
    (t (kill-region (point) (point-at-eol)))))
-- 
1.6.4.2


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

_______________________________________________
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 related	[flat|nested] 9+ messages in thread

* Re: tag or property names with dashes
  2010-08-20 19:30           ` Manish
@ 2010-08-30  8:34             ` Carsten Dominik
  2010-08-30 17:29               ` Manish
  0 siblings, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2010-08-30  8:34 UTC (permalink / raw)
  To: Manish; +Cc: emacs-orgmode list

Hi Manish,

this looks pretty good.  I just went over the patch and
found something like 5 locations where you did not make
the change, and I fixed those.

Have you been testing your patch extensively?  Some testing
needs to be done before we can merge it.

- Carsten

On Aug 20, 2010, at 9:30 PM, Manish wrote:

> On Sat, Aug 21, 2010 at 12:58 AM, Manish <mailtomanish.sharma@gmail.com 
> > wrote:
>> On Fri, Aug 20, 2010 at 11:02 PM, Manish wrote:
>>> On Fri, Aug 20, 2010 at 7:15 PM, Carsten Dominik wrote:
>>>>
>>>> On Aug 20, 2010, at 3:36 PM, Manish wrote:
>>>>
>> [snip: accepting -'s in properties (17 lines)]
>>>>>
>>>>> Are "#" and "%" are disallowed in the tags? Can they be made to  
>>>>> work
>>>>> please?
>>>>
>>>> This is non-trivial and I shy away from the work for now. Make me a
>>>> patch and I will look at it.
>>>
>>> Attempting something that /you/ call non-trivial is nigh impossible
>>> for me. :(
>>>
>>> But even if I were to dare.. any hints where I could start?
>>>
>>
>> Attaching a naive first attempt. With this patch, I have tested  
>> special
>> behavior of ctrl-a/e respecting tags in org files, ascii and HTML
>> exports, agenda, and tag filtering. LaTeX export was not working so
>> could not test and do not have the setup for testing Docbook exports.
>> Please do take a look -- I do not understand the larger
>> repurcussions/side effects of the changes to all the regexes.
>>
>> Thanks
>> -- Manish
>>
>
> This time _with_ patch.
>
> -- Manish
> <0001-Modified-regexes-to-accept-percent-and-hash-sign-as-.patch>

- Carsten

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

* Re: tag or property names with dashes
  2010-08-30  8:34             ` Carsten Dominik
@ 2010-08-30 17:29               ` Manish
  0 siblings, 0 replies; 9+ messages in thread
From: Manish @ 2010-08-30 17:29 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode list

On Mon, Aug 30, 2010 at 2:04 PM, Carsten Dominik wrote:
> Hi Manish,
>
> this looks pretty good.  I just went over the patch and
> found something like 5 locations where you did not make
> the change, and I fixed those.
>
> Have you been testing your patch extensively?  Some testing
> needs to be done before we can merge it.

Yes, I have been running with this patch for over a week now and
haven't faced any issues so far.  I have tested it with HTML, Latex
and ASCII exports, with block agenda, tag filtering, special ctrl-a/e
etc. and haven't faced any issues so far.  It did not break any thing
for me.. so far.

-- Manish

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

end of thread, other threads:[~2010-08-30 17:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-17 19:40 tag or property names with dashes Ilya Shlyakhter
2010-08-20  7:27 ` Carsten Dominik
2010-08-20 13:36   ` Manish
2010-08-20 13:45     ` Carsten Dominik
2010-08-20 17:32       ` Manish
2010-08-20 19:28         ` Manish
2010-08-20 19:30           ` Manish
2010-08-30  8:34             ` Carsten Dominik
2010-08-30 17:29               ` Manish

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