From 68273707ecbca6ff6d34071c04c2b395384c41e5 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 9 Jun 2015 01:08:01 +0300 Subject: [PATCH] Skip past `#' to find BEG * lisp/progmodes/elisp-mode.el (elisp-completion-at-point): Skip past `#' to find BEG (bug#20771). * test/automated/elisp-mode-tests.el (elisp-completes-functions-after-hash-quote): New test. --- lisp/progmodes/elisp-mode.el | 2 +- test/automated/elisp-mode-tests.el | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index e12d1331601..9494e97fa73 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -460,7 +460,7 @@ It can be quoted, or be inside a quoted form." (beg (condition-case nil (save-excursion (backward-sexp 1) - (skip-chars-forward "`',‘") + (skip-chars-forward "`',‘#") (point)) (scan-error pos))) (end diff --git a/test/automated/elisp-mode-tests.el b/test/automated/elisp-mode-tests.el index 7af6dfcdc03..85f6da22441 100644 --- a/test/automated/elisp-mode-tests.el +++ b/test/automated/elisp-mode-tests.el @@ -78,6 +78,15 @@ (should (member "backup-buffer" comps)) (should-not (member "backup-inhibited" comps)))))) +(ert-deftest elisp-completes-functions-after-hash-quote () + (ert-deftest elisp-completes-functions-after-let-bindings () + (with-temp-buffer + (emacs-lisp-mode) + (insert "#'ba") + (let ((comps (elisp--test-completions))) + (should (member "backup-buffer" comps)) + (should-not (member "backup-inhibited" comps)))))) + (ert-deftest elisp-completes-local-variables () (with-temp-buffer (emacs-lisp-mode) -- 2.11.4.GIT