diff options
author | Jim Blandy <jimb@redhat.com> | 1992-05-10 18:15:10 +0000 |
---|---|---|
committer | Jim Blandy <jimb@redhat.com> | 1992-05-10 18:15:10 +0000 |
commit | bb3957de24087c0de67e2ee5961780331bb616b6 (patch) | |
tree | 10c58e8672735be4817a52b64537fb16212c8281 /lisp | |
parent | 9c8d27372ede4d8763584d5c6b1645aef6f6c08f (diff) | |
download | emacs-bb3957de24087c0de67e2ee5961780331bb616b6.tar.gz |
*** empty log message ***
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/comint.el | 34 | ||||
-rw-r--r-- | lisp/files.el | 4 | ||||
-rw-r--r-- | lisp/textmodes/fill.el | 32 |
3 files changed, 38 insertions, 32 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index ab52362b064..91d480e56fd 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -333,34 +333,16 @@ buffer. The hook comint-exec-hook is run after each exec." buffer)) ;;; This auxiliary function cranks up the process for comint-exec in -;;; the appropriate environment. It is twice as long as it should be -;;; because emacs has two distinct mechanisms for manipulating the -;;; process environment, selected at compile time with the -;;; MAINTAIN-ENVIRONMENT #define. In one case, process-environment -;;; is bound; in the other it isn't. +;;; the appropriate environment. (defun comint-exec-1 (name buffer command switches) - (if (boundp 'process-environment) ; Not a completely reliable test. - (let ((process-environment - (comint-update-env process-environment - (list (format "TERMCAP=emacs:co#%d:tc=unknown" - (screen-width)) - "TERM=emacs" - "EMACS=t")))) - (apply 'start-process name buffer command switches)) - - (let ((tcapv (getenv "TERMCAP")) - (termv (getenv "TERM")) - (emv (getenv "EMACS"))) - (unwind-protect - (progn (setenv "TERMCAP" (format "emacs:co#%d:tc=unknown" - (screen-width))) - (setenv "TERM" "emacs") - (setenv "EMACS" "t") - (apply 'start-process name buffer command switches)) - (setenv "TERMCAP" tcapv) - (setenv "TERM" termv) - (setenv "EMACS" emv))))) + (let ((process-environment + (comint-update-env process-environment + (list (format "TERMCAP=emacs:co#%d:tc=unknown" + (screen-width)) + "TERM=emacs" + "EMACS=t")))) + (apply 'start-process name buffer command switches))) diff --git a/lisp/files.el b/lisp/files.el index 2e81fd6fdb0..1827bf9e7a1 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1046,8 +1046,8 @@ Optional second argument EXITING means ask about certain non-file buffers (buffer-name buffer))))))) (function (lambda (buffer) - (set-buffer buffer) - (save-buffer))) + (set-buffer buffer) + (save-buffer))) (buffer-list) '("buffer" "buffers" "save"))) (message "(No files need saving)")))) diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index ad15fed9ee0..7ea751f9a37 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -1,5 +1,5 @@ ;; Fill commands for Emacs -;; Copyright (C) 1985, 1986 Free Software Foundation, Inc. +;; Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -18,6 +18,13 @@ ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +(defconst fill-individual-varying-indent nil + "*Controls criterion for a new paragraph in `fill-individual-paragraphs'. +Non-nil means changing indent doesn't end a paragraph. +That mode can handle paragraphs with extra indentation on the first line, +but it requires separator lines between paragraphs. +Nil means that any change in indentation starts a new paragraph.") + (defun set-fill-prefix () "Set the fill-prefix to the current line up to point. Filling expects lines to start with the fill prefix and @@ -219,7 +226,13 @@ Prefix arg (non-nil third arg, if called from program) means justify as well." (defun fill-individual-paragraphs (min max &optional justifyp mailp) "Fill each paragraph in region according to its individual fill prefix. -Calling from a program, pass range to fill as first two arguments. + +If `fill-individual-varying-indent' is non-nil, +then a mere change in indentation does not end a paragraph. In this mode, +the indentation for a paragraph is the minimum indentation of any line in it. + +When calling from a program, pass range to fill as first two arguments. + Optional third and fourth arguments JUSTIFY-FLAG and MAIL-FLAG: JUSTIFY-FLAG to justify paragraphs (prefix arg), MAIL-FLAG for a mail message, i. e. don't fill header lines." @@ -252,12 +265,23 @@ MAIL-FLAG for a mail message, i. e. don't fill header lines." (forward-line 1) ;; Now stop the loop if end of paragraph. (and (not (eobp)) + (if fill-individual-varying-indent + ;; If this line is a separator line, with or + ;; without prefix, end the paragraph. + (and (not (looking-at paragraph-separate)) (save-excursion (not (and (looking-at fill-prefix-regexp) (progn (forward-char (length fill-prefix)) - (looking-at paragraph-separate)))))))) + (looking-at paragraph-separate)))))) + ;; If this line has more or less indent + ;; than the fill prefix wants, end the paragraph. + (and (looking-at fill-prefix-regexp) + (save-excursion + (not (progn (forward-char (length fill-prefix)) + (or (looking-at paragraph-separate) + (looking-at paragraph-start)))))))))) ;; Fill this paragraph, but don't add a newline at the end. (let ((had-newline (bolp))) (fill-region-as-paragraph start (point) justifyp) - (or had-newline (delete-char -1))))))))
\ No newline at end of file + (or had-newline (delete-char -1)))))))) |