[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode dfc3b78 083/468: Preserve buffer-modified-p state
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode dfc3b78 083/468: Preserve buffer-modified-p state when (un-)marking multiline delimiters |
Date: |
Thu, 5 Aug 2021 04:58:12 -0400 (EDT) |
branch: elpa/lua-mode
commit dfc3b7859ece0e1e51b0f789267aaab6805d3234
Author: immerrr <immerrr@gmail.com>
Commit: immerrr <immerrr@gmail.com>
Preserve buffer-modified-p state when (un-)marking multiline delimiters
---
lua-mode.el | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 4520258..f105b00 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1184,7 +1184,10 @@ left out."
If TYPE is string, mark char as string delimiter. If TYPE is comment,
mark char as comment delimiter. Otherwise, remove the mark if any."
- (lua-put-char-syntax-table pos (lua-get-multiline-delim-syntax type)))
+ (let ((old-modified-p (buffer-modified-p)))
+ (unwind-protect
+ (lua-put-char-syntax-table pos (lua-get-multiline-delim-syntax type))
+ (set-buffer-modified-p old-modified-p))))
(defun lua-clear-multiline-delims (&optional begin end)
"Clears all Lua multiline construct markers in region
@@ -1192,7 +1195,10 @@ mark char as comment delimiter. Otherwise, remove the
mark if any."
If BEGIN is nil, start from `beginning-of-buffer'.
If END is nil, stop at `end-of-buffer'."
(interactive)
- (remove-text-properties (or begin 1) (or end (buffer-size)) '(syntax-table
()))
+ (let ((old-modified-p (buffer-modified-p)))
+ (unwind-protect
+ (remove-text-properties (or begin 1) (or end (buffer-size))
'(syntax-table ()))
+ (set-buffer-modified-p old-modified-p)))
(font-lock-fontify-buffer))
(defun lua-mark-all-multiline-literals (&optional begin end)
- [nongnu] elpa/lua-mode 7935b5f 064/468: Fix previous commit, (continued)
- [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
- [nongnu] elpa/lua-mode bda4fbd 075/468: lua-calculate-unindentation: update docs, remove extraneous catch, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a20b08e 078/468: lua-indent-line: remove extra variable shift-amt, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c0d6f80 079/468: Add markdown README, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 08cff6e 081/468: Implement basic multiline-aware functionality, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode dfc3b78 083/468: Preserve buffer-modified-p state when (un-)marking multiline delimiters,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 7920d17 087/468: lua-mark-all-multiline-literals: if region is active, limit to region boundaries, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4a22b3c 100/468: Allow lua-start-process to be called interactively., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a3ed448 106/468: Make dist with git-archive, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 742180e 125/468: lua-automark-multiline: add lua-automark-multiline-maxsize variable to prevent long waits on big files, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 0b3df35 135/468: Fix string content indentation: it's now indented by indent-level relative to indentation of the line where string/comment literal starts (issue #6), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 5aa6f9e 042/468: Patch from Reuben: fix long string colouring problem, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode eb5d301 055/468: Bump version., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d66ec8e 080/468: Remove broken multiline literal font-locking, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d142ed1 084/468: Update TODO, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode de12f4b 086/468: lua-mark-all-multiline-literals: also handle multiline comments, Philip Kaludercic, 2021/08/05