Kévin Le Gouguec <[email protected]> writes:
> (I hope I got that right.)
Except I forgot the explanatory comment, and I left a typo in the
docstring. Ahem.
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 2b35535fa..caaf5ce58 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -102,6 +102,12 @@ is nil)."
(defun org-time-convert-to-list (time)
(seconds-to-time (float-time time))))
+;; `newline-and-indent' did not take a numeric argument before 27.1.
+(if (version< emacs-version "27")
+ (defsubst org-newline-and-indent (&optional _arg)
+ (newline-and-indent))
+ (defalias 'org-newline-and-indent #'newline-and-indent))
+
;;; Emacs < 26.1 compatibility
diff --git a/lisp/org.el b/lisp/org.el
index 8ad437a20..142bfb999 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17649,12 +17649,12 @@ call `open-line' on the very first character."
(defun org--newline (indent arg interactive)
"Call `newline-and-indent' or just `newline'.
-If INDENT is non-nil, call `newline-and-indent' to indent
-unconditionally; otherwise, call `newline' with ARG and
-INTERACTIVE, which can trigger indentation if
+If INDENT is non-nil, call `newline-and-indent' with ARG (if
+supported) to indent unconditionally; otherwise, call `newline'
+with ARG and INTERACTIVE, which can trigger indentation if
`electric-indent-mode' is enabled."
(if indent
- (newline-and-indent)
+ (org-newline-and-indent arg)
(newline arg interactive)))
(defun org-return (&optional indent arg interactive)