From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: Re: Bug in lisp indentation Date: Sat, 14 Jul 2007 22:06:40 +0200 Message-ID: <87fy3qeomn.fsf@ambire.localdomain> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1184443626 23287 80.91.229.12 (14 Jul 2007 20:07:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 14 Jul 2007 20:07:06 +0000 (UTC) Cc: emacs-devel@gnu.org To: lenst@lysator.liu.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 14 22:07:03 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I9ntN-0004bv-2V for ged-emacs-devel@m.gmane.org; Sat, 14 Jul 2007 22:07:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I9ntM-0004vZ-Ka for ged-emacs-devel@m.gmane.org; Sat, 14 Jul 2007 16:07:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I9ntK-0004uN-7W for emacs-devel@gnu.org; Sat, 14 Jul 2007 16:06:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I9ntJ-0004tE-F5 for emacs-devel@gnu.org; Sat, 14 Jul 2007 16:06:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I9ntJ-0004t1-39 for emacs-devel@gnu.org; Sat, 14 Jul 2007 16:06:57 -0400 Original-Received: from smtp-out2.libero.it ([212.52.84.42]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I9ntI-0006fb-EW for emacs-devel@gnu.org; Sat, 14 Jul 2007 16:06:56 -0400 Original-Received: from localhost (172.31.0.42) by smtp-out2.libero.it (7.3.120) id 4688F31B014C1EB7 for emacs-devel@gnu.org; Sat, 14 Jul 2007 22:06:55 +0200 X-Scanned: with antispam and antivirus automated system at libero.it Original-Received: from smtp-out2.libero.it ([172.31.0.38]) by localhost (asav-out2.libero.it [192.168.32.30]) (amavisd-new, port 10024) with ESMTP id 5gJCoCdX04o4 for ; Sat, 14 Jul 2007 22:06:55 +0200 (CEST) Original-Received: from outrelay08.libero.it (192.168.32.103) by smtp-out2.libero.it (7.3.120) id 4611FD38079579DC for emacs-devel@gnu.org; Sat, 14 Jul 2007 22:06:55 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FAP7JmEaXFSCK/2dsb2JhbACBSg Original-Received: from ppp-138-32.21-151.libero.it (HELO ambire.localdomain) ([151.21.32.138]) by OutRelay-b08.libero.it with ESMTP; 14 Jul 2007 22:06:55 +0200 Original-Received: from ttn by ambire.localdomain with local (Exim 4.63) (envelope-from ) id 1I9nt2-0002op-Fj; Sat, 14 Jul 2007 22:06:40 +0200 In-Reply-To: (Richard Stallman's message of "Sat\, 14 Jul 2007 14\:00\:13 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (gnu/linux) X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:74782 Archived-At: oops, upon further testing i see the first try was buggy. below is try #2. please discard try #1. thi ____________________________________________ diff -c -r1.202 lisp-mode.el *** lisp-mode.el 6 Jul 2007 17:26:29 -0000 1.202 --- lisp-mode.el 14 Jul 2007 20:03:25 -0000 *************** *** 855,860 **** --- 855,869 ---- (setq retry nil) (setq calculate-lisp-indent-last-sexp (elt state 2)) (setq containing-sexp (elt state 1)) + ;; The last sexp may not be the first sexp on the line + ;; where it begins, so find that one, instead. + (when calculate-lisp-indent-last-sexp + (goto-char calculate-lisp-indent-last-sexp) + (when (and containing-sexp + (< containing-sexp (line-beginning-position))) + (beginning-of-line) + (skip-chars-forward " \t") + (setq calculate-lisp-indent-last-sexp (point)))) ;; Position following last unclosed open. (goto-char (1+ containing-sexp)) ;; Is there a complete sexp since then?