Compare commits

...

2 Commits

Author SHA1 Message Date
Gerard Vermeulen 166821a636 Add Git usage example links 2024-01-29 09:44:03 +01:00
Gerard Vermeulen 494ed457de Correct spelling with the codespell help 2024-01-29 09:41:51 +01:00
1 changed files with 35 additions and 20 deletions

View File

@ -115,7 +115,7 @@ original [[https://www.latex-project.org/][LaTeX]] file of the document. An exa
to convert this [[info:org#Top][org]] file to [[https://en.wikipedia.org/wiki/PDF][PDF]] and to see the result with [[HTTPS://github.com/vedang/pdf-tools][PDF-Tools]] in Emacs:
execute the commands ~pdf-tools-install~, ~org-babel-tangle~,
~org-latex-export-latex-to-latex~, and ~compile~. This sets up an infinite
[[https://www.latex-project.org/][LaTeX]] compilation loop to update and redisplay the [[https://en.wikipedia.org/wiki/PDF][PDF]] file after excution of
[[https://www.latex-project.org/][LaTeX]] compilation loop to update and redisplay the [[https://en.wikipedia.org/wiki/PDF][PDF]] file after execution of
the ~org-latex-export-latex-to-latex~ command in this buffer.
Here follows a list of interesting Emacs configurations:
@ -533,7 +533,7 @@ Emacs]] for how to setup fonts properly. It boils down to two rules:
scaling).
The code in listing [[lst:configure-face-attributes]] implements those rules.
Listing [[lst:set-default-face-height]] shows that font scaling is easy in case of
proper initialization of all face heigths. To adjust the font size in the
proper initialization of all face heights. To adjust the font size in the
current or future frames, invoke src_emacs-lisp{(set-default-face-height)}. To
adjust the font size in the current buffer, type:
1. {{{kbd(s-=)}}} to invoke src_emacs-lisp[:results silent]{(text-scale-adjust
@ -585,7 +585,7 @@ selects a fixed pitch face for =magit-mode= and =progmode= buffers.
Scale all other faces with a height that is a real number."
(interactive)
(let* ((prompt (format "face heigth (%s): "
(let* ((prompt (format "face height (%s): "
(face-attribute 'default :height)))
(choices (mapcar #'number-to-string
(number-sequence 50 200 10)))
@ -1765,10 +1765,10 @@ configures =company= after ensuring the =company= installation.
:CUSTOM_ID: sec:regexp-replace
:END:
Executing {{{kbd(M-x replace-regexp)}}} prompts fo a regular expression =REGEXP=
and a substitution =NEWSTRING= to replace =REGEXP= with =NEWSTRING=. The tools
in section [[#sec:narrowing][Narrowing]] allow to limit the scope of {{{kbd(M-x replace-regexp)}}}.
A list pointing to relevant documentation is:
Executing {{{kbd(M-x replace-regexp)}}} prompts for a regular expression
=REGEXP= and a substitution =NEWSTRING= to replace =REGEXP= with =NEWSTRING=.
The tools in section [[#sec:narrowing][Narrowing]] allow to limit the scope of {{{kbd(M-x
replace-regexp)}}}. A list pointing to relevant documentation is:
1. [[info:emacs#Regexp Replace][Regexp Replace (info)]] explains how the substitution handles references to
regular expression groups and lisp expressions.
2. [[info:emacs#Regexps][Syntax of Regular Expressions (info)]] describes regular expression features
@ -1776,8 +1776,9 @@ A list pointing to relevant documentation is:
3. [[info:elisp#Regular Expressions][Emacs Lisp Regular Expressions (info)]] describes regular expression features
for programmers.
4. [[https://www.emacswiki.org/][Emacs Wiki]] has an article on [[https://www.emacswiki.org/emacs/ReplaceRegexpWithLispExpressions][replacing regexp with lisp expressions]].
Table [[tab:replace-regexp-tranform]] tabulates how to perfom example tasks by means
of {{{kbd(M-x replace-regexp)}}} using =(regular-expression transform)= pairs.
Table [[tab:replace-regexp-tranform]] tabulates how to perform example tasks by
means of {{{kbd(M-x replace-regexp)}}} using =(regular-expression transform)=
pairs.
#+attr_latex: :booktabs yes :float table
#+caption[Example =replace-regexp= (regular-expression substitution) pairs]:
@ -1978,6 +1979,20 @@ git push
git checkout master
#+end_src
Useful [[https://git-scm.com/book/en/v2][Git]] links are:
- [[https://sentry.io/answers/abort-a-merge-in-git/][Abort a merge in Git]]
- [[https://sentry.io/answers/change-the-uri-for-a-git-remote/][Change the URI for a Git remote]]
- [[https://sentry.io/answers/check-out-a-remote-branch-in-git/][Check out a remote branch in Git]]
- [[https://sentry.io/answers/clone-a-git-repository-to-a-specific-folder/][Clone a Git repository to a specific folder]]
- [[https://sentry.io/answers/clone-a-specific-git-repository-branch/][Clone a specific Git repository branch]]
- [[https://sentry.io/answers/create-a-new-git-branch-from-an-existing-branch/][Create a new Git branch from an existing branch]]
- [[https://sentry.io/answers/create-a-remote-branch-in-git/][Create a remote branch in Git]]
- [[https://sentry.io/answers/delete-a-commit-from-a-branch-in-git/][Delete a commit from a branch in Git]]
- [[https://sentry.io/answers/delete-a-file-from-a-git-repository/][Delete a file from a Git repository]]
- [[https://sentry.io/answers/delete-a-git-branch-locally-and-remotely/][Delete a Git branch locally and remotely]]
- [[https://sentry.io/answers/determine-the-origin-of-a-cloned-git-repository/][Determine the origin of a cloned Git repository]]
- [[https://sentry.io/answers/undo-the-most-recent-local-git-commits/][Undo the most recent local Git commits]]
*** [[https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/git-push-new-branch-remote-github-gitlab-upstream-example][List all Git branches]]
:PROPERTIES:
:CUSTOM_ID: sec:list-all-git-branches
@ -3093,9 +3108,9 @@ to add =HTML+CSS+JS= for ~mhtml-mode~:
:CUSTOM_ID: sec:using-properties
:END:
Listing [[lst:column-view-demonstration][column view demonstation]] tangles to [[./column-view-demonstration.org][column-view-demonstration.org]] which
Listing [[lst:column-view-demonstration][column view demonstration]] tangles to [[./column-view-demonstration.org][column-view-demonstration.org]] which
complements the [[https://orgmode.org/worg/org-tutorials/org-column-view-tutorial.html][Org view tutorial]] and the [[https://orgmode.org/worg/org-tutorials/org-column-screencast.html][Org view screencast]]. Listing [[lst:property-syntax-demonstration][property
syntax demonstation]] tangles to [[./property-syntax-demonstration.org][property-syntax-demonstration.org]] which
syntax demonstration]] tangles to [[./property-syntax-demonstration.org][property-syntax-demonstration.org]] which
complements [[info:org#Property Syntax][property syntax (info)]].
#+caption[Column view demonstration]:
@ -3298,7 +3313,7 @@ provides quick filtering and selecting of bibliographic entries from the
minibuffer as well as the option to run different commands on those
selections. The article [[https://kristofferbalintona.me/posts/202206141852/][Citations in org-mode: Org-cite and Citar]] tries to walk
you from understanding the general context (bibliography producer, text
processor, text to product convertor) to an Emacs setup. Listing
processor, text to product converter) to an Emacs setup. Listing
[[lst:set-oc+citar-options]] shows the =oc= and =citar= setup with binding of
{{{kbd(C-c b)}}} to src_emacs-lisp{(call-interactively 'org-cite-insert)} in
=org-mode-map=.
@ -3903,7 +3918,7 @@ make test > out.txt 2>&1
(defvar org-testing-lisp-files nil)
(defun setup-org-mode-test ()
"Intialize an `org-mode' test."
"Initialize an `org-mode' test."
(interactive)
(unless (and org-testing-dir org-testing-lisp-files)
(find-library "org.el")
@ -4527,7 +4542,7 @@ abbreviation definitions in this file by means of:
(setq-default abbrev-mode t))
#+end_src
Listing [[lst:word-games]] defines the =anagram-p= function that migth be used games.
Listing [[lst:word-games]] defines the =anagram-p= function that might be used games.
#+caption[Word games]:
#+caption: Word games.
@ -5189,7 +5204,7 @@ SEL values must be positive integers to enable or `nil' to disable elision."
(slynk-eval-sel-command slynk-command-get-sel))
(defun slynk-set-string-elision-length (&optional sel)
"Set the Slynk \"string-elision-length\" by evaluting SEL.
"Set the Slynk \"string-elision-length\" by evaluating SEL.
Valid SEL values are positive integers to enable or `nil' to disable elision."
(interactive "XSlynk string-elision-length (nil or sel > 0): ")
(unless (or (null sel) (and (integerp sel) (> sel 0)))
@ -5863,7 +5878,7 @@ minimal example of how to use =edebug=:
3. Type {{{kbd(C-M-x)}}} with point in =bar=.
4. Evaluate =(foo)=.
5. Type {{{kbd(C-u C-M-x)}}} with point in =bar=.
6. Evalute =(foo)=.
6. Evaluate =(foo)=.
7. Type the space bar to step through =bar=.
Note: I fail to instrument functions as in [[info:elisp#Edebug][Edebug (info)]].
@ -6444,7 +6459,7 @@ Available versions: 0.2.0, 0.1.1, 0.1.0
(defun pip-list-outdated ()
"Save the outdated Python packages in `pip-outdated-packages'.
This invokes an asynchonous process and finishes with a message."
This invokes an asynchronous process and finishes with a message."
(interactive)
(let ((command '("pip" "list" "--outdated" "--format" "json")))
(make-process
@ -6452,7 +6467,7 @@ This invokes an asynchonous process and finishes with a message."
:buffer (generate-new-buffer-name "*pip-list-outdated-output*")
:command command
:sentinel #'pip--list-outdated-sentinel)
(message "Running `%s' asynchonously" (string-join command " "))))
(message "Running `%s' asynchronously" (string-join command " "))))
#+end_src
#+caption[Emacs interface to upgrade outdated unfrozen Python packages]:
@ -6468,7 +6483,7 @@ This invokes an asynchonous process and finishes with a message."
(defun pip-upgrade-maybe ()
"Install the latest version of outdated packages unless they are frozen.
This invokes an asynchonous process and finishes with displaying the process
This invokes an asynchronous process and finishes with displaying the process
buffer to check whether upgrading has made the dependencies incompatible."
(interactive)
(let (found)
@ -6485,7 +6500,7 @@ buffer to check whether upgrading has made the dependencies incompatible."
:buffer (generate-new-buffer-name "*pip-upgrade-maybe*")
:command command
:sentinel #'pip--upgrade-maybe-sentinel)
(message "Running `%s' asynchonously" (string-join command " ")))
(message "Running `%s' asynchronously" (string-join command " ")))
(message "`pip-upgrade-maybe' found no packages to install"))))
#+end_src