all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Simen Heggestøyl via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 68402@debbugs.gnu.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#68402: [elpa/csv-mode] [PATCH] Add option to turn off the "Region OK?" prompt
Date: Fri, 12 Jan 2024 14:52:31 +0100	[thread overview]
Message-ID: <87jzoeveu8.fsf@runbox.com> (raw)

[-- 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


             reply	other threads:[~2024-01-12 13:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12 13:52 Simen Heggestøyl via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-01-12 14:14 ` bug#68402: [elpa/csv-mode] [PATCH] Add option to turn off the "Region OK?" prompt 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jzoeveu8.fsf@runbox.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=68402@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=simenheg@runbox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.