From 96846877930f580e122e9af85b4653918c542f89 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Sun, 10 Jul 2022 15:01:55 +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' (bug#56335). --- etc/NEWS | 4 ++-- lisp/longlines.el | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 660ea7d7201..526bda283c3 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 6dc2f61ed96..4ad2cab2b23 100644 --- a/lisp/longlines.el +++ b/lisp/longlines.el @@ -72,8 +72,9 @@ You can also enable the display temporarily, using the command 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." + :version "29.1" :type 'string) ;;; Internal variables @@ -303,8 +304,8 @@ not need to be wrapped, move point to the next line and return t." 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 +315,17 @@ line." (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 +333,10 @@ If no breakpoint is found, return nil." (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.39.5