Mercurial > hg > xemacs-beta
annotate lisp/paragraphs.el @ 5328:dae3d95cf319
Merge.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 02 Jan 2011 02:32:59 +0000 |
parents | 7d06a8bf47d2 |
children | ed74d2ca7082 308d34e9f07d |
rev | line source |
---|---|
2549 | 1 ;;; paragraphs.el --- paragraph and sentence parsing |
428 | 2 |
2549 | 3 ;; Copyright (C) 1985, 86, 87, 91, 94, 95, 96, 1997, 1999, 2000, 2001 |
4 ;; Free Software Foundation, Inc. | |
428 | 5 |
6 ;; Maintainer: FSF | |
7 ;; Keywords: wp, dumped | |
8 | |
9 ;; This file is part of XEmacs. | |
10 | |
11 ;; XEmacs is free software; you can redistribute it and/or modify it | |
12 ;; under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; XEmacs is distributed in the hope that it will be useful, but | |
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
19 ;; General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free | |
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
24 ;; 02111-1307, USA. | |
25 | |
2549 | 26 ;;; Synched up with: FSF 21.3. |
428 | 27 |
28 ;;; Commentary: | |
29 | |
30 ;; This file is dumped with XEmacs. | |
31 | |
32 ;; This package provides the paragraph-oriented commands documented in the | |
33 ;; XEmacs Reference Manual. | |
34 | |
35 ;; 06/11/1997 - Use char-(after|before) instead of | |
36 ;; (following|preceding)-char. -slb | |
37 | |
38 ;;; Code: | |
39 | |
2549 | 40 (defgroup paragraphs nil |
41 "Paragraph and sentence parsing." | |
42 :group 'editing) | |
428 | 43 |
2549 | 44 (define-minor-mode use-hard-newlines |
428 | 45 "Minor mode to distinguish hard and soft newlines. |
46 When active, the functions `newline' and `open-line' add the | |
47 text-property `hard' to newlines that they insert, and a line is | |
48 only considered as a candidate to match `paragraph-start' or | |
49 `paragraph-separate' if it follows a hard newline. | |
50 | |
51 Prefix argument says to turn mode on if positive, off if negative. | |
52 When the mode is turned on, if there are newlines in the buffer but no hard | |
2549 | 53 newlines, ask the user whether to mark as hard any newlines preceeding a |
428 | 54 `paragraph-start' line. From a program, second arg INSERT specifies whether |
55 to do this; it can be `never' to change nothing, t or `always' to force | |
2549 | 56 marking, `guess' to try to do the right thing with no questions, nil |
428 | 57 or anything else to ask the user. |
58 | |
59 Newlines not marked hard are called \"soft\", and are always internal | |
60 to paragraphs. The fill functions insert and delete only soft newlines." | |
2549 | 61 :group 'paragraphs |
62 :extra-args (insert) | |
63 (when use-hard-newlines | |
428 | 64 ;; Turn mode on |
65 ;; Intuit hard newlines -- | |
66 ;; mark as hard any newlines preceding a paragraph-start line. | |
67 (if (or (eq insert t) (eq insert 'always) | |
68 (and (not (eq 'never insert)) | |
69 (not (text-property-any (point-min) (point-max) 'hard t)) | |
70 (save-excursion | |
71 (goto-char (point-min)) | |
72 (search-forward "\n" nil t)) | |
73 (or (eq insert 'guess) | |
74 (y-or-n-p "Make newlines between paragraphs hard? ")))) | |
75 (save-excursion | |
76 (goto-char (point-min)) | |
77 (while (search-forward "\n" nil t) | |
78 (let ((pos (point))) | |
79 (move-to-left-margin) | |
2549 | 80 (when (looking-at paragraph-start) |
81 (set-hard-newline-properties (1- pos) pos)) | |
82 ;; If paragraph-separate, newline after it is hard too. | |
83 (when (looking-at paragraph-separate) | |
84 (set-hard-newline-properties (1- pos) pos) | |
85 (end-of-line) | |
86 (unless (eobp) | |
87 (set-hard-newline-properties (point) (1+ (point))))))))))) | |
428 | 88 |
2549 | 89 (defcustom paragraph-start "\f\\|[ \t]*$" "\ |
428 | 90 *Regexp for beginning of a line that starts OR separates paragraphs. |
91 This regexp should match lines that separate paragraphs | |
92 and should also match lines that start a paragraph | |
93 \(and are part of that paragraph). | |
94 | |
95 This is matched against the text at the left margin, which is not necessarily | |
96 the beginning of the line, so it should never use \"^\" as an anchor. This | |
97 ensures that the paragraph functions will work equally well within a region | |
98 of text indented by a margin setting. | |
99 | |
100 The variable `paragraph-separate' specifies how to distinguish | |
101 lines that start paragraphs from lines that separate them. | |
102 | |
103 If the variable `use-hard-newlines' is non-nil, then only lines following a | |
2549 | 104 hard newline are considered to match." |
105 :group 'paragraphs | |
106 :type 'regexp) | |
428 | 107 |
108 ;; paragraph-start requires a hard newline, but paragraph-separate does not: | |
109 ;; It is assumed that paragraph-separate is distinctive enough to be believed | |
110 ;; whenever it occurs, while it is reasonable to set paragraph-start to | |
111 ;; something very minimal, even including "." (which makes every hard newline | |
112 ;; start a new paragraph). | |
113 | |
2549 | 114 (defcustom paragraph-separate "[ \t\f]*$" |
115 "*Regexp for beginning of a line that separates paragraphs. | |
450 | 116 If you change this, you may have to change `paragraph-start' also. |
117 | |
118 A line matching this is not part of any paragraph. | |
428 | 119 |
120 This is matched against the text at the left margin, which is not necessarily | |
121 the beginning of the line, so it should not use \"^\" as an anchor. This | |
122 ensures that the paragraph functions will work equally within a region of | |
2549 | 123 text indented by a margin setting." |
124 :group 'paragraphs | |
125 :type 'regexp) | |
126 | |
127 (defcustom sentence-end-double-space t | |
128 "*Non-nil means a single space does not end a sentence. | |
129 This is relevant for filling. See also `sentence-end-without-period' | |
130 and `colon-double-space'. | |
131 | |
132 This variable applies only to filling, not motion commands. To | |
133 change the behavior of motion commands, see `sentence-end'. | |
134 | |
135 If you change this, you should also change `sentence-end'. See Info | |
136 node `Sentences'." | |
137 :type 'boolean | |
138 :group 'fill) | |
428 | 139 |
2549 | 140 (defcustom sentence-end-without-period nil |
141 "*Non-nil means a sentence will end without a period. | |
142 For example, a sentence in Thai text ends with double space but | |
143 without a period." | |
144 :type 'boolean | |
145 :group 'fill) | |
146 | |
147 (defcustom sentence-end | |
5229
7d06a8bf47d2
Move #'purecopy from alloc.c to being an obsolete alias for #'identity
Aidan Kehoe <kehoea@parhasard.net>
parents:
4103
diff
changeset
|
148 ;; This is a bit stupid since it's not auto-updated when the |
7d06a8bf47d2
Move #'purecopy from alloc.c to being an obsolete alias for #'identity
Aidan Kehoe <kehoea@parhasard.net>
parents:
4103
diff
changeset
|
149 ;; other variables are changed, but it's still useful info. |
7d06a8bf47d2
Move #'purecopy from alloc.c to being an obsolete alias for #'identity
Aidan Kehoe <kehoea@parhasard.net>
parents:
4103
diff
changeset
|
150 (concat (if sentence-end-without-period "\\w \\|") |
7d06a8bf47d2
Move #'purecopy from alloc.c to being an obsolete alias for #'identity
Aidan Kehoe <kehoea@parhasard.net>
parents:
4103
diff
changeset
|
151 "[.?!" |
7d06a8bf47d2
Move #'purecopy from alloc.c to being an obsolete alias for #'identity
Aidan Kehoe <kehoea@parhasard.net>
parents:
4103
diff
changeset
|
152 (if (featurep 'mule) |
7d06a8bf47d2
Move #'purecopy from alloc.c to being an obsolete alias for #'identity
Aidan Kehoe <kehoea@parhasard.net>
parents:
4103
diff
changeset
|
153 (decode-coding-string "\033$B!#!%!)!*\033$A!##.#?#!\033$(0!$!%!)!*\033$(G!$!%!)!*\033(B" 'iso-2022-7bit) |
7d06a8bf47d2
Move #'purecopy from alloc.c to being an obsolete alias for #'identity
Aidan Kehoe <kehoea@parhasard.net>
parents:
4103
diff
changeset
|
154 "") |
7d06a8bf47d2
Move #'purecopy from alloc.c to being an obsolete alias for #'identity
Aidan Kehoe <kehoea@parhasard.net>
parents:
4103
diff
changeset
|
155 "][]\"')}]*" |
7d06a8bf47d2
Move #'purecopy from alloc.c to being an obsolete alias for #'identity
Aidan Kehoe <kehoea@parhasard.net>
parents:
4103
diff
changeset
|
156 (if sentence-end-double-space |
7d06a8bf47d2
Move #'purecopy from alloc.c to being an obsolete alias for #'identity
Aidan Kehoe <kehoea@parhasard.net>
parents:
4103
diff
changeset
|
157 "\\($\\| $\\|\t\\| \\)" "\\($\\|[\t ]\\)") |
7d06a8bf47d2
Move #'purecopy from alloc.c to being an obsolete alias for #'identity
Aidan Kehoe <kehoea@parhasard.net>
parents:
4103
diff
changeset
|
158 "[ \t\n]*") |
2549 | 159 "*Regexp describing the end of a sentence. |
160 The value includes the whitespace following the sentence. | |
428 | 161 All paragraph boundaries also end sentences, regardless. |
162 | |
2549 | 163 The default value specifies that in order to be recognized as the end |
164 of a sentence, the ending period, question mark, or exclamation point | |
165 must be followed by two spaces, unless it's inside some sort of quotes | |
166 or parenthesis. | |
167 | |
168 See also the variable `sentence-end-double-space', the variable | |
169 `sentence-end-without-period' and Info node `Sentences'." | |
170 :group 'paragraphs | |
171 :type 'regexp) | |
428 | 172 |
2549 | 173 (defcustom page-delimiter "^\014" |
174 "*Regexp describing line-beginnings that separate pages." | |
175 :group 'paragraphs | |
176 :type 'regexp) | |
428 | 177 |
2549 | 178 (defcustom paragraph-ignore-fill-prefix nil |
179 "*Non-nil means the paragraph commands are not affected by `fill-prefix'. | |
180 This is desirable in modes where blank lines are the paragraph delimiters." | |
181 :group 'paragraphs | |
182 :type 'boolean) | |
428 | 183 |
184 (defun forward-paragraph (&optional arg) | |
185 "Move forward to end of paragraph. | |
2549 | 186 With argument ARG, do it ARG times; |
187 a negative argument ARG = -N means move backward N paragraphs. | |
428 | 188 |
189 A line which `paragraph-start' matches either separates paragraphs | |
190 \(if `paragraph-separate' matches it also) or is the first line of a paragraph. | |
191 A paragraph end is the beginning of a line which is not part of the paragraph | |
2549 | 192 to which the end of the previous line belongs, or the end of the buffer. |
193 Returns the count of paragraphs left to move." | |
428 | 194 (interactive "_p") ; XEmacs |
195 (or arg (setq arg 1)) | |
2549 | 196 (let* ((opoint (point)) |
197 (fill-prefix-regexp | |
428 | 198 (and fill-prefix (not (equal fill-prefix "")) |
199 (not paragraph-ignore-fill-prefix) | |
200 (regexp-quote fill-prefix))) | |
201 ;; Remove ^ from paragraph-start and paragraph-sep if they are there. | |
202 ;; These regexps shouldn't be anchored, because we look for them | |
203 ;; starting at the left-margin. This allows paragraph commands to | |
204 ;; work normally with indented text. | |
205 ;; This hack will not find problem cases like "whatever\\|^something". | |
2549 | 206 (parstart (if (and (not (equal "" paragraph-start)) |
207 (equal ?^ (aref paragraph-start 0))) | |
208 (substring paragraph-start 1) | |
209 paragraph-start)) | |
210 (parsep (if (and (not (equal "" paragraph-separate)) | |
211 (equal ?^ (aref paragraph-separate 0))) | |
212 (substring paragraph-separate 1) | |
213 paragraph-separate)) | |
214 (parsep | |
428 | 215 (if fill-prefix-regexp |
2549 | 216 (concat parsep "\\|" |
428 | 217 fill-prefix-regexp "[ \t]*$") |
2549 | 218 parsep)) |
428 | 219 ;; This is used for searching. |
2549 | 220 (sp-parstart (concat "^[ \t]*\\(?:" parstart "\\|" parsep "\\)")) |
221 start found-start) | |
428 | 222 (while (and (< arg 0) (not (bobp))) |
2549 | 223 (if (and (not (looking-at parsep)) |
428 | 224 (re-search-backward "^\n" (max (1- (point)) (point-min)) t) |
2549 | 225 (looking-at parsep)) |
226 (setq arg (1+ arg)) | |
428 | 227 (setq start (point)) |
228 ;; Move back over paragraph-separating lines. | |
446 | 229 (backward-char 1) (beginning-of-line) |
428 | 230 (while (and (not (bobp)) |
231 (progn (move-to-left-margin) | |
2549 | 232 (looking-at parsep))) |
233 (forward-line -1)) | |
428 | 234 (if (bobp) |
235 nil | |
2549 | 236 (setq arg (1+ arg)) |
428 | 237 ;; Go to end of the previous (non-separating) line. |
238 (end-of-line) | |
239 ;; Search back for line that starts or separates paragraphs. | |
240 (if (if fill-prefix-regexp | |
2549 | 241 ;; There is a fill prefix; it overrides parstart. |
4103 | 242 (let nil ; (multiple-lines) |
428 | 243 (while (and (progn (beginning-of-line) (not (bobp))) |
244 (progn (move-to-left-margin) | |
2549 | 245 (not (looking-at parsep))) |
428 | 246 (looking-at fill-prefix-regexp)) |
4103 | 247 ; (unless (= (point) start) |
248 ; (setq multiple-lines t)) | |
428 | 249 (forward-line -1)) |
250 (move-to-left-margin) | |
2549 | 251 ;; This deleted code caused a long hanging-indent line |
252 ;; not to be filled together with the following lines. | |
253 ;; ;; Don't move back over a line before the paragraph | |
254 ;; ;; which doesn't start with fill-prefix | |
255 ;; ;; unless that is the only line we've moved over. | |
256 ;; (and (not (looking-at fill-prefix-regexp)) | |
257 ;; multiple-lines | |
258 ;; (forward-line 1)) | |
428 | 259 (not (bobp))) |
2549 | 260 (while (and (re-search-backward sp-parstart nil 1) |
261 (setq found-start t) | |
428 | 262 ;; Found a candidate, but need to check if it is a |
2549 | 263 ;; REAL parstart. |
428 | 264 (progn (setq start (point)) |
265 (move-to-left-margin) | |
2549 | 266 (not (looking-at parsep))) |
267 (not (and (looking-at parstart) | |
268 (or (not use-hard-newlines) | |
269 (get-text-property (1- start) 'hard) | |
270 (bobp))))) | |
271 (setq found-start nil) | |
428 | 272 (goto-char start)) |
2549 | 273 found-start) |
428 | 274 ;; Found one. |
275 (progn | |
276 ;; Move forward over paragraph separators. | |
277 ;; We know this cannot reach the place we started | |
278 ;; because we know we moved back over a non-separator. | |
279 (while (and (not (eobp)) | |
280 (progn (move-to-left-margin) | |
2549 | 281 (looking-at parsep))) |
428 | 282 (forward-line 1)) |
283 ;; If line before paragraph is just margin, back up to there. | |
284 (end-of-line 0) | |
285 (if (> (current-column) (current-left-margin)) | |
286 (forward-char 1) | |
287 (skip-chars-backward " \t") | |
288 (if (not (bolp)) | |
289 (forward-line 1)))) | |
290 ;; No starter or separator line => use buffer beg. | |
2549 | 291 (goto-char (point-min)))))) |
292 | |
428 | 293 (while (and (> arg 0) (not (eobp))) |
2549 | 294 ;; Move forward over separator lines... |
295 (while (and (not (eobp)) | |
296 (progn (move-to-left-margin) (not (eobp))) | |
297 (looking-at parsep)) | |
298 (forward-line 1)) | |
299 (unless (eobp) (setq arg (1- arg))) | |
300 ;; ... and one more line. | |
301 (forward-line 1) | |
428 | 302 (if fill-prefix-regexp |
2549 | 303 ;; There is a fill prefix; it overrides parstart. |
428 | 304 (while (and (not (eobp)) |
305 (progn (move-to-left-margin) (not (eobp))) | |
2549 | 306 (not (looking-at parsep)) |
428 | 307 (looking-at fill-prefix-regexp)) |
308 (forward-line 1)) | |
2549 | 309 (while (and (re-search-forward sp-parstart nil 1) |
428 | 310 (progn (setq start (match-beginning 0)) |
311 (goto-char start) | |
312 (not (eobp))) | |
313 (progn (move-to-left-margin) | |
2549 | 314 (not (looking-at parsep))) |
315 (or (not (looking-at parstart)) | |
428 | 316 (and use-hard-newlines |
317 (not (get-text-property (1- start) 'hard))))) | |
318 (forward-char 1)) | |
319 (if (< (point) (point-max)) | |
2549 | 320 (goto-char start)))) |
4103 | 321 (if-fboundp #'constrain-to-field |
322 (constrain-to-field nil opoint t) | |
323 (error | |
324 'void-function | |
325 "constrain-to-field not available; is xemacs-base installed?")) | |
2549 | 326 ;; Return the number of steps that could not be done. |
327 arg)) | |
428 | 328 |
329 (defun backward-paragraph (&optional arg) | |
330 "Move backward to start of paragraph. | |
2549 | 331 With argument ARG, do it ARG times; |
332 a negative argument ARG = -N means move forward N paragraphs. | |
428 | 333 |
334 A paragraph start is the beginning of a line which is a | |
335 `first-line-of-paragraph' or which is ordinary text and follows a | |
336 paragraph-separating line; except: if the first real line of a | |
337 paragraph is preceded by a blank line, the paragraph starts at that | |
338 blank line. | |
339 | |
340 See `forward-paragraph' for more information." | |
341 (interactive "_p") ; XEmacs | |
342 (or arg (setq arg 1)) | |
343 (forward-paragraph (- arg))) | |
344 | |
687 | 345 (defun mark-paragraph (&optional arg) |
428 | 346 "Put point at beginning of this paragraph, mark at end. |
687 | 347 The paragraph marked is the one that contains point or follows point. |
2549 | 348 |
349 With argument ARG, puts mark at end of a following paragraph, so that | |
350 the number of paragraphs marked equals ARG. | |
351 | |
352 If ARG is negative, point is put at end of this paragraph, mark is put | |
353 at beginning of this or a previous paragraph. | |
354 | |
355 If this command is repeated, it marks the next ARG paragraphs after (or | |
356 before, if arg is negative) the ones already marked." | |
687 | 357 (interactive "p") |
358 (unless arg (setq arg 1)) | |
359 (when (zerop arg) | |
360 (error "Cannot mark zero paragraphs")) | |
2549 | 361 (cond ((and (eq last-command this-command) (mark t)) |
362 (set-mark | |
363 (save-excursion | |
364 (goto-char (mark)) | |
365 (forward-paragraph arg) | |
366 (point)))) | |
367 (t | |
368 (forward-paragraph arg) | |
369 (push-mark nil t t) | |
370 (backward-paragraph arg)))) | |
428 | 371 |
372 (defun kill-paragraph (arg) | |
373 "Kill forward to end of paragraph. | |
374 With arg N, kill forward to Nth end of paragraph; | |
375 negative arg -N means kill backward to Nth start of paragraph." | |
376 (interactive "*p") ; XEmacs | |
377 (kill-region (point) (progn (forward-paragraph arg) (point)))) | |
378 | |
379 (defun backward-kill-paragraph (arg) | |
380 "Kill back to start of paragraph. | |
381 With arg N, kill back to Nth start of paragraph; | |
382 negative arg -N means kill forward to Nth end of paragraph." | |
383 (interactive "*p") ; XEmacs | |
384 (kill-region (point) (progn (backward-paragraph arg) (point)))) | |
385 | |
386 (defun transpose-paragraphs (arg) | |
387 "Interchange this (or next) paragraph with previous one." | |
388 (interactive "*p") | |
389 (transpose-subr 'forward-paragraph arg)) | |
390 | |
391 (defun start-of-paragraph-text () | |
392 (let ((opoint (point)) npoint) | |
393 (forward-paragraph -1) | |
394 (setq npoint (point)) | |
395 (skip-chars-forward " \t\n") | |
396 ;; If the range of blank lines found spans the original start point, | |
397 ;; try again from the beginning of it. | |
398 ;; Must be careful to avoid infinite loop | |
399 ;; when following a single return at start of buffer. | |
400 (if (and (>= (point) opoint) (< npoint opoint)) | |
401 (progn | |
402 (goto-char npoint) | |
403 (if (> npoint (point-min)) | |
404 (start-of-paragraph-text)))))) | |
405 | |
406 (defun end-of-paragraph-text () | |
407 (let ((opoint (point))) | |
408 (forward-paragraph 1) | |
446 | 409 (if (eq (char-before (point)) ?\n) (backward-char 1)) |
428 | 410 (if (<= (point) opoint) |
411 (progn | |
412 (forward-char 1) | |
413 (if (< (point) (point-max)) | |
414 (end-of-paragraph-text)))))) | |
415 | |
416 (defun forward-sentence (&optional arg) | |
417 "Move forward to next `sentence-end'. With argument, repeat. | |
418 With negative argument, move backward repeatedly to `sentence-beginning'. | |
419 | |
420 The variable `sentence-end' is a regular expression that matches ends of | |
450 | 421 sentences. A paragraph boundary also terminates a sentence." |
428 | 422 (interactive "_p") ; XEmacs |
423 (or arg (setq arg 1)) | |
2549 | 424 (let ((opoint (point))) |
425 (while (< arg 0) | |
426 (let ((pos (point)) | |
427 (par-beg (save-excursion (start-of-paragraph-text) (point)))) | |
428 (if (and (re-search-backward sentence-end par-beg t) | |
429 (or (< (match-end 0) pos) | |
430 (re-search-backward sentence-end par-beg t))) | |
431 (goto-char (match-end 0)) | |
432 (goto-char par-beg))) | |
433 (setq arg (1+ arg))) | |
434 (while (> arg 0) | |
435 (let ((par-end (save-excursion (end-of-paragraph-text) (point)))) | |
436 (if (re-search-forward sentence-end par-end t) | |
437 (skip-chars-backward " \t\n") | |
438 (goto-char par-end))) | |
439 (setq arg (1- arg))) | |
4103 | 440 (if-fboundp #'constrain-to-field |
441 (constrain-to-field nil opoint t) | |
442 (error | |
443 'void-function | |
444 "constrain-to-field not available; is xemacs-base installed?")))) | |
428 | 445 |
446 (defun backward-sentence (&optional arg) | |
447 "Move backward to start of sentence. With arg, do it arg times. | |
448 See `forward-sentence' for more information." | |
449 (interactive "_p") ; XEmacs | |
450 (or arg (setq arg 1)) | |
451 (forward-sentence (- arg))) | |
452 | |
453 (defun kill-sentence (&optional arg) | |
454 "Kill from point to end of sentence. | |
455 With arg, repeat; negative arg -N means kill back to Nth start of sentence." | |
456 (interactive "*p") ; XEmacs | |
457 (kill-region (point) (progn (forward-sentence arg) (point)))) | |
458 | |
459 (defun backward-kill-sentence (&optional arg) | |
460 "Kill back from point to start of sentence. | |
461 With arg, repeat, or kill forward to Nth end of sentence if negative arg -N." | |
462 (interactive "*p") ; XEmacs | |
463 (kill-region (point) (progn (backward-sentence arg) (point)))) | |
464 | |
465 (defun mark-end-of-sentence (arg) | |
2549 | 466 "Put mark at end of sentence. Arg works as in `forward-sentence'. |
467 If this command is repeated, it marks the next ARG sentences after the | |
468 ones already marked." | |
428 | 469 (interactive "p") |
470 ;; FSF Version: | |
2549 | 471 ; (push-mark |
472 ; (save-excursion | |
473 ; (if (and (eq last-command this-command) (mark t)) | |
474 ; (goto-char (mark))) | |
475 ; (forward-sentence arg) | |
476 ; (point)) | |
477 ; nil t)) | |
428 | 478 (mark-something 'mark-end-of-sentence 'forward-sentence arg)) |
479 | |
480 (defun mark-end-of-line (arg) | |
481 "Put mark at end of line. Arg works as in `end-of-line'." | |
482 (interactive "p") | |
483 (mark-something 'mark-end-of-line 'end-of-line arg)) | |
484 | |
485 (defun transpose-sentences (arg) | |
486 "Interchange this (next) and previous sentence." | |
487 (interactive "*p") | |
488 (transpose-subr 'forward-sentence arg)) | |
489 | |
2549 | 490 ;;; Local Variables: |
491 ;;; coding: iso-2022-7bit | |
492 ;;; End: | |
493 | |
428 | 494 ;;; paragraphs.el ends here |