Function: viper-glob-unix-files
viper-glob-unix-files is a byte-compiled function defined in
viper-util.el.gz.
Signature
(viper-glob-unix-files FILESPEC)
Source Code
;; Defined in /usr/src/emacs/lisp/emulation/viper-util.el.gz
;;; Support for :e, :r, :w file globbing
;; Glob the file spec.
;; This function is designed to work under Unix.
(defun viper-glob-unix-files (filespec)
(let ((gshell
(cond (ex-unix-type-shell shell-file-name)
(t "sh"))) ; probably Unix anyway
(gshell-options
;; using cond in anticipation of further additions
(cond (ex-unix-type-shell-options)
))
(command (cond (viper-ms-style-os-p (format "\"ls -1 -d %s\"" filespec))
(t (format "ls -1 -d %s" filespec))))
status)
(with-current-buffer (get-buffer-create viper-ex-tmp-buf-name)
(erase-buffer)
(setq status
(if gshell-options
(call-process gshell nil t nil
gshell-options
"-c"
command)
(call-process gshell nil t nil
"-c"
command)))
(goto-char (point-min))
;; Issue an error, if no match.
(unless (eq 0 status)
(save-excursion
(skip-chars-forward " \t\n")
(if (looking-at "ls:")
(viper-forward-Word 1))
(error "%s: %s"
(if (stringp gshell)
gshell
"shell")
(buffer-substring (point) (viper-line-pos 'end)))
))
(goto-char (point-min))
(viper-get-filenames-from-buffer 'one-per-line))
))