Use lexical binding in elisp files.

This silences a warning for each of these files. Lexical binding will become the default in a future version of emacs.
This commit is contained in:
Tom Alexander
2026-09-12 21:00:26 -04:00
parent 450478cff4
commit 4a6cbfad67
28 changed files with 29 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(setq gc-cons-threshold (* 128 1024 1024)) ;; 128MiB Increase garbage collection threshold for performance (default 800000) (setq gc-cons-threshold (* 128 1024 1024)) ;; 128MiB Increase garbage collection threshold for performance (default 800000)
;; Increase amount of data read from processes, default 4k ;; Increase amount of data read from processes, default 4k
(when (version<= "27.0" emacs-version) (when (version<= "27.0" emacs-version)

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(use-package diminish) (use-package diminish)
;; Eglot recommends pulling the latest of the standard libraries it ;; Eglot recommends pulling the latest of the standard libraries it

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
;; ========== Function to reload current file ================= ;; ========== Function to reload current file =================
(defun reload-file () (defun reload-file ()

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
;; Add your keys here, as such ;; Add your keys here, as such
;; Disable the suspend frame hotkeys ;; Disable the suspend frame hotkeys

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
;; Set theme ;; Set theme
(load-theme 'tango-dark t) (load-theme 'tango-dark t)
(set-face-attribute 'default nil :background "black") (set-face-attribute 'default nil :background "black")

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(package-initialize) (package-initialize)
(use-package use-package (use-package use-package
:custom :custom

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(use-package eglot (use-package eglot
;; This is an emacs built-in but we're pulling the latest version ;; This is an emacs built-in but we're pulling the latest version
:pin gnu :pin gnu

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(require 'util-tree-sitter) (require 'util-tree-sitter)
(use-package bash-ts-mode (use-package bash-ts-mode

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(require 'common-lsp) (require 'common-lsp)
(require 'util-tree-sitter) (require 'util-tree-sitter)

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(require 'common-lsp) (require 'common-lsp)
(use-package cmake-mode (use-package cmake-mode

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(defun d2-format-buffer () (defun d2-format-buffer ()
"Run prettier." "Run prettier."
(interactive) (interactive)

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(use-package dockerfile-ts-mode (use-package dockerfile-ts-mode
:pin manual :pin manual
:mode ( :mode (

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(require 'common-lsp) (require 'common-lsp)
(require 'util-tree-sitter) (require 'util-tree-sitter)

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(require 'common-lsp) (require 'common-lsp)
(require 'util-tree-sitter) (require 'util-tree-sitter)

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(defun lua-format-buffer () (defun lua-format-buffer ()
"Run stylua." "Run stylua."
(interactive) (interactive)

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(use-package markdown-mode (use-package markdown-mode
:ensure t :ensure t
:commands (markdown-mode gfm-mode) :commands (markdown-mode gfm-mode)

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(use-package nftables-mode (use-package nftables-mode
:commands nftables-mode :commands nftables-mode
) )

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(require 'common-lsp) (require 'common-lsp)
(require 'util-tree-sitter) (require 'util-tree-sitter)

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(require 'color) (require 'color)
(let ((bg (face-attribute 'default :background))) (let ((bg (face-attribute 'default :background)))
(use-package org (use-package org

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(require 'common-lsp) (require 'common-lsp)
(require 'util-tree-sitter) (require 'util-tree-sitter)

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(require 'common-lsp) (require 'common-lsp)
(require 'util-tree-sitter) (require 'util-tree-sitter)

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(require 'common-lsp) (require 'common-lsp)
(require 'util-tree-sitter) (require 'util-tree-sitter)

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(defun xml-fmt () (defun xml-fmt ()
"Run xmllint --format." "Run xmllint --format."
(run-command-on-buffer "xmllint" "--format" "-") (run-command-on-buffer "xmllint" "--format" "-")

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(defun yaml-format-buffer () (defun yaml-format-buffer ()
"Run prettier." "Run prettier."
(interactive) (interactive)

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(use-package flymake (use-package flymake
:pin manual :pin manual
:ensure nil :ensure nil

View File

@@ -1,3 +1,5 @@
;; -*- lexical-binding: t; -*-
;; (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode)) ;; (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode))
(use-package treesit (use-package treesit

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(defun my/minibuffer-delete (arg) (defun my/minibuffer-delete (arg)
"When looking for files, go up an entire directory with the backspace button if theres no text after the directory." "When looking for files, go up an entire directory with the backspace button if theres no text after the directory."
(interactive "p") (interactive "p")

View File

@@ -1,3 +1,4 @@
;; -*- lexical-binding: t; -*-
(add-to-list 'load-path (concat user-emacs-directory "elisp")) (add-to-list 'load-path (concat user-emacs-directory "elisp"))
(require 'base) (require 'base)