Browse Source

Fixed bug with file tags.

This bug was reported by Manuel Hermenegildo.  There
were really two issues:  The parsing of the FILETAGS line
was broken, and the function `org-get-tags-at' did ignore
these tags.  Both problems are fixed now.
Carsten Dominik 17 years ago
parent
commit
edfd4f8abf
3 changed files with 12 additions and 4 deletions
  1. 6 0
      lisp/ChangeLog
  2. 2 0
      lisp/org-exp.el
  3. 4 4
      lisp/org.el

+ 6 - 0
lisp/ChangeLog

@@ -1,5 +1,11 @@
 2008-06-10  Carsten Dominik  <dominik@science.uva.nl>
 2008-06-10  Carsten Dominik  <dominik@science.uva.nl>
 
 
+	* org-exp.el (org-get-current-options): Add the FILETAGS setting.
+
+	* org.el (org-set-regexps-and-options): Fix bug with parsing of
+	file tags.
+	(org-get-tags-at): Add the content of `org-file-tags'.
+
 	* org-exp.el (org-export-handle-comments): Fix bug with several
 	* org-exp.el (org-export-handle-comments): Fix bug with several
 	comment lines after each other.
 	comment lines after each other.
 	(org-number-to-roman, org-number-to-counter): New functions.
 	(org-number-to-roman, org-number-to-counter): New functions.

+ 2 - 0
lisp/org-exp.el

@@ -2374,6 +2374,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
 #+DRAWERS:   %s
 #+DRAWERS:   %s
 #+STARTUP:   %s %s %s %s %s
 #+STARTUP:   %s %s %s %s %s
 #+TAGS:      %s
 #+TAGS:      %s
+#+FILETAGS:  %s
 #+ARCHIVE:   %s
 #+ARCHIVE:   %s
 #+LINK:      %s
 #+LINK:      %s
 "
 "
@@ -2419,6 +2420,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
 		     ((cdr x) (format "%s(%c)" (car x) (cdr x)))
 		     ((cdr x) (format "%s(%c)" (car x) (cdr x)))
 		     (t (car x))))
 		     (t (car x))))
 		  (or org-tag-alist (org-get-buffer-tags)) " ") "")
 		  (or org-tag-alist (org-get-buffer-tags)) " ") "")
+   (mapconcat 'identity org-file-tags " ")
    org-archive-location
    org-archive-location
    "org file:~/org/%s.org"
    "org file:~/org/%s.org"
    ))
    ))

+ 4 - 4
lisp/org.el

@@ -2185,7 +2185,7 @@ Use customize to modify this, or restart Emacs after changing it."
 	  (sexp    :tag "Forbidden chars in border ")
 	  (sexp    :tag "Forbidden chars in border ")
 	  (sexp    :tag "Regexp for body           ")
 	  (sexp    :tag "Regexp for body           ")
 	  (integer :tag "number of newlines allowed")
 	  (integer :tag "number of newlines allowed")
-	  (option (boolean :tag "Stacking (DISABLED)       "))))
+	  (option (boolean :tag "Please ignore this button"))))
 
 
 (defcustom org-emphasis-alist
 (defcustom org-emphasis-alist
   `(("*" bold "<b>" "</b>")
   `(("*" bold "<b>" "</b>")
@@ -2834,7 +2834,7 @@ means to push this value onto the list in the variable.")
 		(push (cons (match-string 1 value) (match-string 2 value))
 		(push (cons (match-string 1 value) (match-string 2 value))
 		      props)))
 		      props)))
 	     ((equal key "FILETAGS")
 	     ((equal key "FILETAGS")
-	      (when (string-match "\\(\\S-+\\)\\s-+\\(.*\\)" value)
+	      (when (string-match "\\S-" value)
 		(setq ftags
 		(setq ftags
 		      (append
 		      (append
 		       ftags
 		       ftags
@@ -9468,7 +9468,7 @@ also TODO lines."
   "Get a list of all headline tags applicable at POS.
   "Get a list of all headline tags applicable at POS.
 POS defaults to point.  If tags are inherited, the list contains
 POS defaults to point.  If tags are inherited, the list contains
 the targets in the same sequence as the headlines appear, i.e.
 the targets in the same sequence as the headlines appear, i.e.
-sthe tags of the current headline come last."
+the tags of the current headline come last."
   (interactive)
   (interactive)
   (let (tags ltags lastpos parent)
   (let (tags ltags lastpos parent)
     (save-excursion
     (save-excursion
@@ -9490,7 +9490,7 @@ sthe tags of the current headline come last."
 		  (org-up-heading-all 1)
 		  (org-up-heading-all 1)
 		  (setq parent t)))
 		  (setq parent t)))
 	    (error nil))))
 	    (error nil))))
-      tags)))
+      (append (org-remove-uniherited-tags org-file-tags) tags))))
 
 
 (defun org-toggle-tag (tag &optional onoff)
 (defun org-toggle-tag (tag &optional onoff)
   "Toggle the tag TAG for the current line.
   "Toggle the tag TAG for the current line.