From 5e6aa0edfad42f002fd9f6a67401d5d6b1e5784f Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 28 Aug 2023 12:28:51 +0200 Subject: [PATCH] Update Emacs configuration --- .emacs.d/init.el | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index ec7b12c..a7f9051 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -127,14 +127,9 @@ :pre-build (("make" "terminfo")))) (elpaca (elfeed :pre-build (("pandoc" "-o" "elfeed.texi" "README.md")))) -(elpaca (esy-publish - :repo "git://git.eshelyaron.com/esy-publish.git")) (elpaca embark-consult) (elpaca emms) -;; (elpaca expreg) (elpaca gnu-elpa-keyring-update) -;; (elpaca (gnus-o365-oauth2 -;; :repo "https://gitlab.com/qha/gnus-o365-oauth2.git")) (elpaca graphql-mode) (elpaca htmlize) (elpaca ialign) @@ -163,9 +158,6 @@ "--eval" "(setq org-babel-confirm-evaluate-answer-no t)" "-f" "org-texinfo-export-to-texinfo")) :repo "https://github.com/minad/marginalia.git")) -;; (elpaca (org-glossary -;; :repo "https://github.com/tecosaur/org-glossary.git" -;; :files ("org-glossary.el" "org-glossary.texi"))) (elpaca (osm :pre-build (("emacs" "--batch" "-l" "ox-texinfo" "README.org" "--eval" "(setq org-babel-confirm-evaluate-answer-no t)" @@ -537,9 +529,18 @@ (autoload 'some-button "some-button" nil t) (autoload 'pdf-view-mode "pdf-view" nil t) +(add-to-list 'load-path "~/checkouts/esy-publish/") +(autoload 'esy-publish-setup "esy-publish" nil t) +(autoload 'esy-publish "esy-publish" nil t) +(autoload 'esy-publish-local-server "esy-publish" nil t) +(autoload 'esy-publish-create-post "esy-publish" nil t) + (with-eval-after-load 'gnus (require 'esy-comm)) +(add-to-list 'savehist-additional-variables + 'esy-o365-token-refresh-last-time) + ;;; Define custom commands (defvar-keymap transpose-lines-repeat-map @@ -548,7 +549,7 @@ (put 'transpose-lines 'repeat-map 'transpose-lines-repeat-map) -;; utility commands +;;; utility commands (defun esy/kill-dwim () "When region is active, kill region, otherwise kill last word." (interactive) @@ -666,16 +667,24 @@ " | ") "*Access Log Summary*"))) -(defun esy/clone (remote) +(defvar esy/clone-history nil) + +(defun esy/clone (remote depth) (interactive (list (let ((default (thing-at-point 'url))) (read-string (format-prompt "Clone" default) - nil nil default)))) + nil 'esy/clone-history default)) + (and current-prefix-arg + (prefix-numeric-value current-prefix-arg)))) (let ((dir (expand-file-name (file-name-base (car (url-path-and-query (url-generic-parse-url remote)))) "~/checkouts"))) - (vc-clone remote 'Git dir) - (find-file dir))) + (apply #'call-process + (append (list "git" nil nil nil "clone") + (when depth + (list "--depth" (number-to-string depth))) + (list remote dir))) + (dired dir))) (defun esy/json-path-to-position (pos) "Return the JSON path from the document's root to the element at POS. @@ -942,17 +951,17 @@ Interactively, POINT is point and KILL is the prefix argument." windmove-swap-states-right)) (put command 'repeat-map 'window-prefix-map)) -;; digit arguments with the super modifier +;;; digit arguments with the super modifier (dotimes (i 10) (keymap-global-set (concat "s-" (number-to-string i)) #'digit-argument)) -;; unbind some keys +;;; unbind some keys (dolist (key '("s-a" "s-d" "s-e" "s-f" "s-g" "s-h" "s-j" "s-k" "s-l" "s-m" "s-o" "s-q" "s-s" "s-t" "s-w" "s-x" "s-y" "s-z")) (keymap-global-unset key)) -;; enable some commands +;;; enable some commands (dolist (command '(set-goal-column narrow-to-region narrow-to-page @@ -960,7 +969,7 @@ Interactively, POINT is point and KILL is the prefix argument." upcase-region)) (put command 'disabled nil)) -;; disable some commands +;;; disable some commands (put 'suspend-frame 'disabled t) ;;; Configure project management commands @@ -1078,7 +1087,8 @@ as the initial input for completion, and return that directory." ;;; Configure `world-clock' (with-eval-after-load 'time - (add-to-list 'zoneinfo-style-world-list '("Europe/Amsterdam" "Amsterdam"))) + (add-to-list 'zoneinfo-style-world-list '("Europe/Amsterdam" "Amsterdam")) + (add-to-list 'zoneinfo-style-world-list '("Asia/Tel_Aviv" "Tel Aviv"))) ;;; Configure spelling errors correction via `flyspell' -- 2.39.5