Subject: bug#68402: closed (Re: bug#68402: [elpa/csv-mode] [PATCH] Add option to turn off the "Region OK?" prompt)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 12 Feb 2025 03:55:02 +0000

Your bug report

#68402: [elpa/csv-mode] [PATCH] Add option to turn off the "Region OK?" prompt

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
68402: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68402
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#68402: [elpa/csv-mode] [PATCH] Add option to turn off the "Region OK?" prompt
From: Stefan Kangas <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: Simen Heggestøyl <[email-masked]>, [email-masked]
Date: Tue, 11 Feb 2025 19:54:29 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Stefan Monnier <[email-masked]> writes:

>> Attached is a proposed patch adding a new option to turn off the
>> "Region OK?" prompt in interactive csv-mode commands.
>
> Thanks, pushed,

I'm therefore closing this bug report.

Subject: [elpa/csv-mode] [PATCH] Add option to turn off the "Region OK?" prompt
From: Simen Heggestøyl <[email-masked]>
To: [email-masked]
Cc: Stefan Monnier <[email-masked]>
Date: Fri, 12 Jan 2024 14:52:31 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi.

Attached is a proposed patch adding a new option to turn off the
"Region OK?" prompt in interactive csv-mode commands.

>From 359ef9582e0c30c18a7c30086f93d69b35120337 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= <[email-masked]>
Date: Fri, 12 Jan 2024 12:06:20 +0100
Subject: [PATCH] Add option to turn off the "Region OK?" prompt

* csv-mode.el (csv-confirm-region): New option to turn off the
"Region OK?" prompt in interactive commands.
---
 csv-mode.el | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/csv-mode.el b/csv-mode.el
index 574050aa94..f639dcf59a 100644
--- a/csv-mode.el
+++ b/csv-mode.el
@@ -4,7 +4,7 @@
 
 ;; Author: "Francis J. Wright" <[email-masked]>
 ;; Maintainer: [email-masked]
-;; Version: 1.22
+;; Version: 1.23
 ;; Package-Requires: ((emacs "27.1") (cl-lib "0.5"))
 ;; Keywords: convenience
 
@@ -110,6 +110,7 @@
 ;; Since 1.21:
 ;; - New command `csv-insert-column'.
 ;; - New config var `csv-align-min-width' for `csv-align-mode'.
+;; - New option `csv-confirm-region'.
 
 ;; Since 1.9:
 ;; - `csv-align-mode' auto-aligns columns dynamically (on screen).
@@ -271,6 +272,10 @@ after separators."
   "If non-nil, make separators in aligned records invisible."
   :type 'boolean)
 
+(defcustom csv-confirm-region t
+  "If non-nil, confirm that region is OK in interactive commands."
+  :type 'boolean)
+
 (defface csv-separator-face
   '((t :inherit escape-glyph))
   "CSV mode face used to highlight separators.")
@@ -557,9 +562,10 @@ The default field when read interactively is the current field."
 		    (exchange-point-and-mark)
 		    (sit-for 1)
 		    (exchange-point-and-mark))
-		  (or (y-or-n-p "Region OK? ")
-		      (error "Action aborted by user"))
-		  (message nil)		; clear y-or-n-p message
+                  (when csv-confirm-region
+                    (or (y-or-n-p "Region OK? ")
+                        (error "Action aborted by user"))
+                    (message nil))      ; clear y-or-n-p message
 		  (list (region-beginning) (region-end))))
 	    ;; Use region set by user:
 	    (list (region-beginning) (region-end)))))
-- 
2.39.2