Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions sqlup-mode.el
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
;;; sqlup-mode.el --- Upcase SQL words for you
;;; sqlup-mode.el --- Upcase SQL words for you -*- lexical-binding: t; -*-

;; Copyright (C) 2014 Aldric Giacomoni

Expand Down Expand Up @@ -134,8 +134,10 @@ the previous word."
;; needed so that \c in postgres is not treated as the keyword C.
(modify-syntax-entry ?\\ "_")
(forward-symbol direction)
(sqlup-work-on-symbol (thing-at-point 'symbol)
(bounds-of-thing-at-point 'symbol))))
(let ((bnds (bounds-of-thing-at-point 'symbol)))
(when (and bnds (not (eq ?. (char-before (car bnds)))))
(sqlup-work-on-symbol
(buffer-substring-no-properties (car bnds) (cdr bnds)) bnds)))))

(defun sqlup-work-on-symbol (symbol symbol-boundaries)
(if (and symbol
Expand Down Expand Up @@ -224,7 +226,9 @@ ANSI SQL keywords."
(and (boundp 'sql-mode-font-lock-keywords) sql-mode-font-lock-keywords))

(defun sqlup-work-buffer ()
"Determines in which buffer sqlup will look to find what it needs and returns it. It can return the current buffer or create and return an indirect buffer based on current buffer and set its major mode to sql-mode."
"Determines in which buffer sqlup will look to find what it needs and
returns it. It can return the current buffer or create and return an
indirect buffer based on current buffer and set its major mode to sql-mode."
(cond ((sqlup-within-sql-buffer-p) (current-buffer))
(t (sqlup-indirect-buffer))))

Expand Down