From 93aa0934cadaa254fd90fc2aedfeeed48aaf8a11 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 12 Feb 2022 22:52:13 +0100 Subject: [PATCH 01/13] Performance improvements as recommended by lsp-mode https://emacs-lsp.github.io/lsp-mode/page/performance/ --- config.org | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config.org b/config.org index ee4a9ed..a7903d6 100644 --- a/config.org +++ b/config.org @@ -72,6 +72,15 @@ Use a sane date style. (setq-default backup-inhibited t) #+end_src +** Performance tweaks + +As recommended by [[https://emacs-lsp.github.io/lsp-mode/page/performance/][lsp-mode]], + +#+begin_src emacs-lisp +(setq gc-cons-threshold 100000000 + read-process-output-max (* 1024 1024)) +#+end_src + ** Disable adding double spaces after periods Source: [[http://www.reddit.com/r/emacs/comments/2l5gtz/real_sentence_in_emacs/][Real sentence in Emacs : emacs]] From 8bdaf26a0aeb8bd5ee86011f8f8abb7c43c54cdb Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 12 Feb 2022 22:52:58 +0100 Subject: [PATCH 02/13] Slightly increased transparency --- config.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.org b/config.org index a7903d6..8ad556a 100644 --- a/config.org +++ b/config.org @@ -441,7 +441,7 @@ Installing and enabling Doom themes. Add a slight transparency to the frames. Code provided by David Wilson / System Crafters [[https://github.com/daviwil/emacs-from-scratch/blob/master/Emacs.org][Emacs from Scratch]] video series. #+begin_src emacs-lisp -(setq mmk2410/frame-transparency '(95 . 95)) +(setq mmk2410/frame-transparency '(90 . 90)) (set-frame-parameter (selected-frame) 'alpha mmk2410/frame-transparency) (add-to-list 'default-frame-alist `(alpha . ,mmk2410/frame-transparency)) From 6624ee703669b7e3726d4ae831f0376d0fac62cd Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 12 Feb 2022 22:53:18 +0100 Subject: [PATCH 03/13] [Org] Increase refile levels to two --- config.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.org b/config.org index 8ad556a..1d44a0d 100644 --- a/config.org +++ b/config.org @@ -1060,7 +1060,7 @@ Configure refiling TODOs. (setq org-refile-use-outline-path 'file) (setq org-outline-path-complete-in-steps nil) (setq org-refile-allow-creating-parent-nodes 'confirm) -(setq org-refile-targets '((org-agenda-files :maxlevel . 1))) +(setq org-refile-targets '((org-agenda-files :maxlevel . 2))) #+end_src Warn me on deadlines in the next year. From 47a59c031d59d0b69db44802ed3dc5e47890f413 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 12 Feb 2022 22:53:29 +0100 Subject: [PATCH 04/13] [lsp] Load for web-mode. Useful for Vue files --- config.org | 1 + 1 file changed, 1 insertion(+) diff --git a/config.org b/config.org index 1d44a0d..e42c116 100644 --- a/config.org +++ b/config.org @@ -1474,6 +1474,7 @@ Source: [[https://github.com/emacs-lsp/lsp-mode][GitHub:emacs-lsp/lsp-mode]] (go-mode . lsp-deferred) (php-mode . lsp-deferred) (vue-mode . lsp-deferred) + (web-mode . lsp-deferred) (typescript-mode . lsp-deferred) (js-mode . lsp-deferred) (lsp-mode . lsp-enable-which-key-integration)) From de8850a14cf91e1c5efd235274132b208fdfe480 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 12 Feb 2022 22:53:45 +0100 Subject: [PATCH 05/13] [PHP] Set coding style to PSR2 --- config.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.org b/config.org index e42c116..91adb37 100644 --- a/config.org +++ b/config.org @@ -1526,7 +1526,8 @@ Source: [[https://github.com/emacs-php/php-mode][GitHub: emacs-php/php-mode]] #+begin_src emacs-lisp (use-package php-mode - :mode "\\.php\\'") + :mode "\\.php\\'" + :config (setq php-mode-coding-style 'PSR2)) #+end_src ** TypeScript From 0091dd84f04400d02e5e3cb8ea7c4c299c141596 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 12 Feb 2022 22:53:57 +0100 Subject: [PATCH 06/13] [Web] Use web-mode for Vue files --- config.org | 1 + 1 file changed, 1 insertion(+) diff --git a/config.org b/config.org index 91adb37..b0b95f4 100644 --- a/config.org +++ b/config.org @@ -1556,6 +1556,7 @@ Source: [[https://github.com/fxbois/web-mode][GitHub: fxbois/web-mode]] ("\\.erb\\'" . web-mode) ("\\.mustache\\'" . web-mode) ("\\.djhtml\\'" . web-mode) + ("\\.vue\\'" . web-mode) ("\\.blade\\.php\\'" . web-mode))) #+end_src From b4c15210ac6ab59a69667553512dbe1252f01162 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 12 Feb 2022 22:54:36 +0100 Subject: [PATCH 07/13] [Vue] Removed since web-mode workes just as well (perhaps even better) --- config.org | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/config.org b/config.org index b0b95f4..b37be1f 100644 --- a/config.org +++ b/config.org @@ -1560,17 +1560,6 @@ Source: [[https://github.com/fxbois/web-mode][GitHub: fxbois/web-mode]] ("\\.blade\\.php\\'" . web-mode))) #+end_src -** Vue Mode - -Emacs major mode for vue.js - -Source: [[https://github.com/AdamNiederer/vue-mode][GitHub: AdamNiederer/vue-mode]] - -#+begin_src emacs-lisp -(use-package vue-mode - :mode "\\.vue\\'") -#+end_src - ** TypoScript TypoScript major mode for Emacs. From 16619a2f17e772de7993b5db4823bd3191c1ce58 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 12 Feb 2022 22:55:21 +0100 Subject: [PATCH 08/13] [Elfeed] Using FreshRSS again --- config.org | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config.org b/config.org index b37be1f..81629e1 100644 --- a/config.org +++ b/config.org @@ -1791,13 +1791,13 @@ Source: [[https://github.com/fasheng/elfeed-protocol][GitHub: fasheng/elfeed-pro :init ;; FreshRSS (self-hosted) ;; Disabled since I currently use Miniflux - ;; (setq elfeed-feeds '(("fever+https://mmk2410@rss.mmk2410.org" - ;; :api-url "https://rss.mmk2410.org/api/fever.php" - ;; :use-authinfo t))) - ;; Miniflux (self-hosted) - (setq elfeed-feeds '(("fever+https://mmk2410@miniflux.rss.mmk2410.org" - :api-url "https://miniflux.rss.mmk2410.org/fever/" + (setq elfeed-feeds '(("fever+https://mmk2410@rss.mmk2410.org" + :api-url "https://rss.mmk2410.org/api/fever.php" :use-authinfo t))) + ;; Miniflux (self-hosted) + ;; (setq elfeed-feeds '(("fever+https://mmk2410@miniflux.rss.mmk2410.org" + ;; :api-url "https://miniflux.rss.mmk2410.org/fever/" + ;; :use-authinfo t))) (elfeed-protocol-enable)) #+end_src From ddb05d56c188fe12b1098507da5c0f7c2a7212ec Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 12 Feb 2022 22:55:49 +0100 Subject: [PATCH 09/13] [mu4e] Don't load mu4e configuration on work computer --- config.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config.org b/config.org index 81629e1..fc4fdd4 100644 --- a/config.org +++ b/config.org @@ -1807,12 +1807,14 @@ Managing e-mails is maybe one of the most critical tasks in my life. Over the la Sadly since my workplace heavily uses Microsoft Office 365 including Outlook for mails I'm currently using Evolution, with a setup heavily inspired by [[https://karl-voit.at/2021/06/01/Thunderbird-to-Evolution/][Karl Voit]]. + ** Load mu4e Not all systems that I use have mu/mu4e installed. Either because I cannot really use it at work or because I'm running a native Windows instance or because I didn't completely setup the machine. Therefore I only load/execute the complete mu4e configuration if Emacs can find a =mu= executable. #+begin_src emacs-lisp -(when (executable-find "mu") ;; Closed after all mu4e configuration +(when (and (executable-find "mu") + (not (string-equal system-name "knuth"))) ;; Closed after all mu4e configuration #+end_src Not all distributions that I use have a enough up-to-date package of mu/maildir-utils in their repositories. Therefore on some system I compile and install it myself which ends in =/usr/local= instead of just =/usr.= Therefore I have a small function that finds the correct load-path for the mu4e package. From 2855f2abc22f001783d6940a4ccbdda02b9dd949 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 12 Feb 2022 22:56:08 +0100 Subject: [PATCH 10/13] [mu4e] Load special configuration on work computer --- config.org | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config.org b/config.org index fc4fdd4..aa09d17 100644 --- a/config.org +++ b/config.org @@ -2122,6 +2122,16 @@ Finally the mu4e configuration is done! So lets close the parenthesis left open ) ;; closing parens for (when (executable-find "mu") #+end_src +** Load work mail + +Load new mail setup which includes support for work mail when running on my work machine. + +#+begin_src emacs-lisp +(when (string-equal system-name "knuth") + (push "~/.emacs.d/lisp" load-path) + (require 'mmk2410-mail-setup)) +#+end_src + * Email with Evolution Since my work place is using Microsoft Outlook for Email including its appointment features I sadly needed to switch away from mu4e to Evolution, as recommended by [[https://karl-voit.at/2021/06/01/Thunderbird-to-Evolution/][Karl Voit]]. Using [[https://github.com/novoid/dot-emacs/blob/master/config.org][his configuration]] as an inspiration and source I could setup the following workflow. From e6ea557889d8b051182631576a7958fd66690610 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 12 Feb 2022 23:05:50 +0100 Subject: [PATCH 11/13] [tab-bar-helpers] Remove global keybinding --- packages/{tab-bar-helpers.el => mmk2410-tab-bar-helpers.el} | 2 -- 1 file changed, 2 deletions(-) rename packages/{tab-bar-helpers.el => mmk2410-tab-bar-helpers.el} (97%) diff --git a/packages/tab-bar-helpers.el b/packages/mmk2410-tab-bar-helpers.el similarity index 97% rename from packages/tab-bar-helpers.el rename to packages/mmk2410-tab-bar-helpers.el index 2ac24bd..00265e5 100644 --- a/packages/tab-bar-helpers.el +++ b/packages/mmk2410-tab-bar-helpers.el @@ -67,8 +67,6 @@ ("m" mmk2410/tab-bar-run-mail "Mail") ("p" mmk2410/tab-bar-run-projects "Projects")) -(global-set-key (kbd "C-c f") 'mmk2410/tab-bar/body) - (provide mmk2410/tab-bar-helpers) ;;; tab-bar-helpers.el ends here From e11793460f43ca75ca498366b7124efda7d1c3d4 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 12 Feb 2022 23:06:08 +0100 Subject: [PATCH 12/13] [tab-bar-helpers] Fixed provides --- packages/mmk2410-tab-bar-helpers.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mmk2410-tab-bar-helpers.el b/packages/mmk2410-tab-bar-helpers.el index 00265e5..1737305 100644 --- a/packages/mmk2410-tab-bar-helpers.el +++ b/packages/mmk2410-tab-bar-helpers.el @@ -67,6 +67,6 @@ ("m" mmk2410/tab-bar-run-mail "Mail") ("p" mmk2410/tab-bar-run-projects "Projects")) -(provide mmk2410/tab-bar-helpers) +(provide 'mmk2410-tab-bar-helpers) ;;; tab-bar-helpers.el ends here From a6393b396badf2a79a4583a95713405a1b5e4504 Mon Sep 17 00:00:00 2001 From: Marcel Kapfer Date: Sat, 12 Feb 2022 23:06:30 +0100 Subject: [PATCH 13/13] =?UTF-8?q?[=C5=A7ab-bar-helper]=20Include=20in=20ma?= =?UTF-8?q?in=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.org | 83 ++++-------------------------------------------------- 1 file changed, 5 insertions(+), 78 deletions(-) diff --git a/config.org b/config.org index aa09d17..2ec1f17 100644 --- a/config.org +++ b/config.org @@ -2194,84 +2194,11 @@ The following function from him takes care of the other way: bringing a message * Helpers ** Tab Bar Setup -Since version 27 Emacs features a tab bar. In contrast to e.g. a browser a tab does not display just one file/buffer/window but an Emacs tab features an entire window configuration. Since I use Emacs not just for programming but (perhaps even mainly) for personal information management (including mail, agenda, journal, IRC and RSS) I had the idea to have one Emacs frame open with different tabs for all these things. Therefore I wrote a ~mmk2410/tab-bar-setup~ function (bound to =C-c f C-f=) creating the following setup: - -- First tab: *Mail* with mu4e -- Second tab: *Agenda / Journal* with an Org agenda on the left and an Org journal on the right -- Third tab: *IRC* with ERC -- Fourth tab: *RSS* with elfeed - -This is accompanied with five helper functions to switch to the wished application in the correct tab and window. - -|------------+-----------------------------------+------------| -| *Applicaton* | *Command* | *Keybinding* | -| Mail | ~mmk2410/tab-bar-switch-to-mail~ | =C-c f m= | -| Agenda | ~mmk2410/tab-bar-switch-to-agenda~ | =C-c f a= | -| Journal | ~mmk2410/tab-bar-switch-to-journal~ | =C-c f j= | -| IRC | ~mmk2410/tab-bar-switch-to-irc~ | =C-c f i= | -| RSS | ~mmk2410/tab-bar-switch-to-rss~ | =C-c f r= | -|------------+-----------------------------------+------------| +Since version 27 Emacs features a tab bar. In contrast to e.g. a browser a tab does not display just one file/buffer/window but an Emacs tab features an entire window configuration. Since I use Emacs not just for programming but (perhaps even mainly) for personal information management (including mail, agenda, journal, IRC and RSS) I had the idea to have one Emacs frame open with different tabs for all these things. Therefore I wrote a small package found in =packages/mmk2410-tab-bar-helpers.el= which I explain in a [[https://mmk2410.org/2022/02/11/using-emacs-tab-bar-mode/][dedicated blog post]]. #+begin_src emacs-lisp -(defun mmk2410/tab-bar-setup () - "Enable tab bar and setup mu4e, Org Journal, Org Agenda and ERC." - (interactive) - (tab-bar-mode 1) - ;; Disabled since I'm currently not using mu4e that much (see Evolution Mail and mu4e setup). - ;; (tab-bar-rename-tab "Mail") - ;; (mu4e-context-switch :name "Private") - ;; (mu4e) - ;; (sit-for 1) - ;; (tab-bar-new-tab) - (tab-bar-rename-tab "Agenda / Journal") - (split-window-horizontally) - (org-agenda nil "c") - (sit-for 1) - (other-window 1) - (org-journal-open-current-journal-file) - (sit-for 1) - (tab-bar-new-tab) - (tab-bar-rename-tab "IRC") - (mmk2410/erc-connect) - (sit-for 1) - (switch-to-buffer "Libera.Chat") - (tab-bar-new-tab) - (tab-bar-rename-tab "RSS") - (elfeed)) - -(defun mmk2410/tab-bar-switch-to-mail () - "Switch to mail tab." - (interactive) - (tab-bar-switch-to-tab "Mail")) - -(defun mmk2410/tab-bar-switch-to-agenda () - "Switch to agenda/journal tab and there in the agenda window." - (interactive) - (tab-bar-switch-to-tab "Agenda / Journal") - (unless (string= (buffer-name) "*Org Agenda*") - (other-window 1))) - -(defun mmk2410/tab-bar-switch-to-journal () - "Switch to agenda/journal tab and there in the journal window." - (interactive) - (tab-bar-switch-to-tab "Agenda / Journal") - (if (string= (buffer-name) "*Org Agenda*") - (other-window 1))) - -(defun mmk2410/tab-bar-switch-to-irc () - "Switch to IRC tab." - (interactive) - (tab-bar-switch-to-tab "IRC")) - -(defun mmk2410/tab-bar-switch-to-rss () - "Switch to RSS tab." - (interactive) - (tab-bar-switch-to-tab "RSS")) - -(global-set-key (kbd "C-c f C-f") 'mmk2410/tab-bar-setup) -(global-set-key (kbd "C-c f m") 'mmk2410/tab-bar-switch-to-mail) -(global-set-key (kbd "C-c f a") 'mmk2410/tab-bar-switch-to-agenda) -(global-set-key (kbd "C-c f j") 'mmk2410/tab-bar-switch-to-journal) -(global-set-key (kbd "C-c f i") 'mmk2410/tab-bar-switch-to-irc) -(global-set-key (kbd "C-c f r") 'mmk2410/tab-bar-switch-to-rss) +(use-package mmk2410-tab-bar-helpers + :after (hydra) + :load-path "packages/" + :bind ("C-c f" . mmk2410/tab-bar/body)) #+end_src