Skip to content

Commit 975e256

Browse files
committed
Rename comment-start and comment-end
It caused errors in Emacs 24.
1 parent 4267030 commit 975e256

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

swift-mode-fill.el

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ Fix up multiline comments.
294294
(or (swift-mode:chunk-after)
295295
(and (looking-at "\\s *\\(/[/*]\\|#*\"\"\"\\)")
296296
(swift-mode:chunk-after (match-end 0)))))))
297-
comment-start
298-
comment-end
297+
comment-start-pos
298+
comment-end-pos
299299
one-line
300300
have-break-after-open-delimiter
301301
have-break-before-close-delimiter
@@ -304,16 +304,16 @@ Fix up multiline comments.
304304
result)
305305
(if (swift-mode:chunk:multiline-comment-p chunk)
306306
(progn
307-
(setq comment-start (swift-mode:chunk:start chunk))
308-
(setq comment-end (swift-mode:chunk:end chunk))
307+
(setq comment-start-pos (swift-mode:chunk:start chunk))
308+
(setq comment-end-pos (swift-mode:chunk:end chunk))
309309
;; Is filling the entire comment?
310310
(if (and (member (save-excursion
311311
(goto-char from)
312312
(skip-syntax-forward " >")
313313
(point))
314-
(list comment-start
314+
(list comment-start-pos
315315
(save-excursion
316-
(goto-char comment-start)
316+
(goto-char comment-start-pos)
317317
(forward-char)
318318
(skip-chars-forward "*")
319319
(skip-syntax-forward " >")
@@ -322,39 +322,42 @@ Fix up multiline comments.
322322
(goto-char to)
323323
(skip-syntax-backward " >")
324324
(point))
325-
(list comment-end
325+
(list comment-end-pos
326326
(save-excursion
327-
(goto-char comment-end)
327+
(goto-char comment-end-pos)
328328
(backward-char)
329329
(skip-chars-backward "*")
330330
(skip-syntax-backward " >")
331331
(point)))))
332332
(progn
333-
(setq one-line
334-
(swift-mode:same-line-p comment-start comment-end))
333+
(setq one-line (swift-mode:same-line-p
334+
comment-start-pos
335+
comment-end-pos))
335336
(setq have-break-after-open-delimiter
336337
(save-excursion
337-
(goto-char comment-start)
338+
(goto-char comment-start-pos)
338339
(forward-char)
339340
(skip-chars-forward "*")
340341
(skip-syntax-forward " ")
341342
(eolp)))
342343
(setq have-break-before-close-delimiter
343344
(save-excursion
344-
(goto-char comment-end)
345+
(goto-char comment-end-pos)
345346
(backward-char)
346347
(skip-chars-backward "*")
347348
(skip-syntax-backward " ")
348349
(bolp)))
349-
(setq comment-start (copy-marker comment-start))
350-
(setq comment-end (copy-marker comment-end))
350+
(setq comment-start-pos (copy-marker comment-start-pos))
351+
(setq comment-end-pos (copy-marker comment-end-pos))
351352
(setq result (apply fill-region-as-paragraph from to args))
352353
;; If the entire comment fits in one line, do nothing.
353354
;; Otherwise, insert line breaks before/after the contents
354355
;; if necessary. See the documentation comment for details.
355-
(unless (swift-mode:same-line-p comment-start comment-end)
356+
(unless (swift-mode:same-line-p
357+
comment-start-pos
358+
comment-end-pos)
356359
(save-excursion
357-
(goto-char comment-start)
360+
(goto-char comment-start-pos)
358361
(forward-char)
359362
(skip-chars-forward "*")
360363
(skip-syntax-forward " ")
@@ -366,7 +369,7 @@ Fix up multiline comments.
366369
(indent-according-to-mode))
367370
(setq contents-start (point)))
368371
(save-excursion
369-
(goto-char comment-end)
372+
(goto-char comment-end-pos)
370373
(backward-char)
371374
(skip-chars-backward "*")
372375
(skip-syntax-backward " ")
@@ -381,8 +384,8 @@ Fix up multiline comments.
381384
contents-start
382385
contents-end
383386
args)))
384-
(set-marker comment-start nil)
385-
(set-marker comment-end nil)
387+
(set-marker comment-start-pos nil)
388+
(set-marker comment-end-pos nil)
386389
result)
387390
(apply fill-region-as-paragraph from to args)))
388391
(apply fill-region-as-paragraph from to args)))
@@ -672,18 +675,18 @@ Example:
672675
;; Do nothing.
673676
nil
674677
(when (swift-mode:chunk:multiline-comment-p chunk)
675-
(let ((comment-start (swift-mode:chunk:start chunk))
676-
(comment-end (swift-mode:chunk:end chunk)))
677-
(when (swift-mode:same-line-p comment-start comment-end)
678+
(let ((comment-start-pos (swift-mode:chunk:start chunk))
679+
(comment-end-pos (swift-mode:chunk:end chunk)))
680+
(when (swift-mode:same-line-p comment-start-pos comment-end-pos)
678681
(save-excursion
679-
(goto-char comment-start)
682+
(goto-char comment-start-pos)
680683
(forward-char)
681684
(skip-chars-forward "*")
682685
(delete-horizontal-space)
683686
(insert-and-inherit "\n")
684687
(indent-according-to-mode))
685688
(save-excursion
686-
(goto-char comment-end)
689+
(goto-char comment-end-pos)
687690
(backward-char)
688691
(skip-chars-backward "*")
689692
(skip-syntax-backward " ")

0 commit comments

Comments
 (0)