From cc40a0fe0e9c071be4506dae93d16acd521d1d84 Mon Sep 17 00:00:00 2001 From: stardiviner Date: Mon, 12 Nov 2018 07:26:55 +0800 Subject: [PATCH 1/3] Fix #60 add an option for uppercase/downcase ANSI SQL candidates --- ejc-autocomplete.el | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ejc-autocomplete.el b/ejc-autocomplete.el index 249ccc9..62d7d32 100644 --- a/ejc-autocomplete.el +++ b/ejc-autocomplete.el @@ -25,6 +25,13 @@ (require 'ejc-doc) (require 'ejc-format) +(defcustom ejc-candidates-uppercase t + "Use uppercase candidates or downcase. +Uppercase by default, set to nil to use downcase candidates." + :type 'boolean + :safe #'booleanp + :group 'ejc-sql) + (defun ejc-get-prefix-word () "Return the word preceding dot before the typing." (save-excursion @@ -95,12 +102,13 @@ nil))) (defun ejc-get-ansi-sql-words () - (if (not (or (ejc-return-point) (ejc-get-prefix-word))) - (progn + (unless (or (ejc-return-point) (ejc-get-prefix-word)) + (progn + (if ejc-candidates-uppercase + (append (mapcar 'upcase ejc-ansi-sql-words) + (mapcar 'upcase ejc-auxulary-sql-words)) (append ejc-ansi-sql-words - ejc-auxulary-sql-words - (mapcar 'upcase ejc-ansi-sql-words) - (mapcar 'upcase ejc-auxulary-sql-words))) + ejc-auxulary-sql-words))) nil)) (defun ac-ejc-documentation (symbol-name) From 5013b1aa0d979a8aff7d850734f7ae2f43afae9c Mon Sep 17 00:00:00 2001 From: kostafey Date: Mon, 12 Nov 2018 02:34:54 +0300 Subject: [PATCH 2/3] Remove whitespace. --- ejc-autocomplete.el | 1 - 1 file changed, 1 deletion(-) diff --git a/ejc-autocomplete.el b/ejc-autocomplete.el index fbe56d1..12d46c3 100644 --- a/ejc-autocomplete.el +++ b/ejc-autocomplete.el @@ -44,7 +44,6 @@ Uppercase by default, set to nil to use downcase candidates." (defface ejc-flx-highlight-face '((t :inherit popup-isearch-match)) "Face used by flx for highlighting flx match characters in `ejc-sql' buffers." - :group 'ejc-sql) (defun ejc-get-prefix-word () From b247a3d09db746bc90c731f5f8c228cae695c7f5 Mon Sep 17 00:00:00 2001 From: kostafey Date: Mon, 12 Nov 2018 02:41:11 +0300 Subject: [PATCH 3/3] Update ejc-autocomplete.el --- ejc-autocomplete.el | 1 + 1 file changed, 1 insertion(+) diff --git a/ejc-autocomplete.el b/ejc-autocomplete.el index 12d46c3..9c83005 100644 --- a/ejc-autocomplete.el +++ b/ejc-autocomplete.el @@ -30,6 +30,7 @@ Uppercase by default, set to nil to use downcase candidates." :type 'boolean :safe #'booleanp + :group 'ejc-sql) (defcustom ejc-use-flx nil "Non-nil enables `flx' fuzzy matching engine autocompletion."