[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode 975e256605 3/5: Rename comment-start and commen
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode 975e256605 3/5: Rename comment-start and comment-end |
Date: |
Sat, 9 Jul 2022 02:59:16 -0400 (EDT) |
branch: elpa/swift-mode
commit 975e256605285c4ba75b86d101bd8cbb1d4a8bd3
Author: taku0 <mxxouy6x3m_github@tatapa.org>
Commit: taku0 <mxxouy6x3m_github@tatapa.org>
Rename comment-start and comment-end
It caused errors in Emacs 24.
---
swift-mode-fill.el | 51 +++++++++++++++++++++++++++------------------------
1 file changed, 27 insertions(+), 24 deletions(-)
diff --git a/swift-mode-fill.el b/swift-mode-fill.el
index 8481a29083..5d0c876873 100644
--- a/swift-mode-fill.el
+++ b/swift-mode-fill.el
@@ -294,8 +294,8 @@ Fix up multiline comments.
(or (swift-mode:chunk-after)
(and (looking-at "\\s *\\(/[/*]\\|#*\"\"\"\\)")
(swift-mode:chunk-after (match-end 0)))))))
- comment-start
- comment-end
+ comment-start-pos
+ comment-end-pos
one-line
have-break-after-open-delimiter
have-break-before-close-delimiter
@@ -304,16 +304,16 @@ Fix up multiline comments.
result)
(if (swift-mode:chunk:multiline-comment-p chunk)
(progn
- (setq comment-start (swift-mode:chunk:start chunk))
- (setq comment-end (swift-mode:chunk:end chunk))
+ (setq comment-start-pos (swift-mode:chunk:start chunk))
+ (setq comment-end-pos (swift-mode:chunk:end chunk))
;; Is filling the entire comment?
(if (and (member (save-excursion
(goto-char from)
(skip-syntax-forward " >")
(point))
- (list comment-start
+ (list comment-start-pos
(save-excursion
- (goto-char comment-start)
+ (goto-char comment-start-pos)
(forward-char)
(skip-chars-forward "*")
(skip-syntax-forward " >")
@@ -322,39 +322,42 @@ Fix up multiline comments.
(goto-char to)
(skip-syntax-backward " >")
(point))
- (list comment-end
+ (list comment-end-pos
(save-excursion
- (goto-char comment-end)
+ (goto-char comment-end-pos)
(backward-char)
(skip-chars-backward "*")
(skip-syntax-backward " >")
(point)))))
(progn
- (setq one-line
- (swift-mode:same-line-p comment-start comment-end))
+ (setq one-line (swift-mode:same-line-p
+ comment-start-pos
+ comment-end-pos))
(setq have-break-after-open-delimiter
(save-excursion
- (goto-char comment-start)
+ (goto-char comment-start-pos)
(forward-char)
(skip-chars-forward "*")
(skip-syntax-forward " ")
(eolp)))
(setq have-break-before-close-delimiter
(save-excursion
- (goto-char comment-end)
+ (goto-char comment-end-pos)
(backward-char)
(skip-chars-backward "*")
(skip-syntax-backward " ")
(bolp)))
- (setq comment-start (copy-marker comment-start))
- (setq comment-end (copy-marker comment-end))
+ (setq comment-start-pos (copy-marker comment-start-pos))
+ (setq comment-end-pos (copy-marker comment-end-pos))
(setq result (apply fill-region-as-paragraph from to args))
;; If the entire comment fits in one line, do nothing.
;; Otherwise, insert line breaks before/after the contents
;; if necessary. See the documentation comment for
details.
- (unless (swift-mode:same-line-p comment-start comment-end)
+ (unless (swift-mode:same-line-p
+ comment-start-pos
+ comment-end-pos)
(save-excursion
- (goto-char comment-start)
+ (goto-char comment-start-pos)
(forward-char)
(skip-chars-forward "*")
(skip-syntax-forward " ")
@@ -366,7 +369,7 @@ Fix up multiline comments.
(indent-according-to-mode))
(setq contents-start (point)))
(save-excursion
- (goto-char comment-end)
+ (goto-char comment-end-pos)
(backward-char)
(skip-chars-backward "*")
(skip-syntax-backward " ")
@@ -381,8 +384,8 @@ Fix up multiline comments.
contents-start
contents-end
args)))
- (set-marker comment-start nil)
- (set-marker comment-end nil)
+ (set-marker comment-start-pos nil)
+ (set-marker comment-end-pos nil)
result)
(apply fill-region-as-paragraph from to args)))
(apply fill-region-as-paragraph from to args)))
@@ -672,18 +675,18 @@ Example:
;; Do nothing.
nil
(when (swift-mode:chunk:multiline-comment-p chunk)
- (let ((comment-start (swift-mode:chunk:start chunk))
- (comment-end (swift-mode:chunk:end chunk)))
- (when (swift-mode:same-line-p comment-start comment-end)
+ (let ((comment-start-pos (swift-mode:chunk:start chunk))
+ (comment-end-pos (swift-mode:chunk:end chunk)))
+ (when (swift-mode:same-line-p comment-start-pos comment-end-pos)
(save-excursion
- (goto-char comment-start)
+ (goto-char comment-start-pos)
(forward-char)
(skip-chars-forward "*")
(delete-horizontal-space)
(insert-and-inherit "\n")
(indent-according-to-mode))
(save-excursion
- (goto-char comment-end)
+ (goto-char comment-end-pos)
(backward-char)
(skip-chars-backward "*")
(skip-syntax-backward " ")