From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#14218: 24.3; octave-insert-defun bad indentation since using smie Date: Fri, 26 Apr 2013 10:34:42 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1366986910 23706 80.91.229.3 (26 Apr 2013 14:35:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Apr 2013 14:35:10 +0000 (UTC) Cc: 14218@debbugs.gnu.org To: Leo Liu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 26 16:35:12 2013 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 1UVjjw-0000DX-MS for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Apr 2013 16:35:08 +0200 Original-Received: from localhost ([::1]:42772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVjjw-0004ap-9b for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Apr 2013 10:35:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVjjr-0004Xh-Qu for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2013 10:35:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVjjq-0003KX-LB for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2013 10:35:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVjjq-0003GU-Fm for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2013 10:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UVjjq-0004or-9F for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2013 10:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Apr 2013 14:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14218 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14218-submit@debbugs.gnu.org id=B14218.136698688818483 (code B ref 14218); Fri, 26 Apr 2013 14:35:02 +0000 Original-Received: (at 14218) by debbugs.gnu.org; 26 Apr 2013 14:34:48 +0000 Original-Received: from localhost ([127.0.0.1]:45009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UVjjc-0004o2-7f for submit@debbugs.gnu.org; Fri, 26 Apr 2013 10:34:48 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:56658) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UVjja-0004nr-2S for 14218@debbugs.gnu.org; Fri, 26 Apr 2013 10:34:46 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFFpYYW/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2RCgOkeoFegxM X-IPAS-Result: Av8EABK/CFFFpYYW/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2RCgOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="8365603" Original-Received: from 69-165-134-22.dsl.teksavvy.com (HELO pastel.home) ([69.165.134.22]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 26 Apr 2013 10:34:40 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 50711678A8; Fri, 26 Apr 2013 10:34:42 -0400 (EDT) In-Reply-To: (Leo Liu's message of "Thu, 25 Apr 2013 13:36:02 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) 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.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:73734 Archived-At: > Thank you for the fix. However with this change: prog-indent-sexp with > point on the first letter of 'function' gives me this funny indentation > and extra whitespace: > function A = dox (n) > ## usage: A = dox (n) > ## > ## > endfunction Duh, thanks. I've installed the additional patch below which should fix it right this time. Stefan === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-04-26 04:16:37 +0000 +++ lisp/progmodes/octave.el 2013-04-26 14:25:15 +0000 @@ -461,11 +461,12 @@ (forward-comment 1)) (cond ((and (looking-at "$\\|[%#]") - (not (smie-rule-bolp)) - ;; Ignore it if it's within parentheses. - (prog1 (let ((ppss (syntax-ppss))) + ;; Ignore it if it's within parentheses or if the newline does not end + ;; some preceding text. + (prog1 (and (not (smie-rule-bolp)) + (let ((ppss (syntax-ppss))) (not (and (nth 1 ppss) - (eq ?\( (char-after (nth 1 ppss)))))) + (eq ?\( (char-after (nth 1 ppss))))))) (forward-comment (point-max)))) ;; Why bother distinguishing \n and ;? ";") ;;"\n"