Browse Source

Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode

Eric Schulte 15 years ago
parent
commit
fc69523827

+ 6 - 1
contrib/scripts/org2hpda

@@ -44,6 +44,11 @@ EMACS = emacs -batch -l ~/.emacs
 LATEX = latex
 LATEX = latex
 DIARY = $($(EMACS) -eval "diary-file")
 DIARY = $($(EMACS) -eval "diary-file")
 
 
+# Number of weeks to be printed. Should be a multiple of 4, because 4
+# of them are merged on one page. Can be set when invoking the script
+# as follows: make NUMBER_OF_WEEKS=8 -f org2hpda
+NUMBER_OF_WEEKS = 4 
+
 hipsterFiles =  weekCalendar.pdf yearCalendar.pdf monthCalendar3.pdf monthCalendar2.pdf monthCalendar1.pdf
 hipsterFiles =  weekCalendar.pdf yearCalendar.pdf monthCalendar3.pdf monthCalendar2.pdf monthCalendar1.pdf
 pocketModFiles =  weekCalendar.pdf yearCalendar-rotated.pdf \
 pocketModFiles =  weekCalendar.pdf yearCalendar-rotated.pdf \
 	monthCalendar3-rotated.pdf monthCalendar2-rotated.pdf monthCalendar1-rotated.pdf
 	monthCalendar3-rotated.pdf monthCalendar2-rotated.pdf monthCalendar1-rotated.pdf
@@ -73,7 +78,7 @@ all: pocketMod.pdf hipsterPDA.pdf
 	done
 	done
 
 
 weekCalendar.tex: $(DIARY)
 weekCalendar.tex: $(DIARY)
-	$(EMACS) -eval "(progn (calendar) (cal-tex-cursor-week-iso 4) (with-current-buffer cal-tex-buffer (write-file \"$@\")))"
+	$(EMACS) -eval "(progn (calendar) (cal-tex-cursor-week-iso $(NUMBER_OF_WEEKS)) (with-current-buffer cal-tex-buffer (write-file \"$@\")))"
 
 
 monthCalendar1.tex: $(DIARY)
 monthCalendar1.tex: $(DIARY)
 	 $(EMACS) -eval "(progn (calendar) (cal-tex-cursor-month-landscape 1) (with-current-buffer cal-tex-buffer (write-file \"$@\")))"
 	 $(EMACS) -eval "(progn (calendar) (cal-tex-cursor-month-landscape 1) (with-current-buffer cal-tex-buffer (write-file \"$@\")))"

+ 3 - 3
doc/org.texi

@@ -11176,10 +11176,10 @@ Include the code block in the tangled output to file @samp{filename}.
 @kindex  C-c C-v t
 @kindex  C-c C-v t
 @subsubheading Functions
 @subsubheading Functions
 @table @code
 @table @code
-@item org-babel-tangle @kbd{C-c C-v t}
-Tangle the current file.
+@item org-babel-tangle 
+Tangle the current file.  Bound to @kbd{C-c C-v t}.
 @item org-babel-tangle-file
 @item org-babel-tangle-file
-Choose a file to tangle.
+Choose a file to tangle.   Bound to @kbd{C-c C-v f}.
 @end table
 @end table
 
 
 @subsubheading Hooks
 @subsubheading Hooks

+ 23 - 26
lisp/ob-R.el

@@ -37,6 +37,7 @@
 (declare-function R "ext:essd-r" (&optional start-args))
 (declare-function R "ext:essd-r" (&optional start-args))
 (declare-function inferior-ess-send-input "ext:ess-inf" ())
 (declare-function inferior-ess-send-input "ext:ess-inf" ())
 (declare-function ess-make-buffer-current "ext:ess-inf" ())
 (declare-function ess-make-buffer-current "ext:ess-inf" ())
