[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 2fc3251 426/468: `lua-funcname-at-point': don't m
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 2fc3251 426/468: `lua-funcname-at-point': don't modify the syntax |
Date: |
Thu, 5 Aug 2021 04:59:22 -0400 (EDT) |
branch: elpa/lua-mode
commit 2fc3251424c9048409f218fb9b31dc63771071a6
Author: Nikita Bloshchanevich <nikblos@outlook.com>
Commit: Nikita Bloshchanevich <nikblos@outlook.com>
`lua-funcname-at-point': don't modify the syntax
Use `re-search-forward' + `re-search-backward', which is much less hacky and
should be faster, as no syntax table needs to be copied.
---
lua-mode.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index a5f5d6a..4618a6d 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -2021,10 +2021,13 @@ Create a Lua process if one doesn't already exist."
(defun lua-funcname-at-point ()
"Get current Name { '.' Name } sequence."
- ;; FIXME: copying/modifying syntax table for each call may incur a penalty
- (with-syntax-table (copy-syntax-table)
- (modify-syntax-entry ?. "_")
- (current-word t)))
+ (save-excursion
+ (save-match-data
+ (re-search-backward "\\`\\|[^A-Za-z.]")
+ ;; NOTE: `point' will be either at the start of the buffer or on a
+ ;; non-symbol character.
+ (re-search-forward "\\([A-Za-z]+\\(?:.[A-Za-z]+\\)*\\)")
+ (match-string 1))))
(defun lua-search-documentation ()
"Search Lua documentation for the word at the point."
- [nongnu] elpa/lua-mode d7ff9c0 444/468: Fix lua-goto-matching-block for when point is at the beginning of keyword, (continued)
- [nongnu] elpa/lua-mode d7ff9c0 444/468: Fix lua-goto-matching-block for when point is at the beginning of keyword, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 1f74cd5 453/468: Remove backward-up-list for "for" continuation lines, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4e346d4 457/468: Add COPYING file, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode cf076a6 460/468: Replace funcall-interactively -> call-interactively (for Emacs-24.3), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 9454aee 461/468: Merge pull request #187 from immerrr/re-enable-emacs-24, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 2d9a468 463/468: Merge pull request #189 from jcs-PR/badge, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a57b1b1 462/468: Add badges to README, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode bc77051 464/468: Fix indentation, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7ee3feb 468/468: Bump version tag for v20210802 release, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4dc4cba 421/468: Remove stray tabs, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 2fc3251 426/468: `lua-funcname-at-point': don't modify the syntax,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 1135932 435/468: test-process: check if the buffer switching works, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8858ffa 436/468: Add CI tests via Github Actions, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 07c6bad 440/468: Add lua-skip-ws-and-comments-forward/-backward functions, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c96a836 445/468: is-continuing-p: use lua-skip-ws-and-comments-backward/-forward, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode cdab971 459/468: re-enable testing on Emacs 24.3, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 2bd9077 465/468: Merge pull request #192 from tarsiiformes/indentation, Philip Kaludercic, 2021/08/05