]> git.eshelyaron.com Git - emacs.git/commitdiff
Check that feature exist in `sql-set-product-feature' (Bug#30494).
authorPierre Téchoueyres <pierre.techoueyres@free.fr>
Sat, 1 Dec 2018 00:20:45 +0000 (01:20 +0100)
committerEli Zaretskii <eliz@gnu.org>
Sat, 12 Jan 2019 11:32:29 +0000 (13:32 +0200)
* lisp/progmodes/sql.el (sql-set-product-feature): Add test for
feature existence.

lisp/progmodes/sql.el

index ebde684109d92eaa53f5cac43278b40c0aa35dd2..6ad221295ca3efe8e9bc071780f28c2e1829e623 100644 (file)
@@ -2668,13 +2668,17 @@ argument must be a plist keyword accepted by
 
   (let* ((p (assoc product sql-product-alist))
          (v (plist-get (cdr p) feature)))
-    (if p
+    (if (and p v)
         (if (and
              (member feature sql-indirect-features)
              (symbolp v))
             (set v newvalue)
           (setcdr p (plist-put (cdr p) feature newvalue)))
-      (error "`%s' is not a known product; use `sql-add-product' to add it first." product))))
+      (progn
+       (when (null p)
+         (error "`%s' is not a known product; use `sql-add-product' to add it first." product))
+       (when (null v)
+         (error "`%s' is not a known feature for `%s'; use `sql-add-product' to add it first." feature product))))))
 
 (defun sql-get-product-feature (product feature &optional fallback not-indirect)
   "Lookup FEATURE associated with a SQL PRODUCT.