emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sh-script skeleton sh-while-getopts causes Lisp error


From: Richard Stallman
Subject: Re: sh-script skeleton sh-while-getopts causes Lisp error
Date: Wed, 01 Oct 2003 10:55:28 -0400

    > When I try to insert an options skeleton in sh-script I get the following
    > Lisp error: (void-variable sh-modify)

    Probably an incompatibility I introduced.
    I'll take a look at it,

I think it was caused by my last changes to sh-script.el
and I sent Klaus this proposed fix.

*** sh-script.el.~1.134.~       Tue Sep 30 08:46:00 2003
--- sh-script.el        Tue Sep 30 13:16:15 2003
***************
*** 1567,1576 ****
        (unless elt
          (setq elt (assq 'sh alist)))
        (if (and (consp (setq val (cdr elt)))
!                (eq (car val) 'sh-append))
            (setcdr elt
                    (setq val
!                         (apply 'sh-append
                                 (let ((sh-shell (car (cdr val))))
                                     (if (assq sh-shell alist)
                                         (sh-feature alist)
--- 1567,1576 ----
        (unless elt
          (setq elt (assq 'sh alist)))
        (if (and (consp (setq val (cdr elt)))
!                (memq (car val) '(sh-append sh-modify)))
            (setcdr elt
                    (setq val
!                         (apply (car val)
                                 (let ((sh-shell (car (cdr val))))
                                     (if (assq sh-shell alist)
                                         (sh-feature alist)
***************
*** 3255,3267 ****
  
  (define-skeleton sh-function
    "Insert a function definition.  See `sh-feature'."
!   (bash eval sh-modify ksh88
        3 "() {")
    (ksh88 "name: "
         "function " str " {" \n
         > _ \n
         < "}" \n)
!   (rc eval sh-modify ksh88
        1 "fn ")
    (sh ()
        "() {" \n
--- 3255,3267 ----
  
  (define-skeleton sh-function
    "Insert a function definition.  See `sh-feature'."
!   (bash sh-modify ksh88
        3 "() {")
    (ksh88 "name: "
         "function " str " {" \n
         > _ \n
         < "}" \n)
!   (rc sh-modify ksh88
        1 "fn ")
    (sh ()
        "() {" \n
***************
*** 3337,3350 ****
         > "select " str " in " _ "; do" \n
         > ?$ str \n
         "done" > \n)
!   (bash eval sh-append ksh88))
  ;;;(put 'sh-select 'menu-enable '(sh-feature sh-select))
  
  
  
  (define-skeleton sh-tmp-file
    "Insert code to setup temporary file handling.  See `sh-feature'."
!   (bash eval identity ksh88)
    (csh (file-name-nondirectory (buffer-file-name))
         "set tmp = /tmp/" str ".$$" \n
         "onintr exit" \n _
--- 3337,3350 ----
         > "select " str " in " _ "; do" \n
         > ?$ str \n
         "done" > \n)
!   (bash sh-append ksh88))
  ;;;(put 'sh-select 'menu-enable '(sh-feature sh-select))
  
  
  
  (define-skeleton sh-tmp-file
    "Insert code to setup temporary file handling.  See `sh-feature'."
!   (bash sh-append ksh88)
    (csh (file-name-nondirectory (buffer-file-name))
         "set tmp = /tmp/" str ".$$" \n
         "onintr exit" \n _
***************
*** 3363,3369 ****
        _ \n
        ?\} > \n
        ?\} > \n)
!   (ksh88 eval sh-modify sh
         7 "EXIT")
    (rc (file-name-nondirectory (buffer-file-name))
        > "tmp = /tmp/" str ".$pid" \n
--- 3363,3369 ----
        _ \n
        ?\} > \n
        ?\} > \n)
!   (ksh88 sh-modify sh
         7 "EXIT")
    (rc (file-name-nondirectory (buffer-file-name))
        > "tmp = /tmp/" str ".$pid" \n
***************
*** 3387,3403 ****
  
  (define-skeleton sh-while
    "Insert a while loop.  See `sh-feature'."
!   (csh eval sh-modify sh
         2 ""
         3 "while( "
         5 " )"
         10 '<
         11 "end")
!   (es eval sh-modify sh
        3 "while { "
        5 " } {"
        10 ?\} )
!   (rc eval sh-modify sh
        3 "while( "
        5 " ) {"
        10 ?\} )
--- 3387,3403 ----
  
  (define-skeleton sh-while
    "Insert a while loop.  See `sh-feature'."
!   (csh sh-modify sh
         2 ""
         3 "while( "
         5 " )"
         10 '<
         11 "end")
!   (es sh-modify sh
        3 "while { "
        5 " } {"
        10 ?\} )
!   (rc sh-modify sh
        3 "while( "
        5 " ) {"
        10 ?\} )
***************
*** 3413,3419 ****
    "Insert a while getopts loop.  See `sh-feature'.
  Prompts for an options string which consists of letters for each recognized
  option followed by a colon `:' if the option accepts an argument."
!   (bash eval sh-modify sh
        18 "${0##*/}")
    (csh nil
         "while( 1 )" \n
--- 3413,3419 ----
    "Insert a while getopts loop.  See `sh-feature'.
  Prompts for an options string which consists of letters for each recognized
  option followed by a colon `:' if the option accepts an argument."
!   (bash sh-modify sh
        18 "${0##*/}")
    (csh nil
         "while( 1 )" \n
***************
*** 3438,3448 ****
         < < "endsw" \n
         "shift" \n
         < "end" \n)
!   (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
--- 3438,3448 ----
         < < "endsw" \n
         "shift" \n
         < "end" \n)
!   (ksh88 sh-modify sh
         16 "print"
         18 "${0##*/}"
         37 "OPTIND-1")
!   (posix sh-modify sh
         18 "$(basename $0)")
    (sh "optstring: "
        > "while getopts :" str " OPT; do" \n




reply via email to

[Prev in Thread] Current Thread [Next in Thread]