aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1992-07-29 02:15:26 +0000
committerRichard M. Stallman1992-07-29 02:15:26 +0000
commitccc58657717691eeee4ddef1441b4626be04a9fe (patch)
tree97a4609a407ad71013f39857d236550294b29c78
parent907482b94c0af96835e47633ac68e452058186a4 (diff)
downloademacs-ccc58657717691eeee4ddef1441b4626be04a9fe.tar.gz
emacs-ccc58657717691eeee4ddef1441b4626be04a9fe.zip
*** empty log message ***
-rw-r--r--lisp/simple.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 2da71888eda..6609ba49c76 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -56,6 +56,7 @@ You may also type up to 3 octal digits, to insert a character with that code"
56 56
57(defun delete-indentation (&optional arg) 57(defun delete-indentation (&optional arg)
58 "Join this line to previous and fix up whitespace at join. 58 "Join this line to previous and fix up whitespace at join.
59If there is a fill prefix, delete it from the beginning of this line.
59With argument, join this line to following line." 60With argument, join this line to following line."
60 (interactive "*P") 61 (interactive "*P")
61 (beginning-of-line) 62 (beginning-of-line)
@@ -63,6 +64,13 @@ With argument, join this line to following line."
63 (if (eq (preceding-char) ?\n) 64 (if (eq (preceding-char) ?\n)
64 (progn 65 (progn
65 (delete-region (point) (1- (point))) 66 (delete-region (point) (1- (point)))
67 ;; If the second line started with the fill prefix,
68 ;; delete the prefix.
69 (if (and fill-prefix
70 (string= fill-prefix
71 (buffer-substring (point)
72 (+ (point) (length fill-prefix)))))
73 (delete-region (point) (+ (point) (length fill-prefix))))
66 (fixup-whitespace)))) 74 (fixup-whitespace))))
67 75
68(defun fixup-whitespace () 76(defun fixup-whitespace ()
@@ -422,14 +430,15 @@ to get different commands to edit and resubmit."
422(defun previous-matching-history-element (regexp n) 430(defun previous-matching-history-element (regexp n)
423 (interactive "sPrevious element matching (regexp): \np") 431 (interactive "sPrevious element matching (regexp): \np")
424 (let ((history (symbol-value minibuffer-history-variable)) 432 (let ((history (symbol-value minibuffer-history-variable))
433 prevpos
425 (pos minibuffer-history-position)) 434 (pos minibuffer-history-position))
426 (while (/= n 0) 435 (while (/= n 0)
427 (setq prevpos pos) 436 (setq prevpos pos)
428 (setq pos (min (max 1 (+ pos (if (< n 0) -1 1))) (length history))) 437 (setq pos (min (max 1 (+ pos (if (< n 0) -1 1))) (length history)))
429 (if (= pos prevpos) 438 (if (= pos prevpos)
430 (error (if (= pos 1) 439 (error (if (= pos 1)
431 "No following item in minibuffer history" 440 "No later matching history item"
432 "No preceding item in minibuffer history"))) 441 "No earlier matching history item")))
433 (if (string-match regexp 442 (if (string-match regexp
434 (if minibuffer-history-sexp-flag 443 (if minibuffer-history-sexp-flag
435 (prin1-to-string (nth (1- pos) history)) 444 (prin1-to-string (nth (1- pos) history))
@@ -455,8 +464,8 @@ to get different commands to edit and resubmit."
455 (length (symbol-value minibuffer-history-variable))))) 464 (length (symbol-value minibuffer-history-variable)))))
456 (if (= minibuffer-history-position narg) 465 (if (= minibuffer-history-position narg)
457 (error (if (= minibuffer-history-position 1) 466 (error (if (= minibuffer-history-position 1)
458 "No following item in minibuffer history" 467 "End of history; no next item"
459 "No preceding item in minibuffer history")) 468 "Beginning of history; no preceding item"))
460 (erase-buffer) 469 (erase-buffer)
461 (setq minibuffer-history-position narg) 470 (setq minibuffer-history-position narg)
462 (let ((elt (nth (1- minibuffer-history-position) 471 (let ((elt (nth (1- minibuffer-history-position)