Fix remaining Emacs 30 bugs and issues.
This commit is contained in:
parent
6a28307eca
commit
ac4d2cbc0b
4 changed files with 69 additions and 84 deletions
|
@ -43,6 +43,7 @@ Best success comes from using the [[https://github.com/d12frosted/homebrew-emacs
|
|||
|
||||
I find that I need to … at least, on my work computer, install two different versions of Emacs that I use to distinguish one for “work” and the other for other activities, like IRC and [[file:ha-feed-reader.org][elfeed]]. To that end, I run the following command to install Emacs:
|
||||
#+begin_src sh
|
||||
brew reinstall $(brew deps emacs-plus@30)
|
||||
brew install emacs-plus@30 --with-native-comp --with-mailutils --with-imagemagick --with-savchenkovaleriy-big-sur-icon --with-no-frame-refocus --debug
|
||||
#+end_src
|
||||
And if it fails, choose =shell= and type:
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"A WAV or AU file used at the completion of a function.")
|
||||
|
||||
;; My replacement in case we can't play internal sounds:
|
||||
(defun beep--beep ()
|
||||
(defun beep-beep ()
|
||||
"Play a default notification sound file.
|
||||
Customize the variable, `beep-alert-sound-file' to adjust the sound."
|
||||
(if (fboundp 'play-sound-internal)
|
||||
|
@ -29,12 +29,12 @@ Customize the variable, `beep-alert-sound-file' to adjust the sound."
|
|||
(defvar beep-speech-executable "say %s"
|
||||
"An OS-dependent shell string to speak. Replaces `%s' with a phrase.")
|
||||
|
||||
(defun beep--speak (phrase)
|
||||
(defun beep-speak (phrase)
|
||||
"Call a program to speak the string, PHRASE.
|
||||
Customize the variable, `beep-speech-executable'."
|
||||
(let ((command (format beep-speech-executable phrase)))
|
||||
(save-window-excursion
|
||||
(async-shell-command command))))
|
||||
(ignore-errors
|
||||
(call-process-shell-command command))))
|
||||
|
||||
(defun beep-when-finished (phrase &optional to-speak)
|
||||
"Notify us with string, PHRASE, to grab our attention.
|
||||
|
@ -42,8 +42,8 @@ Useful after a long process has completed, but use sparingly,
|
|||
as this can be pretty distracting."
|
||||
(when (functionp 'alert)
|
||||
(alert phrase :title "Completed"))
|
||||
(beep--beep)
|
||||
(beep--speak (or to-speak phrase))
|
||||
(beep-beep)
|
||||
(beep-speak (or to-speak phrase))
|
||||
(message phrase))
|
||||
|
||||
(defun compile-and-notify ()
|
||||
|
@ -57,31 +57,12 @@ See `beep-when-finished' for details."
|
|||
(defvar beep-func-too-long-time 5
|
||||
"The number of seconds a function runs before it is considered taking too much time, and needing to be alerted when it has finished.")
|
||||
|
||||
(defun beep--after-function (func)
|
||||
"Call the function, FUNC, interactively, and notify us when completed."
|
||||
(let ((start-time (current-time))
|
||||
duration)
|
||||
(call-interactively func)
|
||||
(setq duration (thread-first
|
||||
(current-time)
|
||||
(time-subtract start-time)
|
||||
decode-time
|
||||
first))
|
||||
(when (> duration beep-func-too-long-time)
|
||||
(beep-when-finished (format "The function, %s, has finished." func)))))
|
||||
|
||||
(defun recompile-and-notify ()
|
||||
"Call `recompile' and notify us when finished.
|
||||
See `beep-when-finished' for details."
|
||||
(interactive)
|
||||
(beep--after-function 'recompile))
|
||||
|
||||
(global-set-key (kbd "C-c c") 'recompile-and-notify)
|
||||
(global-set-key (kbd "C-c C") 'compile-and-notify)
|
||||
|
||||
(defun beep-when-runs-too-long (orig-function &rest args)
|
||||
"Notifies us about the completion of ORIG-FUNCTION.
|
||||
Useful as after advice to long-running functions, for instance:
|
||||
Useful as after advice to long-running functions, for instance:
|
||||
|
||||
(advice-add 'org-publish :around #'beep-when-runs-too-long)"
|
||||
(let ((start-time (current-time))
|
||||
|
|
|
@ -29,6 +29,10 @@ A literate programming file for configuring Emacs.
|
|||
;; loading sequence.
|
||||
;;
|
||||
;;; Code:
|
||||
|
||||
;; Used functions defined elsewhere:
|
||||
(defun font-icons (collection label &rest args)
|
||||
(or (plist-get args :title) label))
|
||||
#+end_src
|
||||
* Basic Configuration
|
||||
I begin configuration of Emacs that isn’t /package-specific/.
|
||||
|
@ -779,7 +783,7 @@ Magnar Sveen's [[https://github.com/magnars/expand-region.el][expand-region]] pr
|
|||
The built-in =isearch= is fantastically simple and useful, bound to ~C-s~, but why not bind searching for the current symbol?
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(global-set-key (kbd "m-s m-s") 'isearch-forward-thing-at-point)
|
||||
(global-set-key (kbd "M-s M-s") 'isearch-forward-thing-at-point)
|
||||
#+END_SRC
|
||||
|
||||
I like Charles Choi’s [[https://github.com/kickingvegas/casual][Casual Suite]], and his original [[https://github.com/kickingvegas/cc-isearch-menu][cc-isearch-menu]] was great at seeing the /buried/ features. I’ve duplicated the features using [[https://github.com/jerrypnz/major-mode-hydra.el][pretty-hydra]]. In the middle of a search, type ~⌘-s~ (Command-s), and menu of options I don’t remember appear.
|
||||
|
|
|
@ -381,8 +381,7 @@ This project replaces [[https://github.com/domtronn/all-the-icons.el][all-the-ic
|
|||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(use-package nerd-icons
|
||||
:straight (nerd-icons :type git :host github :repo "rainstormstudio/nerd-icons.el"
|
||||
:files (:defaults "data"))
|
||||
:straight (nerd-icons :type git :host github :repo "rainstormstudio/nerd-icons.el")
|
||||
:custom
|
||||
;; The Nerd Font you want to use in GUI defaults to fixed-font:
|
||||
(nerd-icons-font-family ha-fixed-font))
|
||||
|
@ -393,8 +392,8 @@ The way we access the /font icons/ has always been … odd; needing to specify t
|
|||
#+BEGIN_SRC emacs-lisp
|
||||
(defun font-icons (collection label &rest args)
|
||||
"Abstraction over `nerd-icons' project.
|
||||
LABEL is a short icon description merged with COLLECTION to
|
||||
identify an icon to use. For instance, 'faicon or 'octicon.
|
||||
LABEL is a short icon description merged with COLLECTION to identify an
|
||||
icon to use. For instance, 'faicon or 'octicon.
|
||||
|
||||
ARGS, a plist, contain the title, sizing and other information.
|
||||
|
||||
|
|
Loading…
Reference in a new issue