Browse Source

Added FILE meta-property

John Wiegley 14 years ago
parent
commit
14350cac34
2 changed files with 5 additions and 1 deletions
  1. 2 0
      doc/org.texi
  2. 3 1
      lisp/org.el

+ 2 - 0
doc/org.texi

@@ -4708,6 +4708,7 @@ used as keys in the properties drawer:
 @cindex property, special, BLOCKED
 @c guessing that ITEM is needed in this area; also, should this list be sorted?
 @cindex property, special, ITEM
+@cindex property, special, FILE
 @example
 TODO         @r{The TODO keyword of the entry.}
 TAGS         @r{The tags defined directly in the headline.}
@@ -4723,6 +4724,7 @@ CLOCKSUM     @r{The sum of CLOCK intervals in the subtree.  @code{org-clock-sum}
              @r{must be run first to compute the values.}
 BLOCKED      @r{"t" if task is currently blocked by children or siblings}
 ITEM         @r{The content of the entry.}
+FILE         @r{The filename the entry is located in.}
 @end example
 
 @node Property searches, Property inheritance, Special properties, Properties and Columns

+ 3 - 1
lisp/org.el

@@ -13237,7 +13237,7 @@ a *different* entry, you cannot use these techniques."
 
 (defconst org-special-properties
   '("TODO" "TAGS" "ALLTAGS" "DEADLINE" "SCHEDULED" "CLOCK" "CLOSED" "PRIORITY"
-    "TIMESTAMP" "TIMESTAMP_IA" "BLOCKED")
+    "TIMESTAMP" "TIMESTAMP_IA" "BLOCKED" "FILE")
   "The special properties valid in Org-mode.
 
 These are properties that are not defined in the property drawer,
@@ -13409,6 +13409,8 @@ things up because then unnecessary parsing is avoided."
 	    (when (and (or (not specific) (string= specific "PRIORITY"))
 		       (looking-at org-priority-regexp))
 	      (push (cons "PRIORITY" (org-match-string-no-properties 2)) props))
+	    (when (or (not specific) (string= specific "FILE"))
+	      (push (cons "FILE" buffer-file-name) props))
 	    (when (and (or (not specific) (string= specific "TAGS"))
 		       (setq value (org-get-tags-string))
 		       (string-match "\\S-" value))