Browse Source

Merge branch 'master' into next

Nicolas Goaziou 6 years ago
parent
commit
0954d4c258
2 changed files with 7 additions and 6 deletions
  1. 3 0
      doc/org-manual.org
  2. 4 6
      lisp/org.el

+ 3 - 0
doc/org-manual.org

@@ -11660,6 +11660,7 @@ neither checks for valid syntax nor changes the contents in any way.
 For example and source blocks, Org code-escapes the contents before
 For example and source blocks, Org code-escapes the contents before
 inclusion.
 inclusion.
 
 
+#+cindex: @samp{minlevel}, include
 If an included file is not specified as having any markup language,
 If an included file is not specified as having any markup language,
 Org assumes it be in Org format and proceeds as usual with a few
 Org assumes it be in Org format and proceeds as usual with a few
 exceptions.  Org makes the footnote labels (see [[*Creating Footnotes]])
 exceptions.  Org makes the footnote labels (see [[*Creating Footnotes]])
@@ -11674,6 +11675,7 @@ top-level headline:
 
 
 : #+INCLUDE: "~/my-book/chapter2.org" :minlevel 1
 : #+INCLUDE: "~/my-book/chapter2.org" :minlevel 1
 
 
+#+cindex: @samp{lines}, include
 Inclusion of only portions of files are specified using ranges
 Inclusion of only portions of files are specified using ranges
 parameter with =:lines= keyword.  The line at the upper end of the
 parameter with =:lines= keyword.  The line at the upper end of the
 range will not be included.  The start and/or the end of the range may
 range will not be included.  The start and/or the end of the range may
@@ -11693,6 +11695,7 @@ Therefore,
 #+texinfo: @noindent
 #+texinfo: @noindent
 includes the first 20 lines of the headline named =conclusion=.
 includes the first 20 lines of the headline named =conclusion=.
 
 
+#+cindex: @samp{only-contents}, include
 To extract only the contents of the matched object, set
 To extract only the contents of the matched object, set
 =:only-contents= property to non-~nil~.  This omits any planning lines
 =:only-contents= property to non-~nil~.  This omits any planning lines
 or property drawers.  For example, to include the body of the heading
 or property drawers.  For example, to include the body of the heading

+ 4 - 6
lisp/org.el

@@ -8209,12 +8209,10 @@ When REMOVE is non-nil, remove the subtree from the clipboard."
 	  (force-level
 	  (force-level
 	   (cond
 	   (cond
 	    (level (prefix-numeric-value level))
 	    (level (prefix-numeric-value level))
-	    ;; When point is right after the stars in an otherwise
-	    ;; empty headline, use stars as the forced level.
-	    ((and (looking-at-p "[ \t]*$")
-		  (string-match-p "^\\*+ *"
-				  (buffer-substring (line-beginning-position)
-						    (point))))
+	    ;; When point is after the stars in an otherwise empty
+	    ;; headline, use the number of stars as the forced level.
+	    ((and (org-match-line "^\\*+[ \t]*$")
+		  (not (eq ?* (char-after))))
 	     (org-outline-level))
 	     (org-outline-level))
 	    ((looking-at-p org-outline-regexp-bol) (org-outline-level))))
 	    ((looking-at-p org-outline-regexp-bol) (org-outline-level))))
 	  (previous-level
 	  (previous-level