diff options
Diffstat (limited to 'lisp/textmodes/paragraphs.el')
-rw-r--r-- | lisp/textmodes/paragraphs.el | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 96edfd6de36..59b15e82a81 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -96,9 +96,8 @@ lines that start paragraphs from lines that separate them. If the variable `use-hard-newlines' is non-nil, then only lines following a hard newline are considered to match." - :group 'paragraphs :type 'regexp) -(put 'paragraph-start 'safe-local-variable 'stringp) +(put 'paragraph-start 'safe-local-variable #'stringp) ;; paragraph-start requires a hard newline, but paragraph-separate does not: ;; It is assumed that paragraph-separate is distinctive enough to be believed @@ -114,9 +113,8 @@ This is matched against the text at the left margin, which is not necessarily the beginning of the line, so it should not use \"^\" as an anchor. This ensures that the paragraph functions will work equally within a region of text indented by a margin setting." - :group 'paragraphs :type 'regexp) -(put 'paragraph-separate 'safe-local-variable 'stringp) +(put 'paragraph-separate 'safe-local-variable #'stringp) (defcustom sentence-end-double-space t "Non-nil means a single space does not end a sentence. @@ -128,7 +126,7 @@ regexp describing the end of a sentence, when the value of the variable `sentence-end' is nil. See Info node `(elisp)Standard Regexps'." :type 'boolean :group 'fill) -(put 'sentence-end-double-space 'safe-local-variable 'booleanp) +(put 'sentence-end-double-space 'safe-local-variable #'booleanp) (defcustom sentence-end-without-period nil "Non-nil means a sentence will end without a period. @@ -140,7 +138,7 @@ regexp describing the end of a sentence, when the value of the variable `sentence-end' is nil. See Info node `(elisp)Standard Regexps'." :type 'boolean :group 'fill) -(put 'sentence-end-without-period 'safe-local-variable 'booleanp) +(put 'sentence-end-without-period 'safe-local-variable #'booleanp) (defcustom sentence-end-without-space "。.?!" @@ -149,9 +147,8 @@ regexp describing the end of a sentence, when the value of the variable This value is used by the function `sentence-end' to construct the regexp describing the end of a sentence, when the value of the variable `sentence-end' is nil. See Info node `(elisp)Standard Regexps'." - :group 'paragraphs :type 'string) -(put 'sentence-end-without-space 'safe-local-variable 'stringp) +(put 'sentence-end-without-space 'safe-local-variable #'stringp) (defcustom sentence-end nil "Regexp describing the end of a sentence. @@ -161,16 +158,14 @@ All paragraph boundaries also end sentences, regardless. The value nil means to use the default value defined by the function `sentence-end'. You should always use this function to obtain the value of this variable." - :group 'paragraphs :type '(choice regexp (const :tag "Use default value" nil))) -(put 'sentence-end 'safe-local-variable 'string-or-null-p) +(put 'sentence-end 'safe-local-variable #'string-or-null-p) (defcustom sentence-end-base "[.?!…‽][]\"'”’)}»›]*" "Regexp matching the basic end of a sentence, not including following space." - :group 'paragraphs :type 'regexp :version "25.1") -(put 'sentence-end-base 'safe-local-variable 'stringp) +(put 'sentence-end-base 'safe-local-variable #'stringp) (defun sentence-end () "Return the regexp describing the end of a sentence. @@ -197,20 +192,16 @@ in between. See Info node `(elisp)Standard Regexps'." (defcustom page-delimiter "^\014" "Regexp describing line-beginnings that separate pages." - :group 'paragraphs :type 'regexp) -(put 'page-delimiter 'safe-local-variable 'stringp) +(put 'page-delimiter 'safe-local-variable #'stringp) (defcustom paragraph-ignore-fill-prefix nil "Non-nil means the paragraph commands are not affected by `fill-prefix'. This is desirable in modes where blank lines are the paragraph delimiters." - :group 'paragraphs :type 'boolean) -(put 'paragraph-ignore-fill-prefix 'safe-local-variable 'booleanp) +(put 'paragraph-ignore-fill-prefix 'safe-local-variable #'booleanp) ;; Silence the compiler. -(defvar multiple-lines) - (defun forward-paragraph (&optional arg) "Move forward to end of paragraph. With argument ARG, do it ARG times; @@ -269,13 +260,13 @@ Returns the count of paragraphs left to move." ;; Search back for line that starts or separates paragraphs. (if (if fill-prefix-regexp ;; There is a fill prefix; it overrides parstart. - (let (multiple-lines) + (let () ;; multiple-lines (while (and (progn (beginning-of-line) (not (bobp))) (progn (move-to-left-margin) (not (looking-at parsep))) (looking-at fill-prefix-regexp)) - (unless (= (point) start) - (setq multiple-lines t)) + ;; (unless (= (point) start) + ;; (setq multiple-lines t)) (forward-line -1)) (move-to-left-margin) ;; This deleted code caused a long hanging-indent line |