Function: sh-tmp-file

sh-tmp-file is an interactive and byte-compiled function defined in sh-script.el.gz.

Signature

(sh-tmp-file &optional STR ARG)

Documentation

Insert code to setup temporary file handling. See sh-feature.

This is a skeleton command (see skeleton-insert). Normally the skeleton text is inserted at point, with nothing "inside". If there is a highlighted region, the skeleton text is wrapped around the region text.

A prefix argument ARG says to wrap the skeleton around the next ARG words. A prefix argument of -1 says to wrap around region, even if not highlighted. A prefix argument of zero says to wrap around zero words---that is, nothing. This is a way of overriding the use of a highlighted region.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/sh-script.el.gz
;;;(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 = `mktemp -t " str ".XXXXXX`" \n
       "onintr exit" \n _
       (and (goto-char (point-max))
	    (not (bolp))
	    ?\n)
       "exit:\n"
       "rm $tmp* >&" null-device > \n)
  (es (file-name-nondirectory (buffer-file-name))
      > "local( signals = $signals sighup sigint;" \n
      > "tmp = `{ mktemp -t " str ".XXXXXX } ) {" \n
      > "catch @ e {" \n
      > "rm $tmp^* >[2]" null-device \n
      "throw $e" \n
      "} {" > \n
      _ \n
      ?\} > \n
      ?\} > \n)
  (ksh88 sh-modify sh
	 7 "EXIT")
  (rc (file-name-nondirectory (buffer-file-name))
      > "tmp = `{ mktemp -t " str ".XXXXXX }" \n
      "fn sigexit { rm $tmp^* >[2]" null-device " }" \n)
  (sh (file-name-nondirectory (buffer-file-name))
      > "TMP=`mktemp -t " str ".XXXXXX`" \n
      "trap \"rm $TMP* 2>" null-device "\" " ?0 \n))