[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 7af5dec 057/468: Use line-beginning(-end)-positio
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 7af5dec 057/468: Use line-beginning(-end)-position when possible |
Date: |
Thu, 5 Aug 2021 04:58:07 -0400 (EDT) |
branch: elpa/lua-mode
commit 7af5dec8bbca9fc230b692ffbf5788892486062c
Author: immerrr <immerrr@gmail.com>
Commit: immerrr <immerrr@gmail.com>
Use line-beginning(-end)-position when possible
---
lua-mode.el | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 6fce1e0..bdc8d22 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -364,8 +364,7 @@ to `lua-mode-map', otherwise they are prefixed with
`lua-prefix-key'."
;; private functions
(defun lua-syntax-status ()
"Returns the syntactic status of the character after the point."
- (parse-partial-sexp (save-excursion (beginning-of-line) (point))
- (point)))
+ (parse-partial-sexp (line-beginning-position) (point)))
(defun lua-string-p ()
@@ -586,13 +585,10 @@ Returns the point, or nil if it reached the end of the
buffer"
(defun lua-last-token-continues-p ()
"Returns true if the last token on this line is a continuation token."
- (let (line-begin
- line-end)
+ (let ((line-begin (line-beginning-position))
+ (line-end (line-end-position)))
(save-excursion
- (beginning-of-line)
- (setq line-begin (point))
(end-of-line)
- (setq line-end (point))
;; we need to check whether the line ends in a comment and
;; skip that one.
(while (lua-find-regexp 'backward "-" line-begin 'lua-string-p)
@@ -603,10 +599,8 @@ Returns the point, or nil if it reached the end of the
buffer"
(defun lua-first-token-continues-p ()
"Returns true if the first token on this line is a continuation token."
- (let (line-end)
+ (let ((line-end (line-end-position)))
(save-excursion
- (end-of-line)
- (setq line-end (point))
(beginning-of-line)
(re-search-forward lua-cont-bol-regexp line-end t))))
@@ -679,7 +673,7 @@ The effect of each token can be either a shift relative to
the current
indentation level, or indentation to some absolute column. This information
is collected in a list of indentation info pairs, which denote absolute
and relative each, and the shift/column to indent to."
- (let* ((line-end (save-excursion (end-of-line) (point)))
+ (let* ((line-end (line-end-position))
(search-stop (if parse-end (min parse-end line-end) line-end))
(indentation-info nil))
(if parse-start (goto-char parse-start))
@@ -929,9 +923,7 @@ This function just searches for a `end' at the beginning of
a line."
"Send current line to lua subprocess, found in `lua-process'.
If `lua-process' is nil or dead, start a new process first."
(interactive)
- (let ((start (save-excursion (beginning-of-line) (point)))
- (end (save-excursion (end-of-line) (point))))
- (lua-send-region start end)))
+ (lua-send-region (line-beginning-position) (line-end-position)))
(defun lua-send-region (start end)
"Send region to lua subprocess."
- [nongnu] elpa/lua-mode bdf4bab 025/468: support for hideshow, (continued)
- [nongnu] elpa/lua-mode bdf4bab 025/468: support for hideshow, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d7c462a 030/468: Fix bug #620: Wrong identation with tables, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode eebb50c 035/468: Fix #1913: Indenting: "(" like "{", Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode fc0a1e3 036/468: Changes/Fixes by Reuben Thomas:, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode de08e4b 028/468: Added version comment for Tom Tromeys package.el, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 676f0a6 045/468: Sync with reality., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 239783b 046/468: Bump version., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a5f8e7b 048/468: Fix generation and use of VERSION, and ignore release notes files., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 14300f1 049/468: Specify branch to pull from., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 60073cc 050/468: Change https to http in URL., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7af5dec 057/468: Use line-beginning(-end)-position when possible,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 3ba5bf1 059/468: Redo lua-toggle-electric-state, remove extra function lua-calculate-state, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e610db4 060/468: lua-make-indentation-info-pair: readability refactoring, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode cc46763 061/468: Add some comments, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b2860f1 062/468: lua-setup-keymap: improve readability, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7935b5f 064/468: Fix previous commit, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 85d26f8 065/468: lua-mode-map: initialize as soon as lua-mode is loaded (previously waited for call to lua-mode), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3339da6 067/468: lua-prefix-key: auto-convert from/to character, update bindings automagically, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 5842703 068/468: Add TODO, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8165775 069/468: Fix lua-set-prefix message, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6b1d389 074/468: lua-calculate-unindentation: skip semicolons as well, Philip Kaludercic, 2021/08/05