aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2019-06-27 16:57:47 +0200
committerLars Ingebrigtsen2019-06-27 16:57:47 +0200
commit8a11e430ec261c08cc928a7a5b05ee1027f50368 (patch)
tree5ab295a34509c313cc7a6d39f410a9eb1a41bc78
parent50ade7afc15697fe820c510cdaf98d50d24e4a64 (diff)
downloademacs-8a11e430ec261c08cc928a7a5b05ee1027f50368.tar.gz
emacs-8a11e430ec261c08cc928a7a5b05ee1027f50368.zip
Use `default-indent-new-line' instead of `indent-new-comment-line'
* lisp/simple.el (default-indent-new-line): Doc string fix. * lisp/textmodes/refill.el (refill-post-command-function): Make default-indent-new-line work as indent-new-comment-line. * lisp/textmodes/refill.el (refill-post-command-function): Bind `M-C-j' and `M-j' to default-indent-new-line instead of indent-new-comment-line to allow overriding via `comment-line-break-function' (bug#12413).
-rw-r--r--lisp/bindings.el4
-rw-r--r--lisp/simple.el2
-rw-r--r--lisp/textmodes/refill.el2
3 files changed, 4 insertions, 4 deletions
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 744bcc36a85..5205d497ef5 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -1229,8 +1229,8 @@ if `inhibit-field-text-motion' is non-nil."
1229(define-key ctl-x-map "\C-t" 'transpose-lines) 1229(define-key ctl-x-map "\C-t" 'transpose-lines)
1230 1230
1231(define-key esc-map ";" 'comment-dwim) 1231(define-key esc-map ";" 'comment-dwim)
1232(define-key esc-map "j" 'indent-new-comment-line) 1232(define-key esc-map "j" 'default-indent-new-line)
1233(define-key esc-map "\C-j" 'indent-new-comment-line) 1233(define-key esc-map "\C-j" 'default-indent-new-line)
1234(define-key ctl-x-map ";" 'comment-set-column) 1234(define-key ctl-x-map ";" 'comment-set-column)
1235(define-key ctl-x-map [?\C-\;] 'comment-line) 1235(define-key ctl-x-map [?\C-\;] 'comment-line)
1236(define-key ctl-x-map "f" 'set-fill-column) 1236(define-key ctl-x-map "f" 'set-fill-column)
diff --git a/lisp/simple.el b/lisp/simple.el
index 87159366f61..5ef5d3dc2ea 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -7318,7 +7318,7 @@ indicating whether it should use soft newlines.")
7318 7318
7319(defun default-indent-new-line (&optional soft) 7319(defun default-indent-new-line (&optional soft)
7320 "Break line at point and indent. 7320 "Break line at point and indent.
7321If a comment syntax is defined, call `comment-indent-new-line'. 7321If a comment syntax is defined, call `comment-line-break-function'.
7322 7322
7323The inserted newline is marked hard if variable `use-hard-newlines' is true, 7323The inserted newline is marked hard if variable `use-hard-newlines' is true,
7324unless optional argument SOFT is non-nil." 7324unless optional argument SOFT is non-nil."
diff --git a/lisp/textmodes/refill.el b/lisp/textmodes/refill.el
index 5c69fdc1b07..e597ba866c4 100644
--- a/lisp/textmodes/refill.el
+++ b/lisp/textmodes/refill.el
@@ -181,7 +181,7 @@ complex processing.")
181 (setq refill-doit nil))) 181 (setq refill-doit nil)))
182 ((or 'quoted-insert 'fill-paragraph 'fill-region) nil) 182 ((or 'quoted-insert 'fill-paragraph 'fill-region) nil)
183 ((or 'newline 'newline-and-indent 'open-line 'indent-new-comment-line 183 ((or 'newline 'newline-and-indent 'open-line 'indent-new-comment-line
184 'reindent-then-newline-and-indent) 184 'default-indent-new-line 'reindent-then-newline-and-indent)
185 ;; Don't zap what was just inserted. 185 ;; Don't zap what was just inserted.
186 (save-excursion 186 (save-excursion
187 (beginning-of-line) ; for newline-and-indent 187 (beginning-of-line) ; for newline-and-indent