From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Sauermann Newsgroups: gmane.emacs.bugs Subject: bug#1012: calculate-lisp-indent Date: Sun, 21 Sep 2008 19:37:20 +0200 Message-ID: <48D68650.1040907@sauermann-consulting.de> Reply-To: Markus Sauermann , 1012@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070203090003050805040103" X-Trace: ger.gmane.org 1222059035 3832 80.91.229.12 (22 Sep 2008 04:50:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Sep 2008 04:50:35 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 22 06:51:29 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KhdOM-0002AT-S4 for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Sep 2008 06:51:23 +0200 Original-Received: from localhost ([127.0.0.1]:59593 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KhdNK-0000c9-Uj for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Sep 2008 00:50:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KhT27-0004YH-TS for bug-gnu-emacs@gnu.org; Sun, 21 Sep 2008 13:47:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KhT25-0004Xo-5A for bug-gnu-emacs@gnu.org; Sun, 21 Sep 2008 13:47:42 -0400 Original-Received: from [199.232.76.173] (port=54935 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KhT25-0004Xl-1F for bug-gnu-emacs@gnu.org; Sun, 21 Sep 2008 13:47:41 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:55002) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KhT24-0002bV-12 for bug-gnu-emacs@gnu.org; Sun, 21 Sep 2008 13:47:40 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8LHlab9025995; Sun, 21 Sep 2008 10:47:36 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m8LHj3N6024525; Sun, 21 Sep 2008 10:45:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Markus Sauermann Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 21 Sep 2008 17:45:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1012 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122201865822431 (code B ref -1); Sun, 21 Sep 2008 17:45:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 21 Sep 2008 17:37:38 +0000 Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8LHbVfl022425 for ; Sun, 21 Sep 2008 10:37:34 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KhSsE-00080Q-Pj for bug-gnu-emacs@gnu.org; Sun, 21 Sep 2008 13:37:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KhSsD-00080A-Ho for bug-gnu-emacs@gnu.org; Sun, 21 Sep 2008 13:37:30 -0400 Original-Received: from [199.232.76.173] (port=36735 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KhSsD-0007zz-6J for bug-gnu-emacs@gnu.org; Sun, 21 Sep 2008 13:37:29 -0400 Original-Received: from smtp1.bitpoint.de ([80.67.224.9]:52803) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KhSsC-0006ud-1I for bug-gnu-emacs@gnu.org; Sun, 21 Sep 2008 13:37:28 -0400 Original-Received: from p5499706c.dip.t-dialin.net ([84.153.112.108]) by smtp1.bitpoint.de with esmtpa (Exim 4.67 (FreeBSD)) (envelope-from ) id 1KhSs1-0009FM-1z for bug-gnu-emacs@gnu.org; Sun, 21 Sep 2008 19:37:17 +0200 User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) X-Enigmail-Version: 0.95.7 X-detected-operating-system: by monty-python.gnu.org: FreeBSD 6.x (1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sun, 21 Sep 2008 13:47:42 -0400 X-Mailman-Approved-At: Mon, 22 Sep 2008 00:49:53 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:20695 Archived-At: This is a multi-part message in MIME format. --------------070203090003050805040103 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by rzlab.ucr.edu id m8LHlab9025995 Hello, I found a bug concerning the function calculate-lisp-indent in lisp-mode.= el. It is triggered in the following scenarios (-!- marks the point): ---begin scenario 1 buffer *scratch*--- (,@foo :bar)-!- ---end scenario 1 buffer *scratch*--- ---begin scenario 2 buffer *scratch*--- ( foo :bar)-!- ---end scenario 2 buffer *scratch*--- Using (bound to the function lisp-indent-line) triggers the following error in both scenarios: ---begin error--- forward-sexp: Scan error: "Containing expression ends prematurely", 192, = 192 ---end error--- I traced this bug to the function calculate-lisp-indent. As far as I understand the code, the characters ",@" in scenario 1 and the spaces in scenario 2 are not treated correctly. In this E-Mail I included a patch, that solves the problems for me, and was created with the command mhoram@revelstone:~/emacs/trunk/emacs/lisp$ cvs diff -c > ~/emacs-bugreport.txt The patch works for scenario 1 by an additional call of the (backward-prefix-chars) function, which sets point back to the beginning of ",@". For scenario 2 the addition of "\\|([ \t]+" solves the problem, by not entering the while-loop (and thus calling the function (forward-sexp -1)), if there are only spaces between the "(" and the first object. Regards, Markus Sauermann In GNU Emacs 22.3.1 (i386-mingw-nt6.0.6001) of 2008-09-06 on SOFT-MJASON Windowing system distributor `Microsoft Corp.', version 6.0.6001 configured using `configure --with-gcc (3.4)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: DEU locale-coding-system: cp1252 default-enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: encoded-kbd-mode: t tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t line-number-mode: t Recent input: q ( , @ f o o : b a r ) M-x r e p o r t Recent messages: ("D:\\Uninstalled\\emacs-22.3\\bin\\emacs.exe" "-q") Loading encoded-kb...done For information about GNU Emacs and the GNU system, type C-h C-a. forward-sexp: Scan error: "Containing expression ends prematurely", 192, = 192 Loading emacsbug... Loading regexp-opt...done Loading emacsbug...done --=20 Markus Sauermann E-Mail: info@sauermann-consulting.de Clemensstr. 55 Rgb. Web: http://www.sauermann-consulting.de 80803 M=FCnchen Tel: 089/337707, 0179/9879005, Fax: 089/38476434 --------------070203090003050805040103 Content-Type: text/plain; name="emacs-bugreport.txt" Content-Disposition: inline; filename="emacs-bugreport.txt" Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by rzlab.ucr.edu id m8LHlab9025995 Index: ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/lisp/ChangeLog,v retrieving revision 1.14493 diff -c -r1.14493 ChangeLog *** ChangeLog 20 Sep 2008 22:09:39 -0000 1.14493 --- ChangeLog 21 Sep 2008 17:08:59 -0000 *************** *** 1,3 **** --- 1,9 ---- + 2008-09-21 Markus Sauermann +=20 + * emacs-lisp/lisp-mode.el (calculate-lisp-indent): + Fix indentation problem with keyword symbols when a list starts + with ,@ or spaces. +=20 2008-09-20 Vincent Bela=C3=AFche =20 * calc/calc-vec.el (calcFunc-venum): Properly handle intervals. Index: emacs-lisp/lisp-mode.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/lisp/emacs-lisp/lisp-mode.el,v retrieving revision 1.226 diff -c -r1.226 lisp-mode.el *** emacs-lisp/lisp-mode.el 20 Sep 2008 21:54:44 -0000 1.226 --- emacs-lisp/lisp-mode.el 21 Sep 2008 17:09:04 -0000 *************** *** 1027,1033 **** ;; where it begins, so find that one, instead. (save-excursion (goto-char calculate-lisp-indent-last-sexp) ! (while (and (not (looking-back "^[ \t]*")) (or (not containing-sexp) (< (1+ containing-sexp) (point))= )) (forward-sexp -1) --- 1027,1034 ---- ;; where it begins, so find that one, instead. (save-excursion (goto-char calculate-lisp-indent-last-sexp) ! (backward-prefix-chars) ! (while (and (not (looking-back "^[ \t]*\\|([ \t]= +")) (or (not containing-sexp) (< (1+ containing-sexp) (point))= )) (forward-sexp -1) --------------070203090003050805040103--