From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Pfeiffer Newsgroups: gmane.emacs.bugs Subject: bug#12963: Fwd: Small modification to sh-script, to cover unsupported case label Date: Thu, 22 Nov 2012 23:31:37 +0100 Message-ID: <50AEA7C9.10208@t-online.de> References: <20121122155324.GC29552@ip-10-228-174-15.eu-west-1.compute.internal> Reply-To: occitan@esperanto.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------070708080703000203000205" X-Trace: ger.gmane.org 1353623571 433 80.91.229.3 (22 Nov 2012 22:32:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Nov 2012 22:32:51 +0000 (UTC) Cc: Ivan Kelly To: 12963@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 22 23:33:02 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 1TbfKP-0006VH-EB for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Nov 2012 23:33:01 +0100 Original-Received: from localhost ([::1]:55397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbfKE-00028D-Jq for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Nov 2012 17:32:50 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbfK8-00027n-59 for bug-gnu-emacs@gnu.org; Thu, 22 Nov 2012 17:32:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbfK4-0008KE-5I for bug-gnu-emacs@gnu.org; Thu, 22 Nov 2012 17:32:44 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbfK4-0008KA-1s for bug-gnu-emacs@gnu.org; Thu, 22 Nov 2012 17:32:40 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TbfLO-00079K-CC for bug-gnu-emacs@gnu.org; Thu, 22 Nov 2012 17:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Pfeiffer Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Nov 2012 22:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12963 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.135362361227441 (code B ref -1); Thu, 22 Nov 2012 22:34:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Nov 2012 22:33:32 +0000 Original-Received: from localhost ([127.0.0.1]:33630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbfKq-00078U-C9 for submit@debbugs.gnu.org; Thu, 22 Nov 2012 17:33:32 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43376) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TbfKl-00078L-8J for submit@debbugs.gnu.org; Thu, 22 Nov 2012 17:33:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbfJL-0008Fv-1v for submit@debbugs.gnu.org; Thu, 22 Nov 2012 17:32:00 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:36735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbfJK-0008Fr-V9 for submit@debbugs.gnu.org; Thu, 22 Nov 2012 17:31:54 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbfJG-0001wV-PA for bug-gnu-emacs@gnu.org; Thu, 22 Nov 2012 17:31:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbfJC-0008Es-Dg for bug-gnu-emacs@gnu.org; Thu, 22 Nov 2012 17:31:50 -0500 Original-Received: from mailout03.t-online.de ([194.25.134.81]:48943) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbfJC-0008Dr-2s for bug-gnu-emacs@gnu.org; Thu, 22 Nov 2012 17:31:46 -0500 Original-Received: from fwd15.aul.t-online.de (fwd15.aul.t-online.de ) by mailout03.t-online.de with smtp id 1TbfJ9-0001gV-N5; Thu, 22 Nov 2012 23:31:43 +0100 Original-Received: from [192.168.178.34] (TWIUUTZS8h9Cer5e1uQWnDZNXZjPGbrfBnh4p4gAUiIrZ8QT-PtFLPeY5sATV3TZbE@[84.176.180.78]) by fwd15.t-online.de with esmtp id 1TbfJ5-0dO7LU0; Thu, 22 Nov 2012 23:31:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: <20121122155324.GC29552@ip-10-228-174-15.eu-west-1.compute.internal> X-Forwarded-Message-Id: <20121122155324.GC29552@ip-10-228-174-15.eu-west-1.compute.internal> X-ID: TWIUUTZS8h9Cer5e1uQWnDZNXZjPGbrfBnh4p4gAUiIrZ8QT-PtFLPeY5sATV3TZbE X-TOI-MSGID: ca5085c1-99ca-41d0-91d5-ef0b1f012637 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:67325 Archived-At: This is a multi-part message in MIME format. --------------070708080703000203000205 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit -------- Original Message -------- Subject: Small modification to sh-script, to cover unsupported case label Date: Thu, 22 Nov 2012 15:53:25 +0000 From: Ivan Kelly To: Daniel Pfeiffer Hi, I ran into an issue with the sh-mode today with case labels. case $X in foo) do_something ;; arg=*) do_something_else_based_on_arg ;; *) default ;; esac Indention will mess up on the second label, due to the = This can be fixed by adding a = to the skip-chars-backwards in sh-font-lock-parens; i.e. (defun sh-font-lock-paren (start) (save-excursion (goto-char start) ;; Skip through all patterns (while (progn (forward-comment (- (point-max))) ;; Skip through one pattern (while (or (/= 0 (skip-syntax-backward "w_")) (/= 0 (skip-chars-backward "?[]*@/\\=")) (and (sh-is-quoted-p (1- (point))) ... Also, I'm finding indent-tabs-mode is being reset by sh-mode. Do you know what could be causing this? Regards Ivan --------------070708080703000203000205 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


-------- Original Message --------
Subject: Small modification to sh-script, to cover unsupported case label
Date: Thu, 22 Nov 2012 15:53:25 +0000
From: Ivan Kelly <ivan@ivankelly.net>
To: Daniel Pfeiffer <occitan@esperanto.org>


Hi,

I ran into an issue with the sh-mode today with case labels.
case $X in
    foo)
        do_something
        ;;
    arg=*)
        do_something_else_based_on_arg
        ;;
    *)
        default
        ;;
esac

Indention will mess up on the second label, due to the =
This can be fixed by adding a = to the skip-chars-backwards in
sh-font-lock-parens;

i.e.
(defun sh-font-lock-paren (start)
  (save-excursion
    (goto-char start)
    ;; Skip through all patterns
    (while
      (progn
        (forward-comment (- (point-max)))
        ;; Skip through one pattern
        (while
          (or (/= 0 (skip-syntax-backward "w_"))
          (/= 0 (skip-chars-backward "?[]*@/\\="))
            (and (sh-is-quoted-p (1- (point)))
...

Also, I'm finding indent-tabs-mode is being reset by sh-mode. Do you
know what could be causing this?

Regards
Ivan



--------------070708080703000203000205--