Org-mode mailing list
 help / color / mirror / Atom feed
From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: Org Mode list <emacs-orgmode@gnu.org>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: [PATCH] Make RET and C-j obey `electric-indent-mode' in org-mode
Date: Thu, 07 May 2020 18:50:30 +0200
Message-ID: <87v9l7pu3t.fsf@gmail.com> (raw)
In-Reply-To: <87368br8wi.fsf@gmail.com> (=?utf-8?Q?=22K=C3=A9vin?= Le Gouguec"'s message of "Thu, 07 May 2020 18:45:33 +0200")

[-- Attachment #1: Type: text/plain, Size: 177 bytes --]

Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:

> (I hope I got that right.)

Except I forgot the explanatory comment, and I left a typo in the
docstring.  Ahem.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1376 bytes --]

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))
+
 \f
 ;;; 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)

  reply	other threads:[~2020-05-07 16:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CADwFkm=qkNCWA40ieZ9Dv-gbk6xAzjG16sOa64GT+Zbv9pCC_A@mail.gmail.com>
     [not found] ` <20200426172206.GC18629@ACM>
     [not found]   ` <87y2qhnc9a.fsf@gmail.com>
     [not found]     ` <20200427102311.GA4976@ACM>
     [not found]       ` <87mu6xtano.fsf@gmail.com>
     [not found]         ` <87k120ohsq.fsf@mail.linkov.net>
     [not found]           ` <87blnbir01.fsf@nicolasgoaziou.fr>
     [not found]             ` <87o8rbmbfa.fsf@mail.linkov.net>
     [not found]               ` <87k11yftqo.fsf@nicolasgoaziou.fr>
     [not found]                 ` <87pnbqo74t.fsf_-_@gmail.com>
2020-04-29 12:30                   ` Reconciling org-mode idiosyncrasies with Emacs core Nicolas Goaziou
2020-05-04 10:45                     ` Kévin Le Gouguec
2020-05-04 14:50                       ` Nicolas Goaziou
2020-05-04 16:14                         ` Kévin Le Gouguec
2020-05-06 14:54                           ` [PATCH] Make RET and C-j obey `electric-indent-mode' in org-mode (was: Reconciling org-mode idiosyncrasies with Emacs core) Kévin Le Gouguec
2020-05-07 10:48                             ` [PATCH] Make RET and C-j obey `electric-indent-mode' in org-mode Nicolas Goaziou
2020-05-07 12:03                               ` Kévin Le Gouguec
2020-05-07 12:21                                 ` Nicolas Goaziou
2020-05-07 16:45                                   ` Kévin Le Gouguec
2020-05-07 16:50                                     ` Kévin Le Gouguec [this message]
2020-05-07 19:38                                       ` Nicolas Goaziou
2020-05-24  6:25                                         ` Bastien
2020-05-07 13:53                             ` Stefan Monnier
2020-05-07 15:33                               ` Kévin Le Gouguec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://orgmode.org

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v9l7pu3t.fsf@gmail.com \
    --to=kevin.legouguec@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git