branch: elpa/magit
commit eda5d3682ab8af3961232d0d026c3a4b12adf3c2
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
Require Emacs 28.1
---
CHANGELOG | 6 +++
default.mk | 2 +-
lisp/magit-base.el | 2 +-
lisp/magit-blame.el | 6 ---
lisp/magit-extras.el | 3 --
lisp/magit-mode.el | 11 +++---
lisp/magit-section.el | 102 +++++++++++++-------------------------------------
lisp/magit.el | 2 +-
8 files changed, 41 insertions(+), 93 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index c5981c0a7e4..dcd2638bf1c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,10 @@
# -*- mode: org -*-
+* v4.3.9 UNRELEASED
+
+- At least Emacs 28.1 is required now. Emacs 30.1 was released
+ earlier this year, so we do actually continue to support Emacs
+ "oldoldstable".
+
* v4.3.8 2025-07-05
Bugfixes:
diff --git a/default.mk b/default.mk
index f23c2fbaf76..f5316c28708 100644
--- a/default.mk
+++ b/default.mk
@@ -115,7 +115,7 @@ VERSION ?= $(shell \
git describe --tags --abbrev=0 --always | cut -c2-)
REVDESC := $(shell test -e $(TOP).git && git describe --tags)
-EMACS_VERSION = 27.1
+EMACS_VERSION = 28.1
EMACSOLD := $(shell $(BATCH) --eval \
"(and (version< emacs-version \"$(EMACS_VERSION)\") (princ \"true\"))")
diff --git a/lisp/magit-base.el b/lisp/magit-base.el
index 2053d9a7675..ed330387186 100644
--- a/lisp/magit-base.el
+++ b/lisp/magit-base.el
@@ -33,7 +33,7 @@
;;; Code:
;; Also update EMACS_VERSION in "default.mk".
-(defconst magit--minimal-emacs "27.1")
+(defconst magit--minimal-emacs "28.1")
(defconst magit--minimal-git "2.25.0")
(require 'cl-lib)
diff --git a/lisp/magit-blame.el b/lisp/magit-blame.el
index 1de4e8f93d5..f6a3e335d5f 100644
--- a/lisp/magit-blame.el
+++ b/lisp/magit-blame.el
@@ -326,12 +326,6 @@ in `magit-blame-read-only-mode-map' instead."
:lighter magit-blame-mode-lighter
:interactive nil
(cond (magit-blame-mode
- (unless arg
- ;; Emacs < 28.1 doesn't support `:interactive'.
- (setq magit-blame-mode nil)
- (user-error
- (concat "Don't call `magit-blame-mode' directly; "
- "instead use `magit-blame'")))
(add-hook 'after-save-hook #'magit-blame--refresh t t)
(add-hook 'post-command-hook #'magit-blame-goto-chunk-hook t t)
(add-hook 'before-revert-hook #'magit-blame--remove-overlays t t)
diff --git a/lisp/magit-extras.el b/lisp/magit-extras.el
index e5501199c8d..b4dbcd050b6 100644
--- a/lisp/magit-extras.el
+++ b/lisp/magit-extras.el
@@ -205,9 +205,6 @@ to nil before loading Magit to prevent \"m\" from being
bound.")
(with-eval-after-load 'project
(when (and magit-bind-magit-project-status
- ;; Added in Emacs 28.1.
- (boundp 'project-prefix-map)
- (boundp 'project-switch-commands)
;; Only modify if it hasn't already been modified.
(equal project-switch-commands
(eval (car (get 'project-switch-commands 'standard-value))
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 4abc458c79b..d5ebee78e3c 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -435,52 +435,51 @@ recommended value."
"This is a placeholder command, which signals an error if called.
Where applicable, other keymaps remap this command to another,
which actually deletes the thing at point."
+ (declare (completion ignore))
(interactive)
(user-error "There is no thing at point that could be deleted"))
-;; Starting with Emacs 28.1 we could use (declare (completion ignore)).
-(put 'magit-delete-thing 'completion-predicate #'ignore)
(defun magit-visit-thing ()
"This is a placeholder command, which may signal an error if called.
Where applicable, other keymaps remap this command to another,
which actually visits the thing at point."
+ (declare (completion ignore))
(interactive)
(if (eq transient-current-command 'magit-dispatch)
(call-interactively (key-binding (this-command-keys)))
(if-let ((url (thing-at-point 'url t)))
(browse-url url)
(user-error "There is no thing at point that could be visited"))))
-(put 'magit-visit-thing 'completion-predicate #'ignore)
(defun magit-edit-thing ()
"This is a placeholder command, which may signal an error if called.
Where applicable, other keymaps remap this command to another,
which actually lets you edit the thing at point, likely in another
buffer."
+ (declare (completion ignore))
(interactive)
(if (eq transient-current-command 'magit-dispatch)
(call-interactively (key-binding (this-command-keys)))
(user-error "There is no thing at point that could be edited")))
-(put 'magit-edit-thing 'completion-predicate #'ignore)
(defun magit-browse-thing ()
"This is a placeholder command, which may signal an error if called.
Where applicable, other keymaps remap this command to another,
which actually visits thing at point using `browse-url'."
+ (declare (completion ignore))
(interactive)
(if-let ((url (thing-at-point 'url t)))
(browse-url url)
(user-error "There is no thing at point that could be browsed")))
-(put 'magit-browse-thing 'completion-predicate #'ignore)
(defun magit-copy-thing ()
"This is a placeholder command, which signals an error if called.
Where applicable, other keymaps remap this command to another,
which actually copies some representation of the thing at point
to the kill ring."
+ (declare (completion ignore))
(interactive)
(user-error "There is no thing at point that we know how to copy"))
-(put 'magit-copy-thing 'completion-predicate #'ignore)
;;;###autoload
(defun magit-info ()
diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index 46e5b91a61d..6f8e2c454b9 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -10,7 +10,7 @@
;; Package-Version: 4.3.8
;; Package-Requires: (
-;; (emacs "27.1")
+;; (emacs "28.1")
;; (compat "30.1")
;; (llama "1.0.0")
;; (seq "2.24"))
@@ -290,16 +290,6 @@ but that ship has sailed, thus this option."
:group 'magit-section
:type 'boolean)
-(defcustom magit-section-show-context-menu-for-emacs<28 nil
- "Whether `mouse-3' shows a context menu for Emacs < 28.
-
-This has to be set before loading `magit-section' or it has
-no effect. This also has no effect for Emacs >= 28, where
-`context-menu-mode' should be enabled instead."
- :package-version '(magit-section . "4.0.0")
- :group 'magit-section
- :type 'boolean)
-
;;; Variables
(defvar-local magit-section-preserve-visibility t)
@@ -403,45 +393,31 @@ This keymap is used in addition to the section-specific
keymap, if any."
"<double-mouse-1>" #'magit-mouse-toggle-section
"<double-mouse-2>" #'magit-mouse-toggle-section)
-(defvar magit-section-mode-map
- (let ((map (make-keymap)))
- (suppress-keymap map t)
- (when (and magit-section-show-context-menu-for-emacs<28
- (< emacs-major-version 28))
- (keymap-set map "<mouse-3>" nil)
- (keymap-set
- map "<down-mouse-3>"
- `( menu-item "" ,(make-sparse-keymap)
- :filter ,(lambda (_)
- (let ((menu (make-sparse-keymap)))
- (if (fboundp 'context-menu-local)
- (context-menu-local menu last-input-event)
- (magit--context-menu-local menu last-input-event))
- (magit-section-context-menu menu last-input-event)
- menu)))))
- (keymap-set map "<left-fringe> <mouse-1>" #'magit-mouse-toggle-section)
- (keymap-set map "<left-fringe> <mouse-2>" #'magit-mouse-toggle-section)
- (keymap-set map "TAB" #'magit-section-toggle)
- (keymap-set map "C-c TAB" #'magit-section-cycle)
- (keymap-set map "C-<tab>" #'magit-section-cycle)
- (keymap-set map "M-<tab>" #'magit-section-cycle)
- ;; <backtab> is the most portable binding for Shift+Tab.
- (keymap-set map "<backtab>" #'magit-section-cycle-global)
- (keymap-set map "^" #'magit-section-up)
- (keymap-set map "p" #'magit-section-backward)
- (keymap-set map "n" #'magit-section-forward)
- (keymap-set map "M-p" #'magit-section-backward-sibling)
- (keymap-set map "M-n" #'magit-section-forward-sibling)
- (keymap-set map "1" #'magit-section-show-level-1)
- (keymap-set map "2" #'magit-section-show-level-2)
- (keymap-set map "3" #'magit-section-show-level-3)
- (keymap-set map "4" #'magit-section-show-level-4)
- (keymap-set map "M-1" #'magit-section-show-level-1-all)
- (keymap-set map "M-2" #'magit-section-show-level-2-all)
- (keymap-set map "M-3" #'magit-section-show-level-3-all)
- (keymap-set map "M-4" #'magit-section-show-level-4-all)
- map)
- "Parent keymap for all keymaps of modes derived from `magit-section-mode'.")
+(defvar-keymap magit-section-mode-map
+ :doc "Parent keymap for keymaps of modes derived from `magit-section-mode'."
+ :full t
+ :suppress t
+ "<left-fringe> <mouse-1>" #'magit-mouse-toggle-section
+ "<left-fringe> <mouse-2>" #'magit-mouse-toggle-section
+ "TAB" #'magit-section-toggle
+ "C-c TAB" #'magit-section-cycle
+ "C-<tab>" #'magit-section-cycle
+ "M-<tab>" #'magit-section-cycle
+ ;; <backtab> is the most portable binding for Shift+Tab.
+ "<backtab>" #'magit-section-cycle-global
+ "^" #'magit-section-up
+ "p" #'magit-section-backward
+ "n" #'magit-section-forward
+ "M-p" #'magit-section-backward-sibling
+ "M-n" #'magit-section-forward-sibling
+ "1" #'magit-section-show-level-1
+ "2" #'magit-section-show-level-2
+ "3" #'magit-section-show-level-3
+ "4" #'magit-section-show-level-4
+ "M-1" #'magit-section-show-level-1-all
+ "M-2" #'magit-section-show-level-2-all
+ "M-3" #'magit-section-show-level-3-all
+ "M-4" #'magit-section-show-level-4-all)
(define-derived-mode magit-section-mode special-mode "Magit-Sections"
"Parent major mode from which major modes with Magit-like sections inherit.
@@ -661,9 +637,7 @@ with SECTION, otherwise return a list of section types."
(when (consp binding)
(define-key-after menu (vector key)
(copy-sequence binding))))
- (if (fboundp 'menu-bar-keymap)
- (menu-bar-keymap map)
- (magit--menu-bar-keymap map)))))
+ (menu-bar-keymap map))))
menu)
(defun magit-menu-item (desc def &optional props)
@@ -757,28 +731,6 @@ The following %-specs are allowed:
(?M . ,(or multiple value))
(?x . ,(format "%s" magit-menu-common-value))))))
-(defun magit--menu-bar-keymap (keymap)
- "Backport of `menu-bar-keymap' for Emacs < 28.
-Slight trimmed down."
- (let ((menu-bar nil))
- (map-keymap (lambda (key binding)
- (push (cons key binding) menu-bar))
- keymap)
- (cons 'keymap (nreverse menu-bar))))
-
-(defun magit--context-menu-local (menu _click)
- "Backport of `context-menu-local' for Emacs < 28."
- (run-hooks 'activate-menubar-hook 'menu-bar-update-hook)
- (keymap-set-after menu "<separator-local>" menu-bar-separator)
- (let ((keymap (local-key-binding [menu-bar])))
- (when keymap
- (map-keymap (lambda (key binding)
- (when (consp binding)
- (define-key-after menu (vector key)
- (copy-sequence binding))))
- (magit--menu-bar-keymap keymap))))
- menu)
-
(define-advice context-menu-region (:around (fn menu click) magit-section-mode)
"Disable in `magit-section-mode' buffers."
(if (derived-mode-p 'magit-section-mode)
diff --git a/lisp/magit.el b/lisp/magit.el
index a65314e1b22..7c41eecad6d 100644
--- a/lisp/magit.el
+++ b/lisp/magit.el
@@ -19,7 +19,7 @@
;; Package-Version: 4.3.8
;; Package-Requires: (
-;; (emacs "27.1")
+;; (emacs "28.1")
;; (compat "30.1")
;; (llama "1.0.0")
;; (magit-section "4.3.8")