[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode c61bda2 040/468: Commit from Reuben:
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode c61bda2 040/468: Commit from Reuben: |
Date: |
Thu, 5 Aug 2021 04:58:04 -0400 (EDT) |
branch: elpa/lua-mode
commit c61bda2cb2408e0ef0e1af02f7a12dbe5257dde7
Author: juergen <juergen>
Commit: juergen <juergen>
Commit from Reuben:
* change the contact details
* reindent some bits that were not correctly indented (saves future
random whitespace changes
---
install.rst | 4 +-
lua-mode.el | 208 ++++++++++++++++++++++++++++++------------------------------
2 files changed, 106 insertions(+), 106 deletions(-)
diff --git a/install.rst b/install.rst
index 68d3166..a6c3e2d 100755
--- a/install.rst
+++ b/install.rst
@@ -2,8 +2,8 @@
Lua-mode
=============================
-:Author: Jürgen Hötzel
-:Contact: juergen@hoetzel.info
+:Maintainer: Reuben Thomas
+:Contact: rrt@sc3d.org
.. contents::
diff --git a/lua-mode.el b/lua-mode.el
index 25ee419..a28cf4f 100755
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -123,7 +123,7 @@ Should be a list of strings."
"Keymap used with lua-mode.")
(defvar lua-electric-flag t
-"If t, electric actions (like automatic reindentation) will happen when an
electric
+ "If t, electric actions (like automatic reindentation) will happen when an
electric
key like `{' is pressed")
(make-variable-buffer-local 'lua-electric-flag)
@@ -238,15 +238,15 @@ traceback location."
"Abbreviation table used in lua-mode buffers.")
(defvar lua-sexp-alist '(("then" . "end")
- ("function" . "end")
- ("do" . "end")))
+ ("function" . "end")
+ ("do" . "end")))
(define-abbrev-table 'lua-mode-abbrev-table
'(
- ("end" "end" lua-indent-line 0)
- ("else" "else" lua-indent-line 0)
- ("elseif" "elseif" lua-indent-line 0)
- ))
+ ("end" "end" lua-indent-line 0)
+ ("else" "else" lua-indent-line 0)
+ ("elseif" "elseif" lua-indent-line 0)
+ ))
(defconst lua-indent-whitespace " \t"
"Character set that constitutes whitespace for indentation in lua.")
@@ -270,7 +270,7 @@ The following keys are bound:
"
(interactive)
(let ((switches nil)
- s)
+ s)
(kill-all-local-variables)
(setq major-mode 'lua-mode)
(setq mode-name "Lua")
@@ -280,17 +280,17 @@ The following keys are bound:
(set (make-local-variable 'comment-start) "--")
(set (make-local-variable 'comment-start-skip) "--")
(set (make-local-variable 'font-lock-defaults)
- '(lua-font-lock-keywords
- nil nil ((?_ . "w")) nil
- (font-lock-syntactic-keywords .
lua-fls-keywords)
- (font-lock-syntactic-face-function .
lua-fls-face-function)))
+ '(lua-font-lock-keywords
+ nil nil ((?_ . "w")) nil
+ (font-lock-syntactic-keywords . lua-fls-keywords)
+ (font-lock-syntactic-face-function . lua-fls-face-function)))
(set (make-local-variable 'imenu-generic-expression)
- lua-imenu-generic-expression)
- (setq local-abbrev-table lua-mode-abbrev-table)
- (abbrev-mode 1)
+ lua-imenu-generic-expression)
+ (setq local-abbrev-table lua-mode-abbrev-table)
+ (abbrev-mode 1)
(make-local-variable 'lua-default-eval)
(or lua-mode-map
- (lua-setup-keymap))
+ (lua-setup-keymap))
(use-local-map lua-mode-map)
(set-syntax-table (copy-syntax-table))
(modify-syntax-entry ?+ ".")
@@ -349,15 +349,15 @@ to `lua-mode-map', otherwise they are prefixed with
`lua-prefix-key'."
(define-key lua-mode-map (kbd "C-M-<home>") 'lua-beginning-of-proc)
(define-key lua-mode-map (kbd "C-M-<end>") 'lua-end-of-proc)
(let ((map (if lua-prefix-key
- (make-sparse-keymap)
- lua-mode-map)))
-
- ;; communication
- (define-key map "\C-l" 'lua-send-buffer)
- (define-key map "\C-f" 'lua-search-documentation)
- (if lua-prefix-key
- (define-key lua-mode-map lua-prefix-key map))
- ))
+ (make-sparse-keymap)
+ lua-mode-map)))
+
+ ;; communication
+ (define-key map "\C-l" 'lua-send-buffer)
+ (define-key map "\C-f" 'lua-search-documentation)
+ (if lua-prefix-key
+ (define-key lua-mode-map lua-prefix-key map))
+ ))
(defun lua-electric-match (arg)
"Insert character and adjust indentation."
@@ -380,7 +380,7 @@ to `lua-mode-map', otherwise they are prefixed with
`lua-prefix-key'."
(defun lua-comment-p ()
"Returns true if the point is in a comment."
- (elt (lua-syntax-status) 4))
+ (elt (lua-syntax-status) 4))
(defun lua-comment-or-string-p ()
"Returns true if the point is in a comment or string."
@@ -441,7 +441,7 @@ ignored, nil otherwise."
"\\>\\)\\|"
(regexp-opt '("{" "(" "[" "]" ")" "}") t))
- ))
+ ))
(defconst lua-block-token-alist
;; The absence of "else" is deliberate. This construct in a way both
@@ -466,23 +466,23 @@ ignored, nil otherwise."
(defconst lua-indentation-modifier-regexp
- ;; The absence of else is deliberate, since it does not modify the
- ;; indentation level per se. It only may cause the line, in which the
- ;; else is, to be shifted to the left.
- ;; This is the code we used to generate the regexp:
- (concat
- "\\(\\<"
- ; n.b. "local function" is a bit of a hack, allowing only a single space
- (regexp-opt '("do" "local function" "function" "repeat" "then") t)
- "\\>\\|"
- (regexp-opt '("{" "(" "["))
- "\\)\\|\\(\\<"
- (regexp-opt '("elseif" "end" "until") t)
- "\\>\\|"
- (regexp-opt '("]" ")" "}"))
- "\\)")
+ ;; The absence of else is deliberate, since it does not modify the
+ ;; indentation level per se. It only may cause the line, in which the
+ ;; else is, to be shifted to the left.
+ ;; This is the code we used to generate the regexp:
+ (concat
+ "\\(\\<"
+ ; n.b. "local function" is a bit of a
hack, allowing only a single space
+ (regexp-opt '("do" "local function" "function" "repeat" "then") t)
+ "\\>\\|"
+ (regexp-opt '("{" "(" "["))
+ "\\)\\|\\(\\<"
+ (regexp-opt '("elseif" "end" "until") t)
+ "\\>\\|"
+ (regexp-opt '("]" ")" "}"))
+ "\\)")
- )
+ )
(defun lua-find-matching-token-word (token search-start)
(let* ((token-info (assoc token lua-block-token-alist))
@@ -501,15 +501,15 @@ ignored, nil otherwise."
(found-pos (match-beginning 0)))
(if (string-match match found-token)
(throw 'found found-pos))
- ;; no - then there is a nested block. If we were looking for
- ;; a block begin token, found-token must be a block end
- ;; token; likewise, if we were looking for a block end token,
- ;; found-token must be a block begin token, otherwise there
- ;; is a grammatical error in the code.
- (if (not (and
- (eq (car (cdr (cdr (assoc found-token
lua-block-token-alist))))
- match-type)
- (lua-find-matching-token-word found-token nil)))
+ ;; no - then there is a nested block. If we were looking for
+ ;; a block begin token, found-token must be a block end
+ ;; token; likewise, if we were looking for a block end token,
+ ;; found-token must be a block begin token, otherwise there
+ ;; is a grammatical error in the code.
+ (if (not (and
+ (eq (car (cdr (cdr (assoc found-token
lua-block-token-alist))))
+ match-type)
+ (lua-find-matching-token-word found-token nil)))
(throw 'found nil)))))))
(defun lua-goto-matching-block-token (&optional search-start parse-start)
@@ -651,13 +651,13 @@ use standalone."
(current-column))
lua-indent-level)))
((or (string-equal found-token "{")
- (string-equal found-token "("))
+ (string-equal found-token "("))
(save-excursion
;; expression follows -> indent at start of next expression
(if (and (not (search-forward-regexp "[[:space:]]--"
(line-end-position) t))
(search-forward-regexp "[^[:space:]]" (line-end-position)
t))
- (cons 'absolute (1- (current-column)))
- (cons 'relative lua-indent-level))))
+ (cons 'absolute (1- (current-column)))
+ (cons 'relative lua-indent-level))))
;; closing tokens follow
((string-equal found-token "end")
(save-excursion
@@ -714,11 +714,11 @@ shift, or the absolute column to indent to."
(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)
+ (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
@@ -810,7 +810,7 @@ to the left by the amount specified in lua-indent-level."
(if (not (string-equal block-token last-token)) (throw 'stop nil))
(setq indentation-modifier (+ indentation-modifier
lua-indent-level))
- (forward-char (length (match-string 0))))))
+ (forward-char (length (match-string 0))))))
indentation-modifier)))
(defun lua-calculate-indentation (&optional parse-start)
@@ -853,23 +853,23 @@ Returns t unless search stops due to beginning or end of
buffer."
(or arg
(setq arg 1))
(let ((found nil)
- (ret t))
+ (ret t))
(if (and (< arg 0)
- (looking-at "^function[ \t]"))
- (forward-char 1))
+ (looking-at "^function[ \t]"))
+ (forward-char 1))
(while (< arg 0)
(if (re-search-forward "^function[ \t]" nil t)
- (setq arg (1+ arg)
- found t)
- (setq ret nil
- arg 0)))
+ (setq arg (1+ arg)
+ found t)
+ (setq ret nil
+ arg 0)))
(if found
- (beginning-of-line))
+ (beginning-of-line))
(while (> arg 0)
(if (re-search-backward "^function[ \t]" nil t)
- (setq arg (1- arg))
- (setq ret nil
- arg 0)))
+ (setq arg (1- arg))
+ (setq ret nil
+ arg 0)))
ret))
(defun lua-end-of-proc (&optional arg)
@@ -971,11 +971,11 @@ If `lua-process' is nil or dead, start a new process
first."
(accept-process-output (get-buffer-process (current-buffer)))
(goto-char (point-max))
(setq prompt-found (and (lua-prompt-line) (< last-prompt (point-max)))))
- ;; remove temp. lua file
- (delete-file tempfile)
- (lua-postprocess-output-buffer lua-process-buffer last-prompt
lua-stdin-line-offset)
- (if lua-always-show
- (display-buffer lua-process-buffer)))))
+ ;; remove temp. lua file
+ (delete-file tempfile)
+ (lua-postprocess-output-buffer lua-process-buffer last-prompt
lua-stdin-line-offset)
+ (if lua-always-show
+ (display-buffer lua-process-buffer)))))
(defun lua-postprocess-output-buffer (buf start &optional
lua-stdin-line-offset)
"Highlight tracebacks found in buf. If an traceback occurred return
@@ -995,15 +995,15 @@ t, otherwise return nil. BUF must exist."
(lua-jump-to-traceback file line lua-stdin-line-offset)
(setq err-p t))
err-p))
-
+
(defun lua-jump-to-traceback (file line lua-stdin-line-offset)
"Jump to the Lua code in FILE at LINE."
;; sanity check: temporary-file-directory
(if (string= (substring file 0 3) "...")
(message "Lua traceback output truncated: customize
'temporary-file-directory' or increase 'LUA_IDSIZE' in 'luaconf.h'.")
(let ((buffer (cond ((or (string-equal file tempfile) (string-equal file
"stdin"))
- (setq line (+ line lua-stdin-line-offset))
- lua-stdin-buffer)
+ (setq line (+ line lua-stdin-line-offset))
+ lua-stdin-buffer)
(t (find-file-noselect file)))))
(pop-to-buffer buffer)
;; Force Lua mode
@@ -1029,8 +1029,8 @@ t, otherwise return nil. BUF must exist."
(comint-check-proc lua-process-buffer))
(lua-start-process lua-default-application))
(comint-simple-send lua-process
- (buffer-substring lua-region-start
lua-region-end)
-)
+ (buffer-substring lua-region-start lua-region-end)
+ )
(if lua-always-show
(display-buffer lua-process-buffer)))
@@ -1047,11 +1047,11 @@ t, otherwise return nil. BUF must exist."
(comint-check-proc lua-process-buffer))
(lua-start-process lua-default-application))
(comint-simple-send lua-process
- (buffer-substring beg end))
+ (buffer-substring beg end))
(if lua-always-show
(display-buffer lua-process-buffer))))
-; FIXME: This needs work... -Bret
+ ; FIXME: This needs work... -Bret
(defun lua-send-buffer ()
"Send whole buffer to lua subprocess."
(interactive)
@@ -1097,26 +1097,26 @@ left out."
(setq lua-electric-flag (lua-calculate-state arg lua-electric-flag)))
(defun lua-forward-sexp (&optional count)
- "Forward to block end"
- (interactive "p")
- (save-match-data
- (let* ((count (or count 1))
- (stackheight 0)
- (block-start (mapcar 'car lua-sexp-alist))
- (block-end (mapcar 'cdr lua-sexp-alist))
- (block-regex (regexp-opt (append block-start block-end) 'words))
- current-exp
- )
- (while (> count 0)
- ;; skip whitespace
- (skip-chars-forward " \t\n")
- (if (looking-at (regexp-opt block-start 'words))
- (let ((keyword (match-string 1)))
- (lua-find-matching-token-word keyword nil))
- ;; If the current keyword is not a "begin" keyword, then just
- ;; perform the normal forward-sexp.
- (forward-sexp 1))
- (setq count (1- count))))))
+ "Forward to block end"
+ (interactive "p")
+ (save-match-data
+ (let* ((count (or count 1))
+ (stackheight 0)
+ (block-start (mapcar 'car lua-sexp-alist))
+ (block-end (mapcar 'cdr lua-sexp-alist))
+ (block-regex (regexp-opt (append block-start block-end) 'words))
+ current-exp
+ )
+ (while (> count 0)
+ ;; skip whitespace
+ (skip-chars-forward " \t\n")
+ (if (looking-at (regexp-opt block-start 'words))
+ (let ((keyword (match-string 1)))
+ (lua-find-matching-token-word keyword nil))
+ ;; If the current keyword is not a "begin" keyword, then just
+ ;; perform the normal forward-sexp.
+ (forward-sexp 1))
+ (setq count (1- count))))))
;; menu bar
- [nongnu] elpa/lua-mode 78fc3ba 005/468: lua-postprocess-output-buffer: jump to lua errors in source files, (continued)
- [nongnu] elpa/lua-mode 78fc3ba 005/468: lua-postprocess-output-buffer: jump to lua errors in source files, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8802c43 006/468: fixed lua-postprocess-output-buffer: start search from last prompt, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3d6f6ed 012/468: enforce interactive mode by default: (defcustom lua-default-command-switches (list "-i")..., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8ab6df6 026/468: Fix bug #619: Wrong identation with .. operator, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d313ff5 024/468: New Release: 20061208, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 31acb6b 029/468: Fix bug #621: Wrong comment block detection, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8f17c27 021/468: fix [#472] lua-mode colorization, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b11a136 022/468: implemented lua-forward-sexp using lua-find-matching-token-word, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c49fb68 023/468: Fixed lua-prompt-regex and handling of output without newline (bug #425), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 99324a4 034/468: minor font-lock fix, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c61bda2 040/468: Commit from Reuben:,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode cd5fa7d 010/468: lua-start-process: made program &optional argument (defaults to name), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 13363db 017/468: Fixed typo (#470), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 9730289 027/468: Insert Project page Link, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode bf0b902 033/468: New Release 20070708, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode ab9783f 041/468: Applied patch from Reuben Thomas:, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 2786823 043/468: Add example code to trigger lua-mode for hash-bang lines containing, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4f4d3de 047/468: Add Makefile with dist and release targets, and ignore release zips., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 16861a3 032/468: Fix bug #620 again: Wrong identation with tables, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e10183d 037/468: handle font-lock-variable-name-face (Reuben Thomas), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode ab2d44c 038/468: Multiple changes by Reuben Thomas:, Philip Kaludercic, 2021/08/05