Skip to content

Commit 61fc785

Browse files
committed
Merge pull request #173 from rranelli/master
Add function to apply `fill-region` in doc strings
2 parents 2b0dc2a + b175798 commit 61fc785

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

elixir-mode.el

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,17 @@ just return nil."
505505
(let* ((output (elixir-mode--execute-elixir-with-code-string-to-quoted string)))
506506
(elixir-quoted--initialize-buffer output)))
507507

508+
(defun elixir-mode-fill-doc-string ()
509+
(interactive)
510+
(save-excursion
511+
(re-search-backward "@\\(?:module\\)?doc +\"\"\"" nil t)
512+
(re-search-forward "\"\"\"" nil t)
513+
(set-mark (point))
514+
(re-search-forward "\"\"\"" nil t)
515+
(re-search-backward "^ *\"\"\"" nil t)
516+
(backward-char)
517+
(fill-region (point) (mark))))
518+
508519
(defun elixir-mode-eval-on-region (beg end)
509520
"Evaluate the Elixir code on the marked region.
510521
Argument BEG Start of the region.

0 commit comments

Comments
 (0)