Tidy and ensure code-cells and writegood-mode installation

This commit is contained in:
Gerard Vermeulen 2022-04-30 09:55:37 +02:00
parent 8e1486b8f6
commit f8c208858c

View File

@ -189,14 +189,7 @@ The [[info:emacs#Init File][init file (info)]] does not load the ~custom-file~ a
'(initial-scratch-message "")
`(insert-directory-program ,(or (executable-find "gls")
(executable-find "ls")))
'(kill-ring-max 300)
'(package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")
("melpa" . "https://melpa.org/packages/")))
;; Pin those packages to GNU ELPA to get the info documentation.
'(package-pinned-packages '((consult . "gnu")
(marginalia . "gnu")
(vertico . "gnu"))))
'(kill-ring-max 300))
#+end_src
#+caption[Customize the second set of Emacs variables]:
@ -204,13 +197,19 @@ The [[info:emacs#Init File][init file (info)]] does not load the ~custom-file~ a
#+name: lst:2nd-custom-set-variables-call
#+begin_src emacs-lisp
(custom-set-variables
'(package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")
("melpa" . "https://melpa.org/packages/")))
;; Pin those packages to GNU ELPA to get the info documentation.
'(package-pinned-packages '((consult . "gnu")
(marginalia . "gnu")
(vertico . "gnu")))
'(package-selected-packages
'(applescript-mode ; mode to edit AppleScript code
async ; asynchroneous processing
auctex ; Aalborg University Center TeX
citar ; bibliography handling
citeproc ; bibliography handling
code-cells ; lightweight notebooks in Emacs
company ; complete anything
consult ; consult completing-read
deadgrep ; use ripgrep from Emacs
@ -224,7 +223,6 @@ The [[info:emacs#Init File][init file (info)]] does not load the ~custom-file~ a
keycast ; show current command with binding
magit ; Git Text-based User Interface
marginalia ; minibuffer margin notes
markdown-mode ; markdown text mode
no-littering ; keep `user-emacs-directory' clean
nov ; EPUB reader
orderless ; Emacs completion style
@ -238,7 +236,6 @@ The [[info:emacs#Init File][init file (info)]] does not load the ~custom-file~ a
smartparens ; smart editing of character pairs
vertico ; VERTical Interactive Completion
wgrep ; open a writable grep buffer
writegood-mode ; bullshit and weasel-word detector
xr ; undo rx to grok regular expressions
yasnippet))) ; code or text template expansion
#+end_src
@ -2437,6 +2434,24 @@ the [[https://github.com/gromnitsky/wordnut#readme][wordnut]] prerequisites.
(message "`wordnut' fails to find the `wn' executable")))
#+end_src
*** [[https://github.com/bnbeckwith/writegood-mode#readme][Writegood mode]]
:PROPERTIES:
:CUSTOM_ID: sec:writing
:END:
[[https://github.com/bnbeckwith/writegood-mode#readme][Writegood mode]] is a minor mode to aid in finding common writing problems. [[http://matt.might.net/articles/shell-scripts-for-passive-voice-weasel-words-duplicates/][Matt
Might's "My Ph.D. advisor rewrote himself in bash" scripts]] inspired this mode.
Listing [[lst:configure-writegood-mode]] configures [[https://github.com/bnbeckwith/writegood-mode#readme][writegood mode]].
#+caption[Configure =writegood-mode=]:
#+caption: Configure =writegood-mode=.
#+name: lst:configure-writegood-mode
#+begin_src emacs-lisp
(when (ensure-package-installation
'writegood-mode) ; bullshit and weasel-word detector
(global-set-key (kbd "C-c g") #'writegood-mode))
#+end_src
* Programming
:PROPERTIES:
:CUSTOM_ID: sec:programming
@ -3065,7 +3080,22 @@ for how to handle ~company-backends~ as a local variable in listing
[[https://github.com/astoff/code-cells.el#readme][Code-cells]] allows to edit [[https://ipython.org/notebook.html][IPython or Jupyter notebooks]] in Emacs with help from
either [[https://github.com/mwouts/jupytext][Jupytext]] or [[https://pandoc.org/][Pandoc]] to translate between the [[https://nbformat.readthedocs.io/en/latest/][ipynb]] format and different
plain text formats. Sofar, I have used [[https://github.com/astoff/code-cells.el#readme][code-cells]] to open [[https://nbformat.readthedocs.io/en/latest/][ipynb]] notebooks with
{{{kbd(C-x C-f)}}} in Emacs for viewing.
{{{kbd(C-x C-f)}}} in Emacs for viewing. Listing [[lst:configure-code-cells]]
configures =code-cells=.
#+caption[Configure =code-cells=]:
#+caption: Configure =code-cells=.
#+name: lst:configure-code-cells
#+begin_src emacs-lisp
(when (ensure-package-installation
'code-cells) ; lightweight notebooks in Emacs
(with-eval-after-load 'code-cells
(let ((map code-cells-mode-map))
(define-key map (kbd "M-p") #'code-cells-backward-cell)
(define-key map (kbd "M-n") #'code-cells-forward-cell)
(define-key map (kbd "C-c C-c") #'code-cells-eval))))
#+end_src
*** TODO Look into: editing facilities
1. [[https://github.com/douglasdavis/numpydoc.el/blob/main/numpydoc.el][Emacs extension to insert numpy style docstrings in function definitions]]