diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 2b35535fa..ed12b9d18 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -102,6 +102,11 @@ is nil)." (defun org-time-convert-to-list (time) (seconds-to-time (float-time time)))) +(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..57e78599f 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)