summaryrefslogtreecommitdiff
path: root/emacs/inits
diff options
context:
space:
mode:
authortslil <tslil@posteo.de>2026-08-25 15:25:32 +0100
committertslil <tslil@posteo.de>2026-08-25 15:31:42 +0100
commit19839d3067c8bd779fc05eb0f355564b232329b3 (patch)
tree1f12a4b5f117a762d9418f6d9f81d9a3bf4ff743 /emacs/inits
parentf0838ce7e11af2e16e47806355ff76707bc5cbc1 (diff)
[emacs] lexical binding i guess
Diffstat (limited to 'emacs/inits')
-rw-r--r--emacs/inits/01-basic.el7
-rw-r--r--emacs/inits/02-modeline.el4
-rw-r--r--emacs/inits/03-miscload.el4
-rw-r--r--emacs/inits/11-completion.el79
-rw-r--r--emacs/inits/13-ibuffer.el2
-rw-r--r--emacs/inits/14-movement.el12
-rw-r--r--emacs/inits/15-project-mgmt.el6
-rw-r--r--emacs/inits/20-programming.el8
-rw-r--r--emacs/inits/21-functional.el2
-rw-r--r--emacs/inits/22-lisp.el2
-rw-r--r--emacs/inits/23-text-related.el14
-rw-r--r--emacs/inits/24-latex.el8
-rw-r--r--emacs/inits/25-theorems.el2
-rw-r--r--emacs/inits/27-gemini.el2
-rw-r--r--emacs/inits/50-file-assocs.el2
-rw-r--r--emacs/inits/60-misc-configs.el2
-rw-r--r--emacs/inits/70-global-keybinds.el6
-rw-r--r--emacs/inits/99-last.el2
18 files changed, 116 insertions, 48 deletions
diff --git a/emacs/inits/01-basic.el b/emacs/inits/01-basic.el
index e159495..d90138c 100644
--- a/emacs/inits/01-basic.el
+++ b/emacs/inits/01-basic.el
@@ -1,4 +1,6 @@
-;; Time-stamp: <2026-07-03 09h32 BST (anker)>
+;;; -*- lexical-binding: t -*-
+
+;; Time-stamp: <2026-08-04 09h48 BST (a6b530d2)>
;; -----------------------------------------------------------------------------
;; Interface
@@ -85,7 +87,8 @@
(setq my-font "Monaspace Krypton-14")
(setq my-font "Crimson Pro-20")
(setq my-font "Readerly-18")
- (setq my-font "Libron-16")
+ (setq my-font "Libron-18")
+ ;; (setq my-font "Kelmscott Mono-20")
(set-frame-font my-font)
(set-fontset-font t 'unicode
diff --git a/emacs/inits/02-modeline.el b/emacs/inits/02-modeline.el
index 142acbb..624100f 100644
--- a/emacs/inits/02-modeline.el
+++ b/emacs/inits/02-modeline.el
@@ -1,4 +1,6 @@
-;; Time-stamp: <2024-01-18 13h15 CET (3913c8e4)>
+;;; -*- lexical-binding: t -*-
+
+;; Time-stamp: <2026-01-02 17h01 GMT (d63c23ed)>
;; -----------------------------------------------------------------------------
;; Mode-line
diff --git a/emacs/inits/03-miscload.el b/emacs/inits/03-miscload.el
index 87c0b4f..038aa1f 100644
--- a/emacs/inits/03-miscload.el
+++ b/emacs/inits/03-miscload.el
@@ -1,4 +1,6 @@
-;; Time-stamp: <2026-05-22 09h04 PDT (7bca6747)>
+;;; -*- lexical-binding: t -*-
+
+;; Time-stamp: <2026-05-22 09h02 PDT (7bca6747)>
(use-package siege-mode
:load-path "~/.config/emacs/scripts/siege-mode/")
diff --git a/emacs/inits/11-completion.el b/emacs/inits/11-completion.el
index c5fd883..654ee5c 100644
--- a/emacs/inits/11-completion.el
+++ b/emacs/inits/11-completion.el
@@ -1,4 +1,6 @@
-;; Time-stamp: <2026-04-05 20h56 BST (anker)>
+;;; -*- lexical-binding: t -*-
+
+;; Time-stamp: <2026-08-25 15h27 BST (581d7bf5)>
(use-package savehist
:ensure t
@@ -33,32 +35,59 @@
:init
(defun my-completing-read-in-region (start end collection &optional predicate)
- "Prompt for completion of region in the minibuffer if non-unique."
+ "Prompt for completion of region in the minibuffer."
(barf-if-buffer-read-only)
(let* ((initial (buffer-substring-no-properties start end))
- (metadata (completion-metadata initial collection predicate))
- (all (completion-all-completions initial collection predicate
- (if (<= start (point) end)
- (- (point) start)
- (length initial)))))
- (when-let ((last (last all)))
- (setcdr last nil))
- (let ((completion (cond
- ((null all) nil)
- ((and (consp all) (null (cdr all))) (car all))
- (t (completing-read "Completion: " collection
- predicate t initial)))))
- (cond
- (completion
- (completion--replace start end completion)
- (let ((exit-fn (completion-metadata-get metadata 'exit-function)))
- (when exit-fn
- (funcall exit-fn completion
- (if (eq (try-completion completion collection predicate) t)
- 'finished 'exact))))
- t)
- (t (message "No completion") nil)))))
-
+ (source-buffer (current-buffer))
+ (wrapped-table
+ (if (functionp collection)
+ `(lambda (str pred action)
+ (let ((result (with-current-buffer ,source-buffer
+ (funcall ',collection str pred action))))
+ (if (eq action 'metadata)
+ (cons 'metadata
+ (mapcar
+ (lambda (x)
+ (if (and (consp x)
+ (symbolp (car x))
+ (string-suffix-p
+ "-function" (symbol-name (car x)))
+ (functionp (cdr x)))
+ (cons (car x)
+ `(lambda (&rest args)
+ (with-current-buffer ,',source-buffer
+ (apply ',(cdr x) args))))
+ x))
+ (cdr result)))
+ result)))
+ collection))
+ (exit-fn (plist-get completion-extra-properties :exit-function))
+ (ann-fun (plist-get completion-extra-properties :annotation-function))
+ (aff-fun (plist-get completion-extra-properties :affixation-function))
+ (completion-extra-properties
+ `(,@(and ann-fun
+ (list :annotation-function
+ `(lambda (&rest args)
+ (with-current-buffer ,source-buffer
+ (apply ',ann-fun args)))))
+ ,@(and aff-fun
+ (list :affixation-function
+ `(lambda (&rest args)
+ (with-current-buffer ,source-buffer
+ (apply ',aff-fun args)))))))
+ (minibuffer-allow-text-properties t)
+ (enable-recursive-minibuffers t)
+ (completion (completing-read "Completion: " wrapped-table
+ predicate t initial)))
+ (cond
+ ((and completion (not (string-empty-p completion)))
+ (completion--replace start end completion)
+ (when exit-fn
+ (funcall exit-fn completion
+ (if (eq (try-completion completion collection predicate) t)
+ 'finished 'exact)))
+ t)
+ (t ([message]I "No completion") nil))))
(defun my-icomplete-backspace ()
"Delete back to previous / in paths, or normal backspace otherwise."
diff --git a/emacs/inits/13-ibuffer.el b/emacs/inits/13-ibuffer.el
index b7139f8..6139eba 100644
--- a/emacs/inits/13-ibuffer.el
+++ b/emacs/inits/13-ibuffer.el
@@ -1,3 +1,5 @@
+;;; -*- lexical-binding: t -*-
+
;; Time-stamp: <2026-07-31 11h44 BST (51019882)>
(use-package ibuffer
diff --git a/emacs/inits/14-movement.el b/emacs/inits/14-movement.el
index 66da01f..4011c54 100644
--- a/emacs/inits/14-movement.el
+++ b/emacs/inits/14-movement.el
@@ -1,4 +1,6 @@
-;; Time-stamp: <2025-06-25 20h18 BST (anker)>
+;;; -*- lexical-binding: t -*-
+
+;; Time-stamp: <2026-03-24 11h04 GMT (1fa9dc52)>
;; -------------------------------------------------------------------
;; We have expand region at home
@@ -102,10 +104,10 @@
(when hardcore-nav-mode
(global-set-key (kbd "<XF86Back>") nil)
(global-set-key (kbd "<XF86Forward>") nil)
- (global-set-key (kbd "<right>") nil)
- (global-set-key (kbd "<left>") nil)
- (global-set-key (kbd "<up>") nil)
- (global-set-key (kbd "<down>") nil)
+ ;; (global-set-key (kbd "<right>") nil)
+ ;; (global-set-key (kbd "<left>") nil)
+ ;; (global-set-key (kbd "<up>") nil)
+ ;; (global-set-key (kbd "<down>") nil)
(global-set-key (kbd "S-<right>") nil)
(global-set-key (kbd "S-<left>") nil)
(global-set-key (kbd "S-<up>") nil)
diff --git a/emacs/inits/15-project-mgmt.el b/emacs/inits/15-project-mgmt.el
index f61d75d..ed83477 100644
--- a/emacs/inits/15-project-mgmt.el
+++ b/emacs/inits/15-project-mgmt.el
@@ -1,4 +1,6 @@
-;; Time-stamp: <2025-02-19 10h42 GMT (anker)>
+;;; -*- lexical-binding: t -*-
+
+;; Time-stamp: <2026-01-02 16h59 GMT (d63c23ed)>
(defun revert-all-file-buffers ()
"Refresh all open file buffers without confirmation"
@@ -15,4 +17,4 @@
(require 'project)
-(setq project-vc-extra-root-markers '("Cargo.toml"))
+(setq project-vc-extra-root-markers '("Cargo.toml" "pyproject.toml"))
diff --git a/emacs/inits/20-programming.el b/emacs/inits/20-programming.el
index e8ae9b5..e7385ba 100644
--- a/emacs/inits/20-programming.el
+++ b/emacs/inits/20-programming.el
@@ -1,4 +1,6 @@
-;; Time-stamp: <2026-07-31 11h59 BST (51019882)>
+;;; -*- lexical-binding: t -*-
+
+;; Time-stamp: <2026-08-15 16h16 BST (7b97f8ba)>
;; -----------------------------------------------------------------------------
;; General setup
@@ -68,9 +70,7 @@
(electric-pair-local-mode)
(set-fill-column 80)
(display-line-numbers-mode 1)
- (when (not (eq major-mode 'text-mode))
- (hs-minor-mode))
- (setq auto-hscroll-mode t)
+ (visual-line-mode 1)
(when (not (eq major-mode 'python-ts-mode))
(keymap-set (current-local-map) "M-/" 'completion-at-point))
)
diff --git a/emacs/inits/21-functional.el b/emacs/inits/21-functional.el
index 714ccf0..2daa0e3 100644
--- a/emacs/inits/21-functional.el
+++ b/emacs/inits/21-functional.el
@@ -1,3 +1,5 @@
+;;; -*- lexical-binding: t -*-
+
;; Time-stamp: <2026-01-02 11h48 GMT (d63c23ed)>
;; -----------------------------------------------------------------------------
diff --git a/emacs/inits/22-lisp.el b/emacs/inits/22-lisp.el
index 9c5e6fb..a411768 100644
--- a/emacs/inits/22-lisp.el
+++ b/emacs/inits/22-lisp.el
@@ -1,3 +1,5 @@
+;;; -*- lexical-binding: t -*-
+
;; Time-stamp: <2025-06-25 20h02 BST (anker)>
;; ----------------------------------------------------------------------------
diff --git a/emacs/inits/23-text-related.el b/emacs/inits/23-text-related.el
index 59dcf62..0cfe2f1 100644
--- a/emacs/inits/23-text-related.el
+++ b/emacs/inits/23-text-related.el
@@ -1,6 +1,6 @@
-;; Time-stamp: <2026-06-22 10h33 BST (anker)>
+;;; -*- lexical-binding: t -*-
-(add-hook 'text-mode-hook (lambda () (setq line-spacing 6)))
+;; Time-stamp: <2026-06-23 10h11 BST (4331e7a1)>
;; -----------------------------------------------------------------------------
;; Spelling
@@ -24,9 +24,11 @@
(setq sentence-end-double-space nil)
(add-hook 'text-mode-hook (lambda ()
+ (setq line-spacing 4)
(subword-mode 1)
(electric-pair-local-mode 1)
- (turn-on-auto-fill)
+ ;; (turn-on-auto-fill)
+ (visual-line-mode 1)
(siege-mode 1)
(spell-fu-mode 1)))
@@ -40,6 +42,12 @@
:defer
:hook (markdown-mode . (lambda ()
(auto-fill-mode -1)
+ (setq-local electric-pair-text-pairs
+ (append '((?{ . ?})
+ (?` . ?`)
+ (?$ . ?$))
+ electric-pair-pairs))
+ (electric-pair-local-mode 1)
(visual-line-mode))))
;; -----------------------------------------------------------------------------
diff --git a/emacs/inits/24-latex.el b/emacs/inits/24-latex.el
index 8df11c1..9f7b33d 100644
--- a/emacs/inits/24-latex.el
+++ b/emacs/inits/24-latex.el
@@ -1,6 +1,8 @@
-;; Time-stamp: <2025-06-25 19h55 BST (anker)>
+;;; -*- lexical-binding: t -*-
-(defvar latex-template-dir (expand-file-name "~/typeset/latex-templates"))
+;; Time-stamp: <2026-01-15 20h47 GMT (2c38aa2b)>
+
+(defvar latex-template-dir (expand-file-name "~/typeset/typeset/latex-templates"))
(defun prompt-latex-file-template ()
"Check if tex file does not exist or the command was called
interactively. If neither, prompt to insert from a template
@@ -119,7 +121,7 @@ populated from the directory *latex-template-dir*"
TeX-source-correlate-mode 'synctex
TeX-view-program-selection '(((output-dvi style-pstricks) "dvips and gv")
(output-dvi "xdvi")
- (output-pdf "Zathura")
+ (output-pdf "Evince")
(output-html "xdg-open")))
;; for PDF tools
diff --git a/emacs/inits/25-theorems.el b/emacs/inits/25-theorems.el
index 51426b3..68aeef4 100644
--- a/emacs/inits/25-theorems.el
+++ b/emacs/inits/25-theorems.el
@@ -1,3 +1,5 @@
+;;; -*- lexical-binding: t -*-
+
;; Time-stamp: <2024-07-13 15h02 CEST (471b3659)>
;; -----------------------------------------------------------------------------
diff --git a/emacs/inits/27-gemini.el b/emacs/inits/27-gemini.el
index 19243d5..0312cb1 100644
--- a/emacs/inits/27-gemini.el
+++ b/emacs/inits/27-gemini.el
@@ -1,3 +1,5 @@
+;;; -*- lexical-binding: t -*-
+
;; Time-stamp: <2025-08-23 13h42 BST (cf998867)>
(use-package elpher
diff --git a/emacs/inits/50-file-assocs.el b/emacs/inits/50-file-assocs.el
index 0024f1a..fc79c1a 100644
--- a/emacs/inits/50-file-assocs.el
+++ b/emacs/inits/50-file-assocs.el
@@ -1,3 +1,5 @@
+;;; -*- lexical-binding: t -*-
+
;; Time-stamp: <2019-09-11 11:29:16 (tslil@basingstoke)>
(use-package gnuplot-mode
diff --git a/emacs/inits/60-misc-configs.el b/emacs/inits/60-misc-configs.el
index 1da810e..9f8a0f1 100644
--- a/emacs/inits/60-misc-configs.el
+++ b/emacs/inits/60-misc-configs.el
@@ -1,3 +1,5 @@
+;;; -*- lexical-binding: t -*-
+
;; Time-stamp: <2022-11-16 07h55 CET (anker)>
(use-package dired
diff --git a/emacs/inits/70-global-keybinds.el b/emacs/inits/70-global-keybinds.el
index de2b17b..6bff284 100644
--- a/emacs/inits/70-global-keybinds.el
+++ b/emacs/inits/70-global-keybinds.el
@@ -1,8 +1,10 @@
-;; Time-stamp: <2026-05-15 09h11 BST (anker)>
+;;; -*- lexical-binding: t -*-
+
+;; Time-stamp: <2026-08-25 15h28 BST (581d7bf5)>
(setq time-stamp-active t
time-stamp-line-limit 3
- time-stamp-format "%Y-%02m-%02d %02Hh%02M %Z (%s)")
+ time-stamp-format "%Y-%02m-%02d %02Hh%02M %Z (%Q)")
(add-hook 'before-save-hook #'time-stamp)
diff --git a/emacs/inits/99-last.el b/emacs/inits/99-last.el
index 9f62f15..b84c993 100644
--- a/emacs/inits/99-last.el
+++ b/emacs/inits/99-last.el
@@ -1,3 +1,5 @@
+;;; -*- lexical-binding: t -*-
+
;; Time-stamp: <2024-03-18 09h51 CET (0c109a04)>
(add-hook 'after-init-hook