Function: sql-add-product
sql-add-product is a byte-compiled function defined in sql.el.gz.
Signature
(sql-add-product PRODUCT DISPLAY &rest PLIST)
Documentation
Add support for a database product in sql-mode.
Add PRODUCT to sql-product-alist which enables sql-mode to
properly support syntax highlighting and interactive interaction.
DISPLAY is the name of the SQL product that will appear in the
menu bar and in messages. PLIST initializes the product
configuration.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/sql.el.gz
(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
properly support syntax highlighting and interactive interaction.
DISPLAY is the name of the SQL product that will appear in the
menu bar and in messages. PLIST initializes the product
configuration."
;; Don't do anything if the product is already supported
(if (assoc product sql-product-alist)
(user-error "Product `%s' is already defined" product)
;; Add product to the alist
(add-to-list 'sql-product-alist `(,product :name ,display . ,plist))
;; Add a menu item to the SQL->Product menu
(easy-menu-add-item sql-mode-menu '("Product")
;; Each product is represented by a radio
;; button with it's display name.
`[,display
(sql-set-product ',product)
:style radio
:selected (eq sql-product ',product)]
;; Maintain the product list in
;; (case-insensitive) alphabetic order of the
;; display names. Loop thru each keymap item
;; looking for an item whose display name is
;; after this product's name.
(let ((next-item)
(down-display (downcase display)))
(map-keymap (lambda (k b)
(when (and (not next-item)
(string-lessp down-display
(downcase (cadr b))))
(setq next-item k)))
(easy-menu-get-map sql-mode-menu '("Product")))
next-item))
product))