Fix fill-paragraph in asm-mode

* lisp/progmodes/asm-mode.el: The value of fill-prefix ought to be nil
not "\t" so that fill-context-prefix can do its thing. In fact,
fill-prefix does not have to be set at all becuase asm-mode derives
from prog-mode and fill-prefix is set in simple.el.

* test/lisp/progmodes/asm-mode-tests.el: Add relevant test (bug#41064).

Copyright-paperwork-exempt: yes
This commit is contained in:
Mattias M 2021-01-28 07:34:10 +01:00 committed by Lars Ingebrigtsen
parent 0870ebb3cb
commit e7e7ef1588
2 changed files with 11 additions and 2 deletions

View file

@ -141,8 +141,7 @@ Special commands:
(setq-local comment-add 1)
(setq-local comment-start-skip "\\(?:\\s<+\\|/[/*]+\\)[ \t]*")
(setq-local comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)")
(setq-local comment-end "")
(setq fill-prefix "\t"))
(setq-local comment-end ""))
(defun asm-indent-line ()
"Auto-indent the current line."

View file

@ -69,4 +69,14 @@
(should (string-match-p ";;; \nlabel:" (buffer-string)))
(should (= (current-column) 4))))
(ert-deftest asm-mode-tests-fill-comment ()
(asm-mode-tests--with-temp-buffer
(call-interactively #'comment-dwim)
(insert "Pellentesque condimentum, magna ut suscipit hendrerit, \
ipsum augue ornare nulla, non luctus diam neque sit amet urna.")
(call-interactively #'fill-paragraph)
(should (equal (buffer-string) "\t;; Pellentesque condimentum, \
magna ut suscipit hendrerit,\n\t;; ipsum augue ornare nulla, non \
luctus diam neque sit amet\n\t;; urna."))))
;;; asm-mode-tests.el ends here