Mercurial > emacs
comparison lisp/simple.el @ 83222:ae7fab96922c
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-627
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-628
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-629
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-630
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-631
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-632
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-633
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-634
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-635
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-636
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-637
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-638
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-54
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-55
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-56
Update from CVS: Add lisp/legacy-gnus-agent.el
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-57
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-58
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-262
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Mon, 25 Oct 2004 18:17:28 +0000 |
parents | 4df500c93e1d d9dc84198059 |
children | 4056279af756 |
comparison
equal
deleted
inserted
replaced
83221:0fc4928cc48e | 83222:ae7fab96922c |
---|---|
1877 "Execute shell command COMMAND and return its output as a string." | 1877 "Execute shell command COMMAND and return its output as a string." |
1878 (with-output-to-string | 1878 (with-output-to-string |
1879 (with-current-buffer | 1879 (with-current-buffer |
1880 standard-output | 1880 standard-output |
1881 (call-process shell-file-name nil t nil shell-command-switch command)))) | 1881 (call-process shell-file-name nil t nil shell-command-switch command)))) |
1882 | |
1883 (defun process-file (program &optional infile buffer display &rest args) | |
1884 "Process files synchronously in a separate process. | |
1885 Similar to `call-process', but may invoke a file handler based on | |
1886 `default-directory'. The current working directory of the | |
1887 subprocess is `default-directory'. | |
1888 | |
1889 File names in INFILE and BUFFER are handled normally, but file | |
1890 names in ARGS should be relative to `default-directory', as they | |
1891 are passed to the process verbatim. \(This is a difference to | |
1892 `call-process' which does not support file handlers for INFILE | |
1893 and BUFFER.\) | |
1894 | |
1895 Some file handlers might not support all variants, for example | |
1896 they might behave as if DISPLAY was nil, regardless of the actual | |
1897 value passed." | |
1898 (let ((fh (find-file-name-handler default-directory 'process-file)) | |
1899 lc stderr-file) | |
1900 (unwind-protect | |
1901 (if fh (apply fh 'process-file program infile buffer display args) | |
1902 (when infile (setq lc (file-local-copy infile))) | |
1903 (setq stderr-file (when (and (consp buffer) (stringp (cadr buffer))) | |
1904 (make-temp-file "emacs")))) | |
1905 (prog1 | |
1906 (apply 'call-process program | |
1907 (or lc infile) | |
1908 (if stderr-file (list (car buffer) stderr-file) buffer) | |
1909 display args) | |
1910 (when stderr-file (copy-file stderr-file (cadr buffer)))) | |
1911 (when stderr-file (delete-file stderr-file)) | |
1912 (when lc (delete-file lc))))) | |
1913 | |
1914 | |
1882 | 1915 |
1883 (defvar universal-argument-map | 1916 (defvar universal-argument-map |
1884 (let ((map (make-sparse-keymap))) | 1917 (let ((map (make-sparse-keymap))) |
1885 (define-key map [t] 'universal-argument-other-key) | 1918 (define-key map [t] 'universal-argument-other-key) |
1886 (define-key map (vector meta-prefix-char t) 'universal-argument-other-key) | 1919 (define-key map (vector meta-prefix-char t) 'universal-argument-other-key) |