GNU bug report logs -
#12963
Fwd: Small modification to sh-script, to cover unsupported case label
Previous Next
Reported by: occitan <at> esperanto.org
Date: Thu, 22 Nov 2012 22:34:02 UTC
Severity: normal
Fixed in version 24.1
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12963 in the body.
You can then email your comments to 12963 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12963
; Package
emacs
.
(Thu, 22 Nov 2012 22:34:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
occitan <at> esperanto.org
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 22 Nov 2012 22:34:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
-------- 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 <at> ivankelly.net>
To: Daniel Pfeiffer <occitan <at> 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
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12963
; Package
emacs
.
(Fri, 23 Nov 2012 02:19:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 12963 <at> debbugs.gnu.org (full text, mbox):
> 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;
This already works correctly in Emacs-24, so I suggest you upgrade.
> Also, I'm finding indent-tabs-mode is being reset by sh-mode. Do you
> know what could be causing this?
AFAICT sh-script.el does not touch indent-tabs-mode (neither the most
recent version, nor the version in Emacs-23). But I'm not exactly sure
what you mean by "being reset".
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12963
; Package
emacs
.
(Fri, 23 Nov 2012 15:55:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 12963 <at> debbugs.gnu.org (full text, mbox):
> By being reset, I mean I have a hook
> (add-hook 'sh-mode-hook '(lambda () (setq indent-tabs-mode nil)))
> I open a sh file, and when I look at the value of indent-tabs-mode,
> it's t.
I just tried
% emacs23 -Q --eval "(add-hook 'sh-mode-hook (lambda () (setq indent-tabs-mode nil)))" test/indent/shell.sh
and C-h v indent-tabs-mode tells me it's nil in this buffer.
I suggest you add a (message "here I am") inside the above lambda (and
I also suggest you don't quote your lambdas with "'") to make sure it's
actually run.
> It may be something else that's borking it, but it works fine in other
> modes (java, c++). Is there a way to instrument a variable so that I
> can see when it gets changed?
No, but a binary search in your .emacs should quickly find the culprit.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12963
; Package
emacs
.
(Fri, 23 Nov 2012 20:03:03 GMT)
Full text and
rfc822 format available.
Message #14 received at 12963 <at> debbugs.gnu.org (full text, mbox):
On Thu, Nov 22, 2012 at 09:16:48PM -0500, Stefan Monnier wrote:
> > 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;
>
> This already works correctly in Emacs-24, so I suggest you upgrade.
Ah ok, I'm using Emacs-23 here, and was pulling trunk from bzr but it
was taking a long time, so I just decided to email the fix.
>
> > Also, I'm finding indent-tabs-mode is being reset by sh-mode. Do you
> > know what could be causing this?
>
> AFAICT sh-script.el does not touch indent-tabs-mode (neither the most
> recent version, nor the version in Emacs-23). But I'm not exactly sure
> what you mean by "being reset".
By being reset, I mean I have a hook
(add-hook 'sh-mode-hook '(lambda () (setq indent-tabs-mode nil)))
I open a sh file, and when I look at the value of indent-tabs-mode,
it's t.
It may be something else that's borking it, but it works fine in other
modes (java, c++). Is there a way to instrument a variable so that I
can see when it gets changed?
-Ivan
bug marked as fixed in version 24.1, send any further explanations to
12963 <at> debbugs.gnu.org and occitan <at> esperanto.org
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Wed, 28 Nov 2012 20:43:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 27 Dec 2012 12:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 12 years and 174 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.