Created
July 4, 2018 22:40
-
-
Save astahlman/45f11f8e84d63df41addd53cdab6b0ef to your computer and use it in GitHub Desktop.
Allow magit-popup menus to be redefined for iterative development.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro magit-redefine-popup (name doc &rest args) | |
"Define a popup command named NAME. | |
See magit-define-popup for a description of the parameters. | |
Unlike with magit-define-popup, changes to the popup definition | |
*will* be reflected upon re-evaluating this form. This is | |
convenient for iterative, interactive development of a | |
magit-popup menu." | |
(let* ((-name (symbol-name name)) | |
(popup-name (progn | |
(string-match "\\([^ ]+\\)-popup" -name) | |
(match-string 1 -name)))) | |
`(progn | |
(makunbound (intern ,(concat popup-name "-arguments"))) | |
(makunbound (intern ,-name)) | |
(fmakunbound (intern ,-name)) | |
(magit-define-popup ,name ,doc ,@args)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment