[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-present d506a63fc5 09/12: Merge branch 'master' into t
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-present d506a63fc5 09/12: Merge branch 'master' into toggle-heading-stars |
Date: |
Sat, 6 Aug 2022 14:58:55 -0400 (EDT) |
branch: elpa/org-present
commit d506a63fc57c9344d415f30c5b5c1c7db6da6920
Merge: 7be98b2c03 ef1f1c5da9
Author: Ric Lister <rlister@gmail.com>
Commit: GitHub <noreply@github.com>
Merge branch 'master' into toggle-heading-stars
---
.gitignore | 1 +
README.md | 7 ++++++
org-present.el | 73 ++++++++++++++++++++++++++++++++++++++--------------------
3 files changed, 56 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 22bb68da37..3090d78f9c 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
@@ -53,6 +54,8 @@ Keys are:
- C-c C-- for small text
- C-c C-q for quit (which will return you back to vanilla org-mode)
- C-c < and C-c > to jump to first/last slide
+- C-c C-r set slides read only
+- C-c C-w allow writing on slides
## Beautification
@@ -64,6 +67,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 4cdf12396d..c0f69b7810 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:
;;
@@ -130,7 +129,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))
@@ -138,7 +137,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))
@@ -188,11 +187,22 @@ makes tabs work in presentation mode as in the rest of
Org mode.")
(progn (goto-char (point-min))
(while (re-search-forward "^\\(*+\\)" nil t)
(org-present-add-overlay (match-beginning 1) (match-end 1)))))
- ;; hide emphasis markers
- (goto-char (point-min))
- (while (re-search-forward org-emph-re nil t)
- (org-present-add-overlay (match-beginning 2) (1+ (match-beginning 2)))
- (org-present-add-overlay (1- (match-end 2)) (match-end 2)))))
+ ;; 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
+ ;; It would be better to reuse org's own facility for this, if possible.
+ ;; However it is not obvious how to do this.
+ (progn
+ ;; hide emphasis markers
+ (goto-char (point-min))
+ (while (re-search-forward org-emph-re nil t)
+ (org-present-add-overlay (match-beginning 2) (1+ (match-beginning
2)))
+ (org-present-add-overlay (1- (match-end 2)) (match-end 2)))
+ ;; hide verbatim markers
+ (goto-char (point-min))
+ (while (re-search-forward org-verbatim-re nil t)
+ (org-present-add-overlay (match-beginning 2) (1+ (match-beginning
2)))
+ (org-present-add-overlay (1- (match-end 2)) (match-end 2)))))))
(defun org-present-rm-overlays ()
"Remove overlays for this mode."
@@ -211,17 +221,21 @@ makes tabs work in presentation mode as in the rest of
Org mode.")
"Make buffer read-only."
(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
@@ -230,8 +244,8 @@ makes tabs work in presentation mode as in the rest of Org
mode.")
(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-quit ()
@@ -246,6 +260,12 @@ makes tabs work in presentation mode as in the rest of Org
mode.")
(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.")
@@ -257,11 +277,14 @@ makes tabs work in presentation mode as in the rest of
Org mode.")
(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
- [nongnu] elpa/org-present 7be98b2c03 02/12: doc(org-present-hide-stars-in-headings): advise on use and effects, (continued)
- [nongnu] elpa/org-present 7be98b2c03 02/12: doc(org-present-hide-stars-in-headings): advise on use and effects, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 60d063f20a 05/12: Add org-present-toggle-one-big-page, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 444f3b3b7e 06/12: link to blog and video, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 98b7d94a0f 11/12: Merge branch 'master' into master, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 140a8c3a34 01/12: feat: Add a toggle for whether to hide stars in headings, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 17412d085f 03/12: feat(folds): add org-present-startup-folded a la org-startup-folded, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 3c3588be82 04/12: Add and fix description of key bindings, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present ef1f1c5da9 08/12: Merge pull request #27 from Kazark/org-present-startup-folded, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 4ec04e1b77 12/12: Merge pull request #36 from rhdxmr/master, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present 868d7087ca 07/12: Merge pull request #44 from rlister/systemcrafters-link, ELPA Syncer, 2022/08/06
- [nongnu] elpa/org-present d506a63fc5 09/12: Merge branch 'master' into toggle-heading-stars,
ELPA Syncer <=
- [nongnu] elpa/org-present dfcb71c199 10/12: Merge pull request #26 from Kazark/toggle-heading-stars, ELPA Syncer, 2022/08/06