comparison lisp/simple.el @ 19109:98515e50136d

(shell-command-on-region, shell-command): Doc fixes. (do-auto-fill): Don't break the line right after a comment starter.
author Richard M. Stallman <rms@gnu.org>
date Mon, 04 Aug 1997 00:51:07 +0000
parents 9d24caacda44
children 6fc804ec9434
comparison
equal deleted inserted replaced
19108:68f319192499 19109:98515e50136d
835 but it is nonetheless available in buffer `*Shell Command Output*', 835 but it is nonetheless available in buffer `*Shell Command Output*',
836 even though that buffer is not automatically displayed. 836 even though that buffer is not automatically displayed.
837 If there is no output, or if output is inserted in the current buffer, 837 If there is no output, or if output is inserted in the current buffer,
838 then `*Shell Command Output*' is deleted. 838 then `*Shell Command Output*' is deleted.
839 839
840 To specify a coding system for converting non-ASCII characters
841 in the shell command output, use \\[universal-coding-system-argument]
842 before this command.
843
844 Noninteractive callers can specify coding systems by binding
845 `coding-system-for-read' and `coding-system-for-write'.
846
840 The optional second argument OUTPUT-BUFFER, if non-nil, 847 The optional second argument OUTPUT-BUFFER, if non-nil,
841 says to put the output in some other buffer. 848 says to put the output in some other buffer.
842 If OUTPUT-BUFFER is a buffer or buffer name, put the output there. 849 If OUTPUT-BUFFER is a buffer or buffer name, put the output there.
843 If OUTPUT-BUFFER is not a buffer and not nil, 850 If OUTPUT-BUFFER is not a buffer and not nil,
844 insert output in current buffer. (This cannot be done asynchronously.) 851 insert output in current buffer. (This cannot be done asynchronously.)
913 &optional output-buffer replace) 920 &optional output-buffer replace)
914 "Execute string COMMAND in inferior shell with region as input. 921 "Execute string COMMAND in inferior shell with region as input.
915 Normally display output (if any) in temp buffer `*Shell Command Output*'; 922 Normally display output (if any) in temp buffer `*Shell Command Output*';
916 Prefix arg means replace the region with it. 923 Prefix arg means replace the region with it.
917 924
925 To specify a coding system for converting non-ASCII characters
926 in the input and output to the shell command, use \\[universal-coding-system-argument]
927 before this command. By default, the input (from the current buffer)
928 is encoded in the same coding system that will be used to save the file,
929 `buffer-file-coding-system'. If the output is going to replace the region,
930 then it is decoded from that same coding system.
931
918 The noninteractive arguments are START, END, COMMAND, OUTPUT-BUFFER, REPLACE. 932 The noninteractive arguments are START, END, COMMAND, OUTPUT-BUFFER, REPLACE.
919 If REPLACE is non-nil, that means insert the output 933 If REPLACE is non-nil, that means insert the output
920 in place of text from START to END, putting point and mark around it. 934 in place of text from START to END, putting point and mark around it.
935 Noninteractive callers can specify coding systems by binding
936 `coding-system-for-read' and `coding-system-for-write'.
921 937
922 If the output is one line, it is displayed in the echo area, 938 If the output is one line, it is displayed in the echo area,
923 but it is nonetheless available in buffer `*Shell Command Output*' 939 but it is nonetheless available in buffer `*Shell Command Output*'
924 even though that buffer is not automatically displayed. 940 even though that buffer is not automatically displayed.
925 If there is no output, or if output is inserted in the current buffer, 941 If there is no output, or if output is inserted in the current buffer,
2666 (if (and enable-kinsoku enable-multibyte-characters) 2682 (if (and enable-kinsoku enable-multibyte-characters)
2667 (kinsoku (save-excursion 2683 (kinsoku (save-excursion
2668 (forward-line 0) (point)))) 2684 (forward-line 0) (point))))
2669 ;; Let fill-point be set to the place where we end up. 2685 ;; Let fill-point be set to the place where we end up.
2670 (point))))) 2686 (point)))))
2687
2671 ;; If that place is not the beginning of the line, 2688 ;; If that place is not the beginning of the line,
2672 ;; break the line there. 2689 ;; break the line there.
2673 (if (save-excursion 2690 (if (save-excursion
2674 (goto-char fill-point) 2691 (goto-char fill-point)
2675 (not (bolp))) 2692 (and (not (bolp))
2693 ;; Don't split right after a comment starter
2694 ;; since we would just make another comment starter.
2695 (not (and comment-start-skip
2696 (let ((limit (point)))
2697 (beginning-of-line)
2698 (and (re-search-forward comment-start-skip
2699 limit t)
2700 (eq (point) limit)))))))
2676 (let ((prev-column (current-column))) 2701 (let ((prev-column (current-column)))
2677 ;; If point is at the fill-point, do not `save-excursion'. 2702 ;; If point is at the fill-point, do not `save-excursion'.
2678 ;; Otherwise, if a comment prefix or fill-prefix is inserted, 2703 ;; Otherwise, if a comment prefix or fill-prefix is inserted,
2679 ;; point will end up before it rather than after it. 2704 ;; point will end up before it rather than after it.
2680 (if (save-excursion 2705 (if (save-excursion