mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-14 13:19:09 +02:00
feat[work]: improve presentation header opening
This commit is contained in:
parent
a2b9cc78b5
commit
3d3e8d450d
3 changed files with 221 additions and 217 deletions
|
|
@ -33821,225 +33821,227 @@ When holding presentations, I think it is important to not have too many distrac
|
|||
|
||||
#+begin_src emacs-lisp
|
||||
|
||||
(use-package org-present
|
||||
:bind (:map org-present-mode-keymap
|
||||
("q" . org-present-quit)
|
||||
("<left>" . swarsel/org-present-prev)
|
||||
("<up>" . 'ignore)
|
||||
("<down>" . 'ignore)
|
||||
("<right>" . swarsel/org-present-next))
|
||||
:hook ((org-present-mode . swarsel/org-present-start)
|
||||
(org-present-mode-quit . swarsel/org-present-end))
|
||||
:config
|
||||
(add-hook 'org-present-after-navigate-functions #'swarsel/org-present-slide)
|
||||
(setq org-present-startup-folded t)
|
||||
)
|
||||
(use-package org-present
|
||||
:bind (:map org-present-mode-keymap
|
||||
("q" . org-present-quit)
|
||||
("<left>" . swarsel/org-present-prev)
|
||||
("<up>" . 'ignore)
|
||||
("<down>" . 'ignore)
|
||||
("<right>" . swarsel/org-present-next))
|
||||
:hook ((org-present-mode . swarsel/org-present-start)
|
||||
(org-present-mode-quit . swarsel/org-present-end))
|
||||
:config
|
||||
(add-hook 'org-present-after-navigate-functions #'swarsel/org-present-slide)
|
||||
(setq org-present-startup-folded t)
|
||||
)
|
||||
|
||||
|
||||
(use-package hide-mode-line)
|
||||
(use-package hide-mode-line)
|
||||
|
||||
(defun swarsel/org-reveal-at-point ()
|
||||
"Reveal the org entry at point if it is a heading."
|
||||
(when (and (derived-mode-p 'org-mode)
|
||||
(org-at-heading-p))
|
||||
(org-show-entry)
|
||||
(org-show-children)))
|
||||
|
||||
(defun swarsel/org-present-maybe-read-only ()
|
||||
"Toggle read-only based on whether cursor is inside a src block."
|
||||
(if (org-in-src-block-p)
|
||||
(when buffer-read-only
|
||||
(org-present-read-write)
|
||||
(evil-insert-state 1))
|
||||
(unless buffer-read-only
|
||||
(org-present-read-only)
|
||||
(evil-insert-state 1))))
|
||||
|
||||
|
||||
(defun swarsel/org-present-narrow (orig-fn &rest args)
|
||||
(cl-letf (((symbol-function 'show-all) #'ignore))
|
||||
(apply orig-fn args))
|
||||
(org-overview)
|
||||
(org-show-entry))
|
||||
|
||||
(advice-add 'org-present-narrow :around #'swarsel/org-present-narrow)
|
||||
|
||||
(defun swarsel/org-present-start ()
|
||||
(setq-local face-remapping-alist `((default (:height 1.5) variable-pitch)
|
||||
(header-line (:height 4.0) variable-pitch)
|
||||
(org-document-title (:height 2.75) org-document-title)
|
||||
(org-code (:height 1.2) org-code)
|
||||
(org-verbatim (:family ,swarsel/fixed-font :height 1.0) org-verbatim)
|
||||
(org-quote (:height 1.0) org-quote)
|
||||
(org-verse (:height 1.0) org-verse)
|
||||
(org-table (:family ,swarsel/fixed-font :weight regular :height 1.0) org-table)
|
||||
(org-block (:height 0.9) org-block)
|
||||
(org-link (:underline nil) org-link)
|
||||
(org-block-begin-line (:height 0.7) org-block)
|
||||
))
|
||||
|
||||
(setq header-line-format " ")
|
||||
(setq visual-fill-column-width 150)
|
||||
(setq indicate-buffer-boundaries nil)
|
||||
(setq inhibit-message nil)
|
||||
(setq org-babel-eval-error-notify t)
|
||||
;; (breadcrumb-mode 0)
|
||||
(org-display-inline-images)
|
||||
(global-hl-line-mode 0)
|
||||
;; (display-line-numbers-mode 0)
|
||||
;; (org-modern-mode 0)
|
||||
(evil-insert-state 1)
|
||||
(org-present-read-only)
|
||||
;; (org-present-hide-cursor)
|
||||
(org-overview) ; fold everything on start
|
||||
(add-hook 'post-command-hook #'swarsel/org-reveal-at-point nil t)
|
||||
(add-hook 'post-command-hook #'swarsel/org-present-maybe-read-only nil t)
|
||||
)
|
||||
|
||||
(defun swarsel/org-present-end ()
|
||||
(setq-local face-remapping-alist `((org-verbatim (:family ,swarsel/fixed-font :weight regular)
|
||||
org-verbatim)
|
||||
(org-table (:family ,swarsel/fixed-font :weight regular) org-table)
|
||||
(org-meta-line (:family ,swarsel/fixed-font :weight regular) org-meta-line)
|
||||
(org-formula (:family ,swarsel/fixed-font :weight regular) org-formula)
|
||||
(org-checkbox (:family ,swarsel/fixed-font :weight regular) org-checkbox)
|
||||
(org-latex-and-related (:family ,swarsel/fixed-font :weight regular)
|
||||
org-latex-and-related)
|
||||
(org-indent (:family ,swarsel/fixed-font :weight regular) org-indent)
|
||||
(org-code (:family ,swarsel/fixed-font :weight regular) org-code)
|
||||
(org-document-info-keyword (:family ,swarsel/fixed-font :weight regular)
|
||||
org-document-info-keyword)
|
||||
(org-block-end-line (:family ,swarsel/fixed-font :weight regular) org-block-end-line)
|
||||
(org-block-begin-line (:family ,swarsel/fixed-font :weight regular)
|
||||
org-block-begin-line)
|
||||
(org-block (:family ,swarsel/fixed-font :weight regular) org-block)
|
||||
(mu4e-compose-header-face (:family ,swarsel/fixed-font :weight regular)
|
||||
mu4e-compose-header-face)
|
||||
(mu4e-compose-separator-face (:family ,swarsel/fixed-font :weight regular)
|
||||
mu4e-compose-separator-face)
|
||||
(mu4e-contact-face (:family ,swarsel/fixed-font :weight regular) mu4e-contact-face)
|
||||
(mu4e-link-face (:family ,swarsel/fixed-font :weight regular) mu4e-link-face)
|
||||
(mu4e-header-value-face (:family ,swarsel/fixed-font :weight regular)
|
||||
mu4e-header-value-face)
|
||||
(mu4e-header-key-face (:family ,swarsel/fixed-font :weight regular)
|
||||
mu4e-header-key-face)
|
||||
(message-header-other (:family ,swarsel/fixed-font :weight regular)
|
||||
message-header-other)
|
||||
(message-header-subject (:family ,swarsel/fixed-font :weight regular)
|
||||
message-header-subject)
|
||||
(message-header-xheader (:family ,swarsel/fixed-font :weight regular)
|
||||
message-header-xheader)
|
||||
(message-header-newsgroups (:family ,swarsel/fixed-font :weight regular)
|
||||
message-header-newsgroups)
|
||||
(message-header-cc (:family ,swarsel/fixed-font :weight regular) message-header-cc)
|
||||
(message-header-to (:family ,swarsel/fixed-font :weight regular) message-header-to)
|
||||
(message-header-name (:family ,swarsel/fixed-font :weight regular)
|
||||
message-header-name)
|
||||
(markdown-math-face (:family ,swarsel/fixed-font :weight regular) markdown-math-face)
|
||||
(markdown-language-keyword-face (:family ,swarsel/fixed-font :weight regular)
|
||||
markdown-language-keyword-face)
|
||||
(markdown-language-info-face (:family ,swarsel/fixed-font :weight regular)
|
||||
markdown-language-info-face)
|
||||
(markdown-inline-code-face (:family ,swarsel/fixed-font :weight regular)
|
||||
markdown-inline-code-face)
|
||||
(markdown-gfm-checkbox-face (:family ,swarsel/fixed-font :weight regular)
|
||||
markdown-gfm-checkbox-face)
|
||||
(markdown-code-face (:family ,swarsel/fixed-font :weight regular) markdown-code-face)
|
||||
(line-number-minor-tick (:family ,swarsel/fixed-font :weight regular)
|
||||
line-number-minor-tick)
|
||||
(line-number-major-tick (:family ,swarsel/fixed-font :weight regular)
|
||||
line-number-major-tick)
|
||||
(line-number-current-line (:family ,swarsel/fixed-font :weight regular)
|
||||
line-number-current-line)
|
||||
(line-number (:family ,swarsel/fixed-font :weight regular) line-number)
|
||||
(font-lock-variable-name-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-variable-name-face)
|
||||
(font-lock-type-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-type-face)
|
||||
(font-lock-string-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-string-face)
|
||||
(font-lock-regexp-grouping-construct (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-regexp-grouping-construct)
|
||||
(font-lock-regexp-grouping-backslash (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-regexp-grouping-backslash)
|
||||
(font-lock-preprocessor-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-preprocessor-face)
|
||||
(font-lock-negation-char-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-negation-char-face)
|
||||
(font-lock-keyword-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-keyword-face)
|
||||
(font-lock-function-name-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-function-name-face)
|
||||
(font-lock-doc-face (:family ,swarsel/fixed-font :weight regular) font-lock-doc-face)
|
||||
(font-lock-constant-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-constant-face)
|
||||
(font-lock-comment-delimiter-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-comment-delimiter-face)
|
||||
(font-lock-builtin-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-builtin-face)
|
||||
(font-latex-sectioning-5-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-latex-sectioning-5-face)
|
||||
(font-latex-warning-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-latex-warning-face)
|
||||
(font-latex-sedate-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-latex-sedate-face)
|
||||
(font-latex-math-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-latex-math-face)
|
||||
(diff-removed (:family ,swarsel/fixed-font :weight regular) diff-removed)
|
||||
(diff-hunk-header (:family ,swarsel/fixed-font :weight regular) diff-hunk-header)
|
||||
(diff-header (:family ,swarsel/fixed-font :weight regular) diff-header)
|
||||
(diff-function (:family ,swarsel/fixed-font :weight regular) diff-function)
|
||||
(diff-file-header (:family ,swarsel/fixed-font :weight regular) diff-file-header)
|
||||
(diff-context (:family ,swarsel/fixed-font :weight regular) diff-context)
|
||||
(diff-added (:family ,swarsel/fixed-font :weight regular) diff-added)
|
||||
(default (:family "Sans Serif" :weight light) variable-pitch default)
|
||||
))
|
||||
(setq header-line-format nil)
|
||||
(setq visual-fill-column-width 150)
|
||||
(setq indicate-buffer-boundaries t)
|
||||
(setq inhibit-message nil)
|
||||
(setq org-babel-no-eval-on-error nil)
|
||||
;; (breadcrumb-mode 1)
|
||||
(global-hl-line-mode 1)
|
||||
;; (display-line-numbers-mode 1)
|
||||
(org-remove-inline-images)
|
||||
;; (org-modern-mode 1)
|
||||
(evil-normal-state 1)
|
||||
;; (org-present-show-cursor)
|
||||
(remove-hook 'post-command-hook #'swarsel/org-reveal-at-point t)
|
||||
(remove-hook 'post-command-hook #'swarsel/org-present-maybe-read-only t)
|
||||
)
|
||||
|
||||
(defun swarsel/org-present-slide-open ()
|
||||
(org-overview)
|
||||
(defun swarsel/org-reveal-at-point ()
|
||||
"Reveal the org entry at point if it is a heading."
|
||||
(when (and (derived-mode-p 'org-mode)
|
||||
(org-at-heading-p))
|
||||
(org-show-entry)
|
||||
(org-show-children)
|
||||
)
|
||||
(org-show-children)))
|
||||
|
||||
(defun swarsel/org-present-prev ()
|
||||
(interactive)
|
||||
(beginning-of-buffer)
|
||||
(org-present-prev)
|
||||
(swarsel/org-present-slide-open)
|
||||
)
|
||||
(defun swarsel/org-present-maybe-read-only ()
|
||||
"Toggle read-only based on whether cursor is inside a src block."
|
||||
(if (org-in-src-block-p)
|
||||
(when buffer-read-only
|
||||
(org-present-read-write)
|
||||
(evil-insert-state 1))
|
||||
(unless buffer-read-only
|
||||
(org-present-read-only)
|
||||
(evil-insert-state 1))))
|
||||
|
||||
(defun swarsel/org-present-next ()
|
||||
(interactive)
|
||||
(let* ((next-heading (save-excursion
|
||||
(when (outline-next-heading) (point))))
|
||||
(next-block (save-excursion
|
||||
(when (re-search-forward "^#\\+begin_src" nil t)
|
||||
(match-beginning 0))))
|
||||
(target (cond
|
||||
((and next-heading next-block) (min next-heading next-block))
|
||||
(next-heading next-heading)
|
||||
(next-block next-block)
|
||||
(t nil))))
|
||||
(if (and target (< target (point-max)))
|
||||
(progn
|
||||
(goto-char target)
|
||||
(org-fold-show-entry))
|
||||
(org-present-next))))
|
||||
|
||||
(defun swarsel/org-present-narrow (orig-fn &rest args)
|
||||
(cl-letf (((symbol-function 'show-all) #'ignore))
|
||||
(apply orig-fn args))
|
||||
(org-overview)
|
||||
(org-show-entry))
|
||||
|
||||
(advice-add 'org-present-narrow :around #'swarsel/org-present-narrow)
|
||||
|
||||
(defun swarsel/org-present-start ()
|
||||
(setq-local face-remapping-alist `((default (:height 1.5) variable-pitch)
|
||||
(header-line (:height 4.0) variable-pitch)
|
||||
(org-document-title (:height 2.75) org-document-title)
|
||||
(org-code (:height 1.2) org-code)
|
||||
(org-verbatim (:family ,swarsel/fixed-font :height 1.0) org-verbatim)
|
||||
(org-quote (:height 1.0) org-quote)
|
||||
(org-verse (:height 1.0) org-verse)
|
||||
(org-table (:family ,swarsel/fixed-font :weight regular :height 1.0) org-table)
|
||||
(org-block (:height 0.9) org-block)
|
||||
(org-link (:underline nil) org-link)
|
||||
(org-block-begin-line (:height 0.7) org-block)
|
||||
))
|
||||
|
||||
(setq header-line-format " ")
|
||||
(setq visual-fill-column-width 150)
|
||||
(setq indicate-buffer-boundaries nil)
|
||||
(setq inhibit-message nil)
|
||||
(setq org-babel-eval-error-notify t)
|
||||
;; (breadcrumb-mode 0)
|
||||
(org-display-inline-images)
|
||||
(global-hl-line-mode 0)
|
||||
;; (display-line-numbers-mode 0)
|
||||
;; (org-modern-mode 0)
|
||||
(evil-insert-state 1)
|
||||
(org-present-read-only)
|
||||
;; (org-present-hide-cursor)
|
||||
(org-overview) ; fold everything on start
|
||||
(add-hook 'post-command-hook #'swarsel/org-reveal-at-point nil t)
|
||||
(add-hook 'post-command-hook #'swarsel/org-present-maybe-read-only nil t)
|
||||
)
|
||||
|
||||
(defun swarsel/org-present-end ()
|
||||
(setq-local face-remapping-alist `((org-verbatim (:family ,swarsel/fixed-font :weight regular)
|
||||
org-verbatim)
|
||||
(org-table (:family ,swarsel/fixed-font :weight regular) org-table)
|
||||
(org-meta-line (:family ,swarsel/fixed-font :weight regular) org-meta-line)
|
||||
(org-formula (:family ,swarsel/fixed-font :weight regular) org-formula)
|
||||
(org-checkbox (:family ,swarsel/fixed-font :weight regular) org-checkbox)
|
||||
(org-latex-and-related (:family ,swarsel/fixed-font :weight regular)
|
||||
org-latex-and-related)
|
||||
(org-indent (:family ,swarsel/fixed-font :weight regular) org-indent)
|
||||
(org-code (:family ,swarsel/fixed-font :weight regular) org-code)
|
||||
(org-document-info-keyword (:family ,swarsel/fixed-font :weight regular)
|
||||
org-document-info-keyword)
|
||||
(org-block-end-line (:family ,swarsel/fixed-font :weight regular) org-block-end-line)
|
||||
(org-block-begin-line (:family ,swarsel/fixed-font :weight regular)
|
||||
org-block-begin-line)
|
||||
(org-block (:family ,swarsel/fixed-font :weight regular) org-block)
|
||||
(mu4e-compose-header-face (:family ,swarsel/fixed-font :weight regular)
|
||||
mu4e-compose-header-face)
|
||||
(mu4e-compose-separator-face (:family ,swarsel/fixed-font :weight regular)
|
||||
mu4e-compose-separator-face)
|
||||
(mu4e-contact-face (:family ,swarsel/fixed-font :weight regular) mu4e-contact-face)
|
||||
(mu4e-link-face (:family ,swarsel/fixed-font :weight regular) mu4e-link-face)
|
||||
(mu4e-header-value-face (:family ,swarsel/fixed-font :weight regular)
|
||||
mu4e-header-value-face)
|
||||
(mu4e-header-key-face (:family ,swarsel/fixed-font :weight regular)
|
||||
mu4e-header-key-face)
|
||||
(message-header-other (:family ,swarsel/fixed-font :weight regular)
|
||||
message-header-other)
|
||||
(message-header-subject (:family ,swarsel/fixed-font :weight regular)
|
||||
message-header-subject)
|
||||
(message-header-xheader (:family ,swarsel/fixed-font :weight regular)
|
||||
message-header-xheader)
|
||||
(message-header-newsgroups (:family ,swarsel/fixed-font :weight regular)
|
||||
message-header-newsgroups)
|
||||
(message-header-cc (:family ,swarsel/fixed-font :weight regular) message-header-cc)
|
||||
(message-header-to (:family ,swarsel/fixed-font :weight regular) message-header-to)
|
||||
(message-header-name (:family ,swarsel/fixed-font :weight regular)
|
||||
message-header-name)
|
||||
(markdown-math-face (:family ,swarsel/fixed-font :weight regular) markdown-math-face)
|
||||
(markdown-language-keyword-face (:family ,swarsel/fixed-font :weight regular)
|
||||
markdown-language-keyword-face)
|
||||
(markdown-language-info-face (:family ,swarsel/fixed-font :weight regular)
|
||||
markdown-language-info-face)
|
||||
(markdown-inline-code-face (:family ,swarsel/fixed-font :weight regular)
|
||||
markdown-inline-code-face)
|
||||
(markdown-gfm-checkbox-face (:family ,swarsel/fixed-font :weight regular)
|
||||
markdown-gfm-checkbox-face)
|
||||
(markdown-code-face (:family ,swarsel/fixed-font :weight regular) markdown-code-face)
|
||||
(line-number-minor-tick (:family ,swarsel/fixed-font :weight regular)
|
||||
line-number-minor-tick)
|
||||
(line-number-major-tick (:family ,swarsel/fixed-font :weight regular)
|
||||
line-number-major-tick)
|
||||
(line-number-current-line (:family ,swarsel/fixed-font :weight regular)
|
||||
line-number-current-line)
|
||||
(line-number (:family ,swarsel/fixed-font :weight regular) line-number)
|
||||
(font-lock-variable-name-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-variable-name-face)
|
||||
(font-lock-type-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-type-face)
|
||||
(font-lock-string-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-string-face)
|
||||
(font-lock-regexp-grouping-construct (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-regexp-grouping-construct)
|
||||
(font-lock-regexp-grouping-backslash (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-regexp-grouping-backslash)
|
||||
(font-lock-preprocessor-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-preprocessor-face)
|
||||
(font-lock-negation-char-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-negation-char-face)
|
||||
(font-lock-keyword-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-keyword-face)
|
||||
(font-lock-function-name-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-function-name-face)
|
||||
(font-lock-doc-face (:family ,swarsel/fixed-font :weight regular) font-lock-doc-face)
|
||||
(font-lock-constant-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-constant-face)
|
||||
(font-lock-comment-delimiter-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-comment-delimiter-face)
|
||||
(font-lock-builtin-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-lock-builtin-face)
|
||||
(font-latex-sectioning-5-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-latex-sectioning-5-face)
|
||||
(font-latex-warning-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-latex-warning-face)
|
||||
(font-latex-sedate-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-latex-sedate-face)
|
||||
(font-latex-math-face (:family ,swarsel/fixed-font :weight regular)
|
||||
font-latex-math-face)
|
||||
(diff-removed (:family ,swarsel/fixed-font :weight regular) diff-removed)
|
||||
(diff-hunk-header (:family ,swarsel/fixed-font :weight regular) diff-hunk-header)
|
||||
(diff-header (:family ,swarsel/fixed-font :weight regular) diff-header)
|
||||
(diff-function (:family ,swarsel/fixed-font :weight regular) diff-function)
|
||||
(diff-file-header (:family ,swarsel/fixed-font :weight regular) diff-file-header)
|
||||
(diff-context (:family ,swarsel/fixed-font :weight regular) diff-context)
|
||||
(diff-added (:family ,swarsel/fixed-font :weight regular) diff-added)
|
||||
(default (:family "Sans Serif" :weight light) variable-pitch default)
|
||||
))
|
||||
(setq header-line-format nil)
|
||||
(setq visual-fill-column-width 150)
|
||||
(setq indicate-buffer-boundaries t)
|
||||
(setq inhibit-message nil)
|
||||
(setq org-babel-no-eval-on-error nil)
|
||||
;; (breadcrumb-mode 1)
|
||||
(global-hl-line-mode 1)
|
||||
;; (display-line-numbers-mode 1)
|
||||
(org-remove-inline-images)
|
||||
;; (org-modern-mode 1)
|
||||
(evil-normal-state 1)
|
||||
;; (org-present-show-cursor)
|
||||
(remove-hook 'post-command-hook #'swarsel/org-reveal-at-point t)
|
||||
(remove-hook 'post-command-hook #'swarsel/org-present-maybe-read-only t)
|
||||
)
|
||||
|
||||
(defun swarsel/org-present-slide-open ()
|
||||
(org-overview)
|
||||
(org-show-entry)
|
||||
(org-show-children)
|
||||
)
|
||||
|
||||
(defun swarsel/org-present-prev ()
|
||||
(interactive)
|
||||
(beginning-of-buffer)
|
||||
(org-present-prev)
|
||||
(swarsel/org-present-slide-open)
|
||||
)
|
||||
|
||||
(defun swarsel/org-present-next ()
|
||||
(interactive)
|
||||
(let* ((next-heading (save-excursion
|
||||
(when (outline-next-heading) (point))))
|
||||
(next-block (save-excursion
|
||||
(when (re-search-forward "^#\\+begin_src" nil t)
|
||||
(match-beginning 0))))
|
||||
(target (cond
|
||||
((and next-heading next-block) (min next-heading next-block))
|
||||
(next-heading next-heading)
|
||||
(next-block next-block)
|
||||
(t nil))))
|
||||
(if (and target (< target (point-max)))
|
||||
(progn
|
||||
(goto-char target)
|
||||
(org-fold-show-entry)
|
||||
(unless (pos-visible-in-window-p (point-max))
|
||||
(recenter 0)))
|
||||
(org-present-next))))
|
||||
|
||||
#+end_src
|
||||
|
||||
|
|
|
|||
|
|
@ -1245,7 +1245,9 @@ create a new one."
|
|||
(if (and target (< target (point-max)))
|
||||
(progn
|
||||
(goto-char target)
|
||||
(org-fold-show-entry))
|
||||
(org-fold-show-entry)
|
||||
(unless (pos-visible-in-window-p (point-max))
|
||||
(recenter 0)))
|
||||
(org-present-next))))
|
||||
|
||||
(defun org-babel-execute:markdown (body params)
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue