From 911234a81a85e5f30ca00c20d009dbce94745894 Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 24 Sep 2023 06:29:37 -0700 Subject: no native comp; alignment cmd; themes-in-package function --- init-el.org | 167 +++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 108 insertions(+), 59 deletions(-) diff --git a/init-el.org b/init-el.org index 364b8aa..3bc8a8c 100644 --- a/init-el.org +++ b/init-el.org @@ -58,8 +58,8 @@ New in emacs 28, native compilation can be enabled: (when (and (fboundp 'native-comp-available-p) (native-comp-available-p)) - (setq package-native-compile t - native-comp-always-compile t)) + (setq package-native-compile nil + native-comp-always-compile nil)) #+end_src @@ -101,7 +101,9 @@ New in emacs 28, native compilation can be enabled: <> <> <> +<> <> + #+end_src I have written a custom leader key system called "my-leader-keys". A @@ -152,7 +154,7 @@ New in emacs 28, native compilation can be enabled: (def-my-command my-leader-command '((?/ "[/] search buffer" swiper) (?q "[q]uery replace" query-replace) - (?i "[i]nsert" my-special-insert) + (?e "[e]diting" my-special-edit-command) (?' "['] shell" persp-shell--jump-to-persp-shell) (?b "[b]uffers" my-buffer-command) (?c "[c]apture" org-capture) @@ -171,8 +173,28 @@ New in emacs 28, native compilation can be enabled: (global-set-key (kbd "M-m") 'my-leader-command) #+end_src + +** My leader key special edit commands + +#+name: my-leader-special-edit +#+begin_src elisp :noweb no-export + +(defun my-freaking-align () + (interactive) + (align-regexp (region-beginning) (region-end) "\\(\\s-*\\)\\s-" 1 1 t) + (indent-region (region-beginning) (region-end))) + +(def-my-command my-special-edit-command + '( + (?i "[i]nsert" my-special-insert) + (?a "[a]lign" my-freaking-align))) + +#+end_src +#+RESULTS: my-leader-special-edit +: my-special-edit-command + ** My leader Key Major Mode Menu #+name: my-leader-key-major-mode-menu @@ -410,6 +432,9 @@ First, update the config #+end_src +#+RESULTS: org-protocol-config +: org-protocol + *** desktop entry Second, make an org-protocol desktop entry @@ -474,7 +499,7 @@ e.g. here's one for org capture #+name: ui-fonts #+begin_src elisp :noweb no-export (add-to-list 'default-frame-alist - '(font . "Comic Mono-12") + '(font . "Comic Mono-17") ;'(font . "Victor Mono-10") ) @@ -671,16 +696,14 @@ e.g. here's one for org capture (package-install 'autothemer) ;; for custom themes (setq my-installed-themes - '(modus-themes - sweet-theme - yoshi-theme - wildcharm-theme - goose-theme + '(yoshi-theme + night-owl-theme + hemera-theme + lush-theme + seoul256-theme + dracula-theme poet-theme - moe-theme - tao-theme - solarized-theme - twilight-bright-theme)) + majapahit-themes)) (dolist (package my-installed-themes) @@ -694,26 +717,36 @@ e.g. here's one for org capture #+name: ui-themes-theme-switcher #+begin_src elisp :results none + +(defun themes-in-package (package) + "PACKAGE is a symbol naming a particular theme package. Return a +list of symbols naming the themes in that package, if there are +any. Each such symbol returned is suitable for passing to +LOAD-THEME" + (let* ((package-search-string + (format "elpa/%s" package)) + (package-dir + (cl-find-if + (lambda (dir) (cl-search package-search-string dir)) + (custom-theme--load-path))) + (suffix + "-theme\\.el\\'")) + (when package-dir + + (remove-if-not + 'custom-theme-p + (mapcar + (lambda (file) + (load-file (format "%s/%s" package-dir file)) + (intern (substring file 0 (string-match-p suffix file)))) + (directory-files package-dir nil suffix)))))) + (setq *coding-themes* - '(modus-operandi-tritanopia - twilight-bright - moe-light - tao-yang - solarized-selenized-light - goose - moe-dark - solarized-selenized-dark - yoshi - sweet - tao-yin - wildcharm - modus-vivendi)) + (mapcan 'themes-in-package + '( yoshi enlightened majapahit seoul256 lush hemera night-owl ))) (setq *writing-themes* - '(poet-monochrome - poet - poet-dark-monochrome - poet-dark)) + (themes-in-package 'poet)) (setq *current-theme-set* *coding-themes*) @@ -737,7 +770,7 @@ e.g. here's one for org capture (defun my-theme-cycler () (interactive) (let ((still-cycling t)) - (message (format "%s [n]ext or [p]evious. Anything else to quit." + (message (format "%s [n]ext or [p]revious. Anything else to quit." (my-theme-string))) (while still-cycling (let ((char (read-key))) @@ -745,7 +778,7 @@ e.g. here's one for org capture ((eq char ?n) (my-theme-command-next)) ((eq char ?p) (my-theme-command-previous)) (t (setq still-cycling nil)))) - (message (format "%s [n]ext or [p]evious. Anything else to quit." + (message (format "%s [n]ext or [p]revious. Anything else to quit." (my-theme-string)))))) (defun my-theme-linum-mode-cycler () @@ -759,7 +792,8 @@ e.g. here's one for org capture (let* ((active-theme (car custom-enabled-themes)) (next-theme (cadr (cl-member active-theme *current-theme-set*)))) (when active-theme (disable-theme active-theme)) - (if next-theme (load-theme next-theme t) + (if next-theme + (load-theme next-theme t) (load-theme (car *current-theme-set*) t)) (setq cursor-type 'box) (setq-default cursor-type 'box) @@ -771,8 +805,10 @@ e.g. here's one for org capture (themes (reverse *current-theme-set*)) (next-theme (cadr (cl-member active-theme themes)))) (when active-theme (disable-theme active-theme)) + (if next-theme (load-theme next-theme t) (load-theme (car themes) t)) + (setq cursor-type 'box) (setq-default cursor-type 'box) (my-theme-linum-mode-cycler))) @@ -946,12 +982,18 @@ stand up and move around. (setq org-capture-templates (quote ( - ("w" "Web" entry + ("w" "Web Clip" entry (file+olp+datetree "~/notes/deft/Web.org" "Weblink") "* TOREAD %:annotation \n\n#+begin_quote\n\n%i\n\n#+end_quote\n\n" :immediate-finish t :empty-lines 1 :prepend t) + ("l" "Web Link" entry + (file+olp+datetree "~/notes/deft/Web.org" "Weblink") + "* TOREAD %:annotation" + :immediate-finish t + :empty-lines 1 + :prepend t) ("n" "Note" entry (file+olp "~/notes/deft/project-Planner.org" "Notes") "* %U\n\n %F\n\n" @@ -1128,25 +1170,27 @@ stand up and move around. (require 'elfeed) (setq elfeed-feeds - '(("https://harpers.org/feed" culture politics news) - ("https://solar.lowtechmagazine.com/posts/index.xml" technology) - ("https://warandpeas.com/feed" comics) - ("http://planet.lisp.org/rss20.xml" lisp blog) - ("http://feeds.feedburner.com/FutilityCloset" art culture) - ("http://feeds2.feedburner.com/NoTechMagazine" technology) - ("http://www.thingsmagazine.net/feed" art culture) - ("https://commonstransition.org/feed/" commons p2p) - ("http://blog.p2pfoundation.net/feed/" p2p activism research) - ("https://www.noemamag.com/feed" culture technology) - ("https://theconvivialsociety.substack.com/feed" technology culture philosophy) - ("https://daily.jstor.org/feed" news) - ("https://www.merriam-webster.com/wotd/feed/rss2" wordoday) - ("https://www.viruscomix.com/rss.xml" comics) - ("https://smbc-comics.com/rss.php" comics) - ("https://www.science.org/blogs/pipeline/feed" science news) - ("https://existentialcomics.com/rss.xml" comics) - ("https://journal.stuffwithstuff.com/rss.xml" programming blog) - ("https://rss.slashdot.org/Slashdot/slashdotMain" tech news))) + '( + ("https://harpers.org/feed" culture politics news) + ("https://solar.lowtechmagazine.com/posts/index.xml" technology) + ("https://lambdaland.org/index.xml" blog lisp emacs) + ("https://warandpeas.com/feed" comics) + ("http://planet.lisp.org/rss20.xml" lisp blog) + ("http://feeds.feedburner.com/FutilityCloset" art culture) + ("http://feeds2.feedburner.com/NoTechMagazine" technology) + ("http://www.thingsmagazine.net/feed" art culture) + ("https://commonstransition.org/feed/" commons p2p) + ("http://blog.p2pfoundation.net/feed/" p2p activism research) + ("https://www.noemamag.com/feed" culture technology) + ("https://theconvivialsociety.substack.com/feed" technology culture philosophy) + ("https://daily.jstor.org/feed" news) + ("https://www.merriam-webster.com/wotd/feed/rss2" wordoday) + ("https://www.viruscomix.com/rss.xml" comics) + ("https://smbc-comics.com/rss.php" comics) + ("https://www.science.org/blogs/pipeline/feed" science news) + ("https://existentialcomics.com/rss.xml" comics) + ("https://journal.stuffwithstuff.com/rss.xml" programming blog) + ("https://rss.slashdot.org/Slashdot/slashdotMain" tech news))) (setq-default elfeed-search-filter "@1-weeks-ago +unread") @@ -1267,8 +1311,6 @@ stand up and move around. <> -<> - #+end_src ** Literate Programming @@ -1298,7 +1340,8 @@ code in emacs org blocks. (lisp . t) (C . t) (shell . t) - (jupyter . t))) + ;(jupyter . t) + )) (setf org-src-window-setup 'current-window) @@ -1307,8 +1350,8 @@ code in emacs org blocks. ;; newer orgs don't know what to do with `#+begin_src jupyter-python`, ;; so I just have to do `#+begin_src jupyter`, but then there's no ;; syntax highlighting -(define-derived-mode jupyter-mode python-mode "Python" - "Haxe syntax highlighting mode. This is simply using js-mode for now.") +;; (define-derived-mode jupyter-mode python-mode "Python" +;; "Haxe syntax highlighting mode. This is simply using js-mode for now.") @@ -1339,6 +1382,10 @@ code in emacs org blocks. (package-install 'flycheck) (package-install 'magit) + +;; see https://github.com/magit/magit/issues/5011 +(require 'seq-25) + (package-install 'paredit) (package-install 'ag) (package-install 'lice) @@ -1346,6 +1393,8 @@ code in emacs org blocks. <> <> + + #+end_src *** Projectile @@ -1654,7 +1703,7 @@ from debian contrib : Package ‘haxe-mode’ installed. -** Python +** COMMENT Python #+name: python-config #+begin_src elisp :noweb no-export :results none -- cgit v1.2.3