@@ -294,8 +294,8 @@ Fix up multiline comments.
294
294
(or (swift-mode:chunk-after)
295
295
(and (looking-at " \\ s *\\ (/[/*]\\ |#*\"\"\" \\ )" )
296
296
(swift-mode:chunk-after (match-end 0 )))))))
297
- comment-start
298
- comment-end
297
+ comment-start-pos
298
+ comment-end-pos
299
299
one-line
300
300
have-break-after-open-delimiter
301
301
have-break-before-close-delimiter
@@ -304,16 +304,16 @@ Fix up multiline comments.
304
304
result)
305
305
(if (swift-mode:chunk:multiline-comment-p chunk)
306
306
(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))
309
309
; ; Is filling the entire comment?
310
310
(if (and (member (save-excursion
311
311
(goto-char from)
312
312
(skip-syntax-forward " >" )
313
313
(point ))
314
- (list comment-start
314
+ (list comment-start-pos
315
315
(save-excursion
316
- (goto-char comment-start)
316
+ (goto-char comment-start-pos )
317
317
(forward-char )
318
318
(skip-chars-forward " *" )
319
319
(skip-syntax-forward " >" )
@@ -322,39 +322,42 @@ Fix up multiline comments.
322
322
(goto-char to)
323
323
(skip-syntax-backward " >" )
324
324
(point ))
325
- (list comment-end
325
+ (list comment-end-pos
326
326
(save-excursion
327
- (goto-char comment-end)
327
+ (goto-char comment-end-pos )
328
328
(backward-char )
329
329
(skip-chars-backward " *" )
330
330
(skip-syntax-backward " >" )
331
331
(point )))))
332
332
(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))
335
336
(setq have-break-after-open-delimiter
336
337
(save-excursion
337
- (goto-char comment-start)
338
+ (goto-char comment-start-pos )
338
339
(forward-char )
339
340
(skip-chars-forward " *" )
340
341
(skip-syntax-forward " " )
341
342
(eolp )))
342
343
(setq have-break-before-close-delimiter
343
344
(save-excursion
344
- (goto-char comment-end)
345
+ (goto-char comment-end-pos )
345
346
(backward-char )
346
347
(skip-chars-backward " *" )
347
348
(skip-syntax-backward " " )
348
349
(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 ))
351
352
(setq result (apply fill-region-as-paragraph from to args))
352
353
; ; If the entire comment fits in one line, do nothing.
353
354
; ; Otherwise, insert line breaks before/after the contents
354
355
; ; 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)
356
359
(save-excursion
357
- (goto-char comment-start)
360
+ (goto-char comment-start-pos )
358
361
(forward-char )
359
362
(skip-chars-forward " *" )
360
363
(skip-syntax-forward " " )
@@ -366,7 +369,7 @@ Fix up multiline comments.
366
369
(indent-according-to-mode ))
367
370
(setq contents-start (point )))
368
371
(save-excursion
369
- (goto-char comment-end)
372
+ (goto-char comment-end-pos )
370
373
(backward-char )
371
374
(skip-chars-backward " *" )
372
375
(skip-syntax-backward " " )
@@ -381,8 +384,8 @@ Fix up multiline comments.
381
384
contents-start
382
385
contents-end
383
386
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 )
386
389
result)
387
390
(apply fill-region-as-paragraph from to args)))
388
391
(apply fill-region-as-paragraph from to args)))
@@ -672,18 +675,18 @@ Example:
672
675
; ; Do nothing.
673
676
nil
674
677
(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 )
678
681
(save-excursion
679
- (goto-char comment-start)
682
+ (goto-char comment-start-pos )
680
683
(forward-char )
681
684
(skip-chars-forward " *" )
682
685
(delete-horizontal-space )
683
686
(insert-and-inherit " \n " )
684
687
(indent-according-to-mode ))
685
688
(save-excursion
686
- (goto-char comment-end)
689
+ (goto-char comment-end-pos )
687
690
(backward-char )
688
691
(skip-chars-backward " *" )
689
692
(skip-syntax-backward " " )
0 commit comments