[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 1e61379 111/468: Fix most of compile-time warning
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 1e61379 111/468: Fix most of compile-time warnings, add couple FIXMEs |
Date: |
Thu, 5 Aug 2021 04:58:18 -0400 (EDT) |
branch: elpa/lua-mode
commit 1e61379c3d4c24eb10c4b426636c5523137cc2a7
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>
Fix most of compile-time warnings, add couple FIXMEs
---
lua-mode.el | 45 ++++++++++++++++++++++-----------------------
1 file changed, 22 insertions(+), 23 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 5a35762..cf18d9c 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -137,16 +137,15 @@ Should be a list of strings."
(defvar lua-process-buffer nil
"Buffer used for communication with Lua subprocess")
-;; defined later on, for now - nothing to update anyways
-(defun lua-prefix-key-update-bindings ()
- )
-
(defun lua--customize-set-prefix-key (prefix-key-sym prefix-key-val)
+ ;; FIXME: enable assertion, it requires 'cl and I'm not sure of its
availability
+ ;; (assert (eq prefix-key-sym 'lua-prefix-key))
(set prefix-key-sym (if (and prefix-key-val (> (length prefix-key-val) 0))
;; read-kbd-macro returns a string or a vector
;; in both cases (elt x 0) is ok
(elt (read-kbd-macro prefix-key-val) 0)))
- (lua-prefix-key-update-bindings)
+ (if (fboundp 'lua-prefix-key-update-bindings)
+ (lua-prefix-key-update-bindings))
(message "prefix key set to %S" (single-key-description (eval
prefix-key-sym))))
(defcustom lua-prefix-key "\C-c"
@@ -184,6 +183,7 @@ If the latter is nil, the keymap translates into
`lua-mode-map' verbatim.")
(")" . lua-electric-match)))
(define-key result-map [menu-bar lua-mode] (cons "Lua" lua-mode-menu))
+ ;; FIXME: see if the declared logic actually works
;; handle prefix-keyed bindings:
;; * if no prefix, set prefix-map as parent, i.e.
;; if key is not defined look it up in prefix-map
@@ -352,6 +352,8 @@ The following keys are bound:
;; setup menu bar entry (XEmacs style)
(if (and (featurep 'menubar)
(boundp 'current-menubar)
+ (fboundp 'set-buffer-menubar)
+ (fboundp 'add-menu)
(not (assoc "Lua" current-menubar)))
(progn
(set-buffer-menubar (copy-sequence current-menubar))
@@ -377,7 +379,7 @@ The following keys are bound:
(defun lua-electric-match (arg)
"Insert character and adjust indentation."
(interactive "P")
- (insert-char last-command-char (prefix-numeric-value arg))
+ (insert-char last-command-event (prefix-numeric-value arg))
(if lua-electric-flag
(lua-indent-line))
(blink-matching-open))
@@ -457,11 +459,6 @@ ignored, nil otherwise."
(if (not (funcall ignore-func))
(throw 'found (point)))))))
-(defun lua-backwards-to-block-begin-or-end ()
- "Move backwards to nearest block begin or end. Returns nil if not
successful."
- (interactive)
- (lua-find-regexp 'backward lua-block-regexp))
-
(defconst lua-block-regexp
(eval-when-compile
(concat
@@ -469,9 +466,7 @@ ignored, nil otherwise."
(regexp-opt '("do" "function" "repeat" "then"
"else" "elseif" "end" "until") t)
"\\_>\\)\\|"
- (regexp-opt '("{" "(" "[" "]" ")" "}") t))
-
- ))
+ (regexp-opt '("{" "(" "[" "]" ")" "}") t))))
(defconst lua-block-token-alist
;; The absence of "else" is deliberate. This construct in a way both
@@ -510,9 +505,13 @@ ignored, nil otherwise."
"\\_>\\|"
(regexp-opt '("]" ")" "}"))
"\\)")
-
)
+(defun lua-backwards-to-block-begin-or-end ()
+ "Move backwards to nearest block begin or end. Returns nil if not
successful."
+ (interactive)
+ (lua-find-regexp 'backward lua-block-regexp))
+
(defun lua-find-matching-token-word (token search-start)
(let* ((token-info (assoc token lua-block-token-alist))
(match (car (cdr token-info)))
@@ -665,7 +664,7 @@ The criteria for a continuing statement are:
;; check last token of previous nonblank line
(lua-last-token-continues-p)))))))
-(defun lua-make-indentation-info-pair ()
+(defun lua-make-indentation-info-pair (found-token found-pos)
"This is a helper function to lua-calculate-indentation-info. Don't
use standalone."
(cond
@@ -733,7 +732,7 @@ and relative each, and the shift/column to indent to."
(found-end (match-end 0))
(data (match-data)))
(setq indentation-info
- (cons (lua-make-indentation-info-pair) indentation-info)))))
+ (cons (lua-make-indentation-info-pair found-token found-pos)
indentation-info)))))
indentation-info))
(defun lua-accumulate-indentation-info (info)
@@ -743,12 +742,12 @@ shift, or the absolute column to indent to."
(let ((info-list (reverse info))
(type 'relative)
(accu 0))
- (mapcar (lambda (x)
- (setq accu (if (eq 'absolute (car x))
- (progn (setq type 'absolute)
- (cdr x))
- (+ accu (cdr x)))))
- info-list)
+ (mapc (lambda (x)
+ (setq accu (if (eq 'absolute (car x))
+ (progn (setq type 'absolute)
+ (cdr x))
+ (+ accu (cdr x)))))
+ info-list)
(cons type accu)))
(defun lua-calculate-indentation-block-modifier (&optional parse-start
- [nongnu] elpa/lua-mode 5607327 096/468: Update TODO, (continued)
- [nongnu] elpa/lua-mode 5607327 096/468: Update TODO, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 2b91610 098/468: Bump contact information, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 5953970 101/468: Bump version, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c044a1b 109/468: Fix emacs compilation warning in XEmacs-oriented code, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3367502 121/468: Merge pull request #7 from rlph/master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 9645322 124/468: lua-indent-line: add lua-indent-string-contents custom variable to enable indenting multiline strings if necessary (issue #6), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 99ef499 129/468: Make lua-automark variables buffer local, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 2ce253c 133/468: lua-automark: fix multiline comments recognition which was failing when there was a single-line comment previously, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 5a81583 140/468: Restore compatibility with Emacs22 and earlier that was broken when patching lua-mode-abbrev-table (should fix #11), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e498788 142/468: lua-calculate-indentation: add comments, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 1e61379 111/468: Fix most of compile-time warnings, add couple FIXMEs,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode d6232fe 119/468: lua-find-regexp: check if match-beginning should be ignored too, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c23fb54 127/468: lua-automark: mark only those buffer parts that may have changed their syntactical meaning, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode dfdbd85 143/468: lua-cont-eol-regexp: add missing keywords "if", "until" and "elseif", Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 612b1e7 166/468: Fixed misplaced paranthesis., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4a203b9 172/468: add lua-send-defun (a lua-send-proc replacement), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 58da3f9 066/468: Remove comment about setting lua-mode-map: not required anymore, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e3a4390 092/468: lua-mark-all-multiline-literals: add default keybinding "lua-prefix C-; ", Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode fa1ef23 107/468: lua-mode-map: dont evaluate at compile-time (fix byte-compilation error), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e9a17ba 120/468: Added autoload for (add-to-list 'interpreter-mode-alist '("lua" . lua-mode)), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 509700f 130/468: lua--automark-update-start-pos: rewind to beginning of line to make sure newly inserted multiline literal delimiters are recognized, Philip Kaludercic, 2021/08/05