;; double quotes (") don't delimit strings
(modify-syntax-entry ?\" "." table)
;; Make these all punctuation
- (mapc #'(lambda (c) (modify-syntax-entry c "." table))
+ (mapc (lambda (c) (modify-syntax-entry c "." table))
(string-to-list "!#$%&+,.:;<=>?@\\|"))
table)
"Syntax table used in `sql-mode' and `sql-interactive-mode'.")
(let ((init (or (and initial (symbol-name initial)) "ansi")))
(intern (completing-read
prompt
- (mapcar #'(lambda (info) (symbol-name (car info)))
+ (mapcar (lambda (info) (symbol-name (car info)))
sql-product-alist)
nil 'require-match
init 'sql-product-history init))))
;; after this product's name.
(let ((next-item)
(down-display (downcase display)))
- (map-keymap #'(lambda (k b)
+ (map-keymap (lambda (k b)
(when (and (not next-item)
(string-lessp down-display
(downcase (cadr b))))
(font-lock-mode-internal t))
(add-hook 'font-lock-mode-hook
- #'(lambda ()
+ (lambda ()
;; Provide defaults for new font-lock faces.
(defvar font-lock-builtin-face
(if (boundp 'font-lock-preprocessor-face)
"Iterate through login parameters and return a list of results."
(delq nil
(mapcar
- #'(lambda (param)
+ (lambda (param)
(let ((token (or (car-safe param) param))
(plist (cdr-safe param)))
(funcall body token plist)))
(defun sql-product-syntax-table ()
(let ((table (copy-syntax-table sql-mode-syntax-table)))
- (mapc #'(lambda (entry)
+ (mapc (lambda (entry)
(modify-syntax-entry (car entry) (cdr entry) table))
(sql-get-product-feature sql-product :syntax-alist))
table))
(append
;; Change all symbol character to word characters
(mapcar
- #'(lambda (entry) (if (string= (substring (cdr entry) 0 1) "_")
+ (lambda (entry) (if (string= (substring (cdr entry) 0 1) "_")
(cons (car entry)
(concat "w" (substring (cdr entry) 1)))
entry))
buf)
;; Look thru each buffer
(car (apply #'append
- (mapcar #'(lambda (b)
+ (mapcar (lambda (b)
(and (sql-buffer-live-p b prod connection)
(list (buffer-name b))))
(buffer-list)))))))
(apply #'append nil
(sql-for-each-login
(sql-get-product-feature sql-product :sqli-login)
- #'(lambda (token plist)
+ (lambda (token plist)
(pcase token
(`user
(unless (string= "" sql-user)
((functionp filter)
(setq string (funcall filter string)))
((listp filter)
- (mapc #'(lambda (f) (setq string (funcall f string))) filter))
+ (mapc (lambda (f) (setq string (funcall f string))) filter))
(t nil))
;; Count how many newlines in the string
(setq sql-output-newline-count
- (apply #'+ (mapcar #'(lambda (ch)
+ (apply #'+ (mapcar (lambda (ch)
(if (eq ch ?\n) 1 0)) string)))
;; Send the string
(when visible
(message "Executing SQL command..."))
(if (consp command)
- (mapc #'(lambda (c) (sql-redirect-one sqlbuf c outbuf save-prior))
+ (mapc (lambda (c) (sql-redirect-one sqlbuf c outbuf save-prior))
command)
(sql-redirect-one sqlbuf command outbuf save-prior))
(when visible
(match-string regexp-groups))
;; list of numbers; return the specified matches only
((consp regexp-groups)
- (mapcar #'(lambda (c)
+ (mapcar (lambda (c)
(cond
((numberp c) (match-string c))
((stringp c) (match-substitute-replacement c))
If the results are empty the OUTBUF is deleted, otherwise the
buffer is popped into a view window."
(mapc
- #'(lambda (c)
+ (lambda (c)
(cond
((stringp c)
(sql-redirect sqlbuf (if arg (format c arg) c) outbuf) t)
"Read a connection name."
(let ((completion-ignore-case t))
(completing-read prompt
- (mapcar #'(lambda (c) (car c))
+ (mapcar (lambda (c) (car c))
sql-connection-alist)
nil t initial 'sql-connection-history default)))
;; Params in the connection
(setq set-params
(mapcar
- #'(lambda (v)
+ (lambda (v)
(pcase (car v)
(`sql-user 'user)
(`sql-password 'password)
;; the remaining params (w/o the connection params)
(setq rem-params
(sql-for-each-login login-params
- #'(lambda (token plist)
+ (lambda (token plist)
(unless (member token set-params)
(if plist (cons token plist) token)))))
;; Set the parameters and start the interactive session
(mapc
- #'(lambda (vv)
+ (lambda (vv)
(set-default (car vv) (eval (cadr vv))))
(cdr connect-set))
(setq-default sql-connection connection)
(cons name
(sql-for-each-login
`(product ,@login)
- #'(lambda (token _plist)
+ (lambda (token _plist)
(pcase token
(`product `(sql-product ',product))
(`user `(sql-user ,user))
"Generate menu entries for using each connection."
(append
(mapcar
- #'(lambda (conn)
+ (lambda (conn)
(vector
(format "Connection <%s>\t%s" (car conn)
(let ((sql-user "") (sql-database "")
;; Remove any settings that haven't changed
(mapc
- #'(lambda (one-cur-setting)
+ (lambda (one-cur-setting)
(setq saved-settings (delete one-cur-setting saved-settings)))
(sql-oracle-save-settings sqlbuf))
(sql-redirect sqlbuf "\\a"))
;; Return the list of table names (public schema name can be omitted)
- (mapcar #'(lambda (tbl)
+ (mapcar (lambda (tbl)
(if (string= (car tbl) "public")
(format "\"%s\"" (cadr tbl))
(format "\"%s\".\"%s\"" (car tbl) (cadr tbl))))