emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/paredit 42500e5d45 1/3: Note that Paredit Mode and Electri


From: ELPA Syncer
Subject: [nongnu] elpa/paredit 42500e5d45 1/3: Note that Paredit Mode and Electric Indent Mode are incompatible.
Date: Sun, 28 Aug 2022 21:59:02 -0400 (EDT)

branch: elpa/paredit
commit 42500e5d450c88a3b249b548be447577d8549b17
Author: Taylor R Campbell <campbell+paredit@mumble.net>
Commit: Taylor R Campbell <campbell+paredit@mumble.net>

    Note that Paredit Mode and Electric Indent Mode are incompatible.
    
    As far as I'm aware, Electric Indent Mode contributes nothing useful
    when Paredit Mode is enabled, but makes it difficult to get newline
    auto-indent working consistently.
    
    Suggest an alternative if what you want is for RET to auto-indent and
    C-j to insert plain newline.
---
 paredit.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/paredit.el b/paredit.el
index 67febc94a2..d8d01d697a 100644
--- a/paredit.el
+++ b/paredit.el
@@ -109,6 +109,16 @@
 ;;;
 ;;;   (foo (bar | baz) quux)  C-<right>  (foo (bar | baz quux))
 ;;;
+;;; Note: Paredit Mode is not compatible with Electric Indent Mode.
+;;; Use one or the other, not both.  If you want RET to auto-indent and
+;;; C-j to just insert newline in Paredit Mode, simply rebind the keys
+;;; with the following fragment in your .emacs file:
+;;;
+;;;     (eval-after-load 'paredit
+;;;       '(progn
+;;;          (define-key paredit-mode-map (kbd "RET") 'paredit-newline)
+;;;          (define-key paredit-mode-map (kbd "C-j") nil)))
+;;;
 ;;; Some paredit commands automatically reindent code.  When they do,
 ;;; they try to indent as locally as possible, to avoid interfering
 ;;; with any indentation you might have manually written.  Only the



reply via email to

[Prev in Thread] Current Thread [Next in Thread]