unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Mauger via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: "39960@debbugs.gnu.org" <39960@debbugs.gnu.org>,
	"michael@mauger.com" <michael@mauger.com>,
	"p.stephani2@gmail.com" <p.stephani2@gmail.com>
Subject: bug#39960: 28.0.50; Incompatible change to sql-add-product in Emacs 27
Date: Mon, 23 Mar 2020 01:20:45 +0000	[thread overview]
Message-ID: <IS-JjtpPrxe4j86lKYUTDqrtBc89s2_EsgnJZkOGHF40FNDwdvt4vXeVHdORPlyRl7FMnKxSpSSOlOX2JY4ymqyYHxGwEHefk6s6RhlnuWA=@protonmail.com> (raw)
In-Reply-To: <83k13o8tsb.fsf@gnu.org>

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, March 13, 2020 5:53 AM, Eli Zaretskii <eliz@gnu.org> wrote:

> Ping!
>
> > Date: Sat, 07 Mar 2020 09:43:39 +0200
> > From: Eli Zaretskii eliz@gnu.org
> > Cc: 39960@debbugs.gnu.org
> >
> > > From: Philipp p.stephani2@gmail.com
> > > Date: Fri, 06 Mar 2020 23:39:16 +0100
> > > In Emacs 26, sql-add-product has the signature
> > > (sql-add-product PRODUCT DISPLAY &rest PLIST)
> > > However, in the Emacs 27 pretest the signature is now
> > > (sql-add-product PRODUCT DISPLAY &optional PLIST)
> > > Note the change from &rest to &optional. This is a breaking change that
> > > breaks all users of sql-add-product. I've found quite a few uses of the
> > > old signature in the wild,
> >
> > Thanks for reporting this.
> > Michael, could you please look into this ASAP? TIA.
> > Btw, this change of a public API is not in NEWS, AFAICT; if we decide
> > eventually on keeping the change, we should announce it in NEWS.

Sorry for the delay. The massive switch to WFH and illness concerns at home
interfered. All are fine, and I actually do get work done occasionally.

I've got the following patch to make. I assume it needs to be made to the
emacs-27 branch and corresponding patches made to master as well. If I
should only commit to master (same change is needed there) for cherry-picking
for emacs-27, let me know.

$ git diff
diff --git a/ChangeLog.3 b/ChangeLog.3
index fc41c1f7dc..e6cad9ed7c 100644
--- a/ChangeLog.3
+++ b/ChangeLog.3
@@ -1,3 +1,11 @@
+2020-03-22  Michael R. Mauger  <michael@mauger.com>
+
+	* lisp/progmodes/sql.el (sql-add-product): Re-correct argument
+	spec.  Previous change was due to my own stupidity; I have
+	resolved prior behavior (Bug#39960).
+	* test/lisp/progmodes/sql-tests.el (sql-test-add-product): Added
+	test to insure I don't make the same mistake again.
+
 2020-02-27  Nicolas Petton  <nicolas@petton.fr>

 	* admin/authors.el (authors-ignored-files): Fix entries.
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 400e304ecf..a04c26d276 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -2740,7 +2740,7 @@ sql-read-product
              nil 'require-match
              init 'sql-product-history init))))

-(defun sql-add-product (product display &optional plist)
+(defun sql-add-product (product display &rest plist)
   "Add support for a database product in `sql-mode'.

 Add PRODUCT to `sql-product-alist' which enables `sql-mode' to
diff --git a/test/lisp/progmodes/sql-tests.el b/test/lisp/progmodes/sql-tests.el
index d6f89341be..91805ab725 100644
--- a/test/lisp/progmodes/sql-tests.el
+++ b/test/lisp/progmodes/sql-tests.el
@@ -187,13 +187,19 @@ sql-test-add-product
       (sql-add-product 'xyz "XyzDb")

       (should (equal (pp-to-string (assoc 'xyz sql-product-alist))
-                     "(xyz :name \"XyzDb\")\n"))))
+                     "(xyz :name \"XyzDb\")\n")))
+
+  (sql-test-product-feature-harness
+      (sql-add-product 'stu "StuDb" :X 1 :Y "2")
+
+      (should (equal (pp-to-string (assoc 'stu sql-product-alist))
+                     "(stu :name \"StuDb\" :X 1 :Y \"2\")\n"))))

 (ert-deftest sql-test-add-existing-product ()
   "Add a product that already exists."

   (sql-test-product-feature-harness
-      (should-error (sql-add-feature 'a "Aaa"))
+      (should-error (sql-add-product 'a "Aaa"))
       (should (equal (pp-to-string (assoc 'a sql-product-alist))
                      "(a :X 1 :Y 2 :Z sql-test-feature-value-a)\n"))))




--
MICHAEL@MAUGER.COM // FSF and EFF member // GNU Emacs sql.el maintainer






  reply	other threads:[~2020-03-23  1:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06 22:39 bug#39960: 28.0.50; Incompatible change to sql-add-product in Emacs 27 Philipp
2020-03-07  7:43 ` Eli Zaretskii
2020-03-13  9:53   ` Eli Zaretskii
2020-03-23  1:20     ` Michael Mauger via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2020-03-23 14:24       ` Eli Zaretskii
2020-07-28 20:06       ` Philipp Stephani
2020-08-09  2:13         ` Michael Mauger via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-09  9:14           ` Philipp Stephani
2020-08-09 14:02             ` Eli Zaretskii
2020-10-01 18:36               ` Lars Ingebrigtsen
2020-10-04 18:49                 ` Philipp Stephani

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='IS-JjtpPrxe4j86lKYUTDqrtBc89s2_EsgnJZkOGHF40FNDwdvt4vXeVHdORPlyRl7FMnKxSpSSOlOX2JY4ymqyYHxGwEHefk6s6RhlnuWA=@protonmail.com' \
    --to=bug-gnu-emacs@gnu.org \
    --cc=39960@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael@mauger.com \
    --cc=mmauger@protonmail.com \
    --cc=p.stephani2@gmail.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).