aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-10-06 19:50:40 +0000
committerDave Love2000-10-06 19:50:40 +0000
commit742c182294f78cd38edf29b44150525a2e235fcc (patch)
tree9ca60e57bc1b220ee8cd9f220960247501c26b3c
parentb57a0405e1777fb028453fec1b9a573b3e7f36bd (diff)
downloademacs-742c182294f78cd38edf29b44150525a2e235fcc.tar.gz
emacs-742c182294f78cd38edf29b44150525a2e235fcc.zip
(sentence-end-double-space)
(sentence-end-without-period): Doc fix. (adaptive-fill-regexp): Purecopy. (unjustify-current-line): Use line-end-position. (fill-individual-paragraphs-prefix): Use line-beginning-position.
-rw-r--r--lisp/ChangeLog20
-rw-r--r--lisp/textmodes/fill.el78
2 files changed, 66 insertions, 32 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 762dae385b5..bce13665692 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,27 @@
12000-10-06 Dave Love <fx@gnu.org> 12000-10-06 Dave Love <fx@gnu.org>
2 2
3 * textmodes/fill.el (sentence-end-double-space)
4 (sentence-end-without-period): Doc fix.
5 (adaptive-fill-regexp): Purecopy.
6 (unjustify-current-line): Use line-end-position.
7 (fill-individual-paragraphs-prefix): Use line-beginning-position.
8
9 * net/eudc-vars.el (eudc): Add :version, :link.
10
11 * international/mule-conf.el (file-coding-system-alist): Use \',
12 not $.
13
14 * emacs-lisp/find-func.el (find-function-regexp): Remove spurion.
15 Fix for define-minor-mode.
16 (function-at-point): Alias to function-called-at-point.
17
18 * custom.el (custom-declare-variable, custom-set-variables): Use mapc.
19
20 * simple.el (backward-word): Doc fix.
21
3 * image-file.el (image-file-name-regexp): image-file-regexps -> 22 * image-file.el (image-file-name-regexp): image-file-regexps ->
4 image-file-name-regexps. 23 image-file-name-regexps.
24 (image-file-name-extensions): Add pbm.
5 25
62000-10-06 Gerd Moellmann <gerd@gnu.org> 262000-10-06 Gerd Moellmann <gerd@gnu.org>
7 27
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 9e5df39fcb0..d7a627c19f3 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -39,9 +39,11 @@ A value of nil means that any change in indentation starts a new paragraph."
39 39
40(defcustom sentence-end-double-space t 40(defcustom sentence-end-double-space t
41 "*Non-nil means a single space does not end a sentence. 41 "*Non-nil means a single space does not end a sentence.
42This is relevant for filling. See also `sentence-end-without-period'
43and `colon-double-space'.
42 44
43If you change this, you should also change `sentence-end'. 45If you change this, you should also change `sentence-end'. See Info
44See Info node `Sentences'." 46node `Sentences'."
45 :type 'boolean 47 :type 'boolean
46 :group 'fill) 48 :group 'fill)
47 49
@@ -51,8 +53,9 @@ See Info node `Sentences'."
51 :group 'fill) 53 :group 'fill)
52 54
53(defcustom sentence-end-without-period nil 55(defcustom sentence-end-without-period nil
54 "*Non-nil means a sentence will end without period. 56 "*Non-nil means a sentence will end without a period.
55For example, Thai text ends with double space but without period." 57For example, a sentence in Thai text ends with double space but
58without a period."
56 :type 'boolean 59 :type 'boolean
57 :group 'fill) 60 :group 'fill)
58 61
@@ -85,7 +88,8 @@ reinserts the fill prefix in each resulting line."
85 :type 'boolean 88 :type 'boolean
86 :group 'fill) 89 :group 'fill)
87 90
88(defcustom adaptive-fill-regexp "[ \t]*\\([-|#;>*]+ *\\|(?[0-9]+[.)] *\\)*" 91(defcustom adaptive-fill-regexp
92 (purecopy "[ \t]*\\([-|#;>*]+ *\\|(?[0-9]+[.)] *\\)*")
89 "*Regexp to match text at start of line that constitutes indentation. 93 "*Regexp to match text at start of line that constitutes indentation.
90If Adaptive Fill mode is enabled, a prefix matching this pattern 94If Adaptive Fill mode is enabled, a prefix matching this pattern
91on the first and second lines of a paragraph is used as the 95on the first and second lines of a paragraph is used as the
@@ -130,7 +134,8 @@ number equals or exceeds the local fill-column - right-margin difference."
130 (here-col 0) 134 (here-col 0)
131 (eol (progn (end-of-line) (point))) 135 (eol (progn (end-of-line) (point)))
132 margin fill-col change col) 136 margin fill-col change col)
133 ;; Look separately at each region of line with a different right-margin. 137 ;; Look separately at each region of line with a different
138 ;; right-margin.
134 (while (and (setq margin (get-text-property here 'right-margin) 139 (while (and (setq margin (get-text-property here 'right-margin)
135 fill-col (- fill-column (or margin 0)) 140 fill-col (- fill-column (or margin 0))
136 change (text-property-not-all 141 change (text-property-not-all
@@ -227,9 +232,11 @@ act as a paragraph-separator."
227 (setq start (point)) 232 (setq start (point))
228 (setq second-line-prefix 233 (setq second-line-prefix
229 (cond ((looking-at paragraph-start) nil) 234 (cond ((looking-at paragraph-start) nil)
230 ((and adaptive-fill-regexp (looking-at adaptive-fill-regexp)) 235 ((and adaptive-fill-regexp
236 (looking-at adaptive-fill-regexp))
231 (buffer-substring-no-properties start (match-end 0))) 237 (buffer-substring-no-properties start (match-end 0)))
232 (adaptive-fill-function (funcall adaptive-fill-function))))) 238 (adaptive-fill-function
239 (funcall adaptive-fill-function)))))
233 (if at-second 240 (if at-second
234 ;; If we get a fill prefix from the second line, 241 ;; If we get a fill prefix from the second line,
235 ;; make sure it or something compatible is on the first line too. 242 ;; make sure it or something compatible is on the first line too.
@@ -539,9 +546,10 @@ space does not end a sentence, so don't break a line there."
539 (or first 546 (or first
540 (and (not (bobp)) 547 (and (not (bobp))
541 sentence-end-double-space 548 sentence-end-double-space
542 (save-excursion (forward-char -1) 549 (save-excursion
543 (and (looking-at "\\. ") 550 (forward-char -1)
544 (not (looking-at "\\. "))))) 551 (and (looking-at "\\. ")
552 (not (looking-at "\\. ")))))
545 (and fill-nobreak-predicate 553 (and fill-nobreak-predicate
546 (funcall fill-nobreak-predicate)))) 554 (funcall fill-nobreak-predicate))))
547 ;; Find a breakable point while ignoring the 555 ;; Find a breakable point while ignoring the
@@ -556,7 +564,8 @@ space does not end a sentence, so don't break a line there."
556 (forward-char -1) 564 (forward-char -1)
557 (goto-char pos)))) 565 (goto-char pos))))
558 (setq first nil))) 566 (setq first nil)))
559 ;; Normally, move back over the single space between the words. 567 ;; Normally, move back over the single space between
568 ;; the words.
560 (if (= (preceding-char) ?\ ) (forward-char -1)) 569 (if (= (preceding-char) ?\ ) (forward-char -1))
561 570
562 (if enable-multibyte-characters 571 (if enable-multibyte-characters
@@ -585,8 +594,10 @@ space does not end a sentence, so don't break a line there."
585 (or (< nchars 0) 594 (or (< nchars 0)
586 (and fill-prefix 595 (and fill-prefix
587 (< nchars (length fill-prefix)) 596 (< nchars (length fill-prefix))
588 (string= (buffer-substring (point) fill-point) 597 (string= (buffer-substring (point)
589 (substring fill-prefix 0 nchars))))))) 598 fill-point)
599 (substring fill-prefix
600 0 nchars)))))))
590 ;; Ok, skip at least one word. But 601 ;; Ok, skip at least one word. But
591 ;; don't stop at a period followed by just one space. 602 ;; don't stop at a period followed by just one space.
592 (let ((first t)) 603 (let ((first t))
@@ -594,9 +605,10 @@ space does not end a sentence, so don't break a line there."
594 (or first 605 (or first
595 (and (not (bobp)) 606 (and (not (bobp))
596 sentence-end-double-space 607 sentence-end-double-space
597 (save-excursion (forward-char -1) 608 (save-excursion
598 (and (looking-at "\\. ") 609 (forward-char -1)
599 (not (looking-at "\\. "))))) 610 (and (looking-at "\\. ")
611 (not (looking-at "\\. ")))))
600 (and fill-nobreak-predicate 612 (and fill-nobreak-predicate
601 (funcall fill-nobreak-predicate)))) 613 (funcall fill-nobreak-predicate))))
602 ;; Find a breakable point while ignoring the 614 ;; Find a breakable point while ignoring the
@@ -614,8 +626,8 @@ space does not end a sentence, so don't break a line there."
614 ;; Check again to see if we got to the end of the paragraph. 626 ;; Check again to see if we got to the end of the paragraph.
615 (if (save-excursion (skip-chars-forward " \t") (eobp)) 627 (if (save-excursion (skip-chars-forward " \t") (eobp))
616 (or nosqueeze (delete-horizontal-space)) 628 (or nosqueeze (delete-horizontal-space))
617 ;; Replace whitespace here with one newline, then indent to left 629 ;; Replace whitespace here with one newline, then
618 ;; margin. 630 ;; indent to left margin.
619 (skip-chars-backward " \t") 631 (skip-chars-backward " \t")
620 (if (and (= (following-char) ?\ ) 632 (if (and (= (following-char) ?\ )
621 (or (aref (char-category-set (preceding-char)) ?|) 633 (or (aref (char-category-set (preceding-char)) ?|)
@@ -677,8 +689,8 @@ argument to it), and if it returns non-nil, we simply return its value."
677 (beg (progn (backward-paragraph) (point)))) 689 (beg (progn (backward-paragraph) (point))))
678 (goto-char before) 690 (goto-char before)
679 (if use-hard-newlines 691 (if use-hard-newlines
680 ;; Can't use fill-region-as-paragraph, since this paragraph may 692 ;; Can't use fill-region-as-paragraph, since this paragraph
681 ;; still contain hard newlines. See fill-region. 693 ;; may still contain hard newlines. See fill-region.
682 (fill-region beg end arg) 694 (fill-region beg end arg)
683 (fill-region-as-paragraph beg end arg))))))) 695 (fill-region-as-paragraph beg end arg)))))))
684 696
@@ -1012,8 +1024,7 @@ extra spaces between words. It does nothing in other justification modes."
1012 ((eq nil justify) nil) 1024 ((eq nil justify) nil)
1013 ((eq 'full justify) ; full justify: remove extra spaces 1025 ((eq 'full justify) ; full justify: remove extra spaces
1014 (beginning-of-line-text) 1026 (beginning-of-line-text)
1015 (canonically-space-region 1027 (canonically-space-region (point) (line-end-position)))
1016 (point) (save-excursion (end-of-line) (point))))
1017 ((memq justify '(center right)) 1028 ((memq justify '(center right))
1018 (save-excursion 1029 (save-excursion
1019 (move-to-left-margin nil t) 1030 (move-to-left-margin nil t)
@@ -1126,7 +1137,8 @@ Also, if CITATION-REGEXP is non-nil, don't fill header lines."
1126 (if (not (and fill-prefix 1137 (if (not (and fill-prefix
1127 (looking-at fill-prefix-regexp))) 1138 (looking-at fill-prefix-regexp)))
1128 (setq fill-prefix 1139 (setq fill-prefix
1129 (fill-individual-paragraphs-prefix citation-regexp) 1140 (fill-individual-paragraphs-prefix
1141 citation-regexp)
1130 fill-prefix-regexp (regexp-quote fill-prefix))) 1142 fill-prefix-regexp (regexp-quote fill-prefix)))
1131 (forward-line 1) 1143 (forward-line 1)
1132 (if (bolp) 1144 (if (bolp)
@@ -1142,8 +1154,10 @@ Also, if CITATION-REGEXP is non-nil, don't fill header lines."
1142 (not (looking-at paragraph-separate)) 1154 (not (looking-at paragraph-separate))
1143 (save-excursion 1155 (save-excursion
1144 (not (and (looking-at fill-prefix-regexp) 1156 (not (and (looking-at fill-prefix-regexp)
1145 (progn (forward-char (length fill-prefix)) 1157 (progn (forward-char
1146 (looking-at paragraph-separate)))))) 1158 (length fill-prefix))
1159 (looking-at
1160 paragraph-separate))))))
1147 ;; If this line has more or less indent 1161 ;; If this line has more or less indent
1148 ;; than the fill prefix wants, end the paragraph. 1162 ;; than the fill prefix wants, end the paragraph.
1149 (and (looking-at fill-prefix-regexp) 1163 (and (looking-at fill-prefix-regexp)
@@ -1155,7 +1169,8 @@ Also, if CITATION-REGEXP is non-nil, don't fill header lines."
1155 (>= (length fill-prefix) 1169 (>= (length fill-prefix)
1156 (length this-line-fill-prefix))) 1170 (length this-line-fill-prefix)))
1157 (save-excursion 1171 (save-excursion
1158 (not (progn (forward-char (length fill-prefix)) 1172 (not (progn (forward-char
1173 (length fill-prefix))
1159 (or (looking-at "[ \t]") 1174 (or (looking-at "[ \t]")
1160 (looking-at paragraph-separate) 1175 (looking-at paragraph-separate)
1161 (looking-at paragraph-start))))) 1176 (looking-at paragraph-start)))))
@@ -1178,13 +1193,11 @@ Also, if CITATION-REGEXP is non-nil, don't fill header lines."
1178 (setq just-one-line-prefix 1193 (setq just-one-line-prefix
1179 (fill-context-prefix 1194 (fill-context-prefix
1180 (point) 1195 (point)
1181 (save-excursion (forward-line 1) 1196 (line-beginning-position 2)))
1182 (point))))
1183 (setq two-lines-prefix 1197 (setq two-lines-prefix
1184 (fill-context-prefix 1198 (fill-context-prefix
1185 (point) 1199 (point)
1186 (save-excursion (forward-line 2) 1200 (line-beginning-position 2)))
1187 (point))))
1188 (when just-one-line-prefix 1201 (when just-one-line-prefix
1189 (setq one-line-citation-part 1202 (setq one-line-citation-part
1190 (if citation-regexp 1203 (if citation-regexp
@@ -1208,7 +1221,8 @@ Also, if CITATION-REGEXP is non-nil, don't fill header lines."
1208 (if (and just-one-line-prefix 1221 (if (and just-one-line-prefix
1209 two-lines-prefix 1222 two-lines-prefix
1210 (string-match (concat "\\`" 1223 (string-match (concat "\\`"
1211 (regexp-quote adjusted-two-lines-citation-part) 1224 (regexp-quote
1225 adjusted-two-lines-citation-part)
1212 "[ \t]*\\'") 1226 "[ \t]*\\'")
1213 one-line-citation-part) 1227 one-line-citation-part)
1214 (>= (string-width one-line-citation-part) 1228 (>= (string-width one-line-citation-part)