From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id yMIoHzrjoV4gcgAA0tVLHw (envelope-from ) for ; Thu, 23 Apr 2020 18:49:30 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 4PbXI0DjoV4TaQAAB5/wlQ (envelope-from ) for ; Thu, 23 Apr 2020 18:49:36 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 168D1941ACC for ; Thu, 23 Apr 2020 18:49:36 +0000 (UTC) Received: from localhost ([::1]:37096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRguj-0005E4-Sb for larch@yhetil.org; Thu, 23 Apr 2020 14:49:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34630) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRguC-0005DX-AW for emacs-orgmode@gnu.org; Thu, 23 Apr 2020 14:49:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRguB-0002tD-EL for emacs-orgmode@gnu.org; Thu, 23 Apr 2020 14:48:59 -0400 Received: from ciao.gmane.io ([159.69.161.202]:38854) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jRguA-0002rr-QN for emacs-orgmode@gnu.org; Thu, 23 Apr 2020 14:48:59 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1jRgu8-000VsQ-CN for emacs-orgmode@gnu.org; Thu, 23 Apr 2020 20:48:56 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Marc Ihm Subject: simple code to use focus-mode with org Date: Thu, 23 Apr 2020 20:48:48 +0200 Message-ID: <5646c714-5861-0cb5-3342-a171c45755f7@ihm.name> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 X-Mozilla-News-Host: news://news.gmane.io:119 Received-SPF: pass client-ip=159.69.161.202; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/23 13:10:58 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Received-From: 159.69.161.202 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: larstvei@ifi.uio.no Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 X-Spam-Score: -0.61 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scan-Result: default: False [-0.61 / 13.00]; GENERIC_REPUTATION(0.00)[-0.56310894845464]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; MV_CASE(0.50)[]; TO_DN_NONE(0.00)[]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.22), country: US(-0.00), ip: 209.51.188.17(-0.56)]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; RCPT_COUNT_TWO(0.00)[2]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[209.51.188.17:from]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FROM_NEQ_ENVFROM(0.00)[marc@ihm.name,emacs-orgmode-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[ihm.name]; HAS_LIST_UNSUB(-0.01)[]; MIME_TRACE(0.00)[0:+]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: Qo/6IamXYx+e 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