Subject: bug#56335: 29.0.50; [PATCH] Add more breakpoint chars support to longlines-mode

From: Manuel Giraud <[email-masked]>
Date: Sun, 10 Jul 2022 10:58:18 +0200

Eli Zaretskii <[email-masked]> writes:

>> From: Manuel Giraud <[email-masked]>
>> Cc: [email-masked],  [email-masked],  [email-masked],  [email-masked]
>> Date: Fri, 08 Jul 2022 09:14:19 +0200
>> 
>> "breakpoint" was already used into longlines' code...  But now we have a
>> user option that contains "breakpoint".  I propose to change this option
>> from 'longlines-breakpoint-chars' to 'longlines-separators'.  What do
>> you think?
>
> I suggest 'longlines-break-chars'.

Fine by me. Here is a renaming patch.

>From 5f36624001f0daf8fa27d8c3fa4e7bb1ae2c3deb Mon Sep 17 00:00:00 2001
From: Manuel Giraud <[email-masked]>
Date: Sun, 10 Jul 2022 10:54:12 +0200
Subject: [PATCH] Rename 'longlines-breakpoint-chars' to
 'longlines-break-chars'

* etc/NEWS:
* lisp/longlines.el (longlines-break-chars): Rename
'longlines-breakpoint-chars' to 'longlines-break-chars'.
---
 etc/NEWS          |  4 ++--
 lisp/longlines.el | 20 ++++++++++----------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 02fe67129d..abdd1f0566 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -463,8 +463,8 @@ previous behavior).  The default is nil, which inhibits recording of
 passwords.
 
 +++
-** New user option 'longlines-breakpoint-chars'.
-This is a string containing chars that could be used as breakpoint in
+** New user option 'longlines-break-chars'.
+This is a string containing chars that could be used as break point in
 longlines mode.
 
 +++
diff --git a/lisp/longlines.el b/lisp/longlines.el
index 6dc2f61ed9..652e3ff14f 100644
--- a/lisp/longlines.el
+++ b/lisp/longlines.el
@@ -72,7 +72,7 @@ longlines-show-effect
 This is used when `longlines-show-hard-newlines' is on."
   :type 'string)
 
-(defcustom longlines-breakpoint-chars " ;,|"
+(defcustom longlines-break-chars " ;,|"
   "A bag of separator chars for longlines."
   :type 'string)
 
@@ -303,8 +303,8 @@ longlines-set-breakpoint
 If the line should not be broken, return nil; point remains on the
 line."
   (move-to-column target-column)
-  (let ((non-breakpoint-re (format "[^%s]" longlines-breakpoint-chars)))
-    (if (and (re-search-forward non-breakpoint-re (line-end-position) t 1)
+  (let ((non-break-re (format "[^%s]" longlines-break-chars)))
+    (if (and (re-search-forward non-break-re (line-end-position) t 1)
              (> (current-column) target-column))
         ;; This line is too long.  Can we break it?
         (or (longlines-find-break-backward)
@@ -314,17 +314,17 @@ longlines-set-breakpoint
 (defun longlines-find-break-backward ()
   "Move point backward to the first available breakpoint and return t.
 If no breakpoint is found, return nil."
-  (let ((breakpoint-re (format "[%s]" longlines-breakpoint-chars)))
-    (when (and (re-search-backward breakpoint-re (line-beginning-position) t 1)
+  (let ((break-re (format "[%s]" longlines-break-chars)))
+    (when (and (re-search-backward break-re (line-beginning-position) t 1)
                (save-excursion
-                 (skip-chars-backward longlines-breakpoint-chars
+                 (skip-chars-backward longlines-break-chars
                                       (line-beginning-position))
                  (null (bolp))))
       (forward-char 1)
       (if (and fill-nobreak-predicate
                (run-hook-with-args-until-success 'fill-nobreak-predicate))
           (progn
-            (skip-chars-backward longlines-breakpoint-chars
+            (skip-chars-backward longlines-break-chars
                                  (line-beginning-position))
             (longlines-find-break-backward))
         t))))
@@ -332,10 +332,10 @@ longlines-find-break-backward
 (defun longlines-find-break-forward ()
   "Move point forward to the first available breakpoint and return t.
 If no break point is found, return nil."
-  (let ((breakpoint-re (format "[%s]" longlines-breakpoint-chars)))
-    (and (re-search-forward breakpoint-re (line-end-position) t 1)
+  (let ((break-re (format "[%s]" longlines-break-chars)))
+    (and (re-search-forward break-re (line-end-position) t 1)
          (progn
-           (skip-chars-forward longlines-breakpoint-chars (line-end-position))
+           (skip-chars-forward longlines-break-chars (line-end-position))
            (null (eolp)))
          (if (and fill-nobreak-predicate
                   (run-hook-with-args-until-success 'fill-nobreak-predicate))
-- 
2.36.1

-- 
Manuel Giraud