unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* sh-script ksh option skeleton bug + a few suggestions
@ 2003-04-14 13:58 Klaus Zeitler
  0 siblings, 0 replies; only message in thread
From: Klaus Zeitler @ 2003-04-14 13:58 UTC (permalink / raw)


This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.3.1 (sparc-sun-solaris2.8, Motif Version 2.1.0)
 of 2003-04-08 on sfsws4
configured using `configure  --with-gcc --prefix=/vol/freeware/SunOS-5.8/emacs/21.3 --sharedstatedir=/vol/freeware/SunOS-5.8/emacs/21.3/share --with-x-toolkit=motif --x-includes=/usr/openwin/include:/usr/local/gnu/include --x-libraries=/usr/openwin/lib:/usr/local/gnu/lib --with-pop'
Important settings:
  value of $LC_ALL: 
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: C
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

1. start emacs -q --no-site-file
2. C-x C-f x.ksh
3. Insert "Options Loop", i.e. C-c C-o 

the code inserted from skeleton looks like:

while getopts :ab OPT; do
    case $OPT in
	a|+a)
	
	;;b|+b)
	
	;;*)
	print "usage: ${0##*/} [+-ab} [--] ARGS..."
	exit 2
    esac
done
OPTIND-1$(( OPTIND - 1 ))


I've attached a patch to fix this.

This patch also contains the following improvements:

1. add "select" to bash sh-other-keywords

2. correct ";;<label>" in skeletons for "Options Loop" and "Case Statement"
   to ";;\n<label>, i.e. change the skeleton "Case Statement" from e.g.

case $b in
    x1)
    
    ;;
    x2)
    
    ;;*)
esac

to

case $b in
    x1)
    
    ;;
    x2)
    
    ;;
    *)
esac

and similar for "Options-Loop" skeleton

3. add an empty line after "elif" lines in skeleton "If Statements"


Furthermore I'd suggest to set sh-heredoc-face to font-lock-doc-face.
Also I wonder why skeleton-end-hook is modified. I can't see any advantage.
Normally I can decide via skeleton-end-newline if a final new-line should
be appended or not, but sh-script-mode doesn't allow that.


And one OT question: My last followups to gnu.emacs.bug didn't show up.
Is it not possible anymore to post directly to gnu.emacs.bug and do I
have to send followups to bug-gnu-emacs@gnu.org instead?

And here's the patch:

--- snip ---
*** sh-script.el	Mon Apr 14 15:52:01 2003
--- sh-script.el.new	Mon Apr 14 15:53:38 2003
***************
*** 653,659 ****
  
  (defcustom sh-other-keywords
    '((bash eval sh-append bourne
! 	  "bye" "logout")
  
      ;; The next entry is only used for defining the others
      (bourne eval sh-append sh
--- 653,659 ----
  
  (defcustom sh-other-keywords
    '((bash eval sh-append bourne
! 	  "bye" "logout" "select")
  
      ;; The next entry is only used for defining the others
      (bourne eval sh-append sh
***************
*** 3077,3083 ****
        ( "other pattern, %s: "
  	> str (propertize ")" 'syntax-table sh-st-punc) \n
  	> _ \n
! 	";;" \n)
        > "*" (propertize ")" 'syntax-table sh-st-punc) \n
        > _ \n
        resume:
--- 3077,3083 ----
        ( "other pattern, %s: "
  	> str (propertize ")" 'syntax-table sh-st-punc) \n
  	> _ \n
! 	";;" \n \n)
        > "*" (propertize ")" 'syntax-table sh-st-punc) \n
        > _ \n
        resume:
***************
*** 3268,3274 ****
        > _ \n
        ( "other condition, %s: "
  	>  "elif " str "; then" > \n
! 	> \n)
        "else" > \n
        > \n
        resume:
--- 3268,3274 ----
        > _ \n
        ( "other condition, %s: "
  	>  "elif " str "; then" > \n
! 	> \n \n)
        "else" > \n
        > \n
        resume:
***************
*** 3401,3407 ****
    (ksh88 eval sh-modify sh
  	 16 "print"
  	 18 "${0##*/}"
! 	 36 "OPTIND-1")
    (posix eval sh-modify sh
  	 18 "$(basename $0)")
    (sh "optstring: "
--- 3401,3407 ----
    (ksh88 eval sh-modify sh
  	 16 "print"
  	 18 "${0##*/}"
! 	 37 "OPTIND-1")
    (posix eval sh-modify sh
  	 18 "$(basename $0)")
    (sh "optstring: "
***************
*** 3416,3422 ****
  		  v2 nil)))
  	> str "|+" str (propertize ")" 'syntax-table sh-st-punc) \n
  	> _ v2 \n
! 	> ";;" \n)
        > "*" (propertize ")" 'syntax-table sh-st-punc) \n
        > "echo" " \"usage: " "`basename $0`"
        " [+-" '(setq v1 (point)) str
--- 3416,3422 ----
  		  v2 nil)))
  	> str "|+" str (propertize ")" 'syntax-table sh-st-punc) \n
  	> _ v2 \n
! 	> ";;" \n \n)
        > "*" (propertize ")" 'syntax-table sh-st-punc) \n
        > "echo" " \"usage: " "`basename $0`"
        " [+-" '(setq v1 (point)) str
--- snip ---

Recent input:
a = $ b <left> <left> <left> SPC <right> SPC <right> 
<right> <return> x 1 <return> x 2 <return> <return> 
<up> <up> <right> <right> <right> <delete> <delete> 
C-d C-d C-d <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <return> <return> <return> 
<up> C-c C-o a b c <backspace> <return> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<return> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> C-c TAB $ a SPC = SPC " x " <return> $ 
a SPC = SPC " y " <return> <return> <help-echo> <down> 
<down> <down> <down> <down> <down> <help-echo> <help-echo> 
<menu-bar> <help-menu> <report-emacs-bug>

Recent messages:
Setting up indent for shell type ksh88
Loading regexp-opt...done
Loading mule-util...done
setting up indent stuff
Indentation variable are now local.
Indentation setup for shell type ksh88
Mark set [2 times]
Loading skeleton...done
Auto-saving...done
Loading emacsbug...done

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-14 13:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-14 13:58 sh-script ksh option skeleton bug + a few suggestions Klaus Zeitler

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).