summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-04-24 10:05:48 +0200
committerBastien Guerry <bzg@altern.org>2013-04-24 10:05:48 +0200
commit8c1f16d475dfae3fd8b11f9d6edf344cd2ccfd71 (patch)
treedb8d36c923877ec24ade407e6165b47e79996545
parent4f690abdb44b876e784ee19299f5d4452d6d1241 (diff)
parent240d645dbb2d7d8968162d9d36058ea406ad4b67 (diff)
downloadorg-mode-8c1f16d475dfae3fd8b11f9d6edf344cd2ccfd71.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org.el26
1 files changed, 22 insertions, 4 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 02c839c..d343e1d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7495,6 +7495,7 @@ and create a new headline with the text in the current line after point
When INVISIBLE-OK is set, stop at invisible headlines when going back.
This is important for non-interactive uses of the command."
(interactive "P")
+ (if (org-called-interactively-p 'any) (org-reveal))
(cond
((or (= (buffer-size) 0)
(and (not (save-excursion
@@ -7551,7 +7552,7 @@ This is important for non-interactive uses of the command."
(blank-a (cdr (assq 'heading org-blank-before-new-entry)))
(blank (if (eq blank-a 'auto) empty-line-p blank-a))
pos hide-previous previous-pos)
- (if ;; At the beginning of a heading, open a new line for insertiong
+ (if ;; At the beginning of a heading, open a new line for insertion
(and (bolp) (org-at-heading-p)
(not eops)
(or (bobp)
@@ -7580,7 +7581,10 @@ This is important for non-interactive uses of the command."
((and (not arg) (not on-heading) (not on-empty-line)
(not (save-excursion
(beginning-of-line 1)
- (looking-at org-list-full-item-re))))
+ (or (looking-at org-list-full-item-re)
+ ;; Don't convert :end: lines to headline
+ (looking-at "^\\s-*:end:")
+ (looking-at "^\\s-*#\\+end_?")))))
(beginning-of-line 1))
(org-insert-heading-respect-content
(if (not eops)
@@ -16071,7 +16075,9 @@ So these are more for recording a certain time/date."
(set-keymap-parent map minibuffer-local-map)
(org-defkey map (kbd ".")
(lambda () (interactive)
- (org-eval-in-calendar '(calendar-goto-today))))
+ (if (= (char-before) 32)
+ (org-eval-in-calendar '(calendar-goto-today))
+ (insert "."))))
(org-defkey map [(meta shift left)]
(lambda () (interactive)
(org-eval-in-calendar '(calendar-backward-month 1))))
@@ -20576,9 +20582,10 @@ number of stars to add."
Calls `org-insert-heading' or `org-table-wrap-region', depending on context.
See the individual commands for more information."
(interactive "P")
+ (org-check-before-invisible-edit 'insert)
(cond
((run-hook-with-args-until-success 'org-metareturn-hook))
- ((or (org-at-drawer-p) (org-at-property-p))
+ ((or (org-at-drawer-p) (org-in-drawer-p) (org-at-property-p))
(newline-and-indent))
((org-at-table-p)
(call-interactively 'org-table-wrap-region))
@@ -21542,6 +21549,17 @@ block from point."
names))
nil)))
+(defun org-in-drawer-p ()
+ "Is point within a drawer?"
+ (save-match-data
+ (let ((case-fold-search t)
+ (lim-up (save-excursion (outline-previous-heading)))
+ (lim-down (save-excursion (outline-next-heading))))
+ (org-between-regexps-p
+ (concat "^[ \t]*:" (regexp-opt org-drawers) ":")
+ "^[ \t]*:end:.*$"
+ lim-up lim-down))))
+
(defun org-occur-in-agenda-files (regexp &optional nlines)
"Call `multi-occur' with buffers for all agenda files."
(interactive "sOrg-files matching: \np")