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

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

[nongnu] elpa/lua-mode 95c64bb 366/468: Add doc for lua-find-matching-to


From: Philip Kaludercic
Subject: [nongnu] elpa/lua-mode 95c64bb 366/468: Add doc for lua-find-matching-token-word
Date: Thu, 5 Aug 2021 04:59:10 -0400 (EDT)

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

    Add doc for lua-find-matching-token-word
---
 lua-mode.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lua-mode.el b/lua-mode.el
index 91fd0a4..af94a13 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1022,6 +1022,15 @@ TOKEN-TYPE determines where the token occurs on a 
statement. open indicates that
   (lua-find-regexp 'backward lua-block-regexp))
 
 (defun lua-find-matching-token-word (token &optional direction)
+  "Find matching open- or close-token for TOKEN in DIRECTION.
+Point has to be exactly at the beginning of TOKEN, e.g. with | being point
+
+  {{ }|}  -- (lua-find-matching-token-word \"}\" 'backward) will return
+          -- the first {
+  {{ |}}  -- (lua-find-matching-token-word \"}\" 'backward) will find
+          -- the second {.
+
+DIRECTION has to be either 'forward or 'backward."
   (let* ((token-info (lua-get-block-token-info token))
          (match-type (lua-get-token-type token-info))
          ;; If we are on a middle token, go backwards. If it is a middle or 
open,



reply via email to

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