From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.bugs Subject: bug#12223: 24.2; [PATCH] skeleton expansion in sh-mode can fail by backward-delete-char-untabify-method Date: Sat, 18 Aug 2012 21:12:23 +0800 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1345295586 4777 80.91.229.3 (18 Aug 2012 13:13:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Aug 2012 13:13:06 +0000 (UTC) To: 12223@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 18 15:13:07 2012 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 1T2ipu-0006z5-7t for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Aug 2012 15:13:06 +0200 Original-Received: from localhost ([::1]:37240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2ips-0000Ba-JG for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Aug 2012 09:13:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2ipp-0000BL-Rx for bug-gnu-emacs@gnu.org; Sat, 18 Aug 2012 09:13:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2ipo-0003uX-QS for bug-gnu-emacs@gnu.org; Sat, 18 Aug 2012 09:13:01 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2ipo-0003uT-Mi for bug-gnu-emacs@gnu.org; Sat, 18 Aug 2012 09:13:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T2ipq-0005D8-C7 for bug-gnu-emacs@gnu.org; Sat, 18 Aug 2012 09:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Aug 2012 13:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12223 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.134529556419998 (code B ref -1); Sat, 18 Aug 2012 13:13:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Aug 2012 13:12:44 +0000 Original-Received: from localhost ([127.0.0.1]:36966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T2ipX-0005CV-Fz for submit@debbugs.gnu.org; Sat, 18 Aug 2012 09:12:44 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33688) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T2ipV-0005CO-Lq for submit@debbugs.gnu.org; Sat, 18 Aug 2012 09:12:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2ipS-0003tJ-HS for submit@debbugs.gnu.org; Sat, 18 Aug 2012 09:12:39 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:46810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2ipS-0003tF-EP for submit@debbugs.gnu.org; Sat, 18 Aug 2012 09:12:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2ipR-0000B2-KJ for bug-gnu-emacs@gnu.org; Sat, 18 Aug 2012 09:12:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2ipQ-0003t5-NH for bug-gnu-emacs@gnu.org; Sat, 18 Aug 2012 09:12:37 -0400 Original-Received: from mail-pb0-f41.google.com ([209.85.160.41]:63788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2ipQ-0003sx-G7 for bug-gnu-emacs@gnu.org; Sat, 18 Aug 2012 09:12:36 -0400 Original-Received: by pbbro12 with SMTP id ro12so5272909pbb.0 for ; Sat, 18 Aug 2012 06:12:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=aurr07pqzVuz8HzVCce0RchQgSQFxFof78thYCnNdEw=; b=xrzu5J4BF1WuSMHtU/+pVVCAvInGUqVcu4bYCox4zjDrGiGUozOE1lscm4CbEofHtd Ul3WLY2vrkleZmiynbov9Mzgplbm8TUIqEUTkwlrewZPibru8Bivxq4OgMVfw9jsAlf9 1gabELT0aTXuBcJHCnZ2ivaNqLIpd4jvUrrOWrDhIpY/wM+bzC2ruNQlJqigRyqJrN/a 9aChfjo0i+0cz+FDOrXFaBCWmo6ixx4vhPaS0/ZNQLbGpNmT81aM/GscKd7NFxHGfMpY 3jCMaUhJJQapYRTUqzKMnGhjexbeLY7SrTxG8dAkok+XCvEwyiFwTFl3ETkSrknoveMZ NZTA== Original-Received: by 10.68.227.163 with SMTP id sb3mr19827303pbc.74.1345295555470; Sat, 18 Aug 2012 06:12:35 -0700 (PDT) Original-Received: from localhost ([123.114.56.118]) by mx.google.com with ESMTPS id th6sm7054569pbc.0.2012.08.18.06.12.31 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 18 Aug 2012 06:12:34 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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 (newer, 2) 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:63266 Archived-At: Looks like defaulting skeleton-untabify to t is no longer a good idea. There is no way in a skeleton to figure out how many chars are to be deleted for the skeleton element -num. So for example, skeletons in sh-scripts can behave abnormally if (setq backward-delete-char-untabify-method 'hungry). 1. Emacs -q 2. (setq backward-delete-char-untabify-method 'hungry) 3. C-x C-f x.bash 4. C-c : and choose bash 5. C-c ( You should see the function template expanded incorrectly. I think defaulting skeleton-untabify to nil is the right fix. Otherwise, the idea that customising backward-delete-char-untabify-method can implicitly change how skeleton does its work is scary. A fix local to sh-script.el can be done too: diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index f0dec93f..509b645d 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1512,6 +1512,7 @@ (define-derived-mode sh-mode prog-mode "Shell-script" (set (make-local-variable 'skeleton-pair-filter-function) 'sh-quoted-p) (set (make-local-variable 'skeleton-further-elements) '((< '(- (min sh-indentation (current-column)))))) + (set (make-local-variable 'skeleton-untabify) nil) (set (make-local-variable 'skeleton-filter-function) 'sh-feature) (set (make-local-variable 'skeleton-newline-indent-rigidly) t) (set (make-local-variable 'sh-indent-supported-here) nil) Leo