diff options
author | Yuchen Pei <id@ypei.org> | 2023-06-29 00:51:04 +1000 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2023-06-29 00:51:04 +1000 |
commit | 947ee69d9d34d9b20e206b4c224c49022082d8b8 (patch) | |
tree | 5b56706eae042e18ab174e8baec0729ae18e1ddf /emacs | |
parent | b0e256586c24c6fb169d61e98302b11026ff10d2 (diff) |
emacs 29 conditionals (time-stamp and tree-sitter)
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/.emacs.d/init/ycp-editing.el | 4 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-prog.el | 39 |
2 files changed, 23 insertions, 20 deletions
diff --git a/emacs/.emacs.d/init/ycp-editing.el b/emacs/.emacs.d/init/ycp-editing.el index bddd955..351fe2e 100644 --- a/emacs/.emacs.d/init/ycp-editing.el +++ b/emacs/.emacs.d/init/ycp-editing.el @@ -138,7 +138,9 @@ (add-to-list 'auto-mode-alist '("\\(README\\|CHANGELOG\\|COPYING\\|LICENSE\\)\\'" . text-mode)) -(add-hook 'before-save-hook 'time-stamp) +;; https://lists.gnu.org/archive/html/emacs-devel/2023-06/msg00113.html +(when (string< emacs-version "29") + (add-hook 'before-save-hook 'time-stamp)) (save-place-mode 1) diff --git a/emacs/.emacs.d/init/ycp-prog.el b/emacs/.emacs.d/init/ycp-prog.el index 003e862..cb061b2 100644 --- a/emacs/.emacs.d/init/ycp-prog.el +++ b/emacs/.emacs.d/init/ycp-prog.el @@ -426,25 +426,26 @@ (setq coq-diffs 'on) (setq proof-three-window-enable nil)) -;;; tree-sitter -(add-to-list 'load-path (locate-user-emacs-file "lisp/elisp-tree-sitter/core")) -(add-to-list 'load-path (locate-user-emacs-file "lisp/elisp-tree-sitter/lisp")) -(my-package tree-sitter - (:delay 30) - (require 'tree-sitter-hl) - (require 'tree-sitter-langs) - (require 'tree-sitter-debug) - (require 'tree-sitter-query) - (add-to-list 'tree-sitter-major-mode-language-alist - '(haskell-mode . haskell)) - (add-to-list 'tree-sitter-major-mode-language-alist - '(phps-mode . php)) - ;; disable tree sitter for c/c++ and use eglot instead - ;; FIXME: make it so it is only disabled with eglot on - (add-to-list 'tree-sitter-major-mode-language-alist - '(c-mode)) - (global-tree-sitter-mode) - (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)) +;;; tree-sitter is built-in in emacs 29 +(when (string< emacs-version "29") + (add-to-list 'load-path (locate-user-emacs-file "lisp/elisp-tree-sitter/core")) + (add-to-list 'load-path (locate-user-emacs-file "lisp/elisp-tree-sitter/lisp")) + (my-package tree-sitter + (:delay 30) + (require 'tree-sitter-hl) + (require 'tree-sitter-langs) + (require 'tree-sitter-debug) + (require 'tree-sitter-query) + (add-to-list 'tree-sitter-major-mode-language-alist + '(haskell-mode . haskell)) + (add-to-list 'tree-sitter-major-mode-language-alist + '(phps-mode . php)) + ;; disable tree sitter for c/c++ and use eglot instead + ;; FIXME: make it so it is only disabled with eglot on + (add-to-list 'tree-sitter-major-mode-language-alist + '(c-mode)) + (global-tree-sitter-mode) + (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode))) ;;; sml (my-package sml-mode |