all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#68402: [elpa/csv-mode] [PATCH] Add option to turn off the "Region OK?" prompt
@ 2024-01-12 13:52 Simen Heggestøyl via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-01-12 14:14 ` Eli Zaretskii
  2024-01-15  1:38 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 8+ messages in thread
From: Simen Heggestøyl via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-01-12 13:52 UTC (permalink / raw)
  To: 68402; +Cc: Stefan Monnier

[-- Attachment #1: Type: text/plain, Size: 125 bytes --]

Hi.

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-option-to-turn-off-the-Region-OK-prompt.patch --]
[-- Type: text/x-diff, Size: 2046 bytes --]

From 359ef9582e0c30c18a7c30086f93d69b35120337 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simen=20Heggest=C3=B8yl?= <simenheg@runbox.com>
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" <F.J.Wright@qmul.ac.uk>
 ;; Maintainer: emacs-devel@gnu.org
-;; 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-01-19 13:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-12 13:52 bug#68402: [elpa/csv-mode] [PATCH] Add option to turn off the "Region OK?" prompt Simen Heggestøyl via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-12 14:14 ` Eli Zaretskii
2024-01-12 15:47   ` Simen Heggestøyl via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-12 15:52     ` Eli Zaretskii
2024-01-19  7:53       ` Simen Heggestøyl via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-19  8:13         ` Eli Zaretskii
2024-01-19 13:03           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-15  1:38 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.