Mercurial > emacs
comparison lisp/simple.el @ 32201:2d44e29be6fa
(shell-command-on-region): If the output is short enough to display in
an expanded echo area, show it here.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Fri, 06 Oct 2000 08:18:12 +0000 |
parents | f80262435e6c |
children | f10445ddce32 |
comparison
equal
deleted
inserted
replaced
32200:dfe3d0e80f84 | 32201:2d44e29be6fa |
---|---|
1102 If COMMAND ends in ampersand, execute it asynchronously. | 1102 If COMMAND ends in ampersand, execute it asynchronously. |
1103 The output appears in the buffer `*Async Shell Command*'. | 1103 The output appears in the buffer `*Async Shell Command*'. |
1104 That buffer is in shell mode. | 1104 That buffer is in shell mode. |
1105 | 1105 |
1106 Otherwise, COMMAND is executed synchronously. The output appears in the | 1106 Otherwise, COMMAND is executed synchronously. The output appears in the |
1107 buffer `*Shell Command Output*'. | 1107 buffer `*Shell Command Output*'. If the output is short enough to |
1108 If the output is one line, it is displayed in the echo area *as well*, | 1108 display in the echo area (which is determined by the variable |
1109 but it is nonetheless available in buffer `*Shell Command Output*', | 1109 `max-mini-window-height'), it is shown there, but it is nonetheless |
1110 even though that buffer is not automatically displayed. | 1110 available in buffer `*Shell Command Output*' even though that buffer is |
1111 If there is no output, or if output is inserted in the current buffer, | 1111 not automatically displayed. If there is no output, or if output is |
1112 then `*Shell Command Output*' is deleted. | 1112 inserted in the current buffer, then `*Shell Command Output*' is |
1113 deleted. | |
1113 | 1114 |
1114 To specify a coding system for converting non-ASCII characters | 1115 To specify a coding system for converting non-ASCII characters |
1115 in the shell command output, use \\[universal-coding-system-argument] | 1116 in the shell command output, use \\[universal-coding-system-argument] |
1116 before this command. | 1117 before this command. |
1117 | 1118 |
1240 The noninteractive arguments are START, END, COMMAND, OUTPUT-BUFFER, | 1241 The noninteractive arguments are START, END, COMMAND, OUTPUT-BUFFER, |
1241 REPLACE, ERROR-BUFFER. Noninteractive callers can specify coding | 1242 REPLACE, ERROR-BUFFER. Noninteractive callers can specify coding |
1242 systems by binding `coding-system-for-read' and | 1243 systems by binding `coding-system-for-read' and |
1243 `coding-system-for-write'. | 1244 `coding-system-for-write'. |
1244 | 1245 |
1245 If the output is one line, it is displayed in the echo area, | 1246 If the output is short enough to display in the echo area (which is |
1246 but it is nonetheless available in buffer `*Shell Command Output*' | 1247 determined by the variable `max-mini-window-height'), it is shown there, |
1247 even though that buffer is not automatically displayed. | 1248 but it is nonetheless available in buffer `*Shell Command Output*' even |
1248 If there is no output, or if output is inserted in the current buffer, | 1249 though that buffer is not automatically displayed. If there is no |
1249 then `*Shell Command Output*' is deleted. | 1250 output, or if output is inserted in the current buffer, then `*Shell |
1251 Command Output*' is deleted. | |
1250 | 1252 |
1251 If the optional fourth argument OUTPUT-BUFFER is non-nil, | 1253 If the optional fourth argument OUTPUT-BUFFER is non-nil, |
1252 that says to put the output in some other buffer. | 1254 that says to put the output in some other buffer. |
1253 If OUTPUT-BUFFER is a buffer or buffer name, put the output there. | 1255 If OUTPUT-BUFFER is a buffer or buffer name, put the output there. |
1254 If OUTPUT-BUFFER is not a buffer and not nil, | 1256 If OUTPUT-BUFFER is not a buffer and not nil, |
1358 (message "(Shell command %sed with no output)" | 1360 (message "(Shell command %sed with no output)" |
1359 (if (equal 0 exit-status) | 1361 (if (equal 0 exit-status) |
1360 "succeed" | 1362 "succeed" |
1361 "fail"))) | 1363 "fail"))) |
1362 (kill-buffer buffer)) | 1364 (kill-buffer buffer)) |
1363 ((= lines 1) | 1365 ((or (= lines 1) |
1366 (<= lines | |
1367 (cond ((floatp max-mini-window-height) | |
1368 (* (frame-height) max-mini-window-height)) | |
1369 ((integerp max-mini-window-height) | |
1370 max-mini-window-height) | |
1371 (t | |
1372 1)))) | |
1364 (message "%s" | 1373 (message "%s" |
1365 (save-excursion | 1374 (with-current-buffer buffer |
1366 (set-buffer buffer) | 1375 (goto-char (point-max)) |
1367 (goto-char (point-min)) | 1376 (when (bolp) |
1368 (buffer-substring (point) | 1377 (backward-char 1)) |
1369 (progn (end-of-line) (point)))))) | 1378 (buffer-substring (point-min) (point))))) |
1370 (t | 1379 (t |
1371 (save-excursion | 1380 (save-excursion |
1372 (set-buffer buffer) | 1381 (set-buffer buffer) |
1373 (goto-char (point-min))) | 1382 (goto-char (point-min))) |
1374 (display-buffer buffer))))))) | 1383 (display-buffer buffer))))))) |