emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/progmodes/sh-script.el


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/sh-script.el
Date: Sun, 05 Oct 2003 09:53:54 -0400

Index: emacs/lisp/progmodes/sh-script.el
diff -c emacs/lisp/progmodes/sh-script.el:1.134 
emacs/lisp/progmodes/sh-script.el:1.135
*** emacs/lisp/progmodes/sh-script.el:1.134     Tue Sep 30 08:42:56 2003
--- emacs/lisp/progmodes/sh-script.el   Sun Oct  5 09:53:54 2003
***************
*** 358,378 ****
  ;; I turned off this feature because it doesn't permit typing commands
  ;; in the usual way without help.
  ;;(defvar sh-abbrevs
! ;;  '((csh eval sh-abbrevs shell
  ;;     "switch" 'sh-case
  ;;     "getopts" 'sh-while-getopts)
  
! ;;    (es eval sh-abbrevs shell
  ;;    "function" 'sh-function)
  
! ;;    (ksh88 eval sh-abbrevs sh
  ;;       "select" 'sh-select)
  
! ;;    (rc eval sh-abbrevs shell
  ;;    "case" 'sh-case
  ;;    "function" 'sh-function)
  
! ;;    (sh eval sh-abbrevs shell
  ;;    "case" 'sh-case
  ;;    "function" 'sh-function
  ;;    "until" 'sh-until
--- 358,378 ----
  ;; I turned off this feature because it doesn't permit typing commands
  ;; in the usual way without help.
  ;;(defvar sh-abbrevs
! ;;  '((csh sh-abbrevs shell
  ;;     "switch" 'sh-case
  ;;     "getopts" 'sh-while-getopts)
  
! ;;    (es sh-abbrevs shell
  ;;    "function" 'sh-function)
  
! ;;    (ksh88 sh-abbrevs sh
  ;;       "select" 'sh-select)
  
! ;;    (rc sh-abbrevs shell
  ;;    "case" 'sh-case
  ;;    "function" 'sh-function)
  
! ;;    (sh sh-abbrevs shell
  ;;    "case" 'sh-case
  ;;    "function" 'sh-function
  ;;    "until" 'sh-until
***************
*** 385,391 ****
  ;;       "tmpfile" sh-tmp-file
  ;;       "while" sh-while)
  
! ;;    (zsh eval sh-abbrevs ksh88
  ;;     "repeat" 'sh-repeat))
  ;;  "Abbrev-table used in Shell-Script mode.  See `sh-feature'.
  ;;;Due to the internal workings of abbrev tables, the shell name symbol is
--- 385,391 ----
  ;;       "tmpfile" sh-tmp-file
  ;;       "while" sh-while)
  
! ;;    (zsh sh-abbrevs ksh88
  ;;     "repeat" 'sh-repeat))
  ;;  "Abbrev-table used in Shell-Script mode.  See `sh-feature'.
  ;;;Due to the internal workings of abbrev tables, the shell name symbol is
***************
*** 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)
***************
*** 3128,3143 ****
  
  (define-skeleton sh-for
    "Insert a for loop.  See `sh-feature'."
!   (csh eval sh-modify sh
         1 ""
         2 "foreach "
         4 " ( "
         6 " )"
         15 '<
         16 "end")
!   (es eval sh-modify rc
        4 " = ")
!   (rc eval sh-modify sh
        2 "for( "
        6 " ) {"
        15 ?\} )
--- 3128,3143 ----
  
  (define-skeleton sh-for
    "Insert a for loop.  See `sh-feature'."
!   (csh sh-modify sh
         1 ""
         2 "foreach "
         4 " ( "
         6 " )"
         15 '<
         16 "end")
!   (es sh-modify rc
        4 " = ")
!   (rc sh-modify sh
        2 "for( "
        6 " ) {"
        15 ?\} )
***************
*** 3150,3163 ****
  
  (define-skeleton sh-indexed-loop
    "Insert an indexed loop from 1 to n.  See `sh-feature'."
!   (bash eval identity posix)
    (csh "Index variable: "
         "@ " str " = 1" \n
         "while( $" str " <= " (read-string "upper limit: ") " )" \n
         > _ ?$ str \n
         "@ " str "++" \n
         < "end" \n)
!   (es eval sh-modify rc
        4 " =")
    (ksh88 "Index variable: "
         > "integer " str "=0" \n
--- 3150,3163 ----
  
  (define-skeleton sh-indexed-loop
    "Insert an indexed loop from 1 to n.  See `sh-feature'."
!   (bash sh-modify posix)
    (csh "Index variable: "
         "@ " str " = 1" \n
         "while( $" str " <= " (read-string "upper limit: ") " )" \n
         > _ ?$ str \n
         "@ " str "++" \n
         < "end" \n)
!   (es sh-modify rc
        4 " =")
    (ksh88 "Index variable: "
         > "integer " str "=0" \n
***************
*** 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]