From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#12413: 24.2.50; M-j should be bound to default-indent-new-line Date: Tue, 11 Sep 2012 13:35:38 +0400 Message-ID: <504F05EA.6000703@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000701080602080402010004" X-Trace: ger.gmane.org 1347356209 2725 80.91.229.3 (11 Sep 2012 09:36:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Sep 2012 09:36:49 +0000 (UTC) To: 12413@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 11 11:36:49 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TBMtk-0004It-2k for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Sep 2012 11:36:48 +0200 Original-Received: from localhost ([::1]:60257 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBMte-00055W-6R for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Sep 2012 05:36:42 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBMtS-00055O-GZ for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2012 05:36:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBMtK-00062Q-M7 for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2012 05:36:30 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBMtK-00062A-IS for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2012 05:36:22 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TBMtx-0007Q8-Re for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2012 05:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Sep 2012 09:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12413 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.134735620328496 (code B ref -1); Tue, 11 Sep 2012 09:37:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Sep 2012 09:36:43 +0000 Original-Received: from localhost ([127.0.0.1]:53665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TBMtf-0007PY-0m for submit@debbugs.gnu.org; Tue, 11 Sep 2012 05:36:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47773) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TBMtb-0007PQ-B7 for submit@debbugs.gnu.org; Tue, 11 Sep 2012 05:36:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBMso-0005lO-B4 for submit@debbugs.gnu.org; Tue, 11 Sep 2012 05:35:59 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:40274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBMsn-0005lF-TZ for submit@debbugs.gnu.org; Tue, 11 Sep 2012 05:35:49 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBMsi-0004NQ-0L for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2012 05:35:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBMsc-0005jo-AV for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2012 05:35:43 -0400 Original-Received: from forward5h.mail.yandex.net ([84.201.186.23]:45116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBMsb-0005jW-Gh for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2012 05:35:38 -0400 Original-Received: from smtp1h.mail.yandex.net (smtp1h.mail.yandex.net [84.201.187.144]) by forward5h.mail.yandex.net (Yandex) with ESMTP id 27B6ED0106D for ; Tue, 11 Sep 2012 13:35:33 +0400 (MSK) Original-Received: from smtp1h.mail.yandex.net (localhost [127.0.0.1]) by smtp1h.mail.yandex.net (Yandex) with ESMTP id 0DB901340127 for ; Tue, 11 Sep 2012 13:35:32 +0400 (MSK) Original-Received: from 5x166x246x245.dynamic.spb.ertelecom.ru (5x166x246x245.dynamic.spb.ertelecom.ru [5.166.246.245]) by smtp1h.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ZWUmCSkB-ZWUutOuY; Tue, 11 Sep 2012 13:35:32 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1347356132; bh=L5Kk02a/G2wgwna/BAbAEGJYl6bSYT9+IsMn6Mat9mY=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type; b=Qa6lODminapdGcRgTpmqUPBzT+j47J1yiYg0TEOzu/AxoLWwSUu27rD7SwfCHYLOO PRHkKKVGra7xy7RZpi0C25CkvF6/tBJJLNEgfFEcVO95h6XHkniJnN1R4LmSz0qTHj lS3DWhk5n36IvSotTYbNVVnvPJzIPt9Tci12eUik= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:64094 Archived-At: This is a multi-part message in MIME format. --------------000701080602080402010004 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Tags: patch A major mode can change the value of comment-line-break-function, but currently it's only used from `do-auto-fill'. I think that doesn't make sense, the value should affect the M-j command, too. default-indent-new-line does pretty much that. The function could use a better name, though - it isn't used in any variables as default value. Inspired by bugs 6806 and 10367. In GNU Emacs 24.2.50.1 (i386-mingw-nt6.1.7601) of 2012-09-11 on SOL Bzr revision: 109973 eggert@cs.ucla.edu-20120911012056-kegco8vmanqs0kpg Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --with-gcc (3.4) --cflags -IJ:/Apps/system/gnuwin32/include' --------------000701080602080402010004 Content-Type: text/plain; charset=windows-1251; name="m-j.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="m-j.diff" === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-10 19:22:53 +0000 +++ lisp/ChangeLog 2012-09-11 09:25:45 +0000 @@ -1,3 +1,12 @@ +2012-09-11 Dmitry Gutov + + * simple.el (default-indent-new-line): Fix the doctring. + * bindings.el (esc-map): Rebind M-j and C-M-j to + default-indent-new-line. + * textmodes/refill.el (refill-post-command-function): Replace + indent-new-comment-line with default-indent-new-line in the + special cases list. + 2012-09-10 Michael R. Mauger * progmodes/sql.el: Version 3.1 === modified file 'lisp/bindings.el' --- lisp/bindings.el 2012-08-15 16:29:11 +0000 +++ lisp/bindings.el 2012-09-11 06:35:54 +0000 @@ -1105,8 +1105,8 @@ (define-key ctl-x-map "\C-t" 'transpose-lines) (define-key esc-map ";" 'comment-dwim) -(define-key esc-map "j" 'indent-new-comment-line) -(define-key esc-map "\C-j" 'indent-new-comment-line) +(define-key esc-map "j" 'default-indent-new-line) +(define-key esc-map "\C-j" 'default-indent-new-line) (define-key ctl-x-map ";" 'comment-set-column) (define-key ctl-x-map "f" 'set-fill-column) (define-key ctl-x-map "$" 'set-selective-display) === modified file 'lisp/simple.el' --- lisp/simple.el 2012-09-07 08:58:31 +0000 +++ lisp/simple.el 2012-09-11 06:34:40 +0000 @@ -5501,7 +5501,7 @@ (defun default-indent-new-line (&optional soft) "Break line at point and indent. -If a comment syntax is defined, call `comment-indent-new-line'. +If a comment syntax is defined, call `comment-line-break-function'. The inserted newline is marked hard if variable `use-hard-newlines' is true, unless optional argument SOFT is non-nil." === modified file 'lisp/textmodes/refill.el' --- lisp/textmodes/refill.el 2012-07-11 23:13:41 +0000 +++ lisp/textmodes/refill.el 2012-09-11 06:50:28 +0000 @@ -179,7 +179,7 @@ (refill-fill-paragraph-at refill-doit) (setq refill-doit nil))) ((or `quoted-insert `fill-paragraph `fill-region) nil) - ((or `newline `newline-and-indent `open-line `indent-new-comment-line + ((or `newline `newline-and-indent `open-line `default-indent-new-line `reindent-then-newline-and-indent) ;; Don't zap what was just inserted. (save-excursion --------------000701080602080402010004--