+(declare-function ess-eval-buffer "ext:ess-inf" (vis))
 
 
 (defconst org-babel-header-arg-names:R
 (defconst org-babel-header-arg-names:R
   '(width height bg units pointsize antialias quality compression
   '(width height bg units pointsize antialias quality compression
@@ -217,9 +218,7 @@ current code buffer."
 
 
 (defvar org-babel-R-eoe-indicator "'org_babel_R_eoe'")
 (defvar org-babel-R-eoe-indicator "'org_babel_R_eoe'")
 (defvar org-babel-R-eoe-output "[1] \"org_babel_R_eoe\"")
 (defvar org-babel-R-eoe-output "[1] \"org_babel_R_eoe\"")
-(defvar org-babel-R-wrapper-method "main <- function ()\n{\n%s\n}
-write.table(main(), file=\"%s\", sep=\"\\t\", na=\"nil\",row.names=%s, col.names=%s, quote=FALSE)")
-(defvar org-babel-R-wrapper-lastvar "write.table(.Last.value, file=\"%s\", sep=\"\\t\", na=\"nil\",row.names=%s, col.names=%s, quote=FALSE)")
+(defvar org-babel-R-write-object-command "{function(object, transfer.file) {invisible(if(inherits(try(write.table(object, file=transfer.file, sep=\"\\t\", na=\"nil\",row.names=%s, col.names=%s, quote=FALSE), silent=TRUE),\"try-error\")) {if(!file.exists(transfer.file)) file.create(transfer.file)})}}(object=%s, transfer.file=\"%s\")")
 
 
 (defun org-babel-R-evaluate
 (defun org-babel-R-evaluate
   (session body result-type column-names-p row-names-p)
   (session body result-type column-names-p row-names-p)
@@ -238,17 +237,17 @@ string. If RESULT-TYPE equals 'value then return the value of the
 last statement in BODY, as elisp."
 last statement in BODY, as elisp."
   (case result-type
   (case result-type
     (value
     (value
-     (let ((tmp-file (org-babel-temp-file "R-results-")))
+     (let ((tmp-file (org-babel-temp-file "R-")))
        (org-babel-eval org-babel-R-command
        (org-babel-eval org-babel-R-command
-		       (format org-babel-R-wrapper-method
-			       body tmp-file
+		       (format org-babel-R-write-object-command
 			       (if row-names-p "TRUE" "FALSE")
 			       (if row-names-p "TRUE" "FALSE")
 			       (if column-names-p
 			       (if column-names-p
 				   (if row-names-p "NA" "TRUE")
 				   (if row-names-p "NA" "TRUE")
-				 "FALSE")))
+				 "FALSE")
+			       (format "{function ()\n{\n%s\n}}()" body)
+			       (org-babel-tramp-localname tmp-file)))
        (org-babel-R-process-value-result
        (org-babel-R-process-value-result
-	(org-babel-import-elisp-from-file
-	 (org-babel-maybe-remote-file tmp-file) '(16)) column-names-p)))
+	(org-babel-import-elisp-from-file tmp-file '(16)) column-names-p)))
     (output (org-babel-eval org-babel-R-command body))))
     (output (org-babel-eval org-babel-R-command body))))
 
 
 (defun org-babel-R-evaluate-session
 (defun org-babel-R-evaluate-session
@@ -259,24 +258,22 @@ string. If RESULT-TYPE equals 'value then return the value of the
 last statement in BODY, as elisp."
 last statement in BODY, as elisp."
   (case result-type
   (case result-type
     (value
     (value
-     (let ((tmp-file (org-babel-temp-file "R-"))
-	   broke)
-       (org-babel-comint-with-output (session org-babel-R-eoe-output)
-	 (insert (mapconcat
-		  #'org-babel-chomp
-		  (list
-		   body
-		   (format org-babel-R-wrapper-lastvar
-			   tmp-file
-			   (if row-names-p "TRUE" "FALSE")
-			   (if column-names-p
-			       (if row-names-p "NA" "TRUE")
-			     "FALSE"))
-		   org-babel-R-eoe-indicator) "\n"))
-	 (inferior-ess-send-input))
+     (with-temp-buffer
+       (insert (org-babel-chomp body))
+       (let ((ess-local-process-name
+	      (process-name (get-buffer-process session))))
+	 (ess-eval-buffer nil)))
+     (let ((tmp-file (org-babel-temp-file "R-")))
+       (org-babel-comint-eval-invisibly-and-wait-for-file
+	session tmp-file
+	(format org-babel-R-write-object-command
+		(if row-names-p "TRUE" "FALSE")
+		(if column-names-p
+		    (if row-names-p "NA" "TRUE")
+		  "FALSE")
+		".Last.value" (org-babel-tramp-localname tmp-file)))
        (org-babel-R-process-value-result
        (org-babel-R-process-value-result
-	(org-babel-import-elisp-from-file
-	 (org-babel-maybe-remote-file tmp-file) '(16))  column-names-p)))
+	(org-babel-import-elisp-from-file tmp-file '(16))  column-names-p)))
     (output
     (output
      (mapconcat
      (mapconcat
       #'org-babel-chomp
       #'org-babel-chomp

+ 20 - 0
lisp/ob-comint.el

@@ -34,6 +34,8 @@
 (require 'ob)
 (require 'ob)
 (require 'comint)
 (require 'comint)
 (eval-when-compile (require 'cl))
 (eval-when-compile (require 'cl))
+(declare-function with-parsed-tramp-file-name "tramp" (filename var &rest body))
+(declare-function tramp-flush-directory-property "tramp" (vec directory))
 
 
 (defun org-babel-comint-buffer-livep (buffer)
 (defun org-babel-comint-buffer-livep (buffer)
   "Check if BUFFER is a comint buffer with a live process."
   "Check if BUFFER is a comint buffer with a live process."
@@ -136,6 +138,24 @@ statement (not large blocks of code)."
                                 "comint-highlight-prompt"))))
                                 "comint-highlight-prompt"))))
       (accept-process-output (get-buffer-process buffer)))))
       (accept-process-output (get-buffer-process buffer)))))
 
 
+(defun org-babel-comint-eval-invisibly-and-wait-for-file
+  (buffer file string &optional period)
+  "Evaluate STRING in BUFFER invisibly.
+Don't return until FILE exists. Code in STRING must ensure that
+FILE exists at end of evaluation."
+  (unless (org-babel-comint-buffer-livep buffer)
+    (error "buffer %s doesn't exist or has no process" buffer))
+  (if (file-exists-p file) (delete-file file))
+  (process-send-string
+   (get-buffer-process buffer)
+   (if (string-match "\n$" string) string (concat string "\n")))
+  ;; From Tramp 2.1.19 the following cache flush is not necessary
+  (if (file-remote-p default-directory)
+      (let (v)
+	(with-parsed-tramp-file-name default-directory nil
+	  (tramp-flush-directory-property v ""))))
+  (while (not (file-exists-p file)) (sit-for (or period 0.25))))
+
 (provide 'ob-comint)
 (provide 'ob-comint)
 
 
 ;; arch-tag: 9adddce6-0864-4be3-b0b5-6c5157dc7889
 ;; arch-tag: 9adddce6-0864-4be3-b0b5-6c5157dc7889

+ 19 - 4
lisp/ob.el

@@ -40,6 +40,7 @@
 (declare-function tramp-dissect-file-name "tramp" (name &optional nodefault))
 (declare-function tramp-dissect-file-name "tramp" (name &optional nodefault))
 (declare-function tramp-file-name-user "tramp" (vec))
 (declare-function tramp-file-name-user "tramp" (vec))
 (declare-function tramp-file-name-host "tramp" (vec))
 (declare-function tramp-file-name-host "tramp" (vec))
+(declare-function with-parsed-tramp-file-name "tramp" (filename var &rest body))
 (declare-function org-icompleting-read "org" (&rest args))
 (declare-function org-icompleting-read "org" (&rest args))
 (declare-function org-edit-src-code "org-src" 
 (declare-function org-edit-src-code "org-src" 
                   (&optional context code edit-buffer-name quietp))
                   (&optional context code edit-buffer-name quietp))
@@ -1671,6 +1672,14 @@ the remote connection."
         (concat "/" user (when user "@") host ":" file))
         (concat "/" user (when user "@") host ":" file))
     file))
     file))
 
 
+(defun org-babel-tramp-localname (file)
+  "Return the local name component of FILE."
+  (if (file-remote-p file)
+      (let (localname)
+	(with-parsed-tramp-file-name file nil
+	  localname))
+    file))
+
 (defvar org-babel-temporary-directory
 (defvar org-babel-temporary-directory
   (or (and (boundp 'org-babel-temporary-directory)
   (or (and (boundp 'org-babel-temporary-directory)
 	   org-babel-temporary-directory)
 	   org-babel-temporary-directory)
@@ -1684,10 +1693,16 @@ Emacs shutdown.")
 Passes PREFIX and SUFFIX directly to `make-temp-file' with the
 Passes PREFIX and SUFFIX directly to `make-temp-file' with the
 value of `temporary-file-directory' temporarily set to the value
 value of `temporary-file-directory' temporarily set to the value
 of `org-babel-temporary-directory'."
 of `org-babel-temporary-directory'."
-  (let ((temporary-file-directory (expand-file-name
-				   org-babel-temporary-directory
-				   temporary-file-directory)))
-    (make-temp-file prefix nil suffix)))
+  (if (file-remote-p default-directory)
+      (make-temp-file
+       (concat (file-remote-p default-directory)
+	       (expand-file-name 
+		prefix temporary-file-directory)
+	       nil suffix))
+    (let ((temporary-file-directory (expand-file-name
+				     org-babel-temporary-directory
+				     temporary-file-directory)))
+      (make-temp-file prefix nil suffix))))
 
 
 (defun org-babel-remove-temporary-directory ()
 (defun org-babel-remove-temporary-directory ()
   "Remove `org-babel-temporary-directory' on Emacs shutdown."
   "Remove `org-babel-temporary-directory' on Emacs shutdown."

+ 5 - 5
lisp/org-agenda.el

@@ -4025,11 +4025,11 @@ MATCH is being ignored."
 			  "\\)\\>"))
 			  "\\)\\>"))
 	 (tags (nth 2 org-stuck-projects))
 	 (tags (nth 2 org-stuck-projects))
 	 (tags-re (if (member "*" tags)
 	 (tags-re (if (member "*" tags)
-		      (org-re "^\\*+ .*:[[:alnum:]_@]+:[ \t]*$")
+		      (org-re "^\\*+ .*:[[:alnum:]_@#%]+:[ \t]*$")
 		    (if tags
 		    (if tags
 			(concat "^\\*+ .*:\\("
 			(concat "^\\*+ .*:\\("
 				(mapconcat 'identity tags "\\|")
 				(mapconcat 'identity tags "\\|")
-				(org-re "\\):[[:alnum:]_@:]*[ \t]*$")))))
+				(org-re "\\):[[:alnum:]_@#%:]*[ \t]*$")))))
 	 (gen-re (nth 3 org-stuck-projects))
 	 (gen-re (nth 3 org-stuck-projects))
 	 (re-list
 	 (re-list
 	  (delq nil
 	  (delq nil
@@ -4988,7 +4988,7 @@ Any match of REMOVE-RE will be removed from TXT."
 	  (setq h (/ m 60) m (- m (* h 60)))
 	  (setq h (/ m 60) m (- m (* h 60)))
 	  (setq s2 (format "%02d:%02d" h m))))
 	  (setq s2 (format "%02d:%02d" h m))))
 
 
-      (when (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$")
+      (when (string-match (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")
 			  txt)
 			  txt)
 	;; Tags are in the string
 	;; Tags are in the string
 	(if (or (eq org-agenda-remove-tags t)
 	(if (or (eq org-agenda-remove-tags t)
@@ -5062,7 +5062,7 @@ Any match of REMOVE-RE will be removed from TXT."
 The modified list may contain inherited tags, and tags matched by
 The modified list may contain inherited tags, and tags matched by
 `org-agenda-hide-tags-regexp' will be removed."
 `org-agenda-hide-tags-regexp' will be removed."
   (when (or add-inherited hide-re)
   (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 txt (substring txt 0 (match-beginning 0))))
     (setq tags
     (setq tags
 	  (delq nil
 	  (delq nil
@@ -6728,7 +6728,7 @@ If FORCE-TAGS is non nil, the car of it returns the new tags."
   (let ((inhibit-read-only t) l c)
   (let ((inhibit-read-only t) l c)
     (save-excursion
     (save-excursion
       (goto-char (if line (point-at-bol) (point-min)))
       (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)
 				(if line (point-at-eol) nil) t)
 	(add-text-properties
 	(add-text-properties
 	 (match-beginning 2) (match-end 2)
 	 (match-beginning 2) (match-end 2)

+ 1 - 1
lisp/org-archive.el

@@ -268,7 +268,7 @@ this heading."
 	      (progn
 	      (progn
 		(if (re-search-forward
 		(if (re-search-forward
 		     (concat "^" (regexp-quote heading)
 		     (concat "^" (regexp-quote heading)
-			     (org-re "[ \t]*\\(:[[:alnum:]_@:]+:\\)?[ \t]*\\($\\|\r\\)"))
+			     (org-re "[ \t]*\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\($\\|\r\\)"))
 		     nil t)
 		     nil t)
 		    (goto-char (match-end 0))
 		    (goto-char (match-end 0))
 		  ;; Heading not found, just insert it at the end
 		  ;; Heading not found, just insert it at the end

+ 2 - 2
lisp/org-ascii.el

@@ -400,7 +400,7 @@ publishing directory."
 
 
 			 (if (and (memq org-export-with-tags '(not-in-toc nil))
 			 (if (and (memq org-export-with-tags '(not-in-toc nil))
 				  (string-match
 				  (string-match
-				   (org-re "[ \t]+:[[:alnum:]_@:]+:[ \t]*$")
+				   (org-re "[ \t]+:[[:alnum:]_@#%:]+:[ \t]*$")
 				   txt))
 				   txt))
 			     (setq txt (replace-match "" t t txt)))
 			     (setq txt (replace-match "" t t txt)))
 			 (if (string-match quote-re0 txt)
 			 (if (string-match quote-re0 txt)
@@ -648,7 +648,7 @@ publishing directory."
 	  (insert "\n"))
 	  (insert "\n"))
       (setq char (nth (- umax level) (reverse org-export-ascii-underline)))
       (setq char (nth (- umax level) (reverse org-export-ascii-underline)))
       (unless org-export-with-tags
       (unless org-export-with-tags
-	(if (string-match (org-re "[ \t]+\\(:[[:alnum:]_@:]+:\\)[ \t]*$") title)
+	(if (string-match (org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$") title)
 	    (setq title (replace-match "" t t title))))
 	    (setq title (replace-match "" t t title))))
       (if org-export-with-section-numbers
       (if org-export-with-section-numbers
 	  (setq title (concat (org-section-number level) " " title)))
 	  (setq title (concat (org-section-number level) " " title)))

+ 1 - 1
lisp/org-capture.el

@@ -1205,7 +1205,7 @@ The template may still contain \"%?\" for cursor positioning."
 			 'org-tags-history)))
 			 'org-tags-history)))
 	      (setq ins (mapconcat 'identity
 	      (setq ins (mapconcat 'identity
 				   (org-split-string
 				   (org-split-string
-				    ins (org-re "[^[:alnum:]_@]+"))
+				    ins (org-re "[^[:alnum:]_@#%]+"))
 				       ":"))
 				       ":"))
 	      (when (string-match "\\S-" ins)
 	      (when (string-match "\\S-" ins)
 		(or (equal (char-before) ?:) (insert ":"))
 		(or (equal (char-before) ?:) (insert ":"))

+ 1 - 1
lisp/org-clock.el

@@ -1863,7 +1863,7 @@ the currently selected interval size."
 	    (when (setq time (get-text-property p :org-clock-minutes))
 	    (when (setq time (get-text-property p :org-clock-minutes))
 	      (save-excursion
 	      (save-excursion
 		(beginning-of-line 1)
 		(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
 			   (setq level (org-reduced-level
 					(- (match-end 1) (match-beginning 1))))
 					(- (match-end 1) (match-beginning 1))))
 			   (<= level maxlevel))
 			   (<= level maxlevel))

+ 1 - 1
lisp/org-colview-xemacs.el

@@ -685,7 +685,7 @@ Where possible, use the standard interface for changing this line."
 	  (txt (match-string 3))
 	  (txt (match-string 3))
 	  (post "")
 	  (post "")
 	  txt2)
 	  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)
 	  (setq post (match-string 0 txt)
 		txt (substring txt 0 (match-beginning 0))))
 		txt (substring txt 0 (match-beginning 0))))
       (setq txt2 (read-string "Edit: " txt))
       (setq txt2 (read-string "Edit: " txt))

+ 1 - 1
lisp/org-colview.el

@@ -519,7 +519,7 @@ Where possible, use the standard interface for changing this line."
 	  (txt (match-string 3))
 	  (txt (match-string 3))
 	  (post "")
 	  (post "")
 	  txt2)
 	  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)
 	  (setq post (match-string 0 txt)
 		txt (substring txt 0 (match-beginning 0))))
 		txt (substring txt 0 (match-beginning 0))))
       (setq txt2 (read-string "Edit: " txt))
       (setq txt2 (read-string "Edit: " txt))

+ 2 - 2
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.
       ;; all levels, so the rest is done only if title is given.
       ;;
       ;;
       ;; Format tags: put them into a superscript like format.
       ;; 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
 	(setq title
 	      (replace-match
 	      (replace-match
 	       (if org-export-with-tags
 	       (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
 Applies all active conversions.  If there are links in the
 string, don't modify these."
 string, don't modify these."
   (let* ((re (concat org-bracket-link-regexp "\\|"
   (let* ((re (concat org-bracket-link-regexp "\\|"
-		     (org-re "[ \t]+\\(:[[:alnum:]_@:]+:\\)[ \t]*$")))
+		     (org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")))
 	 m s l res)
 	 m s l res)
     (while (setq m (string-match re string))
     (while (setq m (string-match re string))
       (setq s (substring string 0 m)
       (setq s (substring string 0 m)

+ 1 - 1
lisp/org-exp.el

@@ -2796,7 +2796,7 @@ If yes remove the column and the special lines."
 (defun org-export-cleanup-toc-line (s)
 (defun org-export-cleanup-toc-line (s)
   "Remove tags and timestamps from lines going into the toc."
   "Remove tags and timestamps from lines going into the toc."
   (when (memq org-export-with-tags '(not-in-toc nil))
   (when (memq org-export-with-tags '(not-in-toc nil))
-    (if (string-match (org-re " +:[[:alnum:]_@:]+: *$") s)
+    (if (string-match (org-re " +:[[:alnum:]_@#%:]+: *$") s)
 	(setq s (replace-match "" t t s))))
 	(setq s (replace-match "" t t s))))
   (when org-export-remove-timestamps-from-toc
   (when org-export-remove-timestamps-from-toc
     (while (string-match org-maybe-keyword-time-regexp s)
     (while (string-match org-maybe-keyword-time-regexp s)

+ 3 - 3
lisp/org-html.el

@@ -1095,7 +1095,7 @@ lang=\"%s\" xml:lang=\"%s\">
 					 (org-search-todo-below
 					 (org-search-todo-below
 					  line lines level))))
 					  line lines level))))
 			  (if (string-match
 			  (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)))
 			      (setq txt (replace-match  "&nbsp;&nbsp;&nbsp;<span class=\"tag\"> \\1</span>" t nil txt)))
 			  (if (string-match quote-re0 txt)
 			  (if (string-match quote-re0 txt)
 			      (setq txt (replace-match "" t t 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.
   "Prepare STRING for HTML export.  Apply all active conversions.
 If there are links in the string, don't modify these."
 If there are links in the string, don't modify these."
   (let* ((re (concat org-bracket-link-regexp "\\|"
   (let* ((re (concat org-bracket-link-regexp "\\|"
-		     (org-re "[ \t]+\\(:[[:alnum:]_@:]+:\\)[ \t]*$")))
+		     (org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")))
 	 m s l res)
 	 m s l res)
     (if (string-match "^[ \t]*\\+-[-+]*\\+[ \t]*$" string)
     (if (string-match "^[ \t]*\\+-[-+]*\\+[ \t]*$" string)
 	string
 	string
@@ -2328,7 +2328,7 @@ When TITLE is nil, just close all open levels."
     (when title
     (when title
       ;; If title is nil, this means this function is called to close
       ;; If title is nil, this means this function is called to close
       ;; all levels, so the rest is done only if title is given
       ;; 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
 	  (setq title (replace-match
 		       (if org-export-with-tags
 		       (if org-export-with-tags
 			   (save-match-data
 			   (save-match-data

+ 1 - 1
lisp/org-latex.el

@@ -1329,7 +1329,7 @@ links, keywords, lists, tables, fixed-width"
 	  (replace-match "")
 	  (replace-match "")
 	(replace-match (format "\\textbf{%s}" (match-string 0)) t t)))
 	(replace-match (format "\\textbf{%s}" (match-string 0)) t t)))
     ;; convert tags
     ;; 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)
       (if (or (not org-export-with-tags)
 	      (plist-get remove-list :tags))
 	      (plist-get remove-list :tags))
 	  (replace-match "")
 	  (replace-match "")

+ 1 - 1
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-completion-function nil nil nil
 			   'org-tags-history)))
 			   'org-tags-history)))
 		(setq ins (mapconcat 'identity
 		(setq ins (mapconcat 'identity
-				     (org-split-string ins (org-re "[^[:alnum:]_@]+"))
+				     (org-split-string ins (org-re "[^[:alnum:]_@#%]+"))
 				     ":"))
 				     ":"))
 		(when (string-match "\\S-" ins)
 		(when (string-match "\\S-" ins)
 		  (or (equal (char-before) ?:) (insert ":"))
 		  (or (equal (char-before) ?:) (insert ":"))

+ 29 - 30
lisp/org.el

@@ -3088,7 +3088,7 @@ points to a file, `org-agenda-diary-entry' will be used instead."
 
 
 (defcustom org-format-latex-options
 (defcustom org-format-latex-options
   '(:foreground default :background default :scale 1.0
   '(: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" "$" "$$" "\\(" "\\["))
     :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\["))
   "Options for creating images from LaTeX fragments.
   "Options for creating images from LaTeX fragments.
 This is a property list with the following properties:
 This is a property list with the following properties:
@@ -3176,7 +3176,6 @@ will be appended."
     (""     "float"     nil)
     (""     "float"     nil)
     (""     "wrapfig"   nil)
     (""     "wrapfig"   nil)
     (""     "soul"      t)
     (""     "soul"      t)
-    (""     "t1enc"     t)
     (""     "textcomp"  t)
     (""     "textcomp"  t)
     (""     "marvosym"  t)
     (""     "marvosym"  t)
     (""     "wasysym"   t)
     (""     "wasysym"   t)
@@ -3191,7 +3190,7 @@ with another package you are using.
 The packages in this list are needed by one part or another of Org-mode
 The packages in this list are needed by one part or another of Org-mode
 to function properly.
 to function properly.
 
 
-- inputenc, fontenc, t1enc: for basic font and character selection
+- inputenc, fontenc:  for basic font and character selection
 - textcomp, marvosymb, wasysym, latexsym, amssym: for various symbols used
 - textcomp, marvosymb, wasysym, latexsym, amssym: for various symbols used
   for interpreting the entities in `org-entities'.  You can skip some of these
   for interpreting the entities in `org-entities'.  You can skip some of these
   packages if you don't use any of the symbols in it.
   packages if you don't use any of the symbols in it.
@@ -4377,7 +4376,7 @@ means to push this value onto the list in the variable.")
 	     ((equal e "{") (push '(:startgroup) tgs))
 	     ((equal e "{") (push '(:startgroup) tgs))
 	     ((equal e "}") (push '(:endgroup) tgs))
 	     ((equal e "}") (push '(:endgroup) tgs))
 	     ((equal e "\\n") (push '(:newline) 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)
 	      (push (cons (match-string 1 e)
 			  (string-to-char (match-string 2 e)))
 			  (string-to-char (match-string 2 e)))
 		    tgs))
 		    tgs))
@@ -4421,7 +4420,7 @@ means to push this value onto the list in the variable.")
 	    (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
 	    (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
 		    (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
 		    (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
 		    "\\)\\>\\)?\\(?:[ \t]*\\(\\[#.\\]\\)\\)?[ \t]*\\(.*?\\)"
 		    "\\)\\>\\)?\\(?:[ \t]*\\(\\[#.\\]\\)\\)?[ \t]*\\(.*?\\)"
-		    "\\(?:[ \t]+\\(:[[:alnum:]_@:]+:\\)\\)?[ \t]*$")
+		    "\\(?:[ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ \t]*$")
 	    org-complex-heading-regexp-format
 	    org-complex-heading-regexp-format
 	    (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
 	    (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
 		    (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
 		    (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
@@ -4430,7 +4429,7 @@ means to push this value onto the list in the variable.")
 		    "\\(?:[ \t]*\\(?:\\[[0-9%%/]+\\]\\)\\)?" ;; stats cookie
 		    "\\(?:[ \t]*\\(?:\\[[0-9%%/]+\\]\\)\\)?" ;; stats cookie
 		    "[ \t]*\\(%s\\)"
 		    "[ \t]*\\(%s\\)"
 		    "\\(?:[ \t]*\\(?:\\[[0-9%%/]+\\]\\)\\)?" ;; stats cookie
 		    "\\(?:[ \t]*\\(?:\\[[0-9%%/]+\\]\\)\\)?" ;; stats cookie
-		    "\\(?:[ \t]+\\(:[[:alnum:]_@:]+:\\)\\)?[ \t]*$")
+		    "\\(?:[ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ \t]*$")
 	    org-nl-done-regexp
 	    org-nl-done-regexp
 	    (concat "\n\\*+[ \t]+"
 	    (concat "\n\\*+[ \t]+"
 		    "\\(?:" (mapconcat 'regexp-quote org-done-keywords "\\|")
 		    "\\(?:" (mapconcat 'regexp-quote org-done-keywords "\\|")
@@ -4439,7 +4438,7 @@ means to push this value onto the list in the variable.")
 	    (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
 	    (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
 		    (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
 		    (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
 		    (org-re
 		    (org-re
-		     "\\)\\>\\)? *\\(.*?\\([ \t]:[[:alnum:]:_@]+:[ \t]*\\)?$\\)"))
+		     "\\)\\>\\)? *\\(.*?\\([ \t]:[[:alnum:]:_@#%]+:[ \t]*\\)?$\\)"))
 	    org-looking-at-done-regexp
 	    org-looking-at-done-regexp
 	    (concat "^" "\\(?:"
 	    (concat "^" "\\(?:"
 		    (mapconcat 'regexp-quote org-done-keywords "\\|") "\\)"
 		    (mapconcat 'regexp-quote org-done-keywords "\\|") "\\)"
@@ -5353,7 +5352,7 @@ between words."
 	"\\)\\>")))
 	"\\)\\>")))
 
 
 (defun org-activate-tags (limit)
 (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
       (progn
 	(org-remove-flyspell-overlays-in (match-beginning 1) (match-end 1))
 	(org-remove-flyspell-overlays-in (match-beginning 1) (match-end 1))
 	(add-text-properties (match-beginning 1) (match-end 1)
 	(add-text-properties (match-beginning 1) (match-end 1)
@@ -6711,7 +6710,7 @@ This is important for non-interactive uses of the command."
 	      (when hide-previous
 	      (when hide-previous
 		(show-children)
 		(show-children)
 		(org-show-entry))
 		(org-show-entry))
-	      (looking-at ".*?\\([ \t]+\\(:[[:alnum:]_@:]+:\\)\\)?[ \t]*$")
+	      (looking-at ".*?\\([ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ \t]*$")
 	      (setq tags (and (match-end 2) (match-string 2)))
 	      (setq tags (and (match-end 2) (match-string 2)))
 	      (and (match-end 1)
 	      (and (match-end 1)
 		   (delete-region (match-beginning 1) (match-end 1)))
 		   (delete-region (match-beginning 1) (match-end 1)))
@@ -6747,7 +6746,7 @@ This is important for non-interactive uses of the command."
     (org-back-to-heading t)
     (org-back-to-heading t)
     (if (looking-at
     (if (looking-at
 	 (if no-tags
 	 (if no-tags
-	     (org-re "\\*+[ \t]+\\([^\n\r]*?\\)\\([ \t]+:[[:alnum:]:_@]+:[ \t]*\\)?$")
+	     (org-re "\\*+[ \t]+\\([^\n\r]*?\\)\\([ \t]+:[[:alnum:]:_@#%]+:[ \t]*\\)?$")
 	   "\\*+[ \t]+\\([^\r\n]*\\)"))
 	   "\\*+[ \t]+\\([^\r\n]*\\)"))
 	(match-string 1) "")))
 	(match-string 1) "")))
 
 
@@ -8441,7 +8440,7 @@ according to FMT (default from `org-email-link-description-format')."
       ;; We are using a headline, clean up garbage in there.
       ;; We are using a headline, clean up garbage in there.
       (if (string-match org-todo-regexp s)
       (if (string-match org-todo-regexp s)
 	  (setq s (replace-match "" t t 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 (replace-match "" t t s)))
       (setq s (org-trim s))
       (setq s (org-trim s))
       (if (string-match (concat "^\\(" org-quote-string "\\|"
       (if (string-match (concat "^\\(" org-quote-string "\\|"
@@ -9057,7 +9056,7 @@ application the system uses for this file type."
 	    (setq type (match-string 1) path (match-string 2))
 	    (setq type (match-string 1) path (match-string 2))
 	    (throw 'match t)))
 	    (throw 'match t)))
 	(save-excursion
 	(save-excursion
-	  (when (org-in-regexp (org-re "\\(:[[:alnum:]_@:]+\\):[ \t]*$"))
+	  (when (org-in-regexp (org-re "\\(:[[:alnum:]_@#%:]+\\):[ \t]*$"))
 	    (setq type "tags"
 	    (setq type "tags"
 		  path (match-string 1))
 		  path (match-string 1))
 	    (while (string-match ":" path)
 	    (while (string-match ":" path)
@@ -9411,7 +9410,7 @@ in all files.  If AVOID-POS is given, ignore matches near that position."
       (when (equal (string-to-char s) ?*)
       (when (equal (string-to-char s) ?*)
 	;; Anchor on headlines, post may include tags.
 	;; Anchor on headlines, post may include tags.
 	(setq pre "^\\*+[ \t]+\\(?:\\sw+\\)?[ \t]*"
 	(setq pre "^\\*+[ \t]+\\(?:\\sw+\\)?[ \t]*"
-	      post (org-re "[ \t]*\\(?:[ \t]+:[[:alnum:]_@:+]:[ \t]*\\)?$")
+	      post (org-re "[ \t]*\\(?:[ \t]+:[[:alnum:]_@#%:+]:[ \t]*\\)?$")
 	      s (substring s 1)))
 	      s (substring s 1)))
       (remove-text-properties
       (remove-text-properties
        0 (length s)
        0 (length s)
@@ -10591,7 +10590,7 @@ At all other locations, this simply calls the value of
      (let* ((a nil)
      (let* ((a nil)
 	    (end (point))
 	    (end (point))
 	    (beg1 (save-excursion
 	    (beg1 (save-excursion
-		    (skip-chars-backward (org-re "[:alnum:]_@"))
+		    (skip-chars-backward (org-re "[:alnum:]_@#%"))
 		    (point)))
 		    (point)))
 	    (beg (save-excursion
 	    (beg (save-excursion
 		   (skip-chars-backward "a-zA-Z0-9_:$")
 		   (skip-chars-backward "a-zA-Z0-9_:$")
@@ -12218,7 +12217,7 @@ only lines with a TODO keyword are included in the output."
   (let* ((re (concat "^" outline-regexp " *\\(\\<\\("
   (let* ((re (concat "^" outline-regexp " *\\(\\<\\("
 		     (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
 		     (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
 		     (org-re
 		     (org-re
-		      "\\>\\)\\)? *\\(.*?\\)\\(:[[:alnum:]_@:]+:\\)?[ \t]*$")))
+		      "\\>\\)\\)? *\\(.*?\\)\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*$")))
 	 (props (list 'face 'default
 	 (props (list 'face 'default
 		      'done-face 'org-agenda-done
 		      'done-face 'org-agenda-done
 		      'undone-face 'default
 		      'undone-face 'default
@@ -12418,7 +12417,7 @@ also TODO lines."
 
 
   ;; Parse the string and create a lisp form
   ;; Parse the string and create a lisp form
   (let ((match0 match)
   (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
 	minus tag mm
 	tagsmatch todomatch tagsmatcher todomatcher kwd matcher
 	tagsmatch todomatch tagsmatcher todomatcher kwd matcher
 	orterms term orlist re-p str-p level-p level-op time-p
 	orterms term orlist re-p str-p level-p level-op time-p
@@ -12448,7 +12447,7 @@ also TODO lines."
 			   (equal (match-string 1 term) "-"))
 			   (equal (match-string 1 term) "-"))
 		tag (save-match-data (replace-regexp-in-string
 		tag (save-match-data (replace-regexp-in-string
 				      "\\\\-" "-"
 				      "\\\\-" "-"
-				      (match-string 2 term)))				      
+				      (match-string 2 term)))
 		re-p (equal (string-to-char tag) ?{)
 		re-p (equal (string-to-char tag) ?{)
 		level-p (match-end 4)
 		level-p (match-end 4)
 		prop-p (match-end 5)
 		prop-p (match-end 5)
@@ -12627,7 +12626,7 @@ ignore inherited ones."
 		    (while (not (equal lastpos (point)))
 		    (while (not (equal lastpos (point)))
 		      (setq lastpos (point))
 		      (setq lastpos (point))
 		      (when (looking-at
 		      (when (looking-at
-			     (org-re "[^\r\n]+?:\\([[:alnum:]_@:]+\\):[ \t]*$"))
+			     (org-re "[^\r\n]+?:\\([[:alnum:]_@#%:]+\\):[ \t]*$"))
 			(setq ltags (org-split-string
 			(setq ltags (org-split-string
 				     (org-match-string-no-properties 1) ":"))
 				     (org-match-string-no-properties 1) ":"))
 			(when parent
 			(when parent
@@ -12654,7 +12653,7 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
   (let (res current)
   (let (res current)
     (save-excursion
     (save-excursion
       (org-back-to-heading t)
       (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)
 			     (point-at-eol) t)
 	  (progn
 	  (progn
 	    (setq current (match-string 1))
 	    (setq current (match-string 1))
@@ -12684,7 +12683,7 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
   ;; Assumes that this is a headline
   ;; Assumes that this is a headline
   (let ((pos (point)) (col (current-column)) ncol tags-l p)
   (let ((pos (point)) (col (current-column)) ncol tags-l p)
     (beginning-of-line 1)
     (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)))
 	     (< pos (match-beginning 2)))
 	(progn
 	(progn
 	  (setq tags-l (- (match-end 2) (match-beginning 2)))
 	  (setq tags-l (- (match-end 2) (match-beginning 2)))
@@ -12804,7 +12803,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
 
 
       (if org-tags-sort-function
       (if org-tags-sort-function
       	  (setq tags (mapconcat 'identity
       	  (setq tags (mapconcat 'identity
-      				(sort (org-split-string tags (org-re "[^[:alnum:]_@]+"))
+      				(sort (org-split-string tags (org-re "[^[:alnum:]_@#%]+"))
       				      org-tags-sort-function) ":")))
       				      org-tags-sort-function) ":")))
 
 
       (if (string-match "\\`[\t ]*\\'" tags)
       (if (string-match "\\`[\t ]*\\'" tags)
@@ -12961,7 +12960,7 @@ Returns the new tags string, or nil to not change the current settings."
     (save-excursion
     (save-excursion
       (beginning-of-line 1)
       (beginning-of-line 1)
       (if (looking-at
       (if (looking-at
-	   (org-re ".*[ \t]\\(:[[:alnum:]_@:]+:\\)[ \t]*$"))
+	   (org-re ".*[ \t]\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"))
 	  (setq ov-start (match-beginning 1)
 	  (setq ov-start (match-beginning 1)
 		ov-end (match-end 1)
 		ov-end (match-end 1)
 		ov-prefix "")
 		ov-prefix "")
@@ -13111,7 +13110,7 @@ Returns the new tags string, or nil to not change the current settings."
 		(org-fast-tag-insert "Current" current c-face)
 		(org-fast-tag-insert "Current" current c-face)
 		(org-set-current-tags-overlay current ov-prefix)
 		(org-set-current-tags-overlay current ov-prefix)
 		(while (re-search-forward
 		(while (re-search-forward
-			(org-re "\\[.\\] \\([[:alnum:]_@]+\\)") nil t)
+			(org-re "\\[.\\] \\([[:alnum:]_@#%]+\\)") nil t)
 		  (setq tg (match-string 1))
 		  (setq tg (match-string 1))
 		  (add-text-properties
 		  (add-text-properties
 		   (match-beginning 1) (match-end 1)
 		   (match-beginning 1) (match-end 1)
@@ -13132,7 +13131,7 @@ Returns the new tags string, or nil to not change the current settings."
     (error "Not on a heading"))
     (error "Not on a heading"))
   (save-excursion
   (save-excursion
     (beginning-of-line 1)
     (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)
 	(org-match-string-no-properties 1)
       "")))
       "")))
 
 
@@ -13146,7 +13145,7 @@ Returns the new tags string, or nil to not change the current settings."
     (save-excursion
     (save-excursion
       (goto-char (point-min))
       (goto-char (point-min))
       (while (re-search-forward
       (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)) ?*)
 	(when (equal (char-after (point-at-bol 0)) ?*)
 	  (mapc (lambda (x) (add-to-list 'tags x))
 	  (mapc (lambda (x) (add-to-list 'tags x))
 		(org-split-string (org-match-string-no-properties 1) ":")))))
 		(org-split-string (org-match-string-no-properties 1) ":")))))
@@ -15984,14 +15983,14 @@ Some of the options can be changed using the variable
 	      (unless checkdir ; make sure the directory exists
 	      (unless checkdir ; make sure the directory exists
 		(setq checkdir t)
 		(setq checkdir t)
 		(or (file-directory-p todir) (make-directory todir t)))
 		(or (file-directory-p todir) (make-directory todir t)))
-	      
+
 	      (unless executables-checked
 	      (unless executables-checked
 		(org-check-external-command
 		(org-check-external-command
 		 "latex" "needed to convert LaTeX fragments to images")
 		 "latex" "needed to convert LaTeX fragments to images")
 		(org-check-external-command
 		(org-check-external-command
 		 "dvipng" "needed to convert LaTeX fragments to images")
 		 "dvipng" "needed to convert LaTeX fragments to images")
 		(setq executables-checked t))
 		(setq executables-checked t))
-	      
+
 	      (unless (file-exists-p movefile)
 	      (unless (file-exists-p movefile)
 		(org-create-formula-image
 		(org-create-formula-image
 		 txt movefile opt forbuffer))
 		 txt movefile opt forbuffer))
@@ -17306,7 +17305,7 @@ See the individual commands for more information."
     (call-interactively 'org-open-at-point))
     (call-interactively 'org-open-at-point))
    ((and (org-at-heading-p)
    ((and (org-at-heading-p)
 	 (looking-at
 	 (looking-at
-	  (org-re "\\([ \t]+\\(:[[:alnum:]_@:]+:\\)\\)[ \t]*$")))
+	  (org-re "\\([ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)[ \t]*$")))
     (org-show-entry)
     (org-show-entry)
     (end-of-line 1)
     (end-of-line 1)
     (newline))
     (newline))
@@ -18867,7 +18866,7 @@ beyond the end of the headline."
 	       (t 'end-of-line)))
 	       (t 'end-of-line)))
       (let ((pos (point)))
       (let ((pos (point)))
 	(beginning-of-line 1)
 	(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 (eq special t)
 		(if (or (< pos (match-beginning 1))
 		(if (or (< pos (match-beginning 1))
 			(= pos (match-end 0)))
 			(= pos (match-end 0)))
@@ -18921,7 +18920,7 @@ depending on context."
 		(not (y-or-n-p "Kill hidden subtree along with headline? ")))
 		(not (y-or-n-p "Kill hidden subtree along with headline? ")))
 	    (error "C-k aborted - would kill hidden subtree")))
 	    (error "C-k aborted - would kill hidden subtree")))
     (call-interactively 'kill-line))
     (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))
     (kill-region (point) (match-beginning 1))
     (org-set-tags nil t))
     (org-set-tags nil t))
    (t (kill-region (point) (point-at-eol)))))
    (t (kill-region (point) (point-at-eol)))))