emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marc Ihm <marc@ihm.name>
To: emacs-orgmode@gnu.org
Cc: larstvei@ifi.uio.no
Subject: simple code to use focus-mode with org
Date: Thu, 23 Apr 2020 20:48:48 +0200	[thread overview]
Message-ID: <5646c714-5861-0cb5-3342-a171c45755f7@ihm.name> (raw)

Hi,

when presenting things informally from org I often use the great 
focus-mode (see https://github.com/larstvei/Focus) to keep my audience 
focused on the individual nodes of my presentation:


(defun forward-heading (&optional N)
   "Forward one orgmode-heading for thing-at-point"
   (interactive "p")
   (if (= N -1)
       (outline-previous-heading)
     (outline-next-heading)))

(require 'thingatpt)
(require 'focus)

(setq focus-mode-to-thing '((org-mode . heading)))
(focus-mode)


The only interesting thing here is the trivial function forward-heading, 
which allows focus-mode to handle org-nodes and focus on them.
The connection is made by setting focus-mode-to-thing; the symbol 
heading leads focus-mode to invoke forward-heading, see the 
documentation of thingatpt for details.

Hope someone finds this useful.

regards,
Marc



             reply	other threads:[~2020-04-23 18:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 18:48 Marc Ihm [this message]
2020-04-24  4:55 ` simple code to use focus-mode with org stardiviner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5646c714-5861-0cb5-3342-a171c45755f7@ihm.name \
    --to=marc@ihm.name \
    --cc=emacs-orgmode@gnu.org \
    --cc=larstvei@ifi.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).