diff --git a/custom-lisp/nebkor-personal.el b/custom-lisp/nebkor-personal.el index 732d181..7fe14ac 100644 --- a/custom-lisp/nebkor-personal.el +++ b/custom-lisp/nebkor-personal.el @@ -1,3 +1,4 @@ +;; -*- lexical-binding: t; -*- (global-set-key [C-tab] #'other-window) (global-set-key [C-S-tab] #'sother-window) (global-set-key [C-iso-lefttab] #'sother-window) diff --git a/nebkor-emacs.org b/nebkor-emacs.org index 5908360..7366277 100644 --- a/nebkor-emacs.org +++ b/nebkor-emacs.org @@ -216,7 +216,8 @@ be updated accordingly. #+end_quote #+begin_src emacs-lisp :tangle no :results none -(org-babel-tangle) + ;; -*- lexical-binding: t; -*- + (org-babel-tangle) #+end_src @@ -672,6 +673,7 @@ Now we are ready to load our per-module configuration files: This module defines everything related to the aesthetics of Emacs. #+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-theme.el" :mkdirp yes + ;; -*- lexical-binding: t; -*- ;;; Everything related to the look of Emacs #+end_src @@ -1014,6 +1016,7 @@ in the function ~prot/enable-variable-pitch~. :END: #+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el" :mkdirp yes + ;; -*- lexical-binding: t; -*- ;;; Essential configurations (use-package emacs :ensure nil @@ -1569,73 +1572,74 @@ soon as I type a space after some characters I am using ~orderless~. (There are more details in Prot's file, for the interested reader) #+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-completion.el" :mkdirp yes -;;; General minibuffer settings -(use-package minibuffer - :ensure nil - :config -;;;; Completion styles - (setq completion-styles '(basic substring initials flex orderless)) ; also see `completion-category-overrides' - (setq completion-pcm-leading-wildcard t) ; Emacs 31: make `partial-completion' behave like `substring' + ;; -*- lexical-binding: t; -*- + ;;; General minibuffer settings + (use-package minibuffer + :ensure nil + :config + ;;;; Completion styles + (setq completion-styles '(basic substring initials flex orderless)) ; also see `completion-category-overrides' + (setq completion-pcm-leading-wildcard t) ; Emacs 31: make `partial-completion' behave like `substring' - ;; Reset all the per-category defaults so that (i) we use the - ;; standard `completion-styles' and (ii) can specify our own styles - ;; in the `completion-category-overrides' without having to - ;; explicitly override everything. - (setq completion-category-defaults nil) + ;; Reset all the per-category defaults so that (i) we use the + ;; standard `completion-styles' and (ii) can specify our own styles + ;; in the `completion-category-overrides' without having to + ;; explicitly override everything. + (setq completion-category-defaults nil) - ;; A non-exhaustve list of known completion categories: - ;; - ;; - `bookmark' - ;; - `buffer' - ;; - `charset' - ;; - `coding-system' - ;; - `color' - ;; - `command' (e.g. `M-x') - ;; - `customize-group' - ;; - `environment-variable' - ;; - `expression' - ;; - `face' - ;; - `file' - ;; - `function' (the `describe-function' command bound to `C-h f') - ;; - `info-menu' - ;; - `imenu' - ;; - `input-method' - ;; - `kill-ring' - ;; - `library' - ;; - `minor-mode' - ;; - `multi-category' - ;; - `package' - ;; - `project-file' - ;; - `symbol' (the `describe-symbol' command bound to `C-h o') - ;; - `theme' - ;; - `unicode-name' (the `insert-char' command bound to `C-x 8 RET') - ;; - `variable' (the `describe-variable' command bound to `C-h v') - ;; - `consult-grep' - ;; - `consult-isearch' - ;; - `consult-kmacro' - ;; - `consult-location' - ;; - `embark-keybinding' - ;; - (setq completion-category-overrides - ;; NOTE 2021-10-25: I am adding `basic' because it works better as a - ;; default for some contexts. Read: - ;; . - ;; - ;; `partial-completion' is a killer app for files, because it - ;; can expand ~/.l/s/fo to ~/.local/share/fonts. - ;; - ;; If `basic' cannot match my current input, Emacs tries the - ;; next completion style in the given order. In other words, - ;; `orderless' kicks in as soon as I input a space or one of its - ;; style dispatcher characters. - '((file (styles . (basic partial-completion orderless))) - (bookmark (styles . (basic substring))) - (library (styles . (basic substring))) - (embark-keybinding (styles . (basic substring))) - (imenu (styles . (basic substring orderless))) - (consult-location (styles . (basic substring orderless))) - (kill-ring (styles . (emacs22 orderless))) - (eglot (styles . (emacs22 substring orderless)))))) + ;; A non-exhaustve list of known completion categories: + ;; + ;; - `bookmark' + ;; - `buffer' + ;; - `charset' + ;; - `coding-system' + ;; - `color' + ;; - `command' (e.g. `M-x') + ;; - `customize-group' + ;; - `environment-variable' + ;; - `expression' + ;; - `face' + ;; - `file' + ;; - `function' (the `describe-function' command bound to `C-h f') + ;; - `info-menu' + ;; - `imenu' + ;; - `input-method' + ;; - `kill-ring' + ;; - `library' + ;; - `minor-mode' + ;; - `multi-category' + ;; - `package' + ;; - `project-file' + ;; - `symbol' (the `describe-symbol' command bound to `C-h o') + ;; - `theme' + ;; - `unicode-name' (the `insert-char' command bound to `C-x 8 RET') + ;; - `variable' (the `describe-variable' command bound to `C-h v') + ;; - `consult-grep' + ;; - `consult-isearch' + ;; - `consult-kmacro' + ;; - `consult-location' + ;; - `embark-keybinding' + ;; + (setq completion-category-overrides + ;; NOTE 2021-10-25: I am adding `basic' because it works better as a + ;; default for some contexts. Read: + ;; . + ;; + ;; `partial-completion' is a killer app for files, because it + ;; can expand ~/.l/s/fo to ~/.local/share/fonts. + ;; + ;; If `basic' cannot match my current input, Emacs tries the + ;; next completion style in the given order. In other words, + ;; `orderless' kicks in as soon as I input a space or one of its + ;; style dispatcher characters. + '((file (styles . (basic partial-completion orderless))) + (bookmark (styles . (basic substring))) + (library (styles . (basic substring))) + (embark-keybinding (styles . (basic substring))) + (imenu (styles . (basic substring orderless))) + (consult-location (styles . (basic substring orderless))) + (kill-ring (styles . (emacs22 orderless))) + (eglot (styles . (emacs22 substring orderless)))))) #+end_src ** The =nebkor-completion.el= for the ~orderless~ completion style @@ -2236,6 +2240,7 @@ I use ~vertico-repeat~ to mimic the functionality that ~helm-resume~ would provi My old custom functions file. #+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-functions.el" :mkdirp yes + ;; -*- lexical-binding: t; -*- (defun diff-and-set-modified-p () "Diff the current buffer with its associated file and set buffer modified status." (let* ((tmpfile (diff-file-local-copy (current-buffer))) @@ -2427,6 +2432,7 @@ Now on to the configurations. tweak to ensure that ~consult-imenu~ returns good ~imenu~ results to us. #+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-search.el" :mkdirp yes + ;; -*- lexical-binding: t; -*- (use-package imenu :ensure nil :config @@ -2744,14 +2750,15 @@ them manually. I prefer this extra layer of safety. Plus, we have the #+end_quote #+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-dired.el" :mkdirp yes -;;; Dired file manager and prot-dired.el extras -(use-package dired - :ensure nil - :commands (dired) - :config - (setq dired-recursive-copies 'always) - (setq dired-recursive-deletes 'always) - (setq delete-by-moving-to-trash t)) + ;; -*- lexical-binding: t; -*- + ;;; Dired file manager and prot-dired.el extras + (use-package dired + :ensure nil + :commands (dired) + :config + (setq dired-recursive-copies 'always) + (setq dired-recursive-deletes 'always) + (setq delete-by-moving-to-trash t)) #+end_src ** The =nebkor-dired.el= switches for how files are listed (~ls~) @@ -3093,14 +3100,15 @@ name. #+end_quote #+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-window.el" -;;; General window and buffer configurations -(use-package uniquify - :ensure nil - :config -;;;; `uniquify' (unique names for buffers) - (setq uniquify-buffer-name-style 'forward) - (setq uniquify-strip-common-suffix t) - (setq uniquify-after-kill-buffer-p t)) + ;; -*- lexical-binding: t; -*- + ;;; General window and buffer configurations + (use-package uniquify + :ensure nil + :config + ;;;; `uniquify' (unique names for buffers) + (setq uniquify-buffer-name-style 'forward) + (setq uniquify-strip-common-suffix t) + (setq uniquify-after-kill-buffer-p t)) #+end_src @@ -3276,18 +3284,19 @@ integrates with ~magit~ ([[#h:b08af527-9ebf-4425-ac3a-24b4f371a4fd][The =nebkor- #+end_quote #+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-git.el" :mkdirp yes -;;;; `ediff' -(use-package ediff - :ensure nil - :commands (ediff-buffers ediff-files ediff-buffers3 ediff-files3) - :init - (setq ediff-split-window-function 'split-window-horizontally) - (setq ediff-window-setup-function 'ediff-setup-windows-plain) - :config - (setq ediff-keep-variants nil) - (setq ediff-make-buffers-readonly-at-startup nil) - (setq ediff-merge-revisions-with-ancestor t) - (setq ediff-show-clashes-only t)) + ;; -*- lexical-binding: t; -*- + ;;;; `ediff' + (use-package ediff + :ensure nil + :commands (ediff-buffers ediff-files ediff-buffers3 ediff-files3) + :init + (setq ediff-split-window-function 'split-window-horizontally) + (setq ediff-window-setup-function 'ediff-setup-windows-plain) + :config + (setq ediff-keep-variants nil) + (setq ediff-make-buffers-readonly-at-startup nil) + (setq ediff-merge-revisions-with-ancestor t) + (setq ediff-show-clashes-only t)) #+end_src ** The =nebkor-git.el= section about project management (~project~) @@ -3454,6 +3463,21 @@ branches, etc. '(("~/src/prototypes" . 1)))) #+end_src +#+begin_quote +The difftastic Emacs package is designed to integrate difftastic - a structural diff tool - into +your Emacs workflow, enhancing your code review and comparison experience. This package +automatically displays difftastic’s output within Emacs using faces from your user theme, ensuring +consistency with your overall coding environment. +#+end_quote + +#+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-git.el" + (elpaca (difftastic :host "github.com" :repo "pkryger/difftastic.el") + (use-package difftastic)) + + (use-package difftastic-bindings + :config (difftastic-bindings-mode)) +#+end_src + ** Finally, we provide the =nebkor-git.el= module :PROPERTIES: :CUSTOM_ID: h:4e7035c5-9350-4c51-be85-85f2539ed295 @@ -3537,28 +3561,29 @@ Org is far more capable, so I switched to it completely. #+end_quote #+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-org.el" :mkdirp yes -;;; Calendar -(use-package calendar - :ensure nil - :commands (calendar) - :config - (setq calendar-mark-diary-entries-flag nil) - (setq calendar-mark-holidays-flag t) - (setq calendar-mode-line-format nil) - (setq calendar-time-display-form - '( 24-hours ":" minutes - (when time-zone (format "(%s)" time-zone)))) - (setq calendar-week-start-day 1) ; Monday - (setq calendar-date-style 'iso) - (setq calendar-time-zone-style 'numeric) ; Emacs 28.1 + ;; -*- lexical-binding: t; -*- + ;;; Calendar + (use-package calendar + :ensure nil + :commands (calendar) + :config + (setq calendar-mark-diary-entries-flag nil) + (setq calendar-mark-holidays-flag t) + (setq calendar-mode-line-format nil) + (setq calendar-time-display-form + '( 24-hours ":" minutes + (when time-zone (format "(%s)" time-zone)))) + (setq calendar-week-start-day 1) ; Monday + (setq calendar-date-style 'iso) + (setq calendar-time-zone-style 'numeric) ; Emacs 28.1 - (require 'solar) - (setq calendar-latitude 35.17 ; Not my actual coordinates - calendar-longitude 33.36) + (require 'solar) + (setq calendar-latitude 35.17 ; Not my actual coordinates + calendar-longitude 33.36) - (require 'cal-dst) - (setq calendar-standard-time-zone-name "+0700") - (setq calendar-daylight-time-zone-name "+0800")) + (require 'cal-dst) + (setq calendar-standard-time-zone-name "+0700") + (setq calendar-daylight-time-zone-name "+0800")) #+end_src ** The =nebkor-org.el= section about appointment reminders (~appt~) @@ -4513,6 +4538,7 @@ title of the task, and the like. The documentation string of :END: #+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-langs.el" :mkdirp yes + ;; -*- lexical-binding: t; -*- ;;;; Tabs, indentation, and the TAB key (use-package emacs :ensure nil @@ -5334,6 +5360,7 @@ PDF Tools is an absolute powerhouse for reading and annotating PDF files. It is my goto tool for reading any academic papers. #+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-study.el" :mkdirp yes + ;; -*- lexical-binding: t; -*- ;;; PDF Tools for reading and annotating PDF files (use-package pdf-tools :ensure (:host github :repo "vedang/pdf-tools" :branch "master") @@ -6318,6 +6345,7 @@ figure it out. :END: #+begin_src emacs-lisp :tangle "custom-lisp/nebkor-personal.el" :mkdirp yes + ;; -*- lexical-binding: t; -*- (global-set-key [C-tab] #'other-window) (global-set-key [C-S-tab] #'sother-window) (global-set-key [C-iso-lefttab] #'sother-window) diff --git a/nebkor-modules/nebkor-completion.el b/nebkor-modules/nebkor-completion.el index 6ca8b47..3b0984a 100644 --- a/nebkor-modules/nebkor-completion.el +++ b/nebkor-modules/nebkor-completion.el @@ -1,3 +1,4 @@ +;; -*- lexical-binding: t; -*- ;;; General minibuffer settings (use-package minibuffer :ensure nil diff --git a/nebkor-modules/nebkor-dired.el b/nebkor-modules/nebkor-dired.el index 9663ac7..3266319 100644 --- a/nebkor-modules/nebkor-dired.el +++ b/nebkor-modules/nebkor-dired.el @@ -1,3 +1,4 @@ +;; -*- lexical-binding: t; -*- ;;; Dired file manager and prot-dired.el extras (use-package dired :ensure nil diff --git a/nebkor-modules/nebkor-essentials.el b/nebkor-modules/nebkor-essentials.el index a210ecb..dd91549 100644 --- a/nebkor-modules/nebkor-essentials.el +++ b/nebkor-modules/nebkor-essentials.el @@ -1,3 +1,4 @@ +;; -*- lexical-binding: t; -*- ;;; Essential configurations (use-package emacs :ensure nil diff --git a/nebkor-modules/nebkor-functions.el b/nebkor-modules/nebkor-functions.el index 75de8a0..12211bd 100644 --- a/nebkor-modules/nebkor-functions.el +++ b/nebkor-modules/nebkor-functions.el @@ -1,3 +1,4 @@ +;; -*- lexical-binding: t; -*- (defun diff-and-set-modified-p () "Diff the current buffer with its associated file and set buffer modified status." (let* ((tmpfile (diff-file-local-copy (current-buffer))) diff --git a/nebkor-modules/nebkor-git.el b/nebkor-modules/nebkor-git.el index 220956d..61c8a96 100644 --- a/nebkor-modules/nebkor-git.el +++ b/nebkor-modules/nebkor-git.el @@ -1,3 +1,4 @@ +;; -*- lexical-binding: t; -*- ;;;; `ediff' (use-package ediff :ensure nil @@ -74,4 +75,10 @@ (setq magit-repository-directories '(("~/src/prototypes" . 1)))) +(elpaca (difftastic :host "github.com" :repo "pkryger/difftastic.el") + (use-package difftastic)) + +(use-package difftastic-bindings + :config (difftastic-bindings-mode)) + (provide 'nebkor-git) diff --git a/nebkor-modules/nebkor-langs.el b/nebkor-modules/nebkor-langs.el index 6e0eb54..6d7f4c8 100644 --- a/nebkor-modules/nebkor-langs.el +++ b/nebkor-modules/nebkor-langs.el @@ -1,3 +1,4 @@ +;; -*- lexical-binding: t; -*- ;;;; Tabs, indentation, and the TAB key (use-package emacs :ensure nil diff --git a/nebkor-modules/nebkor-org.el b/nebkor-modules/nebkor-org.el index 108a7f0..c4f6f23 100644 --- a/nebkor-modules/nebkor-org.el +++ b/nebkor-modules/nebkor-org.el @@ -1,3 +1,4 @@ +;; -*- lexical-binding: t; -*- ;;; Calendar (use-package calendar :ensure nil diff --git a/nebkor-modules/nebkor-search.el b/nebkor-modules/nebkor-search.el index d0f091e..b420bc3 100644 --- a/nebkor-modules/nebkor-search.el +++ b/nebkor-modules/nebkor-search.el @@ -1,3 +1,4 @@ +;; -*- lexical-binding: t; -*- (use-package imenu :ensure nil :config diff --git a/nebkor-modules/nebkor-study.el b/nebkor-modules/nebkor-study.el index 3fcd15d..7ba8c80 100644 --- a/nebkor-modules/nebkor-study.el +++ b/nebkor-modules/nebkor-study.el @@ -1,3 +1,4 @@ +;; -*- lexical-binding: t; -*- ;;; PDF Tools for reading and annotating PDF files (use-package pdf-tools :ensure (:host github :repo "vedang/pdf-tools" :branch "master") diff --git a/nebkor-modules/nebkor-theme.el b/nebkor-modules/nebkor-theme.el index d80c45f..305ab80 100644 --- a/nebkor-modules/nebkor-theme.el +++ b/nebkor-modules/nebkor-theme.el @@ -1,3 +1,4 @@ +;; -*- lexical-binding: t; -*- ;;; Everything related to the look of Emacs ;;(add-to-list 'default-frame-alist '(background-color . "snow")) diff --git a/nebkor-modules/nebkor-window.el b/nebkor-modules/nebkor-window.el index 33ccfe9..8d5bcd3 100644 --- a/nebkor-modules/nebkor-window.el +++ b/nebkor-modules/nebkor-window.el @@ -1,3 +1,4 @@ +;; -*- lexical-binding: t; -*- ;;; General window and buffer configurations (use-package uniquify :ensure nil