This commit is contained in:
parent
8eda323c31
commit
f6512fe1bd
|
@ -140,10 +140,9 @@ See `no-littering' for examples.")
|
||||||
|
|
||||||
(add-to-list 'setup-modifier-list 'setup-wrap-to-demote-errors)
|
(add-to-list 'setup-modifier-list 'setup-wrap-to-demote-errors)
|
||||||
(unless (memq debug-on-error '(nil init))
|
(unless (memq debug-on-error '(nil init))
|
||||||
(define-advice setup (:before (head &rest args) +setup-before)
|
(define-advice setup (:around (fn head &rest args) +setup-report)
|
||||||
(message "[Setup] %S" head))
|
(+with-progress ((format "[Setup] %S..." head))
|
||||||
(define-advice setup (:after (head &rest args) +setup-after)
|
(apply fn head args))))
|
||||||
(message "[Setup] %S...done" head)))
|
|
||||||
|
|
||||||
;;; Appendix
|
;;; Appendix
|
||||||
|
|
||||||
|
|
47
init.el
47
init.el
|
@ -465,7 +465,7 @@
|
||||||
|
|
||||||
(setup notmuch
|
(setup notmuch
|
||||||
(:load-from "~/usr/share/emacs/site-lisp/")
|
(:load-from "~/usr/share/emacs/site-lisp/")
|
||||||
;;(:load-after org-contacts)
|
(:load-after org-contacts)
|
||||||
(:also-load +notmuch +message)
|
(:also-load +notmuch +message)
|
||||||
(+define-dir notmuch/ (sync/ "emacs/notmuch")
|
(+define-dir notmuch/ (sync/ "emacs/notmuch")
|
||||||
"Notmuch configuration and data.")
|
"Notmuch configuration and data.")
|
||||||
|
@ -568,11 +568,11 @@
|
||||||
org-startup-truncated nil
|
org-startup-truncated nil
|
||||||
org-startup-with-inline-images t
|
org-startup-with-inline-images t
|
||||||
org-tags-column (- (- fill-column (length org-ellipsis)))
|
org-tags-column (- (- fill-column (length org-ellipsis)))
|
||||||
org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)"
|
org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" "ONGOING(o@)"
|
||||||
"|" "DONE(d!)")
|
"|" "DONE(d!)")
|
||||||
(sequence "ONGOING(o@)")
|
|
||||||
(sequence "|" "CANCELED(k@)")
|
(sequence "|" "CANCELED(k@)")
|
||||||
(sequence "MEETING(m)"))
|
(sequence "MEETING(m)")
|
||||||
|
(sequence "ASSIGNED(a@/!)" "REVIEW(r)" "|" "DONE(d!)"))
|
||||||
org-emphasis-alist '(("*" org-bold)
|
org-emphasis-alist '(("*" org-bold)
|
||||||
("/" org-italic)
|
("/" org-italic)
|
||||||
("_" org-underline)
|
("_" org-underline)
|
||||||
|
@ -698,8 +698,8 @@
|
||||||
:unnarrowed t))
|
:unnarrowed t))
|
||||||
(+org-capture-sort))
|
(+org-capture-sort))
|
||||||
|
|
||||||
(setup org-contacts
|
(setup org-contacts (:quit)
|
||||||
(:load-after org)
|
(:require)
|
||||||
(:also-straight org-vcard) ; for importing Vcard files
|
(:also-straight org-vcard) ; for importing Vcard files
|
||||||
(:option org-contacts-matcher "contact") ; Contacts are tagged "contact"
|
(:option org-contacts-matcher "contact") ; Contacts are tagged "contact"
|
||||||
)
|
)
|
||||||
|
@ -854,6 +854,12 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers."
|
||||||
(:when-loaded
|
(:when-loaded
|
||||||
(setf (alist-get ?. avy-dispatch-alist) #'avy-action-embark)))
|
(setf (alist-get ?. avy-dispatch-alist) #'avy-action-embark)))
|
||||||
|
|
||||||
|
(setup (:straight bbdb)
|
||||||
|
(:require bbdb-autoloads
|
||||||
|
bbdb)
|
||||||
|
(:also-straight bbdb-vcard)
|
||||||
|
(bbdb-initialize 'gnus 'message))
|
||||||
|
|
||||||
(setup (:straight (bongo :type git
|
(setup (:straight (bongo :type git
|
||||||
:flavor melpa
|
:flavor melpa
|
||||||
:files ("*.el" "*.texi" "images" "*.rb" "bongo-pkg.el" "*.info")
|
:files ("*.el" "*.texi" "images" "*.rb" "bongo-pkg.el" "*.info")
|
||||||
|
@ -1344,7 +1350,9 @@ See also `crux-reopen-as-root-mode'."
|
||||||
(:+leader "f" #'elfeed "C-f" #'elfeed)
|
(:+leader "f" #'elfeed "C-f" #'elfeed)
|
||||||
(advice-add #'elfeed-search-fetch :after #'beginning-of-buffer)
|
(advice-add #'elfeed-search-fetch :after #'beginning-of-buffer)
|
||||||
(:with-mode elfeed-search-mode
|
(:with-mode elfeed-search-mode
|
||||||
(:bind "&" #'+elfeed-search-browse-generic)
|
(:bind "&" #'+elfeed-search-browse-generic
|
||||||
|
"w" #'elfeed-search-yank
|
||||||
|
"y" nil)
|
||||||
(:hook #'hl-line-mode)
|
(:hook #'hl-line-mode)
|
||||||
;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/
|
;; https://old.reddit.com/r/emacs/comments/rlli0u/whats_your_favorite_defadvice/hphfh4e/
|
||||||
(advice-add #'elfeed-search-update--force :after #'elfeed-db-save)
|
(advice-add #'elfeed-search-update--force :after #'elfeed-db-save)
|
||||||
|
@ -1353,7 +1361,9 @@ See also `crux-reopen-as-root-mode'."
|
||||||
(:bind "SPC" #'+elfeed-scroll-up-command
|
(:bind "SPC" #'+elfeed-scroll-up-command
|
||||||
"S-SPC" #'+elfeed-scroll-down-command
|
"S-SPC" #'+elfeed-scroll-down-command
|
||||||
"&" #'+elfeed-show-browse-generic
|
"&" #'+elfeed-show-browse-generic
|
||||||
"RET" #'shr-browse-url)
|
"RET" #'shr-browse-url
|
||||||
|
"w" #'elfeed-show-yank
|
||||||
|
"y" nil)
|
||||||
(:hook #'reading-mode)
|
(:hook #'reading-mode)
|
||||||
(:option +elfeed--update-repeat (* 60 30) ; 1/2 hour
|
(:option +elfeed--update-repeat (* 60 30) ; 1/2 hour
|
||||||
+elfeed--update-first-time 60))
|
+elfeed--update-first-time 60))
|
||||||
|
@ -1744,9 +1754,10 @@ See also `crux-reopen-as-root-mode'."
|
||||||
(:option +mwim-passthrough-modes '(comint-mode
|
(:option +mwim-passthrough-modes '(comint-mode
|
||||||
eshell-mode
|
eshell-mode
|
||||||
vterm-mode
|
vterm-mode
|
||||||
crossword-mode))
|
crossword-mode
|
||||||
(:global "C-a" #'+mwim-beginning-maybe
|
geiser-repl-mode))
|
||||||
"C-e" #'+mwim-end-maybe))
|
(:global "C-a" #'mwim-beginning
|
||||||
|
"C-e" #'mwim-end))
|
||||||
|
|
||||||
(setup (:straight notmuch-bookmarks)
|
(setup (:straight notmuch-bookmarks)
|
||||||
(:load-after notmuch)
|
(:load-after notmuch)
|
||||||
|
@ -1780,12 +1791,16 @@ See also `crux-reopen-as-root-mode'."
|
||||||
(:hook-into org-mode))
|
(:hook-into org-mode))
|
||||||
|
|
||||||
(setup (:straight org-download)
|
(setup (:straight org-download)
|
||||||
|
(:require)
|
||||||
(:option org-download-method 'attach
|
(:option org-download-method 'attach
|
||||||
org-download-backend (cond ((executable-find "curl") 'curl)
|
org-download-backend (cond ((executable-find "curl") 'curl)
|
||||||
((executable-find "wget") 'wget)
|
((executable-find "wget") 'wget)
|
||||||
(:else 'url-retrieve)))
|
(:else 'url-retrieve)))
|
||||||
(add-hook 'dired-mode-hook 'org-download-enable))
|
(add-hook 'dired-mode-hook 'org-download-enable))
|
||||||
|
|
||||||
|
(setup (:straight org-mime)
|
||||||
|
(:option org-mime-export-ascii 'utf-8))
|
||||||
|
|
||||||
(setup (:straight org-mime)
|
(setup (:straight org-mime)
|
||||||
(add-hook 'message-mode-hook
|
(add-hook 'message-mode-hook
|
||||||
(defun org-mime-setup@message-mode ()
|
(defun org-mime-setup@message-mode ()
|
||||||
|
@ -1801,9 +1816,9 @@ See also `crux-reopen-as-root-mode'."
|
||||||
(setup (:straight (org-taskwise
|
(setup (:straight (org-taskwise
|
||||||
:host github
|
:host github
|
||||||
:repo "duckwork/org-taskwise.el"))
|
:repo "duckwork/org-taskwise.el"))
|
||||||
(:load-after org)
|
(with-eval-after-load 'org
|
||||||
(:bind-into org-mode
|
(require 'org-taskwise)
|
||||||
"C-x n t" #'org-taskwise-narrow-to-task))
|
(define-key org-mode-map (kbd "C-x n t") #'org-taskwise-narrow-to-task)))
|
||||||
|
|
||||||
(setup (:straight org-visibility)
|
(setup (:straight org-visibility)
|
||||||
(:require org-visibility)
|
(:require org-visibility)
|
||||||
|
@ -1834,7 +1849,8 @@ See also `crux-reopen-as-root-mode'."
|
||||||
lisp-interaction-mode-hook
|
lisp-interaction-mode-hook
|
||||||
lisp-mode-hook
|
lisp-mode-hook
|
||||||
scheme-mode-hook
|
scheme-mode-hook
|
||||||
geiser-mode-hook))
|
geiser-mode-hook
|
||||||
|
geiser-repl-mode-hook))
|
||||||
(add-hook hook #'enable-paredit-mode))
|
(add-hook hook #'enable-paredit-mode))
|
||||||
(:also-load eldoc)
|
(:also-load eldoc)
|
||||||
(eldoc-add-command #'paredit-backward-delete #'paredit-close-round))
|
(eldoc-add-command #'paredit-backward-delete #'paredit-close-round))
|
||||||
|
@ -1916,6 +1932,7 @@ See also `crux-reopen-as-root-mode'."
|
||||||
+modeline-text-scale
|
+modeline-text-scale
|
||||||
,(+modeline-concat
|
,(+modeline-concat
|
||||||
'(+modeline-god-mode
|
'(+modeline-god-mode
|
||||||
|
+modeline-kmacro-indicator
|
||||||
+modeline-reading-mode
|
+modeline-reading-mode
|
||||||
+modeline-narrowed)
|
+modeline-narrowed)
|
||||||
",")
|
",")
|
||||||
|
|
|
@ -60,49 +60,51 @@
|
||||||
(make-directory (file-name-directory script) :parents)
|
(make-directory (file-name-directory script) :parents)
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert
|
(insert
|
||||||
(prin1-to-string ;; Print the following s-expression to a string
|
(let ((print-level nil)
|
||||||
`(progn
|
(print-length nil))
|
||||||
;; Set up the environment
|
(prin1-to-string ;; Print the following s-expression to a string
|
||||||
(setq lexical-binding t)
|
`(progn
|
||||||
(load (locate-user-emacs-file "early-init"))
|
;; Set up the environment
|
||||||
(dolist (pkg '(elfeed elfeed-org))
|
(setq lexical-binding t)
|
||||||
(straight-use-package pkg)
|
(load (locate-user-emacs-file "early-init"))
|
||||||
(require pkg))
|
(dolist (pkg '(elfeed elfeed-org))
|
||||||
;; Copy variables from current environment
|
(straight-use-package pkg)
|
||||||
(progn
|
(require pkg))
|
||||||
,@(cl-loop for copy-var in '(rmh-elfeed-org-files
|
;; Copy variables from current environment
|
||||||
elfeed-db-directory
|
(progn
|
||||||
elfeed-curl-program-name
|
,@(cl-loop for copy-var in '(rmh-elfeed-org-files
|
||||||
elfeed-use-curl
|
elfeed-db-directory
|
||||||
elfeed-curl-extra-arguments
|
elfeed-curl-program-name
|
||||||
elfeed-enclosure-default-dir)
|
elfeed-use-curl
|
||||||
collect `(progn (message "%S = %S" ',copy-var ',(symbol-value copy-var))
|
elfeed-curl-extra-arguments
|
||||||
(setq ,copy-var ',(symbol-value copy-var)))))
|
elfeed-enclosure-default-dir)
|
||||||
;; Define new variables for this environment
|
collect `(progn (message "%S = %S" ',copy-var ',(symbol-value copy-var))
|
||||||
(progn
|
(setq ,copy-var ',(symbol-value copy-var)))))
|
||||||
,@(cl-loop for (new-var . new-val) in '((elfeed-curl-max-connections . 4))
|
;; Define new variables for this environment
|
||||||
collect `(progn (message "%S = %S" ',new-var ',new-val)
|
(progn
|
||||||
(setq ,new-var ',new-val))))
|
,@(cl-loop for (new-var . new-val) in '((elfeed-curl-max-connections . 4))
|
||||||
;; Redefine `elfeed-log' to log everything
|
collect `(progn (message "%S = %S" ',new-var ',new-val)
|
||||||
(defun elfeed-log (level fmt &rest objects)
|
(setq ,new-var ',new-val))))
|
||||||
(princ (format "[%s] [%s]: %s\n"
|
;; Redefine `elfeed-log' to log everything
|
||||||
(format-time-string "%F %T")
|
(defun elfeed-log (level fmt &rest objects)
|
||||||
level
|
(princ (format "[%s] [%s]: %s\n"
|
||||||
(apply #'format fmt objects))))
|
(format-time-string "%F %T")
|
||||||
;; Run elfeed
|
level
|
||||||
(elfeed-org)
|
(apply #'format fmt objects))))
|
||||||
(elfeed)
|
;; Run elfeed
|
||||||
(elfeed-db-load)
|
(elfeed-org)
|
||||||
(elfeed-update)
|
(elfeed)
|
||||||
;; Wait for `elfeed-update' to finish
|
(elfeed-db-load)
|
||||||
(while (> (elfeed-queue-count-total) 0)
|
(elfeed-update)
|
||||||
(sleep-for 5)
|
;; Wait for `elfeed-update' to finish
|
||||||
(message "%s" (elfeed-queue-count-total))
|
(while (> (elfeed-queue-count-total) 0)
|
||||||
(accept-process-output))
|
(sleep-for 5)
|
||||||
;; Garbage collect and save the database
|
(message "%s" (elfeed-queue-count-total))
|
||||||
(elfeed-db-gc)
|
(accept-process-output))
|
||||||
(elfeed-db-save)
|
;; Garbage collect and save the database
|
||||||
(princ (format ,update-message-format "done.")))))
|
(elfeed-db-gc)
|
||||||
|
(elfeed-db-save)
|
||||||
|
(princ (format ,update-message-format "done."))))))
|
||||||
(write-file script))
|
(write-file script))
|
||||||
(chmod script #o777)
|
(chmod script #o777)
|
||||||
(message update-message-format "start")
|
(message update-message-format "start")
|
||||||
|
|
|
@ -60,15 +60,18 @@ Do this only if the buffer is not visiting a file."
|
||||||
enable-recursive-minibuffers t
|
enable-recursive-minibuffers t
|
||||||
executable-prefix-env t
|
executable-prefix-env t
|
||||||
fast-but-imprecise-scrolling t
|
fast-but-imprecise-scrolling t
|
||||||
find-file-visit-truename t
|
|
||||||
file-name-shadow-properties '(invisible t intangible t)
|
file-name-shadow-properties '(invisible t intangible t)
|
||||||
fill-column 80
|
fill-column 80
|
||||||
|
find-file-visit-truename t
|
||||||
frame-resize-pixelwise t
|
frame-resize-pixelwise t
|
||||||
global-auto-revert-non-file-buffers t
|
global-auto-revert-non-file-buffers t
|
||||||
global-mark-ring-max 100
|
global-mark-ring-max 100
|
||||||
hscroll-margin 1
|
hscroll-margin 1
|
||||||
hscroll-step 1
|
hscroll-step 1
|
||||||
imenu-auto-rescan t
|
imenu-auto-rescan t
|
||||||
|
image-use-external-converter (or (executable-find "convert")
|
||||||
|
(executable-find "gm")
|
||||||
|
(executable-find "ffmpeg"))
|
||||||
indent-tabs-mode nil
|
indent-tabs-mode nil
|
||||||
indicate-buffer-boundaries 'left
|
indicate-buffer-boundaries 'left
|
||||||
indicate-empty-lines nil
|
indicate-empty-lines nil
|
||||||
|
@ -104,7 +107,7 @@ Do this only if the buffer is not visiting a file."
|
||||||
save-interprogram-paste-before-kill t
|
save-interprogram-paste-before-kill t
|
||||||
scroll-conservatively 101
|
scroll-conservatively 101
|
||||||
scroll-down-aggressively 0.01
|
scroll-down-aggressively 0.01
|
||||||
scroll-margin 1
|
scroll-margin 2
|
||||||
scroll-preserve-screen-position 1
|
scroll-preserve-screen-position 1
|
||||||
scroll-step 1
|
scroll-step 1
|
||||||
scroll-up-aggressively 0.01
|
scroll-up-aggressively 0.01
|
||||||
|
@ -148,6 +151,9 @@ Do this only if the buffer is not visiting a file."
|
||||||
|
|
||||||
;;; Encodings
|
;;; Encodings
|
||||||
|
|
||||||
|
;; Allegedly, this is the only one you need...
|
||||||
|
(set-language-environment "UTF-8")
|
||||||
|
;; But I still set all of these, for fun.
|
||||||
(setq-default locale-coding-system 'utf-8-unix
|
(setq-default locale-coding-system 'utf-8-unix
|
||||||
coding-system-for-read 'utf-8-unix
|
coding-system-for-read 'utf-8-unix
|
||||||
coding-system-for-write 'utf-8-unix
|
coding-system-for-write 'utf-8-unix
|
||||||
|
@ -159,7 +165,6 @@ Do this only if the buffer is not visiting a file."
|
||||||
STRING))
|
STRING))
|
||||||
|
|
||||||
(set-charset-priority 'unicode)
|
(set-charset-priority 'unicode)
|
||||||
(set-language-environment "UTF-8")
|
|
||||||
(prefer-coding-system 'utf-8-unix)
|
(prefer-coding-system 'utf-8-unix)
|
||||||
(set-default-coding-systems 'utf-8-unix)
|
(set-default-coding-systems 'utf-8-unix)
|
||||||
(set-terminal-coding-system 'utf-8-unix)
|
(set-terminal-coding-system 'utf-8-unix)
|
||||||
|
|
|
@ -58,30 +58,34 @@ prefix ARG is non-nil; then it just saves them."
|
||||||
(unless (buffer-file-name)
|
(unless (buffer-file-name)
|
||||||
(user-error "Buffer not attached to file"))
|
(user-error "Buffer not attached to file"))
|
||||||
(hack-dir-local-variables)
|
(hack-dir-local-variables)
|
||||||
(when-let ((new-words (+ispell-append-removing-duplicates
|
(let ((print-level nil)
|
||||||
:test #'string=
|
(print-length nil))
|
||||||
ispell-buffer-session-localwords
|
(when-let ((new-words (cl-remove-if (lambda (el) (eq el '\.\.\.)) ; XXX: NO IDEA
|
||||||
(alist-get 'ispell-buffer-session-localwords
|
; where this came from
|
||||||
dir-local-variables-alist)
|
(+ispell-append-removing-duplicates
|
||||||
(alist-get 'ispell-buffer-session-localwords
|
:test #'string=
|
||||||
file-local-variables-alist)
|
ispell-buffer-session-localwords
|
||||||
(+ispell-buffer-local-words-list))))
|
(alist-get 'ispell-buffer-session-localwords
|
||||||
(save-excursion
|
dir-local-variables-alist)
|
||||||
(add-dir-local-variable
|
(alist-get 'ispell-buffer-session-localwords
|
||||||
major-mode
|
file-local-variables-alist)
|
||||||
'ispell-buffer-session-localwords
|
(+ispell-buffer-local-words-list)))))
|
||||||
(setq ispell-buffer-session-localwords
|
(save-excursion
|
||||||
new-words))
|
(add-dir-local-variable
|
||||||
(when (or arg
|
major-mode
|
||||||
(y-or-n-p "Save .dir-locals.el?"))
|
'ispell-buffer-session-localwords
|
||||||
(save-buffer))
|
(setq ispell-buffer-session-localwords
|
||||||
(bury-buffer))
|
new-words))
|
||||||
(or ispell-buffer-local-name
|
(when (or arg
|
||||||
(setq ispell-buffer-local-name (buffer-name)))
|
(y-or-n-p "Save .dir-locals.el?"))
|
||||||
(save-excursion
|
(save-buffer))
|
||||||
(goto-char (point-min))
|
(bury-buffer))
|
||||||
(while (search-forward ispell-words-keyword nil t)
|
(or ispell-buffer-local-name
|
||||||
(delete-region (point-at-bol) (1+ (point-at-eol)))))))
|
(setq ispell-buffer-local-name (buffer-name)))
|
||||||
|
(save-excursion
|
||||||
|
(goto-char (point-min))
|
||||||
|
(while (search-forward ispell-words-keyword nil t)
|
||||||
|
(delete-region (point-at-bol) (1+ (point-at-eol))))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +ispell-move-buffer-words-to-dir-locals-hook ()
|
(defun +ispell-move-buffer-words-to-dir-locals-hook ()
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
(defun +kmacro-change-mode-line (&rest _)
|
(defun +kmacro-change-mode-line (&rest _)
|
||||||
"Remap the mode-line face when recording a kmacro."
|
"Remap the mode-line face when recording a kmacro."
|
||||||
|
|
||||||
(add-to-list 'face-remapping-alist '(mode-line . +kmacro-modeline)))
|
(add-to-list 'face-remapping-alist '(mode-line . +kmacro-modeline)))
|
||||||
|
|
||||||
(defun +kmacro-restore-mode-line (&rest _)
|
(defun +kmacro-restore-mode-line (&rest _)
|
||||||
|
|
|
@ -296,7 +296,7 @@ See `line-number-mode', `column-number-mode', `file-percentage-mode'"
|
||||||
(interactive "e")
|
(interactive "e")
|
||||||
(with-selected-window
|
(with-selected-window
|
||||||
(posn-window
|
(posn-window
|
||||||
(event-start ev))
|
(event-start e))
|
||||||
(god-local-mode -1)
|
(god-local-mode -1)
|
||||||
(force-mode-line-update)))))
|
(force-mode-line-update)))))
|
||||||
'mouse-face 'mode-line-highlight))))
|
'mouse-face 'mode-line-highlight))))
|
||||||
|
@ -326,5 +326,26 @@ See `line-number-mode', `column-number-mode', `file-percentage-mode'"
|
||||||
map))
|
map))
|
||||||
'mouse-face 'mode-line-highlight))))
|
'mouse-face 'mode-line-highlight))))
|
||||||
|
|
||||||
|
(defface +modeline-kmacro-indicator '((t :foreground "Firebrick"))
|
||||||
|
"Face for the kmacro indicator in the modeline.")
|
||||||
|
|
||||||
|
(defun +modeline-kmacro-indicator (&optional spacer)
|
||||||
|
"Display an indicator when recording a kmacro."
|
||||||
|
(when defining-kbd-macro
|
||||||
|
(concat (or spacer +modeline-default-spacer)
|
||||||
|
(propertize "●"
|
||||||
|
'face '+modeline-kmacro-indicator
|
||||||
|
'help-echo (format (concat "Defining a macro\n"
|
||||||
|
"Current step: %d\n"
|
||||||
|
"mouse-1: Stop recording")
|
||||||
|
kmacro-counter)
|
||||||
|
'local-map (purecopy (simple-modeline-make-mouse-map
|
||||||
|
'mouse-1 (lambda (e)
|
||||||
|
(interactive "e")
|
||||||
|
(with-selected-window
|
||||||
|
(posn-window (event-start e))
|
||||||
|
(kmacro-end-macro nil)))))
|
||||||
|
'mouse-face 'mode-line-highlight))))
|
||||||
|
|
||||||
(provide '+modeline)
|
(provide '+modeline)
|
||||||
;;; +modeline.el ends here
|
;;; +modeline.el ends here
|
||||||
|
|
|
@ -550,6 +550,7 @@ language name.")
|
||||||
"Export region to HTML, and copy it to the clipboard.
|
"Export region to HTML, and copy it to the clipboard.
|
||||||
Arguments ASYNC, SUBTREEP, VISIBLE-ONLY, BODY-ONLY, EXT-PLIST,
|
Arguments ASYNC, SUBTREEP, VISIBLE-ONLY, BODY-ONLY, EXT-PLIST,
|
||||||
and POST-PROCESS are passed to `org-export-to-file'."
|
and POST-PROCESS are passed to `org-export-to-file'."
|
||||||
|
(interactive) ; XXX: hould this be interactive?
|
||||||
(message "Exporting Org to HTML...")
|
(message "Exporting Org to HTML...")
|
||||||
(let ((org-tmp-file "/tmp/org.html"))
|
(let ((org-tmp-file "/tmp/org.html"))
|
||||||
(org-export-to-file 'html org-tmp-file
|
(org-export-to-file 'html org-tmp-file
|
||||||
|
@ -567,8 +568,5 @@ and POST-PROCESS are passed to `org-export-to-file'."
|
||||||
(interactive)
|
(interactive)
|
||||||
(+org-export-clip-to-html nil :subtree))
|
(+org-export-clip-to-html nil :subtree))
|
||||||
|
|
||||||
;;; Taskwise functions
|
|
||||||
;; TODO: break out into another library
|
|
||||||
|
|
||||||
(provide '+org)
|
(provide '+org)
|
||||||
;;; +org.el ends here
|
;;; +org.el ends here
|
||||||
|
|
|
@ -27,7 +27,8 @@
|
||||||
"Display `tracking-mode-line-buffers' in the tab-bar."
|
"Display `tracking-mode-line-buffers' in the tab-bar."
|
||||||
;; TODO: write something to convert a mode-line construct to a tab-bar
|
;; TODO: write something to convert a mode-line construct to a tab-bar
|
||||||
;; construct.
|
;; construct.
|
||||||
(when tracking-mode
|
(when (and tracking-mode
|
||||||
|
(not (bound-and-true-p org-clock-current-task)))
|
||||||
(cons (when (> (length tracking-mode-line-buffers) 0)
|
(cons (when (> (length tracking-mode-line-buffers) 0)
|
||||||
'(track-mode-line-separator menu-item " " ignore))
|
'(track-mode-line-separator menu-item " " ignore))
|
||||||
(cl-loop for i from 0 below (length tracking-mode-line-buffers)
|
(cl-loop for i from 0 below (length tracking-mode-line-buffers)
|
||||||
|
@ -63,7 +64,8 @@
|
||||||
|
|
||||||
(defun +tab-bar-org-clock ()
|
(defun +tab-bar-org-clock ()
|
||||||
"Display `org-mode-line-string' in the tab-bar."
|
"Display `org-mode-line-string' in the tab-bar."
|
||||||
(when (org-clocking-p)
|
(when (and (fboundp 'org-clocking-p)
|
||||||
|
(org-clocking-p))
|
||||||
;; org-mode-line-string
|
;; org-mode-line-string
|
||||||
`((org-clocking menu-item
|
`((org-clocking menu-item
|
||||||
,org-mode-line-string
|
,org-mode-line-string
|
||||||
|
|
57
lisp/acdw.el
57
lisp/acdw.el
|
@ -281,24 +281,30 @@ always nil; this function is mostly intended for use in init."
|
||||||
(defun chat-disconnect ()
|
(defun chat-disconnect ()
|
||||||
"Disconnect from all chats."
|
"Disconnect from all chats."
|
||||||
(interactive)
|
(interactive)
|
||||||
(ignore-errors
|
(+with-progress "Quitting circe..."
|
||||||
(circe-command-GQUIT "☮ 🫀 🍞"))
|
|
||||||
(ignore-errors
|
|
||||||
(jabber-disconnect))
|
|
||||||
(dolist (team +slack-teams)
|
|
||||||
(ignore-errors
|
(ignore-errors
|
||||||
(slack-team-disconnect team)))
|
(circe-command-GQUIT "☮ 🫀 🍞")
|
||||||
(ignore-errors (slack-ws-close))
|
(cancel-timer (irc-connection-get conn :flood-timer))))
|
||||||
(+mapc-some-buffers (lambda () "Remove the buffer from tracking and kill it unconditionally."
|
(+with-progress "Quitting jabber..."
|
||||||
(let ((kill-buffer-query-functions nil))
|
(ignore-errors
|
||||||
(tracking-remove-buffer (current-buffer))
|
(jabber-disconnect)))
|
||||||
(kill-buffer)))
|
(+with-progress "Quitting-slack..."
|
||||||
(lambda () "Return t if derived from the following modes."
|
(dolist (team +slack-teams)
|
||||||
(derived-mode-p 'lui-mode
|
(ignore-errors
|
||||||
'jabber-chat-mode
|
(slack-team-disconnect team)))
|
||||||
'jabber-roster-mode
|
(ignore-errors (slack-ws-close)))
|
||||||
'jabber-browse-mode
|
(+with-progress "Killing buffers..."
|
||||||
'slack-mode))))
|
(ignore-errors
|
||||||
|
(+mapc-some-buffers (lambda () "Remove the buffer from tracking and kill it unconditionally."
|
||||||
|
(let ((kill-buffer-query-functions nil))
|
||||||
|
(tracking-remove-buffer (current-buffer))
|
||||||
|
(kill-buffer)))
|
||||||
|
(lambda () "Return t if derived from the following modes."
|
||||||
|
(derived-mode-p 'lui-mode
|
||||||
|
'jabber-chat-mode
|
||||||
|
'jabber-roster-mode
|
||||||
|
'jabber-browse-mode
|
||||||
|
'slack-mode))))))
|
||||||
|
|
||||||
;; I can never remember all the damn chat things I run, so this just does all of em.
|
;; I can never remember all the damn chat things I run, so this just does all of em.
|
||||||
(defun chat (&optional arg)
|
(defun chat (&optional arg)
|
||||||
|
@ -306,7 +312,9 @@ always nil; this function is mostly intended for use in init."
|
||||||
With optional ARG, kill all chat-related buffers first."
|
With optional ARG, kill all chat-related buffers first."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(when arg (chat-disconnect))
|
(when arg (chat-disconnect))
|
||||||
(mapc #'call-interactively chat-functions))
|
(dolist-with-progress-reporter (fn chat-functions)
|
||||||
|
"Connecting to chat..."
|
||||||
|
(call-interactively fn)))
|
||||||
|
|
||||||
(defun +forward-paragraph (arg)
|
(defun +forward-paragraph (arg)
|
||||||
"Move forward ARG (simple) paragraphs.
|
"Move forward ARG (simple) paragraphs.
|
||||||
|
@ -353,5 +361,18 @@ SEPARATOR defaults to the newline (\\n)."
|
||||||
(with-current-buffer (find-file-noselect file)
|
(with-current-buffer (find-file-noselect file)
|
||||||
(buffer-string)))
|
(buffer-string)))
|
||||||
|
|
||||||
|
(defmacro +with-progress (pr-args &rest body)
|
||||||
|
"Perform BODY wrapped in a progress reporter.
|
||||||
|
PR-ARGS is the list of arguments to pass to
|
||||||
|
`make-progress-reporter'; it can be a single string for the
|
||||||
|
message, as well. If you want to use a formatted string, wrap
|
||||||
|
the `format' call in a list."
|
||||||
|
(declare (indent 1))
|
||||||
|
(let ((reporter (gensym))
|
||||||
|
(pr-args (if (listp pr-args) pr-args (list pr-args))))
|
||||||
|
`(let ((,reporter (make-progress-reporter ,@pr-args)))
|
||||||
|
(prog1 (progn ,@body)
|
||||||
|
(progress-reporter-done ,reporter)))))
|
||||||
|
|
||||||
(provide 'acdw)
|
(provide 'acdw)
|
||||||
;;; acdw.el ends here
|
;;; acdw.el ends here
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
;; Other ideas: [[https://twitter.com/NPRougier/status/1488570192561160195][from Nic Rougier]]
|
;; Other ideas: [[https://twitter.com/NPRougier/status/1488570192561160195][from Nic Rougier]]
|
||||||
(add-function :after machine-after-load-theme
|
(add-function :after machine-after-load-theme
|
||||||
(defun +bob-set-faces (&rest _)
|
(defun +bob-set-faces (&rest _)
|
||||||
(let ((base-face "Monego")
|
(let ((base-face "Roboto Mono")
|
||||||
(italic-face "Victor Mono")
|
(italic-face nil)
|
||||||
;; (bold-face nil)
|
;; (bold-face nil)
|
||||||
(mono-face nil)
|
(mono-face nil)
|
||||||
(var-face "Lato")
|
(var-face "Lato")
|
||||||
|
@ -22,16 +22,17 @@
|
||||||
:height ,base-size)
|
:height ,base-size)
|
||||||
;; (bold :family ,(or bold-face base-face)
|
;; (bold :family ,(or bold-face base-face)
|
||||||
;; :weight bold)
|
;; :weight bold)
|
||||||
(italic :family ,(or italic-face base-face)
|
;; (italic :family ,(or italic-face base-face)
|
||||||
:weight medium
|
;; :weight medium
|
||||||
:slant italic
|
;; :slant italic
|
||||||
:height ,base-size)
|
;; :height ,base-size)
|
||||||
(fixed-pitch :family ,(or mono-face base-face)
|
(fixed-pitch :family ,(or mono-face base-face)
|
||||||
:weight regular
|
:weight regular
|
||||||
:height ,base-size)
|
:height ,base-size)
|
||||||
(variable-pitch :family ,(or var-face base-face)
|
(variable-pitch :family ,(or var-face base-face)
|
||||||
:height 1.2)
|
:height 1.2)
|
||||||
(org-italic :family ,(or var-face base-face)
|
(org-italic :family ,(or var-face base-face)
|
||||||
:slant italic))))))
|
:slant italic))))
|
||||||
|
))
|
||||||
|
|
||||||
;;; bob.el ends here
|
;;; bob.el ends here
|
||||||
|
|
Loading…
Reference in New Issue