Compare commits

...

2 Commits

Author SHA1 Message Date
547fc0031e Tweak `which-function-mode' setup code 2024-02-07 18:47:11 +01:00
1aabe90518 Add github quick setup 2024-02-07 18:45:50 +01:00

View File

@ -1965,6 +1965,38 @@ git push
git checkout master
#+end_src
*** Github quick setup
:PROPERTIES:
:CUSTOM_ID: sec:github-quick-setup
:END:
#+caption[Make a new repository on the command line]:
#+caption: Make a new repository on the command line.
#+name: lst:make-new-git-repo
#+begin_src shell -n :eval never
echo "# org-oxx" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:gav451/org-oxx.git
git push -u origin main
#+end_src
#+caption[Push an old git repository on the command line]:
#+caption: Push an old git repository on the command line.
#+name: lst:push-old-git-repo
#+begin_src shell -n :eval never
git remote add origin git@github.com:gav451/org-oxx.git
git branch -M main
git push -u origin main
#+end_src
*** Learn git
:PROPERTIES:
:CUSTOM_ID: sec:learn-git
:END:
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]]
@ -4769,7 +4801,9 @@ true in case document headlines contain links. The code in listing
#+caption: Setup ~which-function-mode~.
#+name: lst:setup-which-function-mode
#+begin_src emacs-lisp -n :results silent
(setopt which-func-modes '(emacs-lisp-mode org-mode pdf-view-mode))
(with-eval-after-load 'which-func
(setopt which-func-modes
'(emacs-lisp-mode org-mode pdf-view-mode)))
;; It looks like `python-mode' does nothing when they it is an element
;; of `which-func-modes'.
@ -4810,7 +4844,7 @@ Return the document title when point is above the first headline."
(defun which-func-pdf-view-function ()
"Return the title of the current headline.
Return \"Front Matter\" when point is above the first headline."
Return \"Front Matter\" when current page is above the first headline."
(interactive) ;; Keep this function interactive for fixing.
(when (eq major-mode 'pdf-view-mode)
(let* ((current-page (pdf-view-current-page))