[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 3c8cfe6 160/468: Add credit, reformat new code to
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 3c8cfe6 160/468: Add credit, reformat new code to fit into 77 cols |
Date: |
Thu, 5 Aug 2021 04:58:28 -0400 (EDT) |
branch: elpa/lua-mode
commit 3c8cfe69e9add111c65b7343f68a3b6e4fd866b0
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>
Add credit, reformat new code to fit into 77 cols
---
lua-mode.el | 47 +++++++++++++++++++++++++++++++++--------------
1 file changed, 33 insertions(+), 14 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 2e9bb4b..5555cb2 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -38,6 +38,9 @@
;;; Commentary:
+;; Thanks to d87 <github.com/d87> for an idea of highlighting lua
+;; builtins/numbers
+
;; Thanks to Vedat Hallac <github.com/vhallac> for sharing some of
;; his fixes and updates to core indentation logics
@@ -295,27 +298,36 @@ traceback location."
"match" "rep" "reverse" "sub" "upper"))
("table" . ("concat" "insert" "maxn" "pack" "remove" "sort"
"unpack")))))
- ;; This code uses \\< and \\> to delimit builtin symbols instead of \\_<
and \\_>, because --
- ;; a necessity -- '.' syntax class is hacked to 'symbol' and \\_> won't
detect a symbol
- ;; boundary in 'foo.bar' and -- sufficiency -- conveniently, underscore
'_' is hacked to count
- ;; as word constituent, but only for font-locking. Neither of these
hacks makes sense to me,
- ;; I'm going to wipe them out as soon as I'm sure that indentation won't
get hurt. --immerrr
+ ;; This code uses \\< and \\> to delimit builtin symbols instead of
+ ;; \\_< and \\_>, because -- a necessity -- '.' syntax class is hacked
+ ;; to 'symbol' and \\_> won't detect a symbol boundary in 'foo.bar' and
+ ;; -- sufficiency -- conveniently, underscore '_' is hacked to count as
+ ;; word constituent, but only for font-locking. Neither of these hacks
+ ;; makes sense to me, I'm going to wipe them out as soon as I'm sure
+ ;; that indentation won't get hurt. --immerrr
;;
- (flet ((module-name-re (x) (concat "\\(?1:\\<" (if (listp x) (car x) x)
"\\>\\)"))
- (module-members-re (x) (if (listp x)
- (concat "\\(?:[ \t]*\\.[ \t]*\\<\\(?2:"
- (regexp-opt (cdr x))
- "\\)\\>\\)?")
- "")))
+ (flet
+ ((module-name-re (x)
+ (concat "\\(?1:\\<"
+ (if (listp x) (car x) x)
+ "\\>\\)"))
+ (module-members-re (x) (if (listp x)
+ (concat "\\(?:[ \t]*\\.[ \t]*"
+ "\\<\\(?2:"
+ (regexp-opt (cdr x))
+ "\\)\\>\\)?")
+ "")))
(concat
- ;; common prefix - beginning-of-line or neither of [ '.', ':' ] to
exclude "foo.string.rep"
+ ;; common prefix - beginning-of-line or neither of [ '.', ':' ] to
+ ;; exclude "foo.string.rep"
"\\(?:\\`\\|[^:. \n\t]\\)"
;; optional whitespace
"[ \n\t]*"
"\\(?:"
;; any of modules/functions
- (mapconcat (lambda (x) (concat "\\(?:" (module-name-re x)
(module-members-re x) "\\)"))
+ (mapconcat (lambda (x) (concat (module-name-re x)
+ (module-members-re x)))
modules
"\\|")
"\\)"))))
@@ -352,7 +364,14 @@ index of respective Lua reference manuals.")
'("\\_<0x[[:xdigit:]]+\\_>" . font-lock-constant-face)
;; regular numbers
-
'("\\_<\\(?1:\\(?:\\(?:[0-9]+\\.?[0-9]*\\|[0-9]*\\.?[0-9]+\\)\\(?:[eE][+-]?[0-9]+\\)?\\)\\)\\_>"
+ ;;
+ ;; This regexp relies on '.' being symbol constituent. Whenever this
+ ;; changes, the regexp needs revisiting --immerrr
+ `(,(concat "\\_<\\(?1:"
+ ;; make a digit on either side of dot mandatory
+ "\\(?:[0-9]+\\.?[0-9]*\\|[0-9]*\\.?[0-9]+\\)"
+ "\\(?:[eE][+-]?[0-9]+\\)?"
+ "\\)\\_>")
. font-lock-constant-face)
;; Keywords.
- [nongnu] elpa/lua-mode 3a3f0b0 193/468: Improve local var assignment matching, (continued)
- [nongnu] elpa/lua-mode 3a3f0b0 193/468: Improve local var assignment matching, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode af50eca 195/468: Bump copyright information (no luck with FSF), rephrase comment, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 918f297 072/468: rename: lua-calculate-indentation-left-shift -> lua-calculate-unindentation, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode cf2f42a 076/468: .gitignore: ignore emacs backups, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 9384855 093/468: lua-mark-all-multiline-literals: run when during lua-mode initialization, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6de08c0 090/468: Update TODO, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e3a8282 099/468: Make URL/Version fields in lua-mode.el prettier, update parse expression in Makefile, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 1c37d0d 114/468: Bump version, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e17a48c 126/468: Give credit to people participated recently, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode dcf5fc1 138/468: Indentation fixes and tidy up., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3c8cfe6 160/468: Add credit, reformat new code to fit into 77 cols,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 6b48a94 165/468: Second part of the fix for #34, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7a3a5f6 169/468: Add script to facilitate indentation testing, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7f8e519 178/468: Add backward compatibility aliases for cl-assert & cl-labels functions, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e6a46ee 182/468: Update README.md, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4b407cc 203/468: Print 'Prefix key set to ...' only when setting via interactive function, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 88b0ec3 209/468: Fix indentation for blocks starting on continued lines, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 32b5639 210/468: Fix wrong imenu generic expression, add one more regexp to match 'x = function(...)' definitions, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 57d3e46 212/468: lua-mode.el: bump "Version:" field, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c7c8d0c 179/468: Fix bug with lua-mode-syntax-table initialization, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 0b4ae97 184/468: Merge branch 'fix-36' of git://github.com/vhallac/lua-mode, Philip Kaludercic, 2021/08/05