From 7a17077f24f94c6c81bc8c9d8528fdfbab84c1fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Hauspie?= <michael.hauspie@univ-lille.fr>
Date: Wed, 26 Feb 2025 19:48:54 +0100
Subject: [PATCH] Change binding for org-present mode and some tweaks

---
 configuration.org | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/configuration.org b/configuration.org
index 989abce..86f2e8d 100644
--- a/configuration.org
+++ b/configuration.org
@@ -321,7 +321,7 @@ Select the font I will use depending on the system
                                         ; Font on MacOS
     (progn
       (setq mh-font-fixed "Fira Code")
-      (setq mh-font-variable "Marianne")
+      (setq mh-font-variable "Sans Serif")
       )
                                         ; Font on Other Systems (Linux actually, I do not use emacs on windows)
   (progn
@@ -595,6 +595,7 @@ it with =visual-fill-column= to enhance the visual look of the presentation.
 (require 'org-faces)
 
 ;; Function to be called when changing slide
+
 (defun my/org-present-prepare-slide (buffer-name heading)
   ;; Show only top-level headlines
   (org-overview)
@@ -603,7 +604,8 @@ it with =visual-fill-column= to enhance the visual look of the presentation.
   (org-show-entry)
 
   ;; Show only direct subheadings of the slide but don't expand them
-  (org-show-children))
+  (org-show-children)
+  )
 
 ;; What to do when starting/ending a presentation
 (defun my/org-present-start ()
@@ -657,7 +659,7 @@ it with =visual-fill-column= to enhance the visual look of the presentation.
 
 (defun my/org-present-end ()
   (visual-fill-column-mode 0)
-  (visual-line-mode 0)
+;  (visual-line-mode 0)
   (display-line-numbers-mode 1)
   (menu-bar-mode 1)
   (scroll-bar-mode 1)
@@ -686,10 +688,20 @@ it with =visual-fill-column= to enhance the visual look of the presentation.
 
 (use-package org-present
   :hook (
+         ;; Setup slides environnement when starting a presentation
          (org-present-mode . my/org-present-start)
+         ;; And restore it when leaving
          (org-present-mode-quit . my/org-present-end)
          )
+  ;; Keep using <left> and <right> to move point and uses pgup and pgdown to switch slides
+  :bind (:map org-present-mode-keymap
+              ("<next>" . 'org-present-next)
+              ("<prior>" . 'org-present-prev)
+              ("<left>" . nil)
+              ("<right>" . nil)
+         )
   :init
+  ;; Behavior when switching slides
   (add-hook 'org-present-after-navigate-functions 'my/org-present-prepare-slide)
   )
 (use-package visual-fill-column
-- 
GitLab