Zulip Chat Archive

Stream: new members

Topic: emacs tip: filladapt


Joseph Corneli (Aug 07 2018 at 10:46):

I had run into an issue with filling block comments in lean-mode.

The problem is solved with

(require 'filladapt)
(add-hook 'lean-mode-hook #'filladapt-mode)

Maybe that's helpful for someone.

Joseph Corneli (Aug 07 2018 at 10:49):

... oh, but maybe I spoke too soon, since by default that screws up the fill behavior for -- style comments.

Joseph Corneli (Aug 07 2018 at 10:58):

OK, adding one line to the relevant token table fixed it:

(setq filladapt-token-table
      '(("^" beginning-of-line)
        (">+" citation->)
        ("\\(\\w\\|[0-9]\\)[^'`\"<
]*>[    ]*" supercite-citation)
        (";+" lisp-comment)
        ;; Added this line
        ("--" lisp-comment)
        ("#+" sh-comment)
        ("%+" postscript-comment)
        ("///*" c++-comment)
        ("@c[   ]" texinfo-comment)
        ("@comment[     ]" texinfo-comment)
        ("\\\\item[     ]" bullet)
        ("[0-9]+\\.[    ]" bullet)
        ("[0-9]+\\(\\.[0-9]+\\)+[   ]" bullet)
        ("[A-Za-z]\\.[  ]" bullet)
        ("(?[0-9]+)[    ]" bullet)
        ("(?[A-Za-z])[  ]" bullet)
        ("[0-9]+[A-Za-z]\\.[    ]" bullet)
        ("(?[0-9]+[A-Za-z])[    ]" bullet)
        ("[-~*+]+[  ]" bullet)
        ("o[    ]" bullet)
        ("[     ]+" space)
        ("$" end-of-line)))

Simon Hudon (Aug 07 2018 at 14:12):

I've created a repo for user contributions to lean-mode: https://github.com/leanprover-community/lean-mode-contrib

That might be a good place to put it

Joseph Corneli (Aug 07 2018 at 16:39):

OK I'll try to tidy up and send there. Thanks!

Simon Hudon (Aug 07 2018 at 19:09):

:+1:


Last updated: Dec 20 2023 at 11:08 UTC