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

* bug#68402: [elpa/csv-mode] [PATCH] Add option to turn off the "Region OK?" prompt
  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-15  1:38 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2024-01-12 14:14 UTC (permalink / raw)
  To: Simen Heggestøyl; +Cc: monnier, 68402

> Cc: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Fri, 12 Jan 2024 14:52:31 +0100
> From:  Simen Heggestøyl via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Attached is a proposed patch adding a new option to turn off the
> "Region OK?" prompt in interactive csv-mode commands.

Thanks.

> +(defcustom csv-confirm-region t
> +  "If non-nil, confirm that region is OK in interactive commands."
> +  :type 'boolean)
> +

New defcustoms should have a :version tag.

Do we need to call this out in NEWS?





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

* bug#68402: [elpa/csv-mode] [PATCH] Add option to turn off the "Region OK?" prompt
  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
  0 siblings, 1 reply; 8+ messages in thread
From: Simen Heggestøyl via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-01-12 15:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: monnier, 68402

Eli Zaretskii <eliz@gnu.org> writes:

> New defcustoms should have a :version tag.

Even in GNU ELPA?

> Do we need to call this out in NEWS?

I don't think so, given that csv-mode lives in GNU ELPA?

-- Simen





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

* bug#68402: [elpa/csv-mode] [PATCH] Add option to turn off the "Region OK?" prompt
  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
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2024-01-12 15:52 UTC (permalink / raw)
  To: Simen Heggestøyl; +Cc: monnier, 68402

> From: Simen Heggestøyl <simenheg@runbox.com>
> Cc: 68402@debbugs.gnu.org,  monnier@iro.umontreal.ca
> Date: Fri, 12 Jan 2024 16:47:25 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > New defcustoms should have a :version tag.
> 
> Even in GNU ELPA?

I thought ELPA packages have their versions?

Is there a way to tell customize-changed that a defcustom of an ELPA
package is new or changed since the last version?

> > Do we need to call this out in NEWS?
> 
> I don't think so, given that csv-mode lives in GNU ELPA?

Right, sorry.





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

* bug#68402: [elpa/csv-mode] [PATCH] Add option to turn off the "Region OK?" prompt
  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-15  1:38 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 8+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-01-15  1:38 UTC (permalink / raw)
  To: Simen Heggestøyl; +Cc: 68402

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

Thanks, pushed,


        Stefan






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

* bug#68402: [elpa/csv-mode] [PATCH] Add option to turn off the "Region OK?" prompt
  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
  0 siblings, 1 reply; 8+ messages in thread
From: Simen Heggestøyl via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-01-19  7:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: monnier, 68402

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Simen Heggestøyl <simenheg@runbox.com>
>> Cc: 68402@debbugs.gnu.org,  monnier@iro.umontreal.ca
>> Date: Fri, 12 Jan 2024 16:47:25 +0100
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > New defcustoms should have a :version tag.
>> 
>> Even in GNU ELPA?
>
> I thought ELPA packages have their versions?
>
> Is there a way to tell customize-changed that a defcustom of an ELPA
> package is new or changed since the last version?

As far as I can tell, :version denotes the Emacs version. But maybe
:package-version would have been appropriate to use here? I don't see it
used for any of the other defcustoms in csv-mode, though.

-- Simen





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

* bug#68402: [elpa/csv-mode] [PATCH] Add option to turn off the "Region OK?" prompt
  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
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2024-01-19  8:13 UTC (permalink / raw)
  To: Simen Heggestøyl; +Cc: monnier, 68402

> From: Simen Heggestøyl <simenheg@runbox.com>
> Cc: 68402@debbugs.gnu.org,  monnier@iro.umontreal.ca
> Date: Fri, 19 Jan 2024 08:53:42 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: Simen Heggestøyl <simenheg@runbox.com>
> >> Cc: 68402@debbugs.gnu.org,  monnier@iro.umontreal.ca
> >> Date: Fri, 12 Jan 2024 16:47:25 +0100
> >> 
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >> 
> >> > New defcustoms should have a :version tag.
> >> 
> >> Even in GNU ELPA?
> >
> > I thought ELPA packages have their versions?
> >
> > Is there a way to tell customize-changed that a defcustom of an ELPA
> > package is new or changed since the last version?
> 
> As far as I can tell, :version denotes the Emacs version. But maybe
> :package-version would have been appropriate to use here? I don't see it
> used for any of the other defcustoms in csv-mode, though.

Stefan, how does customize-changed deal with defcustoms of ELPA
packages?





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

* bug#68402: [elpa/csv-mode] [PATCH] Add option to turn off the "Region OK?" prompt
  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
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-01-19 13:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Simen Heggestøyl, 68402

>> As far as I can tell, :version denotes the Emacs version. But maybe
>> :package-version would have been appropriate to use here? I don't see it
>> used for any of the other defcustoms in csv-mode, though.
>
> Stefan, how does customize-changed deal with defcustoms of ELPA
> packages?

As Simen found out, there's `:package-version` for that.
Many packages don't bother to use it, tho.


        Stefan






^ permalink raw reply	[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.