GNU bug report logs - #25353
Shell-script[bash] mode not ready for extglob

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Wed, 4 Jan 2017 11:29:02 UTC

Severity: minor

Merged with 21321, 31609

Found in versions 24.5, 25.3

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Subject: Shell-script[bash] mode not ready for extglob
Date: Wed, 04 Jan 2017 17:59:52 +0800
Doing
 C-x h [mark-whole-buffer]
 <tab> [indent-for-tab-command]
just makes indentation out of whack, here where we use shopt -s extglob
patterns. emacs-version "25.1.1".


#!/bin/sh
b=256 t=10000
shopt -s extglob
while read cid
do
    echo -n "$cid: "
    case $cid in
	+([0-9])-[0-9][0-9])
			    printf "%d\n" $((${cid%-*} * 256 + ${cid#*-}))
			    for i in 01 11 21 31 41 51
			    do printf "%d %s\n" $((${cid%-*} * 256 + i)) $i
			    done
			    ;;
			    +([0-9]))
				     printf "%06d-%02d\n" $((cid / b)) $((cid % b))
				     printf "%02d-%04d-%02d\n" $((cid / b / t))  $((cid / b % t)) $((cid % b))
				     ;;
				     *) echo '???' 1>&2; exit 11;
					;;
				     esac
done




This bug report was last modified 3 years and 160 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.