Skip to content

Commit

Permalink
Bump minimum supported version to Emacs-28
Browse files Browse the repository at this point in the history
  • Loading branch information
pkryger committed Dec 12, 2024
1 parent b02e5bb commit 5daba87
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 38 deletions.
10 changes: 5 additions & 5 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
;; the startup time.
(setq gc-cons-threshold 100000000)

(let ((min-version "27.1"))
(let ((min-version "28"))
(when (version< emacs-version min-version)
(error "This config requires at least Emacs %s, but you're running %s"
(error "This config requires at least Emacs-%s, but you're running %s"
min-version emacs-version)))

(setq initial-scratch-message
Expand Down Expand Up @@ -140,7 +140,7 @@ melpa-stable.")
;; Bind this early, and only if it has not been bound already,
;; so customisation from other places (i.e., before-init files)
;; are not overwritten.
(unless (boundp 'package-install-upgrade-built-in)
(unless (boundp 'package-install-upgrade-built-in) ;; since Emacs-29
(setq package-install-upgrade-built-in t))

;; Load before init files
Expand Down Expand Up @@ -172,7 +172,7 @@ melpa-stable.")
(setq package-user-dir
(locate-user-emacs-file (concat "elpa-" emacs-version)))

(when (fboundp 'native-comp-available-p) ;; check needed before Emacs-28
(when (fboundp 'native-comp-available-p)
(setq package-native-compile (native-comp-available-p)))

(package-initialize)
Expand Down Expand Up @@ -426,7 +426,7 @@ after it's been byte compiled."
(exordium-require 'init-dired) ; enable dired+ and wdired permission editing
(exordium-require 'init-git) ; Magit and git gutter
(exordium-require 'init-git-visit-diffs) ; visit diffs in successive narrowed buffers
(when (version< "29.1" emacs-version)
(when (version< "29" emacs-version)
(exordium-require 'init-forge)) ; Forge

(exordium-require 'init-flb-mode) ; frame-local buffers
Expand Down
4 changes: 2 additions & 2 deletions modules/init-company.el
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
(load (file-name-concat (locate-user-emacs-file "modules") "init-require"))))
(exordium-require 'init-prefs)

(when (version< "29.1" emacs-version)
(when (version< "29" emacs-version)
(exordium-require 'init-forge))

(eval-when-compile
Expand Down Expand Up @@ -42,7 +42,7 @@

(use-package company
:diminish "CA"
:if (version< "29.1" emacs-version)
:if (version< "29" emacs-version)
:defer t
:commands (company-begin-backend)
:init
Expand Down
2 changes: 1 addition & 1 deletion modules/init-docker.el
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
:custom
(docker-use-sudo nil))

(when (version< emacs-version "29")
(when (version< emacs-version "29")
(use-package docker-tramp
:after docker
:defer t))
Expand Down
25 changes: 7 additions & 18 deletions modules/init-font-lock.el
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,13 @@
(c-mode . t)
(C++-mode . 1) ;; t or 1 or 2
(t . t)))
;;
;; Lazy font-lock to avoid the bug in Emacs 24
(cond ((fboundp 'jit-lock-mode)
(setq jit-lock-chunk-size 5000
jit-lock-context-time 0.2
jit-lock-defer-time .1
jit-lock-stealth-nice 0.2
jit-lock-stealth-time 5
jit-lock-stealth-verbose nil)
(jit-lock-mode t))
((fboundp 'turn-on-lazy-shot) ; before Emacs-29
(add-hook 'font-lock-mode-hook #'turn-on-lazy-shot))
((fboundp 'turn-on-lazy-lock) ; before Emacs-29
(add-hook 'font-lock-mode-hook #'turn-on-lazy-lock)
(defvar lazy-lock-stealth-time)
(setq lazy-lock-stealth-time 10)
(defvar lazy-lock-minimum-size)
(setq lazy-lock-minimum-size 10000))))
(setq jit-lock-chunk-size 5000
jit-lock-context-time 0.2
jit-lock-defer-time .1
jit-lock-stealth-nice 0.2
jit-lock-stealth-time 5
jit-lock-stealth-verbose nil)
(jit-lock-mode t))
(t
;; Disable font lock completely.
(global-font-lock-mode -1)))
Expand Down
4 changes: 2 additions & 2 deletions modules/init-forge.t.el
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
(require 'ert)
(require 'cl-lib)

(when (version< "29.1" emacs-version)
(when (version< "29" emacs-version)

(eval-when-compile
(unless (featurep 'init-require)
Expand Down Expand Up @@ -74,7 +74,7 @@
(exordium-forge-cleanup-known-repositories--concat to-delete)))))


) ;; (version< "29.1" emacs-version)
) ;; (version< "29" emacs-version)

(provide 'init-forge.t)

Expand Down
15 changes: 5 additions & 10 deletions modules/init-util.el
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,9 @@ Otherwise escape quotes in the inner string (rationalising escaping)."
(save-restriction
(widen)
(save-excursion
;; Starting with emacs-28 python strings are split when using a generic
;; string delimeter: first and last two quotes are a separate sexp, and
;; the `forward-sexp' only works from the most inner quote. However,
;; in emacs-27, the `forward-sexp' works only from the most outer quote.
;; Python strings are split on a generic string delimeter: first and last
;; two quotes are a separate sexp, and the `forward-sexp' only works from
;; the most inner quote.
(when-let* ((orig-start (if (region-active-p)
(let* ((pt (min (region-beginning)
(region-end)))
Expand Down Expand Up @@ -569,13 +568,9 @@ Otherwise escape quotes in the inner string (rationalising escaping)."
pt))
(save-excursion
(goto-char orig-start)
(forward-char (if (version< emacs-version "28")
0
(logand quote-length 2)))
(forward-char (logand quote-length 2))
(forward-sexp)
(forward-char (if (version< emacs-version "28")
0
(logand quote-length 2)))
(forward-char (logand quote-length 2))
(point)))))
(goto-char orig-start)
(delete-char quote-length)
Expand Down

0 comments on commit 5daba87

Please sign in to comment.