[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sh-script skeleton sh-while-getopts causes Lisp error
From: |
Klaus Zeitler |
Subject: |
sh-script skeleton sh-while-getopts causes Lisp error |
Date: |
Tue, 30 Sep 2003 12:33:00 +0200 (MEST) |
Symptoms:
When I try to insert an options skeleton in sh-script I get the following
Lisp error: (void-variable sh-modify)
Here's a backtrace:
eval(sh-modify)
skeleton-internal-1(sh-modify nil nil)
byte-code("address@hidden #" [skeleton recursive skeleton-internal-1
nil] 4)
skeleton-internal-list((eval sh-modify sh 18 "${0##*/}") nil)
(let ((< ...)) (skeleton-internal-list skeleton str))
eval((let ((< ...)) (skeleton-internal-list skeleton str)))
skeleton-insert((eval sh-modify sh 18 "${0##*/}") nil nil)
skeleton-proxy-new(((bash eval sh-modify sh 18 "${0##*/}") (csh nil "while( 1
)" n > "switch( \"$1\" )" n (quote ...) > > ("option, %s: " < "case " ... ...
str 58 n > "set " v1 & " = $2" | -4 & _ n ... & n "breaksw" n) < "case --:" n >
"shift" n < "default:" n > "break" n resume: < < "endsw" n "shift" n < "end" n)
(ksh88 eval sh-modify sh 16 "print" 118 "${0##*/}" 37 "OPTIND-1") (posix eval
sh-modify sh 18 "$(basename $0)") (sh "optstring: " > "while getopts :" str "
OPT; do" n > "case $OPT in" n (quote ...) (... > str "|+" str
sh-non-closing-paren n > _ v2 n > ";;" n) > "*" sh-non-closing-paren n > "echo"
" \"usage: " "`basename $0`" " [+-" (quote ...) str (quote ...) (if ... -5) (if
... "] " "} ") "[--] ARGS...\"" n "exit 2" > n "esac" > n "done" > n "shift "
(sh-add "OPTIND" -1) n)) nil nil)
sh-while-getopts(nil nil)
call-interactively(sh-while-getopts)
When I compare the backtrace with 21.3 it looks as if the skeleton is already
evaluated once there when skeleton-proxy-new is called. My guess is that somehow
the define-skeleton macro is evaluating a bit differently now.
And here's an emacs 21.3 backtrace:
skeleton-internal-list(("optstring: " > "while getopts :" str " OPT; do" n >
"case $OPT in" n (quote (setq v1 ...)) ((prog1 ... ...) > str "|+" str
(propertize ")" ... sh-st-punc) n > _ v2 n > ";;" n n) > "*" (propertize ")"
(quote syntax-table) sh-st-punc) n > "echo" " \"usage: " "${0##*/}" " [+-"
(quote (setq v1 ...)) str (quote (save-excursion ...)) (if (eq ... 45) -5) (if
(and ... ...) "] " "} ") "[--] ARGS...\"" n "exit 2" > n "esac" > n "done" > n
"shift " (sh-add "OPTIND" -1)) nil)
(let ((< ...)) (skeleton-internal-list skeleton str))
eval((let ((< ...)) (skeleton-internal-list skeleton str)))
skeleton-insert(("optstring: " > "while getopts :" str " OPT; do" n > "case
$OPT in" n (quote (setq v1 ...)) ((prog1 ... ...) > str "|+" str (propertize
")" ... sh-st-punc) n > _ v2 n > ";;" n n) > "*" (propertize ")" (quote
syntax-table) sh-st-punc) n > "echo" " \"usage: " "${0##*/}" " [+-" (quote
(setq v1 ...)) str (quote (save-excursion ...)) (if (eq ... 45) -5) (if (and
... ...) "] " "} ") "[--] ARGS...\"" n "exit 2" > n "esac" > n "done" > n
"shift " (sh-add "OPTIND" -1)) nil nil)
skeleton-proxy-new(((bash "optstring: " > "while getopts :" str " OPT; do" n
> "case $OPT in" n (quote ...) (... > str "|+" str ... n > _ v2 n > ";;" n n) >
"*" (propertize ")" ... sh-st-punc) n > "echo" " \"usage: " "${0##*/}" " [+-"
(quote ...) str (quote ...) (if ... -5) (if ... "] " "} ") "[--] ARGS...\"" n
"exit 2" > n "esac" > n "done" > n "shift " (sh-add "OPTIND" -1)) (csh nil
"while( 1 )" n > "switch( \"$1\" ))" n (quote ...) > > ("option, %s: " < "case
" ... ... str 58 n > "set " v1 & " = $2" | -4 & _ n ... & n "breaksw" n) <
"case --:" n > "shift" n < "default:" n > "break" n resume: < < "endsw" n
"shift" n < "end") (ksh88 eval sh-modify sh 16 "print" 18 "${0##*/}" 37
"OPTIND-1") (posix eval sh-modify sh 18 "$(basename $0)") (sh "optstring: " >
"while getopts :" str " OPT; do" n > "case $OPT in" n (quote ...) (... > str
"|+" str ... n > _ v2 n > ";;" n n) > "*" (propertize ")" ... sh-st-punc) n >
"echo" " \"usage: " "`basename $0`" " [+-" (quote ...) str (quote ...!
) (if ... -5) (if ... "] " "} ") "[--] ARGS...\"" n "exit 2" > n "esac" > n
"done" > n "shift " (sh-add "OPTIND" -1))) nil nil)
byte-code("ÂÃ #" [str arg skeleton-proxy-new ((bash "optstring: " >
"while getopts :" str " OPT; do" n > "case $OPT in" n ... ... > "*" ... n >
"echo" " \"usage: " "${0##*/}" " [+-" ... str ... ... ... "[--] ARGS...\"" n
"exit 2" > n "esac" > n "done" > n "shift " ...) (csh nil "while( 1 )" n >
"switch( \"$1\" )" n ... > > ... << "case --:" n > "shift" n < "default:" n >
"break" n resume: < < "endsw" n "shift" n < "end") (ksh88 eval sh-modify sh 16
"print" 18 "${0##*/}" 37 "OPTIND-1") (posix eval sh-modify sh 18 "$(basename
$0)") (sh "optstring: " > "while getopts :" str " OPT; do" n > "case $OPT in" n
... ... > "*" ... n > "echo" " \"usage: " "`basename $0`" " [+-" ... str ...
... ... "[--] ARGS...\"" n "exit 2" > n "esac" > n "done" > n "shift " ...))] 4)
sh-while-getopts(nil nil)
call-interactively(sh-while-getopts)
In GNU Emacs 21.3.50.4 (sparc-sun-solaris2.8, Motif Version 2.1.0)
of 2003-09-30 on sfsws4
configured using `configure '--with-gcc'
'--prefix=/vol/freeware/SunOS-5.8/emacs/cvs'
'--sharedstatedir=/vol/freeware/SunOS-5.8/emacs/cvs/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' 'CC=gcc''
Important settings:
value of $LC_ALL: nil
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
Recent input:
<down-mouse-1> <mouse-1> <escape> x s e t - v a r SPC
<return> d e b SPC o n - e n <backspace> r SPC <return>
t <return> C-x C-f C-a C-k ~ / t s t / x . <backspace>
<backspace> t . s h <return> C-SPC <escape> > C-w C-c
C-o <help-echo> <help-echo> <down-mouse-1> <mouse-1>
<help-echo> <help-echo> <menu-bar> <help-menu> <re
port-emacs-bug>
Recent messages:
Setting up indent for shell type bash
Loading regexp-opt...done
setting up indent stuff
Indentation variable are now local.
Indentation setup for shell type bash
Mark set [2 times]
Loading skeleton...done
Loading debug...done
Entering debugger...
Loading emacsbug...done
- sh-script skeleton sh-while-getopts causes Lisp error,
Klaus Zeitler <=