Commit graph

8 commits

Author SHA1 Message Date
Henrik Lissner
729e8d8f39
Fix #4035: fill-column toggle 2020-10-06 14:19:36 -04:00
Steven vanZyl
3f28411f64 Use delegate function
As suggested by Henrik I changed it to use a delegate function, which reduces
code duplication and makes things cleaner
2020-10-05 10:14:54 -04:00
Steven vanZyl
5eb03ae45b Change fill-column conditionals to use macro
The conditionals in the `fill-column` module used the raw version number, this
commit changes them to use the macro provided by DOOM.

Suggested by @gagbo
2020-10-05 10:14:54 -04:00
Steven vanZyl
7daa3aaae9 Improve fill-column module for 27
Emacs 27 introduced `display-fill-column-indicator-mode` which replaces
`hl-fill-column`. This commit adds some conditionals to use
`display-fill-column-indicator-mode` on Emacs 27+, or falls back to
`hl-fill-column-mode` on older versions.
2020-10-05 10:14:54 -04:00
Henrik Lissner
b78fc4eb76
Minor refactor & reformatting across the board 2020-04-08 15:30:10 -04:00
Henrik Lissner
a3e262c7ac
💥 Refactor add-hook! macro & change arg order
This update may potentially break your usage of add-hook! if you pass
the :local or :append properties to it. This is how they used to work:

  (add-hook! :append 'some-mode-hook #'do-something)

Thsoe properties must now follow the hooks, e.g.

  (add-hook! 'some-mode-hook :append #'do-something)

Other changes:
- Various add-hook calls have been renamed to add-hook! because I
  incorrectly assumed `defun` always returned its definition's symbol,
  when in fact, its return value is "undefined" (so sayeth the
  documentation). This should fix #1597.
- This update adds the ability to add multiple functions to hooks
  without a list:

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

- The indentation logic has been changed so that consecutive function
  symbols at indented at the same level as the first argument, but forms
  are indent like a defun.

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

    (add-hook! 'some-mode-hook
      (message "Hello"))
2019-07-26 20:17:29 +02:00
Henrik Lissner
650e9049f0
Autoload hl-fill-column-mode
Because the package doesn't, for some reason.
2019-07-24 15:25:24 +02:00
Henrik Lissner
448ec65997
ui/fill-column: move init code into autoload. 2019-07-22 02:37:46 +02:00