aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKai Großjohann2002-02-15 08:53:15 +0000
committerKai Großjohann2002-02-15 08:53:15 +0000
commitcad113ae34fd336c0ea44dacf12c267cdb94d9ce (patch)
treedd65ff473805a1a75a4daa29ce0569317dea3f69 /lisp
parent66c8296f833ff25ec680feaaaf2ba57f429919de (diff)
downloademacs-cad113ae34fd336c0ea44dacf12c267cdb94d9ce.tar.gz
emacs-cad113ae34fd336c0ea44dacf12c267cdb94d9ce.zip
* lisp/simple.el (mark-word): Mark more if repeated.
* lisp/textmodes/paragraphs.el (mark-paragraph): Ditto. (mark-end-of-sentence): Ditto.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/emacs-lisp/lisp.el39
-rw-r--r--lisp/simple.el21
-rw-r--r--lisp/textmodes/paragraphs.el37
4 files changed, 72 insertions, 31 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2343d88cb71..a4ed23eef55 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12002-02-15 Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
2
3 * simple.el (mark-word): Mark more if repeated.
4 * textmodes/paragraphs.el (mark-paragraph): Ditto.
5 (mark-end-of-sentence): Ditto.
6
12002-02-15 Per Abrahamsen <abraham@dina.kvl.dk> 72002-02-15 Per Abrahamsen <abraham@dina.kvl.dk>
2 8
3 * wid-edit.el (widgetp): Made it more robust. 9 * wid-edit.el (widgetp): Made it more robust.
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index deab27f34e7..a815eddfd78 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -76,13 +76,18 @@ move to with the same argument.
76If this command is repeated, it marks the next ARG sexps after the ones 76If this command is repeated, it marks the next ARG sexps after the ones
77already marked." 77already marked."
78 (interactive "p") 78 (interactive "p")
79 (push-mark 79 (cond ((and (eq last-command this-command) (mark t))
80 (save-excursion 80 (set-mark
81 (if (and (eq last-command this-command) (mark t)) 81 (save-excursion
82 (goto-char (mark))) 82 (goto-char (mark))
83 (forward-sexp (or arg 1)) 83 (forward-sexp (or arg 1))
84 (point)) 84 (point))))
85 nil t)) 85 (t
86 (push-mark
87 (save-excursion
88 (forward-sexp (or arg 1))
89 (point))
90 nil t))))
86 91
87(defun forward-list (&optional arg) 92(defun forward-list (&optional arg)
88 "Move forward across one balanced group of parentheses. 93 "Move forward across one balanced group of parentheses.
@@ -250,13 +255,21 @@ is called as a function to find the defun's end."
250 255
251(defun mark-defun () 256(defun mark-defun ()
252 "Put mark at end of this defun, point at beginning. 257 "Put mark at end of this defun, point at beginning.
253The defun marked is the one that contains point or follows point." 258The defun marked is the one that contains point or follows point.
259If this command is repeated, marks more defuns after the ones
260already marked."
254 (interactive) 261 (interactive)
255 (push-mark (point)) 262 (let (here)
256 (end-of-defun) 263 (when (and (eq last-command this-command) (mark t))
257 (push-mark (point) nil t) 264 (setq here (point))
258 (beginning-of-defun) 265 (goto-char (mark)))
259 (re-search-backward "^\n" (- (point) 1) t)) 266 (push-mark (point))
267 (end-of-defun)
268 (push-mark (point) nil t)
269 (if here
270 (goto-char here)
271 (beginning-of-defun)
272 (re-search-backward "^\n" (- (point) 1) t))))
260 273
261(defun narrow-to-defun (&optional arg) 274(defun narrow-to-defun (&optional arg)
262 "Make text outside current defun invisible. 275 "Make text outside current defun invisible.
diff --git a/lisp/simple.el b/lisp/simple.el
index ff36a7c1873..6708af57a2c 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2812,13 +2812,22 @@ With argument, do this that many times."
2812 (forward-word (- arg))) 2812 (forward-word (- arg)))
2813 2813
2814(defun mark-word (arg) 2814(defun mark-word (arg)
2815 "Set mark arg words away from point." 2815 "Set mark arg words away from point.
2816If this command is repeated, it marks the next ARG words after the ones
2817already marked."
2816 (interactive "p") 2818 (interactive "p")
2817 (push-mark 2819 (cond ((and (eq last-command this-command) (mark t))
2818 (save-excursion 2820 (set-mark
2819 (forward-word arg) 2821 (save-excursion
2820 (point)) 2822 (goto-char (mark))
2821 nil t)) 2823 (forward-word arg)
2824 (point))))
2825 (t
2826 (push-mark
2827 (save-excursion
2828 (forward-word arg)
2829 (point))
2830 nil t))))
2822 2831
2823(defun kill-word (arg) 2832(defun kill-word (arg)
2824 "Kill characters forward until encountering the end of a word. 2833 "Kill characters forward until encountering the end of a word.
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index ed9a78696fd..91d9b1699f9 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -325,14 +325,23 @@ With argument ARG, puts mark at end of a following paragraph, so that
325the number of paragraphs marked equals ARG. 325the number of paragraphs marked equals ARG.
326 326
327If ARG is negative, point is put at end of this paragraph, mark is put 327If ARG is negative, point is put at end of this paragraph, mark is put
328at beginning of this or a previous paragraph." 328at beginning of this or a previous paragraph.
329
330If this command is repeated, it marks the next ARG paragraphs after (or
331before, if arg is negative) the ones already marked."
329 (interactive "p") 332 (interactive "p")
330 (unless arg (setq arg 1)) 333 (let (here)
331 (when (zerop arg) 334 (unless arg (setq arg 1))
332 (error "Cannot mark zero paragraphs")) 335 (when (zerop arg)
333 (forward-paragraph arg) 336 (error "Cannot mark zero paragraphs"))
334 (push-mark nil t t) 337 (when (and (eq last-command this-command) (mark t))
335 (backward-paragraph arg)) 338 (setq here (point))
339 (goto-char (mark)))
340 (forward-paragraph arg)
341 (push-mark nil t t)
342 (if here
343 (goto-char here)
344 (backward-paragraph arg))))
336 345
337(defun kill-paragraph (arg) 346(defun kill-paragraph (arg)
338 "Kill forward to end of paragraph. 347 "Kill forward to end of paragraph.
@@ -424,13 +433,17 @@ With arg, repeat, or kill forward to Nth end of sentence if negative arg -N."
424 (kill-region (point) (progn (backward-sentence arg) (point)))) 433 (kill-region (point) (progn (backward-sentence arg) (point))))
425 434
426(defun mark-end-of-sentence (arg) 435(defun mark-end-of-sentence (arg)
427 "Put mark at end of sentence. Arg works as in `forward-sentence'." 436 "Put mark at end of sentence. Arg works as in `forward-sentence'.
437If this command is repeated, it marks the next ARG sentences after the
438ones already marked."
428 (interactive "p") 439 (interactive "p")
429 (push-mark 440 (push-mark
430 (save-excursion 441 (save-excursion
431 (forward-sentence arg) 442 (if (and (eq last-command this-command) (mark t))
432 (point)) 443 (goto-char (mark)))
433 nil t)) 444 (forward-sentence arg)
445 (point))
446 nil t))
434 447
435(defun transpose-sentences (arg) 448(defun transpose-sentences (arg)
436 "Interchange this (next) and previous sentence." 449 "Interchange this (next) and previous sentence."