summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-02-26 18:21:40 +0100
committerBastien Guerry <bzg@altern.org>2013-02-26 18:21:40 +0100
commit3ee229dcd165a4e7c0f49d52c13431dfaac1364b (patch)
tree5eff8915841ca94da23b1ff63e40c4af2c4d6534
parent295b0ba5d1e0e370211de6e50829d9291cacedf4 (diff)
parentff92e688dd78c0a52c9fe353b427b6e7ad5a8c46 (diff)
downloadorg-mode-3ee229dcd165a4e7c0f49d52c13431dfaac1364b.tar.gz
Merge branch 'master' of orgmode.org:org-mode
-rw-r--r--lisp/org.el65
1 files changed, 35 insertions, 30 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 8911568..256f7ba 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8766,36 +8766,41 @@ should be checked in for a command to execute outside of tables."
(setq nname (format "%s-%d" name (setq i (1+ i)))))
(setq name (intern nname)))
(eval
- `(defun ,name (arg)
- ,(concat "In Structure, run `" (symbol-name fun) "'.\n"
- "Outside of structure, run the binding of `"
- (key-description key) "'.")
- (interactive "p")
- (unless
- (let* ((org-heading-regexp
- (concat "^"
- orgstruct-heading-prefix-regexp
- "\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ ]*$"))
- (org-outline-regexp
- (concat orgstruct-heading-prefix-regexp "\\*+ "))
- (org-outline-regexp-bol
- (concat "^" org-outline-regexp))
- (outline-regexp org-outline-regexp)
- (outline-heading-end-regexp "\n")
- (outline-level 'outline-level)
- (outline-heading-alist))
- (when (org-context-p 'headline 'item
- ,(when (memq fun '(org-insert-heading))
- '(when orgstruct-is-++
- 'item-body)))
- (org-run-like-in-org-mode ',fun)
- t))
- (let* ((orgstruct-mode)
- (binding (key-binding ,key)))
- (if (keymapp binding)
- (set-temporary-overlay-map binding)
- (call-interactively
- (or binding 'orgstruct-error)))))))
+ (let ((bindings '((org-heading-regexp
+ (concat "^"
+ orgstruct-heading-prefix-regexp
+ "\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ ]*$"))
+ (org-outline-regexp
+ (concat orgstruct-heading-prefix-regexp "\\*+ "))
+ (org-outline-regexp-bol
+ (concat "^" org-outline-regexp))
+ (outline-regexp org-outline-regexp)
+ (outline-heading-end-regexp "\n")
+ (outline-level 'outline-level)
+ (outline-heading-alist))))
+ `(defun ,name (arg)
+ ,(concat "In Structure, run `" (symbol-name fun) "'.\n"
+ "Outside of structure, run the binding of `"
+ (key-description key) "'.")
+ (interactive "p")
+ (unless
+ (let* ,bindings
+ (when (org-context-p 'headline 'item
+ ,(when (memq fun '(org-insert-heading))
+ '(when orgstruct-is-++
+ 'item-body)))
+ (org-run-like-in-org-mode
+ (lambda ()
+ (interactive)
+ (let* ,bindings
+ (call-interactively ',fun))))
+ t))
+ (let* ((orgstruct-mode)
+ (binding (key-binding ,key)))
+ (if (keymapp binding)
+ (set-temporary-overlay-map binding)
+ (call-interactively
+ (or binding 'orgstruct-error))))))))
name))
(defun org-contextualize-keys (alist contexts)