Reorganization and wrong indentation

This commit is contained in:
Howard Abrams 2025-01-16 15:05:15 -08:00
parent e36ae58ae0
commit bba1e52a06
4 changed files with 22 additions and 20 deletions

View file

@ -621,8 +621,9 @@ As I've mentioned [[http://www.howardism.org/Technical/Emacs/beep-for-emacs.html
'libnotify))) 'libnotify)))
(use-package beep (use-package beep
:straight nil ; Already in the load-path :straight (:local-repo "~/src/hamacs/elisp")
:hook (after-init . ha-random-startup-message) :hook (after-init . ha-random-startup-message)
:commands (beep-when-finished beep-when-run-too-long)
:config :config
(dolist (func '(org-publish (dolist (func '(org-publish
org-publish-all org-publish-all
@ -640,8 +641,9 @@ As I've mentioned [[http://www.howardism.org/Technical/Emacs/beep-for-emacs.html
"Beware lest the dragons fly")))) "Beware lest the dragons fly"))))
(beep-when-finished msg))) (beep-when-finished msg)))
#+end_src #+end_src
While that code /advices/ the publishing and compile commands, I may want to add more. While that code /advices/ the publishing and compile commands, I may want to add more.
**** Visual Replacing Regular Expressions *** Visual Replacing Regular Expressions
I appreciated the [[https://github.com/benma/visual-regexp.el][visual-regexp package]] to see what you want to change /before/ executing the replace. I appreciated the [[https://github.com/benma/visual-regexp.el][visual-regexp package]] to see what you want to change /before/ executing the replace.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package visual-regexp (use-package visual-regexp
@ -682,7 +684,7 @@ Now we just need to filter the results from the built-in Emacs function:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(advice-add 'read-regexp :filter-return 'read-regexp-with-rx) (advice-add 'read-regexp :filter-return 'read-regexp-with-rx)
#+end_src #+end_src
**** Jump with Avy *** Jump with Avy
While I grew up on =Control S=, I am liking the /mental model/ associated with the [[https://github.com/abo-abo/avy][avy project]] that allows a /jump/ among matches across all visible windows. I use the ~F18~ key on my keyboard that should be easy to use, but ~g o~ seems obvious. While I grew up on =Control S=, I am liking the /mental model/ associated with the [[https://github.com/abo-abo/avy][avy project]] that allows a /jump/ among matches across all visible windows. I use the ~F18~ key on my keyboard that should be easy to use, but ~g o~ seems obvious.
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -720,7 +722,7 @@ If you hit the following keys /before/ you select a target, you get special acti
Im not thinking of ideas of what would be useful, e.g. ~v~ to highlight from cursor to target, etc. Im not thinking of ideas of what would be useful, e.g. ~v~ to highlight from cursor to target, etc.
Want to know something amazing. In a Terminal, like =vterm= or =eshell=, I run ~s-g~ and pinpoint the UUID in the output of a long command. Then type ~y~ and then ~C-y~ to paste that ID without even moving the mouse. Want to know something amazing. In a Terminal, like =vterm= or =eshell=, I run ~s-g~ and pinpoint the UUID in the output of a long command. Then type ~y~ and then ~C-y~ to paste that ID without even moving the mouse.
**** Link Hint, the Link Jumper *** Link Hint, the Link Jumper
The [[info:emacs#Goto Address mode][Goto Address]] mode (see this [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Goto-Address-mode.html][online link]]) turns URLs into clickable links. Nice feature and built into Emacs, but it requires using the mouse or moving to the URL and hitting ~Return~ (if you like this idea, check out [[https://xenodium.com/actionable-urls-in-emacs-buffers/][Álvaro Ramírez's configuration]] for this). The [[info:emacs#Goto Address mode][Goto Address]] mode (see this [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Goto-Address-mode.html][online link]]) turns URLs into clickable links. Nice feature and built into Emacs, but it requires using the mouse or moving to the URL and hitting ~Return~ (if you like this idea, check out [[https://xenodium.com/actionable-urls-in-emacs-buffers/][Álvaro Ramírez's configuration]] for this).
I appreciated [[https://github.com/abo-abo/ace-link][ace-link]]s idea for hyperlinks on Org, EWW and Info pages, as it allowed you to jump to a URL from any location on the screen. The [[https://github.com/noctuid/link-hint.el][link-hint]] project does this, but works with more types of files and links: I appreciated [[https://github.com/abo-abo/ace-link][ace-link]]s idea for hyperlinks on Org, EWW and Info pages, as it allowed you to jump to a URL from any location on the screen. The [[https://github.com/noctuid/link-hint.el][link-hint]] project does this, but works with more types of files and links:
@ -750,7 +752,7 @@ Can I open a link in another window? The idea with this is that I can select a l
(ace-select-window) (ace-select-window)
(eww (current-kill 0))) (eww (current-kill 0)))
#+end_src #+end_src
**** Expand Region *** Expand Region
Magnar Sveen's [[https://github.com/magnars/expand-region.el][expand-region]] project allows me to hit ~v~ in =visual= mode, and have the selection grow by syntactical units. Magnar Sveen's [[https://github.com/magnars/expand-region.el][expand-region]] project allows me to hit ~v~ in =visual= mode, and have the selection grow by syntactical units.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package expand-region (use-package expand-region
@ -763,7 +765,7 @@ Magnar Sveen's [[https://github.com/magnars/expand-region.el][expand-region]] pr
"V" 'er/contract-region "V" 'er/contract-region
"-" 'er/contract-region)) "-" 'er/contract-region))
#+end_src #+end_src
**** iSearch *** iSearch
The built-in =isearch= is fantastically simple and useful, but the [[https://github.com/kickingvegas/cc-isearch-menu][cc-isearch-menu]] helps expose some /buried/ features. The built-in =isearch= is fantastically simple and useful, but the [[https://github.com/kickingvegas/cc-isearch-menu][cc-isearch-menu]] helps expose some /buried/ features.
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -912,6 +914,7 @@ The /special/ perspective is a nice shortcut to the one I use the most:
#+end_src #+end_src
I often want a workspace dedicated to an /application/, so this function: I often want a workspace dedicated to an /application/, so this function:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun ha-app-perspective (name func) (defun ha-app-perspective (name func)
(lambda () (lambda ()

View file

@ -1,7 +1,7 @@
#+title: Start Screen #+TITLE: Start Screen
#+author: Howard Abrams #+AUTHOR: Howard Abrams
#+date: 2022-11-02 #+DATE: 2022-11-02
#+tags: emacs #+TAGS: emacs
A literate programming file for configuring Emacs to show a startup screen. A literate programming file for configuring Emacs to show a startup screen.

View file

@ -877,11 +877,6 @@ Since I tweaked the help menu, I craft my own menu:
"h C-g" '(keyboard-escape-quit :which-key t)) "h C-g" '(keyboard-escape-quit :which-key t))
#+end_src #+end_src
Some of these call the [[file:ha-programming-elisp.org::*Helpful Functions][Helpful]] package:
#+begin_src emacs-lisp
(use-package helpful)
#+end_src
Remember these keys in the *Help* buffer: Remember these keys in the *Help* buffer:
- ~s~ :: view source of the function - ~s~ :: view source of the function
- ~i~ :: view info manual of the function - ~i~ :: view info manual of the function

View file

@ -40,17 +40,23 @@ The [[https://github.com/tarsius/paren-face][paren-face]] project lowers the col
:hook (emacs-lisp-mode . paren-face-mode)) :hook (emacs-lisp-mode . paren-face-mode))
#+end_src #+end_src
** Helpful Functions
Show code examples with the [[https://github.com/xuchunyang/elisp-demos][elisp-demos]] package. Show code examples with the [[https://github.com/xuchunyang/elisp-demos][elisp-demos]] package.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package elisp-demos (use-package elisp-demos
:config :config
(advice-add 'describe-function-1 :after #'elisp-demos-advice-describe-function-1)) (advice-add 'describe-function-1 :after #'elisp-demos-advice-describe-function-1))
#+end_src #+end_src
** Helpful Functions
Lets take advantage of [[https://github.com/Wilfred/helpful][helpful]] package for getting more information into the =describe-function= call. Find a function without a good demonstration? Call =elisp-demos-add-demo=.
Lets take advantage of [[https://github.com/Wilfred/helpful][helpful]] package for getting more information into the =describe-function= call, but note that this package doesnt seem to be compatible with Emacs v30.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package helpful) (use-package helpful
:if (version< emacs-version "30"))
#+end_src #+end_src
And we should extend it with the [[https://github.com/xuchunyang/elisp-demos][elisp-demos]] project: And we should extend it with the [[https://github.com/xuchunyang/elisp-demos][elisp-demos]] project:
@ -62,8 +68,6 @@ And we should extend it with the [[https://github.com/xuchunyang/elisp-demos][el
(advice-add 'helpful-update :after #'elisp-demos-advice-helpful-update)) (advice-add 'helpful-update :after #'elisp-demos-advice-helpful-update))
#+end_src #+end_src
Find a function without a good demonstration? Call =elisp-demos-add-demo=.
Wilfreds [[https://github.com/Wilfred/suggest.el][suggest]] function helps you find the right function. Basically, you type in the parameters of a function, and then the desired output, and it will write the function call. Wilfreds [[https://github.com/Wilfred/suggest.el][suggest]] function helps you find the right function. Basically, you type in the parameters of a function, and then the desired output, and it will write the function call.
#+begin_src emacs-lisp #+begin_src emacs-lisp