From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.bugs Subject: bug#17818: 24.3.91; sh-learn-buffer-indent doesn't learn current indent anymore Date: Fri, 20 Jun 2014 16:54:04 +0200 Message-ID: <87ha3fy6lv.fsf@marauder.physik.uni-ulm.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1403276246 9646 80.91.229.3 (20 Jun 2014 14:57:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Jun 2014 14:57:26 +0000 (UTC) To: 17818@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 20 16:57:19 2014 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 1Wy0Fi-0006QZ-Qk for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Jun 2014 16:57:19 +0200 Original-Received: from localhost ([::1]:41459 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy0Fi-0005Pt-GJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Jun 2014 10:57:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy0FZ-0005MJ-Bb for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 10:57:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wy0FS-00071P-O6 for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 10:57:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy0FS-00070U-Kh for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 10:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Wy0FS-0003Ad-72 for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 10:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Reiner Steib Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jun 2014 14:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17818 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.140327620312157 (code B ref -1); Fri, 20 Jun 2014 14:57:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Jun 2014 14:56:43 +0000 Original-Received: from localhost ([127.0.0.1]:54869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wy0F5-00039r-QV for submit@debbugs.gnu.org; Fri, 20 Jun 2014 10:56:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55111) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wy0F0-00039b-As for submit@debbugs.gnu.org; Fri, 20 Jun 2014 10:56:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wy0Eo-0006rD-Sr for submit@debbugs.gnu.org; Fri, 20 Jun 2014 10:56:29 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:35293) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy0Eo-0006r9-QP for submit@debbugs.gnu.org; Fri, 20 Jun 2014 10:56:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy0Ei-00059M-HH for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 10:56:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wy0EW-0006oO-HF for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 10:56:16 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:62355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy0EW-0006nu-7i for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 10:56:04 -0400 Original-Received: from rqn17961lx ([84.168.145.201]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0Metpl-1XMPlS46p7-00OYvx; Fri, 20 Jun 2014 16:55:56 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) X-Provags-ID: V03:K0:/J5rCI4pd+njQ//HalvOvjvZzToOZcx35sO1Tu3ynKG6HlwS6Qn N8JQ9hqlhIiD5qUNmZtIH0OtbL/NyW7pjAOhn7D/Y6h/Np7jqfXhb+qng9UoMT4++yC1Vpl M5QNLHxSHe8mnVs3nqG4IkCeP2CtMcHXfFWJr2cZ4cnYYg+LNq4dAhuIEE1ebXTmmQLs38n Hk/MQCDCYqX0HwF6QMpPA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:90594 Archived-At: Hi, in Emacs 24.3.91, `sh-learn-buffer-indent' doesn't seem to learn the current indent rules of the buffer anymore. It worked correctly in 23.3 and better in 24.1, see below. (I use `sh-learn-buffer-indent' in `sh-set-shell-hook'.) Consider this shell script: ### $ cat shell-script-test.sh #!/bin/sh if true; do echo "My sh-basic-offset offset should be 2." fi for a in 1; do echo "My sh-basic-offset offset should be 2." done ### * In Emacs 23.3 (==> *expected behavior*): - emacs -title emacs-23.3 shell-script-test.sh - M-x sh-learn-buffer-indent RET - C-x b *indent* RET Switching to buffer *indent* shows: Indentation values for buffer shell-script-test.sh. 0 indentation variables have different values. Comments follow default indentation. Initial value of sh-basic-offset: 4 Suggested sh-basic-offset: 2 Learned variable settings: sh-indent-after-if 2 sh-indent-for-fi 0 sh-indent-after-loop-construct 2 sh-indent-for-done 0 sh-indent-comment t - Put point after first "then", hit RET and TAB (or C-j) - the new line is indented by 2 spaces (==> *expected behavior*) - Put point after first "echo" line, hit RET and TAB (or C-j) - the new line is indented by 2 spaces (==> *expected behavior*) * Emacs 24.1: - emacs -title emacs-24.1 -Q shell-script-test.sh - M-x sh-learn-buffer-indent RET Result: Message: Buffer is read-only: # Buffer *indent* exists but it is empty. Something is wrong, but indentation works as expected. - Put point after first "then", hit RET and TAB (or C-j) - the new line is indented by 2 spaces (==> *expected behavior*) - Put point after first "echo" line, hit RET and TAB (or C-j) - the new line is indented by 2 spaces (==> *expected behavior*) * Emacs 24.3.91: - emacs -title emacs-24.1 -Q shell-script-test.sh - M-x sh-learn-buffer-indent RET Message: Local rules set - Put point after first "then", hit RET (or C-j and TAB) [1] - the new line is indented by 4 spaces (==> *wrong behavior*) - Put point after first "echo" line, hitRET (or C-j and TAB) - the new line is indented by 4 spaces (==> *wrong behavior*) and the "echo" line is indented by 4 spaces (==> *wrong behavior*) In GNU Emacs 24.3.91.1 (i686-pc-mingw32) of 2014-05-12 on LEG570 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1' Important settings: value of $LANG: C.ISO-8859-1 locale-coding-system: cp1252 Bye, Reiner. [1] NEWS says: *** `electric-indent-mode' is now enabled by default. Typing RET reindents the current line and indents the new line. `C-j' inserts a newline but does not indent. In some programming modes, additional characters are electric (eg `{'). -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/