From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: skeleton.el machinery eats newlines. Date: Sat, 11 Jan 2003 20:22:03 -0600 (CST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200301120222.UAA28562@eel.dms.auburn.edu> References: <200301080429.WAA23098@eel.dms.auburn.edu> <200301100436.WAA27007@eel.dms.auburn.edu> <200301120120.TAA28541@eel.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1042338262 10785 80.91.224.249 (12 Jan 2003 02:24:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 12 Jan 2003 02:24:22 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18XXnQ-0002np-00 for ; Sun, 12 Jan 2003 03:24:20 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18XXuD-0003SY-00 for ; Sun, 12 Jan 2003 03:31:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18XXmg-00065P-06 for emacs-devel@quimby.gnus.org; Sat, 11 Jan 2003 21:23:34 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18XXm0-0005dE-00 for emacs-devel@gnu.org; Sat, 11 Jan 2003 21:22:52 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18XXlt-0005Jj-00 for emacs-devel@gnu.org; Sat, 11 Jan 2003 21:22:48 -0500 Original-Received: from manatee.dms.auburn.edu ([131.204.53.104]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18XXki-0004Q2-00 for emacs-devel@gnu.org; Sat, 11 Jan 2003 21:21:32 -0500 Original-Received: from eel.dms.auburn.edu (eel.dms.auburn.edu [131.204.53.108]) by manatee.dms.auburn.edu (8.9.1a/8.9.1) with ESMTP id UAA00642; Sat, 11 Jan 2003 20:21:31 -0600 (CST) Original-Received: (from teirllm@localhost) by eel.dms.auburn.edu (8.9.3+Sun/8.9.3) id UAA28562; Sat, 11 Jan 2003 20:22:03 -0600 (CST) X-Authentication-Warning: eel.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: teirllm@dms.auburn.edu In-reply-to: <200301120120.TAA28541@eel.dms.auburn.edu> (message from Luc Teirlinck on Sat, 11 Jan 2003 19:20:41 -0600 (CST)) Original-cc: gmorris+mail@ast.cam.ac.uk X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10679 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10679 Here is the problem with my previous patch: The return value of sh-get-indent-info after my patch avoiding the "Beginning of buffer error" (in the previously described situation) is: ((t 1) (+ sh-indent-for-case-alt) (+ sh-indent-for-case-label)) Now we add: #! /usr/local/bin/bash and a blank line at the beginning of the buffer. New return value (same relative position of point): ((t 25) (+ sh-indent-for-case-alt)) Adding only a blank line yields: ((t 2) (+ sh-indent-for-case-alt)) The 25 and 2 are expected. The beginning of the case statement is now at position 25 (2, respectively). However, somehow the (+ sh-indent-for-case-label) in the first return value seems to be a remaining bug. Note that the entire bug never occurs if the file starts with any kind of comment, magic or not, or with a blank line. Even if we can take care of this problem, I do not know whether there are no other places in the indentation machinery that assume the file to start with some kind of comment, or blank line. Could somebody familiar with the shell indentation machinery take a look at this? The (forward-char -1) is where the problem manifests itself. Clearly at the beginning of the buffer we should definitely not call (forward-char -1), but somehow for the remaining code to work well point should be at "the end of the line before the beginning of the buffer". Sincerely, Luc.