summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-01-31 11:06:39 (GMT)
committer Bastien Guerry <bzg@altern.org>2013-01-31 11:06:39 (GMT)
commitbe1169fac7ad3a8b7b2ed1c38a5d8a0fe4944f7e (patch)
tree5e189055ad5360a5ee1afe32f4222f561093cba8
parent7dbe05551dd73beaf9ce8b8d809c9f8e28fc0894 (diff)
parentbbea8d348b7972e0b29727f328f7f4dd92f18def (diff)
downloadorg-mode-be1169fac7ad3a8b7b2ed1c38a5d8a0fe4944f7e.zip
org-mode-be1169fac7ad3a8b7b2ed1c38a5d8a0fe4944f7e.tar.gz
Merge branch 'master-new-features'
-rw-r--r--lisp/org-agenda.el4
-rw-r--r--lisp/org-capture.el4
-rw-r--r--lisp/org.el6
3 files changed, 13 insertions, 1 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index f3ffa8e..2ce9f20 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2423,6 +2423,8 @@ Here are the available contexts definitions:
in-mode: command displayed only in matching modes
not-in-file: command not displayed in matching files
not-in-mode: command not displayed in matching modes
+ in-buffer: command displayed only in matching buffers
+not-in-buffer: command not displayed in matching buffers
[function]: a custom function taking no argument
If you define several checks, the agenda command will be
@@ -2448,6 +2450,8 @@ duplicates.)"
(choice
(const :tag "In file" in-file)
(const :tag "Not in file" not-in-file)
+ (const :tag "In buffer" in-buffer)
+ (const :tag "Not in buffer" not-in-buffer)
(const :tag "In mode" in-mode)
(const :tag "Not in mode" not-in-mode))
(regexp))
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 639a490..2ca5239 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -461,6 +461,8 @@ Here are the available contexts definitions:
in-mode: command displayed only in matching modes
not-in-file: command not displayed in matching files
not-in-mode: command not displayed in matching modes
+ in-buffer: command displayed only in matching buffers
+not-in-buffer: command not displayed in matching buffers
[function]: a custom function taking no argument
If you define several checks, the agenda command will be
@@ -486,6 +488,8 @@ to avoid duplicates.)"
(choice
(const :tag "In file" in-file)
(const :tag "Not in file" not-in-file)
+ (const :tag "In buffer" in-buffer)
+ (const :tag "Not in buffer" not-in-buffer)
(const :tag "In mode" in-mode)
(const :tag "Not in mode" not-in-mode))
(regexp))
diff --git a/lisp/org.el b/lisp/org.el
index 651182a..310972b 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8729,11 +8729,15 @@ definitions."
(string-match (cdr rr) (buffer-file-name)))
(and (eq (car rr) 'in-mode)
(string-match (cdr rr) (symbol-name major-mode)))
+ (and (eq (car rr) 'in-buffer)
+ (string-match (cdr rr) (buffer-name)))
(when (and (eq (car rr) 'not-in-file)
(buffer-file-name))
(not (string-match (cdr rr) (buffer-file-name))))
(when (eq (car rr) 'not-in-mode)
- (not (string-match (cdr rr) (symbol-name major-mode)))))))
+ (not (string-match (cdr rr) (symbol-name major-mode))))
+ (when (eq (car rr) 'not-in-buffer)
+ (not (string-match (cdr rr) (buffer-name)))))))
(push r res)))
(car (last r))))
(delete-dups (delq nil res))))