Compare commits

...

3 Commits

1 changed files with 55 additions and 86 deletions

View File

@ -1706,37 +1706,16 @@ pairs.
| renumber grep/occur matches | =\(.+:\)= | =\,(1+ \#)._= |
|-----------------------------+---------------------------------+---------------|
** [[https://github.com/Wilfred/deadgrep#readme][Deadgrep]] :noexport:
** [[info:emacs#Incremental Search][Incremental Search (info)]] and [[info:emacs#Other Repeating Search][Other Search and Loop Commands (info)]]
:PROPERTIES:
:CUSTOM_ID: sec:deadgrep
:header-args:emacs-lisp: :tangle no :eval never-export
:END:
[[https://github.com/Wilfred/deadgrep#readme][Deadgrep]] uses [[https://github.com/BurntSushi/ripgrep#readme][ripgrep]] for superfast text searching in the default directory or
the current [[https://en.wikipedia.org/wiki/Version_control][VCS]] directory tree. Listing [[lst:bind-deadgrep-commands][setup =deadgrep= commands]] binds
=deadgrep= globally to {{{kbd(M-s d)}}} and =deadgrep-edit-mode= locally to
{{{kbd(C-c C-w)}}}.
#+caption[Bind =deadgrep= commands]:
#+caption: Bind =deadgrep= commands.
#+name: lst:bind-deadgrep-commands
#+begin_src emacs-lisp -n :results silent
(when (and (ensure-package-installation 'deadgrep)
(fboundp 'deadgrep))
(keymap-set search-map "d" #'deadgrep)
(with-eval-after-load 'deadgrep
(keymap-set deadgrep-mode-map "C-c C-w" #'deadgrep-edit-mode)))
#+end_src
** [[https://www.masteringemacs.org/article/searching-buffers-occur-mode][Searching and Editing in Buffers with Occur Mode]]
:PROPERTIES:
:CUSTOM_ID: sec:occur
:CUSTOM_ID: sec:search
:END:
#+caption[Define =multi-occur-in-this-mode=]:
#+caption: Define =multi-occur-in-this-mode=.
#+name: lst:multi-occur-in-this-mode
#+begin_src emacs-lisp -n
;; https://www.masteringemacs.org/article/searching-buffers-occur-mode
(defun get-buffers-matching-mode (mode)
"Return a list of buffers whose major-mode is equal to MODE."
(let ((buffer-mode-matches '()))
@ -1754,6 +1733,57 @@ the current [[https://en.wikipedia.org/wiki/Version_control][VCS]] directory tre
(car (occur-read-primary-args))))
#+end_src
#+caption[Use =consult-line= from =isearch=]:
#+caption: Use =consult-line= from =isearch=.
#+name: lst:consult-line-from-isearch
#+begin_src emacs-lisp -n :results silent
;; https://blog.chmouel.com/posts/emacs-isearch/
(when (package-installed-p 'consult)
(defun consult-line-from-isearch ()
"Invoke `consult-line' from isearch."
(interactive)
(let ((query (if isearch-regexp
isearch-string
(regexp-quote isearch-string))))
(isearch-update-ring isearch-string isearch-regexp)
(let (search-nonincremental-instead)
(ignore-errors (isearch-done t t)))
(consult-line query)))
(keymap-set isearch-mode-map "C-l" #'consult-line-from-isearch))
#+end_src
#+caption[Use =occur= and =project-find-regexp= from =isearch=]:
#+caption: Use =occur= and =project-find-regexp= from =isearch=.
#+name: lst:occur-and-project-find-regexp-from-isearch
#+begin_src emacs-lisp -n :results silent
;; https://blog.chmouel.com/posts/emacs-isearch/
(defun occur-from-isearch ()
"Invoke `occur' from isearch."
(interactive)
(let ((query (if isearch-regexp
isearch-string
(regexp-quote isearch-string))))
(isearch-update-ring isearch-string isearch-regexp)
(let (search-nonincremental-instead)
(ignore-errors (isearch-done t t)))
(occur query)))
(defun project-find-regexp-from-isearch ()
"Invoke `project-find-regexp' from isearch."
(interactive)
(let ((query (if isearch-regexp
isearch-string
(regexp-quote isearch-string))))
(isearch-update-ring isearch-string isearch-regexp)
(let (search-nonincremental-instead)
(ignore-errors (isearch-done t t)))
(project-find-regexp query)))
(keymap-set isearch-mode-map "C-o" #'occur-from-isearch)
(keymap-set isearch-mode-map "C-f" #'project-find-regexp-from-isearch)
#+end_src
** [[https://www.genivia.com/get-ugrep.html][Ugrep]]
:PROPERTIES:
:CUSTOM_ID: sec:ugrep
@ -2153,68 +2183,6 @@ configuration objectives:
LaTeX-section-label)))
#+end_src
*** [[https://gitlab.com/matsievskiysv/math-preview/-/blob/master/README.md][Math-preview]] :noexport:
:PROPERTIES:
:CUSTOM_ID: sec:math-preview
:header-args:emacs-lisp: :tangle no
:END:
[[https://gitlab.com/matsievskiysv/math-preview/-/blob/master/README.md][Math-preview]] uses [[https://docs.mathjax.org/en/latest/][Mathjax-3]] to display [[https://www.latex-project.org/][LaTeX]], [[https://www.w3.org/Math/][MathML]],and [[http://asciimath.org/][asciimath]] in Emacs
buffers with help of an external [[https://nodejs.org][node.js]] program.
#+caption[Setup =math-preview=]:
#+caption: Setup =math-preview=.
#+name: lst:setup-math-preview
#+begin_src emacs-lisp -n :results silent
(when (ensure-package-installation 'math-preview)
(with-eval-after-load 'math-preview
;; https://docs.mathjax.org/en/latest/input/tex/extensions/physics.html
(let ((physics (split-string "
abs absolutevalue acomm acos acosecant acosine acot acotangent
acsc admat anticommutator antidiagonalmatrix arccos arccosecant
arccosine arccot arccotangent arccsc arcsec arcsecant arcsin
arcsine arctan arctangent asec asecant asin asine atan atangent
bmqty bqty Bqty bra braket comm commutator cos cosecant cosh
cosine cot cotangent coth cp cross crossproduct csc csch curl dd
derivative det determinant diagonalmatrix diffd differential div
divergence dmat dotproduct dv dyad erf ev eval evaluated exp
expectationvalue exponential expval fderivative fdv flatfrac
functionalderivative grad gradient gradientnabla hypcosecant
hypcosine hypcotangent hypsecant hypsine hyptangent
identitymatrix Im imaginary imat innerproduct ip ket ketbra
laplacian ln log logarithm matrixdeterminant matrixel
matrixelement matrixquantity mdet mel mqty naturallogarithm norm
op order outerproduct partialderivative paulimatrix pb
pderivative pdv pmat pmqty Pmqty poissonbracket pqty Pr
principalvalue Probability pv PV qall qand qas qassume qc qcc
qcomma qelse qeven qfor qgiven qif qin qinteger qlet qodd qor
qotherwise qq qqtext qsince qthen qty quantity qunless qusing
rank Re real Res Residue sbmqty sec secant sech sin sine sinh
smallmatrixquantity smdet smqty spmqty sPmqty svmqty tan tangent
tanh tr Tr trace Trace va var variation vb vdot vectorarrow
vectorbold vectorunit vmqty vnabla vqty vu xmat xmatrix
zeromatrix zmat")))
(cl-pushnew `("physics" . ,physics)
math-preview-tex-packages-autoload-packages))
(setq math-preview-raise 0.5
math-preview-scale 1
math-preview-tex-default-packages '("autoload" "ams" "physics"))
(let ((command (executable-find "~/node_modules/.bin/math-preview")))
(if command
(setq math-preview-command command)
;; https://stackoverflow.com/a/17509764 answers:
;; How to install an npm package from github directly?
(unless (file-directory-p "~/node_modules")
(make-directory "~/node_modules"))
(cl-destructuring-bind (exit-code output)
(shell-command-with-exit-code
"npm" "install"
"git+https://gitlab.com/matsievskiysv/math-preview.git")
(if (= 0 exit-code)
(message "%s" (string-trim output))
(error "%s" (string-trim output))))))))
#+end_src
*** TODO Improve the AUCTeX configuration slowly
:PROPERTIES:
:CUSTOM_ID: sec:setup-auctex-slowly
@ -5730,6 +5698,7 @@ Points for further investigation are:
6. The list of installed packages in listing [[lst:list-julia-packages-result]]
facilitate [[https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-julia.html][Julia Code Blocks in Babel]] because the list contains [[https://github.com/JuliaData/CSV.jl][CSV]] and
[[https://dataframes.juliadata.org/stable/][DataFrames]].
7. How to update automatically to the [[https://julialang.org/downloads/#current_stable_release][current stable release of Julia]].
A list of interesting online course material is:
1. [[https://ucidatascienceinitiative.github.io/IntroToJulia/][A Deep Introduction to Julia for Data Science and Scientific Computing]].
2. [[https://juliateachingctu.github.io/Julia-for-Optimization-and-Learning/stable/][Julia for Optimization and Learning]].