Skip to content

Commit

Permalink
magit-disable-section-inserter: Allow several functions as arguments
Browse files Browse the repository at this point in the history
The function `magit-disable-section-inserter` is convenient in a
.dir-locals.el file to disable a section per repository. When more
than one section should be disabled, this function can be called
several times. This commit makes disabling several sections easier by
allowing more than one section as argument.
  • Loading branch information
DamienCassou committed Mar 18, 2024
1 parent 28bcd29 commit 0ee0d4b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lisp/magit-section.el
Expand Up @@ -2179,10 +2179,15 @@ again use `remove-hook'."

(defun magit-disable-section-inserter (fn)
"Disable the section inserter FN in the current repository.
FN can be a single section inserter or a list of inserters.
It is only intended for use in \".dir-locals.el\" and
\".dir-locals-2.el\". Also see info node `(magit)Per-Repository
Configuration'."
(cl-pushnew fn magit-disabled-section-inserters))
(unless (listp fn) (cl-callf list fn))
(dolist (each fn)
(cl-pushnew each magit-disabled-section-inserters)))

(put 'magit-disable-section-inserter 'safe-local-eval-function t)

Expand Down

0 comments on commit 0ee0d4b

Please sign in to comment.