"ORDER BY 2 DESC, 3 DESC, 4 DESC, 5 DESC, 6 DESC, 1;")
nil nil)
(with-current-buffer b
- (set (make-local-variable 'sql-product) 'oracle)
+ (setq-local sql-product 'oracle)
(sql-product-font-lock t nil)
(font-lock-mode +1)))))
((syntax-alist (sql-product-font-lock-syntax-alist)))
;; Get the product-specific keywords.
- (set (make-local-variable 'sql-mode-font-lock-keywords)
+ (setq-local sql-mode-font-lock-keywords
(append
(unless (eq sql-product 'ansi)
(sql-get-product-feature sql-product :font-lock))
;; Setup font-lock. Force re-parsing of `font-lock-defaults'.
(kill-local-variable 'font-lock-set-defaults)
- (set (make-local-variable 'font-lock-defaults)
+ (setq-local font-lock-defaults
(list 'sql-mode-font-lock-keywords
keywords-only t syntax-alist))
(sql-execute-feature sqlbuf "*List All*" :list-all enhanced nil)
(with-current-buffer sqlbuf
;; Contains the name of database objects
- (set (make-local-variable 'sql-contains-names) t)
- (set (make-local-variable 'sql-buffer) sqlbuf))))
+ (setq-local sql-contains-names t)
+ (setq-local sql-buffer sqlbuf))))
(defun sql-list-table (name &optional enhanced)
"List the details of a database table named NAME.
(easy-menu-add sql-mode-menu))
;; (smie-setup sql-smie-grammar #'sql-smie-rules)
- (set (make-local-variable 'comment-start) "--")
+ (setq-local comment-start "--")
;; Make each buffer in sql-mode remember the "current" SQLi buffer.
(make-local-variable 'sql-buffer)
;; Add imenu support for sql-mode. Note that imenu-generic-expression
imenu-case-fold-search t)
;; Make `sql-send-paragraph' work on paragraphs that contain indented
;; lines.
- (set (make-local-variable 'paragraph-separate) "[\f]*$")
- (set (make-local-variable 'paragraph-start) "[\n\f]")
+ (setq-local paragraph-separate "[\f]*$")
+ (setq-local paragraph-start "[\n\f]")
;; Abbrevs
(setq-local abbrev-all-caps 1)
;; Contains the name of database objects
- (set (make-local-variable 'sql-contains-names) t)
+ (setq-local sql-contains-names t)
(setq-local syntax-propertize-function
(syntax-propertize-rules
;; Handle escaped apostrophes within strings.
:after-hook (sql--adjust-interactive-setup)
;; Get the `sql-product' for this interactive session.
- (set (make-local-variable 'sql-product)
- (or sql-interactive-product
- sql-product))
+ (setq-local sql-product (or sql-interactive-product
+ sql-product))
;; Setup the mode.
(setq mode-name
(sql-product-font-lock t nil)
;; Enable commenting and uncommenting of the region.
- (set (make-local-variable 'comment-start) "--")
+ (setq-local comment-start "--")
;; Abbreviation table init and case-insensitive. It is not activated
;; by default.
(setq local-abbrev-table sql-mode-abbrev-table)
(let ((proc (get-buffer-process (current-buffer))))
(when proc (set-process-sentinel proc #'sql-stop)))
;; Save the connection and login params
- (set (make-local-variable 'sql-user) sql-user)
- (set (make-local-variable 'sql-database) sql-database)
- (set (make-local-variable 'sql-server) sql-server)
- (set (make-local-variable 'sql-port) sql-port)
- (set (make-local-variable 'sql-connection) sql-connection)
+ (setq-local sql-user sql-user)
+ (setq-local sql-database sql-database)
+ (setq-local sql-server sql-server)
+ (setq-local sql-port sql-port)
+ (setq-local sql-connection sql-connection)
(setq-default sql-connection nil)
;; Contains the name of database objects
- (set (make-local-variable 'sql-contains-names) t)
+ (setq-local sql-contains-names t)
;; Keep track of existing object names
- (set (make-local-variable 'sql-completion-object) nil)
- (set (make-local-variable 'sql-completion-column) nil)
+ (setq-local sql-completion-object nil)
+ (setq-local sql-completion-column nil)
;; Create a useful name for renaming this buffer later.
- (set (make-local-variable 'sql-alternate-buffer-name)
- (sql-make-alternate-buffer-name))
+ (setq-local sql-alternate-buffer-name
+ (sql-make-alternate-buffer-name))
;; User stuff. Initialize before the hook.
- (set (make-local-variable 'sql-prompt-regexp)
- (or (sql-get-product-feature sql-product :prompt-regexp) "^"))
- (set (make-local-variable 'sql-prompt-length)
- (sql-get-product-feature sql-product :prompt-length))
- (set (make-local-variable 'sql-prompt-cont-regexp)
- (sql-get-product-feature sql-product :prompt-cont-regexp))
+ (setq-local sql-prompt-regexp
+ (or (sql-get-product-feature sql-product :prompt-regexp) "^"))
+ (setq-local sql-prompt-length
+ (sql-get-product-feature sql-product :prompt-length))
+ (setq-local sql-prompt-cont-regexp
+ (sql-get-product-feature sql-product :prompt-cont-regexp))
(make-local-variable 'sql-output-newline-count)
(make-local-variable 'sql-preoutput-hold)
(add-hook 'comint-preoutput-filter-functions
sql-prompt-regexp))
(setq left-margin (or sql-prompt-length 0))
;; Install input sender
- (set (make-local-variable 'comint-input-sender) #'sql-input-sender)
+ (setq-local comint-input-sender #'sql-input-sender)
;; People wanting a different history file for each
;; buffer/process/client/whatever can change separator and file-name
;; on the sql-interactive-mode-hook.
;; Set the new buffer name
(setq new-sqli-buffer (current-buffer))
- (set (make-local-variable 'sql-buffer)
- (buffer-name new-sqli-buffer))
+ (setq-local sql-buffer (buffer-name new-sqli-buffer))
;; Set `sql-buffer' in the start buffer
(with-current-buffer start-buffer