emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/org-present 98b7d94a0f 11/12: Merge branch 'master' into m


From: ELPA Syncer
Subject: [nongnu] elpa/org-present 98b7d94a0f 11/12: Merge branch 'master' into master
Date: Sat, 6 Aug 2022 14:58:55 -0400 (EDT)

branch: elpa/org-present
commit 98b7d94a0f27c929f5054287b0b47e475fe496f4
Merge: 60d063f20a dfcb71c199
Author: Ric Lister <rlister@gmail.com>
Commit: GitHub <noreply@github.com>

    Merge branch 'master' into master
---
 .gitignore     |  1 +
 README.md      |  5 +++++
 org-present.el | 70 +++++++++++++++++++++++++++++++++++++---------------------
 3 files changed, 51 insertions(+), 25 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..c531d9867f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.elc
diff --git a/README.md b/README.md
index d9fd800a83..e911cb7b10 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,5 @@
 # org-present-mode
+[![NonGNU 
ELPA](https://elpa.nongnu.org/nongnu/org-present.svg)](https://elpa.nongnu.org/nongnu/org-present.html)
 
 This is meant to be an extremely minimalist presentation tool for
 Emacs [org-mode](http://orgmode.org/).  Simply layout your
@@ -67,6 +68,10 @@ If you're on a Mac with an older emacs you might also want 
to look at the
 [fullscreen 
patch](http://cloud.github.com/downloads/typester/emacs/feature-fullscreen.patch).
 `toggle-frame-fullscreen` comes with emacs 24.
 
+## Customization
+
+David Wilson from System Crafters has made an excellent [blog 
post](https://systemcrafters.net/emacs-tips/presentations-with-org-present/) 
and [video](https://www.youtube.com/watch?v=SCPoF1PTZpI) about customization of 
`org-present`.
+
 ## Copyright
 
 Copyright © 2014 Richard Lister.
diff --git a/org-present.el b/org-present.el
index 7a9b283796..ae42bcbd37 100644
--- a/org-present.el
+++ b/org-present.el
@@ -3,25 +3,24 @@
 ;; Copyright (C) 2012 by Ric Lister
 ;;
 ;; Author: Ric Lister
+;; Version: 0.1
 ;; Package-Requires: ((org "7"))
 ;; URL: https://github.com/rlister/org-present
 ;;
 ;; This file is not part of GNU Emacs.
 ;;
-;; This program is free software; you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 2 of the
-;; License, or any later version.
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 ;;
-;; This program is distributed in the hope that it will be useful, but
-;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-;; General Public License for more details.
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
 ;;
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; if not, write to the Free Software
-;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-;; 02111-1307, USA.
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
 ;;
 ;;; Commentary:
 ;;
@@ -132,7 +131,7 @@
   "Jump to first slide of presentation."
   (interactive)
   (widen)
-  (beginning-of-buffer)
+  (goto-char (point-min))
   (org-present-narrow)
   (org-present-run-after-navigate-functions))
 
@@ -140,7 +139,7 @@
   "Jump to last slide of presentation."
   (interactive)
   (widen)
-  (end-of-buffer)
+  (goto-char (point-max))
   (org-present-top)
   (org-present-narrow)
   (org-present-run-after-navigate-functions))
@@ -169,6 +168,13 @@
      (regexp-opt '("title:" "author:" "date:" "email:"))
      string)))
 
+(defvar org-present-hide-stars-in-headings t
+  "Whether to hide the asterisk characters in headings while in presentation
+mode. If you turn this off (by setting it to nil) make sure to set
+`org-hide-emphasis-markers' non-nil, since currently `org-present''s algorithm
+for hiding emphasis markers has a bad interaction with bullets. This combo also
+makes tabs work in presentation mode as in the rest of Org mode.")
+
 (defun org-present-add-overlays ()
   "Add overlays for this mode."
   (add-to-invisibility-spec '(org-present))
@@ -179,9 +185,10 @@
       (let ((end (if (org-present-show-option (match-string 2)) 2 0)))
         (org-present-add-overlay (match-beginning 1) (match-end end))))
     ;; hide stars in headings
-    (goto-char (point-min))
-    (while (re-search-forward "^\\(*+\\)" nil t)
-      (org-present-add-overlay (match-beginning 1) (match-end 1)))
+    (if org-present-hide-stars-in-headings
+        (progn (goto-char (point-min))
+               (while (re-search-forward "^\\(*+\\)" nil t)
+                 (org-present-add-overlay (match-beginning 1) (match-end 1)))))
     ;; hide emphasis/verbatim markers if not already hidden by org
     (if org-hide-emphasis-markers nil
       ;; TODO https://github.com/rlister/org-present/issues/12
@@ -201,7 +208,7 @@
 
 (defun org-present-rm-overlays ()
   "Remove overlays for this mode."
-  (mapc 'delete-overlay org-present-overlays-list)
+  (mapc #'delete-overlay org-present-overlays-list)
   (remove-from-invisibility-spec '(org-present)))
 
 (defun org-present-read-only ()
@@ -210,23 +217,27 @@
   (setq buffer-read-only t)
   (setq org-present-cursor-cache cursor-type
         cursor-type nil)
-  (define-key org-present-mode-keymap (kbd "SPC") 'org-present-next))
+  (define-key org-present-mode-keymap (kbd "SPC") #'org-present-next))
 
 (defun org-present-read-write ()
   "Make buffer read/write."
   (interactive)
   (setq buffer-read-only nil)
-  (setq cursor-type org-present-cursor-cache)
   (define-key org-present-mode-keymap (kbd "SPC") 'self-insert-command))
 
 (defun org-present-hide-cursor ()
   "Hide the cursor for current window."
   (interactive)
+  (if cursor-type
+      (setq-local org-present-cursor-cache cursor-type
+            cursor-type nil))
   (internal-show-cursor (selected-window) nil))
 
 (defun org-present-show-cursor ()
   "Show the cursor for current window."
   (interactive)
+  (if org-present-cursor-cache
+      (setq-local cursor-type org-present-cursor-cache))
   (internal-show-cursor (selected-window) t))
 
 ;;;###autoload
@@ -235,8 +246,8 @@
   (interactive)
   (setq org-present-mode t)
   (org-present-add-overlays)
-  (org-present-narrow)
   (run-hooks 'org-present-mode-hook)
+  (org-present-narrow)
   (org-present-run-after-navigate-functions))
 
 (defun org-present-toggle-one-big-page ()
@@ -261,6 +272,12 @@
   (run-hooks 'org-present-mode-quit-hook)
   (setq org-present-mode nil))
 
+(defvar org-present-startup-folded nil
+  "Like `org-startup-folded', but for presentation mode. Also analogous to
+introduction of slide items by effects in other presentation programs: i.e., if
+you do not want to show the whole slide at first, but to unfurl it slowly, set
+this to non-nil.")
+
 (defvar org-present-after-navigate-functions nil
   "Abnormal hook run after org-present navigates to a new heading.")
 
@@ -272,11 +289,14 @@
    (replace-regexp-in-string "[ \t\n]*\\'" "" string)))
 
 (defun org-present-run-after-navigate-functions ()
-  "Run org-present-after-navigate hook, passing the name of the presentation 
buffer and the current heading."
-  (let* ((title-text (thing-at-point 'line))
-         (safe-title-text (replace-regexp-in-string "^[ \*]" "" title-text))
-         (current-heading (org-present-trim-string safe-title-text)))
-    (run-hook-with-args 'org-present-after-navigate-functions (buffer-name) 
current-heading)))
+  "Fold slide if `org-present-startup-folded' is non-nil.
+Run org-present-after-navigate hook, passing the name of the presentation 
buffer and the current heading."
+  (progn
+    (if org-present-startup-folded (org-cycle))
+    (let* ((title-text (thing-at-point 'line))
+           (safe-title-text (replace-regexp-in-string "^[ \*]" "" title-text))
+           (current-heading (org-present-trim-string safe-title-text)))
+      (run-hook-with-args 'org-present-after-navigate-functions (buffer-name) 
current-heading))))
 
 (provide 'org-present)
 ;;; org-present.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]