Re: [PATCH] Make RET and C-j obey `electric-indent-mode' in org-mode

2020-05-24 Thread Bastien
Nicolas Goaziou writes: > Kévin Le Gouguec writes: > >>> (I hope I got that right.) > > LGTM. I applied the patch on your behalf. > > Now Org has future-proof support for Electric indent mode. Thanks to both of you for this welcome improvement! -- Bastien

Re: [PATCH] Make RET and C-j obey `electric-indent-mode' in org-mode

2020-05-07 Thread Nicolas Goaziou
Kévin Le Gouguec writes: >> (I hope I got that right.) LGTM. I applied the patch on your behalf. Now Org has future-proof support for Electric indent mode. Thank you.

Re: [PATCH] Make RET and C-j obey `electric-indent-mode' in org-mode

2020-05-07 Thread Kévin Le Gouguec
Kévin Le Gouguec 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

Re: [PATCH] Make RET and C-j obey `electric-indent-mode' in org-mode

2020-05-07 Thread Kévin Le Gouguec
Nicolas Goaziou writes: > AFAICT, `newline-and-indent' doesn't accept any argument. Keeping it > introduces a build warning and test failures. Hence the removal. > > Since you were calling it with an argument I assume this may be > a novelty in Emacs 27. Wow, you're right. That caught me

Re: [PATCH] Make RET and C-j obey `electric-indent-mode' in org-mode

2020-05-07 Thread Kévin Le Gouguec
Stefan Monnier writes: >> +(defmacro org-test-with-minor-mode (mode state body) >> + "Run BODY after setting MODE to STATE. >> +Restore MODE to its former state afterward." >> + (declare (debug (sexp sexp body)) (indent 2)) >> + `(let ((old-state ,mode)) >> + (,mode (if ,state 1 0)) >>

Re: [PATCH] Make RET and C-j obey `electric-indent-mode' in org-mode

2020-05-07 Thread Stefan Monnier
> +(defmacro org-test-with-minor-mode (mode state body) > + "Run BODY after setting MODE to STATE. > +Restore MODE to its former state afterward." > + (declare (debug (sexp sexp body)) (indent 2)) > + `(let ((old-state ,mode)) > + (,mode (if ,state 1 0)) > + ,@body > + (,mode

Re: [PATCH] Make RET and C-j obey `electric-indent-mode' in org-mode

2020-05-07 Thread Nicolas Goaziou
Kévin Le Gouguec writes: > I see you've removed ARG from the call to `newline-and-indent'; I don't > have a strong opinion about this (though I don't see a reason not to > keep it), but I guess the docstring of `org--newline' should be changed > to match? AFAICT, `newline-and-indent' doesn't

Re: [PATCH] Make RET and C-j obey `electric-indent-mode' in org-mode

2020-05-07 Thread Kévin Le Gouguec
Nicolas Goaziou writes: > I fixed a typo and applied your patch. Thank you for fixing the typo in ORG-NEWS. I see you've removed ARG from the call to `newline-and-indent'; I don't have a strong opinion about this (though I don't see a reason not to keep it), but I guess the docstring of

Re: [PATCH] Make RET and C-j obey `electric-indent-mode' in org-mode

2020-05-07 Thread Nicolas Goaziou
Hello, Kévin Le Gouguec writes: > Here's a complete patch to make RET and C-j honor electric-indent-mode > in org-mode, targeting Org's master branch. Thank you very much. I fixed a typo and applied your patch. > +(defmacro org-test-with-minor-mode (mode state body) > + "Run BODY after

[PATCH] Make RET and C-j obey `electric-indent-mode' in org-mode (was: Reconciling org-mode idiosyncrasies with Emacs core)

2020-05-06 Thread Kévin Le Gouguec
ect: [PATCH] Make RET and C-j obey `electric-indent-mode' * etc/ORG-NEWS: Announce the change. * lisp/org-compat.el (org-return-indent): Deprecate this command. * lisp/org-keys.el (org-mode-map): Rebind C-j to a command emulating `electric-newline-and-maybe-indent'. * lisp/org.el (org-cdlatex-environm