emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/lua-mode 45a881d 243/468: lua-search-documentation: fix 'f


From: Philip Kaludercic
Subject: [nongnu] elpa/lua-mode 45a881d 243/468: lua-search-documentation: fix 'foo.bar' lookups broken when making '.' punctuation
Date: Thu, 5 Aug 2021 04:58:46 -0400 (EDT)

branch: elpa/lua-mode
commit 45a881d6121834097ecc92cbbbbc3efa7dcf60d9
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>

    lua-search-documentation: fix 'foo.bar' lookups broken when making '.' 
punctuation
---
 lua-mode.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lua-mode.el b/lua-mode.el
index 314a28d..fc7e52a 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1708,10 +1708,17 @@ Otherwise, return START."
   (interactive)
   (delete-windows-on lua-process-buffer))
 
+(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)))
+
 (defun lua-search-documentation ()
   "Search Lua documentation for the word at the point."
   (interactive)
-  (browse-url (concat lua-search-url-prefix (current-word t))))
+  (browse-url (concat lua-search-url-prefix (lua-funcname-at-point))))
 
 (defun lua-toggle-electric-state (&optional arg)
   "Toggle the electric indentation feature.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]