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

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

[nongnu] elpa/org-present aa3db6540a 02/47: readme and code


From: ELPA Syncer
Subject: [nongnu] elpa/org-present aa3db6540a 02/47: readme and code
Date: Sat, 8 Jan 2022 13:58:27 -0500 (EST)

branch: elpa/org-present
commit aa3db6540a7ceb0d0a95afc64ba8fa156ed6fec2
Author: Richard Lister <rlister+gh@gmail.com>
Commit: Richard Lister <rlister+gh@gmail.com>

    readme and code
---
 README         |   0
 README.rdoc    |  46 +++++++++++++++++++++
 org-present.el | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 173 insertions(+)

diff --git a/README b/README
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/README.rdoc b/README.rdoc
new file mode 100644
index 0000000000..8c89c5ba54
--- /dev/null
+++ b/README.rdoc
@@ -0,0 +1,46 @@
+= org-present-mode
+
+This is meant to be an extremely minimalist presentation tool for Emacs 
{org-mode}[http://orgmode.org/].
+Simply layout your presentation with each slide under a top-level header, 
start the minor mode with
+'org-present', and page through each slide with left/right keys.
+
+== Philosophy
+
+Most of the time I'm giving a talk, it is a work in progress and I want to be 
be able to edit
+as I go along. Also, to split my frame and work on code examples with my 
slides still visible.
+
+== Configuration
+
+Add something like this to your emacs config:
+
+  (add-to-list 'load-path "~/path/to/org-present")
+  (autoload 'org-present "org-present" nil t)
+
+  (add-hook 'org-present-mode-hook
+            (lambda ()
+              (org-present-big)
+              (org-display-inline-images)))
+ 
+  (add-hook 'org-present-mode-quit-hook
+            (lambda ()
+              (org-present-small)
+              (org-remove-inline-images)))
+
+Then start the minor mode with:
+
+  M-x org-present
+
+Keys are left/right for movement, C-c C-= for large txt, C-c C-- for small 
text, and C-c C-q for quit
+(which will return you back to vanilla org-mode).
+
+== Beautification
+
+This works well with hide-mode-line 
(http://webonastick.com/emacs-lisp/hide-mode-line.el),
+which hides the mode-line when only one frame and buffer are open.
+
+If you're on a Mac you might also want to look at the fullscreen patch here:
+http://cloud.github.com/downloads/typester/emacs/feature-fullscreen.patch
+
+== Copyright
+
+Copyright (c) 2012 Richard Lister.
diff --git a/org-present.el b/org-present.el
new file mode 100644
index 0000000000..8a5c370670
--- /dev/null
+++ b/org-present.el
@@ -0,0 +1,127 @@
+;; org-present.el -- Minimalist presentation minor-mode for Emacs org-mode.
+;; 
+;; Copyright (C) 2012 by Ric Lister
+;;
+;; 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 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.
+;;
+;; Usage:
+;;
+;; Add the following to your emacs config:
+;;
+;;   (add-to-list 'load-path "~/path/to/org-present")
+;;   (autoload 'org-present "org-present" nil t)
+;;
+;;   (add-hook 'org-present-mode-hook
+;;             (lambda ()
+;;               (org-present-big)
+;;               (org-display-inline-images)))
+;;  
+;;   (add-hook 'org-present-mode-quit-hook
+;;             (lambda ()
+;;               (org-present-small)
+;;               (org-remove-inline-images)))
+;;
+;; Open an org-mode file with each slide under a top-level heading.
+;; Start org-present with org-present-mode, left and right keys will move 
forward
+;; and backward through slides. C-c C-q will quit org-present.
+;;
+;; This works well with hide-mode-line 
(http://webonastick.com/emacs-lisp/hide-mode-line.el),
+;; which hides the mode-line when only one frame and buffer are open.
+;;
+;; If you're on a Mac you might also want to look at the fullscreen patch here:
+;; http://cloud.github.com/downloads/typester/emacs/feature-fullscreen.patch
+
+(defvar org-present-mode-keymap (make-keymap) "org-present-mode keymap.")
+
+;; left and right page keys
+(define-key org-present-mode-keymap [right]         'org-present-next)
+(define-key org-present-mode-keymap [left]          'org-present-prev)
+(define-key org-present-mode-keymap (kbd "C-c C-=") 'org-present-big)
+(define-key org-present-mode-keymap (kbd "C-c C--") 'org-present-small)
+(define-key org-present-mode-keymap (kbd "C-c C-q") 'org-present-quit)
+
+;; how much to scale up font size
+(defvar org-present-text-scale 5)
+
+(define-minor-mode org-present-mode
+  "Minimalist presentation minor mode for org-mode."
+  nil
+  " OP"
+  org-present-mode-keymap)
+
+(make-variable-buffer-local 'org-present-mode)
+
+(defun org-present-top ()
+  "Jump to current top-level heading, should be safe outside a heading."
+  (interactive)
+  (unless (org-at-heading-p) (outline-previous-heading))
+  (let ((level (org-current-level)))
+    (when (and level (> level 1))
+      (outline-up-heading (- level 1))
+      (message (number-to-string level)))))
+
+(defun org-present-next ()
+  "Jump to next top-level heading."
+  (interactive)
+  (if (org-current-level)
+      (progn
+        (org-present-top)
+        (widen)
+        (org-get-next-sibling))
+    (outline-next-heading))
+  (org-present-narrow))
+
+(defun org-present-prev ()
+  "Jump to previous top-level heading."
+  (interactive)
+  (if (org-current-level)
+      (progn
+        (widen)
+        (org-present-top)
+        (org-get-last-sibling)))
+  (org-present-narrow))
+
+(defun org-present-narrow ()
+  "Show just current page; in a heading we narrow, else show all headings 
folded (initial page)."
+  (interactive)
+  (if (org-current-level)
+      (progn
+        (org-narrow-to-subtree)
+        (show-all))
+    (org-cycle `(4))))
+
+(defun org-present-big ()
+  "Make font size larger."
+  (interactive)
+  (text-scale-increase 0)
+  (text-scale-increase org-present-text-scale))
+
+(defun org-present-small ()
+  "Change font size back to original."
+  (interactive)
+  (text-scale-increase 0))
+
+(defun org-present-quit ()
+  "Quit the minor-mode."
+  (interactive)
+  (org-present-small)
+  (widen)
+  (run-hooks 'org-present-mode-quit-hook)
+  (setq org-present-mode nil))
+
+(run-hooks 'org-present-mode-hook)



reply via email to

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