aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-11-10 17:33:26 +0000
committerRichard M. Stallman1995-11-10 17:33:26 +0000
commit2b03c5067cfe1b45fe62b56af10c97596bbe3322 (patch)
tree23ab61fc944b4134045cb2d833c91eead4d027c8
parentc7e878709b712e11758963da5453b2eb6ecaf18b (diff)
downloademacs-2b03c5067cfe1b45fe62b56af10c97596bbe3322.tar.gz
emacs-2b03c5067cfe1b45fe62b56af10c97596bbe3322.zip
(do-auto-fill): Use fill-context-prefix.
(shell-command-on-region): Use region-beginning and region-end, to put them in the command history. (do-auto-fill): When choosing fill-prefix, don't include the left-margin indentation.
-rw-r--r--lisp/simple.el25
1 files changed, 7 insertions, 18 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index d15b902c0c8..51af9d364fe 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -857,7 +857,9 @@ In either case, the output is inserted after point (leaving mark after it)."
857 (read-from-minibuffer "Shell command on region: " 857 (read-from-minibuffer "Shell command on region: "
858 nil nil nil 858 nil nil nil
859 'shell-command-history))) 859 'shell-command-history)))
860 (list (point) (mark) 860 ;; call-interactively recognizes region-beginning and
861 ;; region-end specially, leaving them in the history.
862 (list (region-beginning) (region-end)
861 string 863 string
862 current-prefix-arg 864 current-prefix-arg
863 current-prefix-arg))) 865 current-prefix-arg)))
@@ -2328,23 +2330,10 @@ Setting this variable automatically makes it local to the current buffer.")
2328 ;; Choose a fill-prefix automatically. 2330 ;; Choose a fill-prefix automatically.
2329 (if (and adaptive-fill-mode 2331 (if (and adaptive-fill-mode
2330 (or (null fill-prefix) (string= fill-prefix ""))) 2332 (or (null fill-prefix) (string= fill-prefix "")))
2331 (let (start end temp) 2333 (setq fill-prefix
2332 (save-excursion 2334 (fill-context-prefix
2333 (end-of-line) 2335 (save-excursion (backward-paragraph 1) (point))
2334 (setq end (point)) 2336 (point))))
2335 (beginning-of-line)
2336 (setq start (point))
2337 (move-to-left-margin)
2338 ;; Don't do it if this line is a paragraph-starter line
2339 ;; because then the next line will probably also become one.
2340 ;; In text mode, when the user indents the first line of a
2341 ;; paragraph, we don't want all the lines to be indented.
2342 (if (not (looking-at paragraph-start))
2343 (cond ((re-search-forward adaptive-fill-regexp end t)
2344 (setq fill-prefix
2345 (buffer-substring-no-properties start (point))))
2346 ((setq temp (funcall adaptive-fill-function))
2347 (setq fill-prefix temp)))))))
2348 2337
2349 (while (and (not give-up) (> (current-column) fc)) 2338 (while (and (not give-up) (> (current-column) fc))
2350 ;; Determine where to split the line. 2339 ;; Determine where to split the line.