diff --git a/extensions/legit/legit-rebase.lisp b/extensions/legit/legit-rebase.lisp index 91262c8f1..d851b7c08 100644 --- a/extensions/legit/legit-rebase.lisp +++ b/extensions/legit/legit-rebase.lisp @@ -40,6 +40,11 @@ and :keymap *legit-rebase-mode-keymap*) (setf (variable-value 'enable-syntax-highlight) t)) +(define-file-associations legit-rebase-mode + ((:file-namestring "git-rebase-todo") + (:file-namestring "git-rebase-todo.backup"))) + + ;; Use commits with a keypress: (define-key *legit-rebase-mode-keymap* "p" 'rebase-mark-line-pick) (define-key *legit-rebase-mode-keymap* "r" 'rebase-mark-line-reword) diff --git a/src/file.lisp b/src/file.lisp index 24ab35233..9a221dcd7 100644 --- a/src/file.lisp +++ b/src/file.lisp @@ -12,6 +12,21 @@ (get mode 'file-mode-associations)) (defmacro define-file-associations (mode specs) + "Associate a mode to a list of file names so that the files are always open in this mode. + + Specs are in the form (:spec \"filename\"), + + Available specs: + + :file-namestring + + Example: + + (define-file-associations makefile-mode + ((:file-namestring \"Makefile\") + (:file-namestring \"makefile\"))) + + See also DEFINE-FILE-TYPE." `(setf (file-mode-associations ',mode) ',specs)) (defun get-file-mode (pathname)