From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CJMDFvaR7mFlEwEAgWs5BA (envelope-from ) for ; Mon, 24 Jan 2022 12:48:06 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MLusEvaR7mF9AQAAauVa8A (envelope-from ) for ; Mon, 24 Jan 2022 12:48:06 +0100 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 9D8773E60B for ; Mon, 24 Jan 2022 12:48:05 +0100 (CET) Received: from localhost ([::1]:60602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nBxpJ-00085l-Cq for larch@yhetil.org; Mon, 24 Jan 2022 06:48:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBxob-00084f-B0 for emacs-orgmode@gnu.org; Mon, 24 Jan 2022 06:47:17 -0500 Received: from [2a00:1450:4864:20::436] (port=34795 helo=mail-wr1-x436.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nBxoY-0004em-Cw for emacs-orgmode@gnu.org; Mon, 24 Jan 2022 06:47:17 -0500 Received: by mail-wr1-x436.google.com with SMTP id f17so13045831wrx.1 for ; Mon, 24 Jan 2022 03:47:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=pJHS55eRvkY1lEOvQgsyrLQPkAFe+6VJumeL63m8xs4=; b=puUbUhiYB8ztAY0FrR2rSQMvNPqNf7NPGifr8TuXx5wmNeaKBQIk4H3Dwhbmf6AygP HS3G06Ym5tUFO0Rb0bpM4Oe3jHa9wwoWivEOGDUzUcgf32rWFwZZsiVkSLxie19dvB+V d4DCJ/QAqJBSCHiTfFOy5yPxJpsp8ipdWBnyYMXHynMRA8p+x7koQS7KR0BXK0IdG3Hf gocTXHkwNc/1d3/DBgDYMfPIs8ekuoTsgutAYRStlKKd9emRy/HjnTBpPn282RGu/Zq0 dueDq5CvOxUB1U7T1jWPH3J9kNdyMLHSn+iE6pcmv8QDdH705PFwPa5sQcb6lRPV3O5m mlLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=pJHS55eRvkY1lEOvQgsyrLQPkAFe+6VJumeL63m8xs4=; b=V7qCIGoIvjyCHvu71BXUOKGsRUAh0tn6A4H9Hyykyp7uAppu6gUwTEf6AJRMGOQKzj Icy6XqS+JC/m6ImwgtTU04ZKRFzPqLVMefeGrQt/TOOHQEGrMdSr4WVFY6enX1YkH53H 937EnmwDVP/axzmTfxoNSRHLDltbyLYn0/NjwCII36FXqv9E5RghvxFLtOWCDtc7K6DE DJ79A0YeezI8PeQNDJs48Tiqy8RZeeUarfkBFWnLVh8yPh/QgQRFyxauY01GZ4j2AvAX R6fjk48GmP83XT5VBPPaOC3uid2T16gWkmVLeWDMfnW/x3VsDdEjgKgF29kvPeSY3qgl OB7A== X-Gm-Message-State: AOAM5305hOswzfogvkLmV8UwWGWbV8zKhLJRs6eS/OquhJkgbcZLPNU0 ah7OO9r4O0P2C2ARZFHg13sJOwksN+vAka7HOHkDake/ X-Google-Smtp-Source: ABdhPJwdmQRwQDAfz/aJKDzvXpWSmIyrKB1zIDParrUtnpiktcu2sHCPd1Rv1rNTJyf8Hdyea0heJerRjull8zjFRPI= X-Received: by 2002:a17:906:f1d2:: with SMTP id gx18mr12231911ejb.674.1643024414871; Mon, 24 Jan 2022 03:40:14 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Neil Jerram Date: Mon, 24 Jan 2022 11:40:05 +0000 Message-ID: Subject: Re: Read only org view mode To: Org Mode List Content-Type: multipart/alternative; boundary="0000000000009b162005d6526ed2" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::436 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=neiljerram@gmail.com; helo=mail-wr1-x436.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1643024885; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=pJHS55eRvkY1lEOvQgsyrLQPkAFe+6VJumeL63m8xs4=; b=TJSlN+s65MErZGVy2RapLY/kNA4h7TnYqTZvEFwuIVgWdXqjITLSWo+tCnP0iU21An3xOY K1lc6lTX61Syfui950li5jAUsaHAOtB5PXXjrNnNYWN+KjahrisrwvDspydglzxtofi32v Biaxed2wFS+jGSUkpmIhl22EKwm3DfGik8m6uf6jh3EhJgoKSdYf23qL++LShW1sCtrhOv vAeUXY6LNWhxW8itL4DxjV8cZ2lySQBeNwqTlpzQpo8YK+figQdiolrWrpeqWZmkvISauf WxuYtBic20M4TdgJ67kMNQx8JtbU/8r0h2QKnb7N7XvziCR7Mb8uY8N6jdHXCg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643024885; a=rsa-sha256; cv=none; b=eOS/OnymrNQs7a4ej7dG0I40LfuxYPHws9wiQCFw93Ip0PckC7lJVF0l3zd5ThwdpmVBt/ rHyQ7KQntSvDnWKv4K460wvnOjgSsqiWeeyzGCmX0Ssby9s+on6TkRQHrQDHQwa+G1b1Yd 9a4bmRX9/gF/yVW1yz3DKNtTkj1D7BckwDNnF/9lF/cVUQb9rruQAS+8LRMp/csHvfob9N beSOLjYI5Xn+dRki3dl2P0mBp5nODMvzHjxYhyBs+3mXPJcJ62HWOuhsfuNowBi/0NJW8s kgsRppjH/6/Kb1ljRjvpJ6A3OKg5zHI1m1L+lo8R3dQE5VNmOCz6bo9CMVCdWA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=puUbUhiY; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -9.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=puUbUhiY; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 9D8773E60B X-Spam-Score: -9.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: ob5ZniEp1xi3 --0000000000009b162005d6526ed2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 24 Jan 2022, 11:14 Russell Adams, wrote= : > Why not just do an ASCII export to a temporary read only buffer for > viewing? > Do you mean that you're agreeing with the concept, but finding the implementation unnecessarily complicated? > I always thought the point of Org was to have minimal markup so that > the native file was plainly legible. > > On Sun, Jan 23, 2022 at 08:19:12AM +0100, Arthur Miller wrote: > > Hi mailing list, > > > > is something like this of interest to add to org-mode? > > > > Attached is a prototype to a read-only view mode. It tries to hide as > much of > > markup as possible to make it more "readable". It uses built-in > view-mode to > > make the buffer read only and enable some common commands. I plan to ad= d > more > > "dired like" movement though. > > > > I don't claim it is very well written or efficient; I appreciate input > on that > > regard. To note is that I use minor-modes as "toggles", to make the > > functionality avialable as "solo pieces" as well as a code generation > tool. > > > > I am just checking interest here. More info and a screencast are > avialable at: > > > > https://github.com/amno1/org-view-mode > > > > > ;;; org-view-mode.el --- Read-only viewer with less markup clutter in > org mode files -*- lexical-binding: t; -*- > > > > ;; Copyright (C) 2021 Arthur Miller > > > > ;; Author: Arthur Miller > > ;; Keywords: convenience, outlines, tools > > > > ;; 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. > > > > ;; You should have received a copy of the GNU General Public License > > ;; along with this program. If not, see >. > > > > ;; Author: Arthur Miller > > ;; Version: 0.0.1 > > ;; Keywords: tools convenience > > ;; Package-Requires: ((emacs "24.1")) > > ;; URL: https://github.com/amno1/org-view-mode > > > > ;;; Commentary: > > > > ;; A minor mode to help reduce clutter in org-mode files by > > ;; hiding/unhiding org-mode markup language > > ;; > > ;; To turn it on execute: > > ;; > > ;; `M-x org-view-mode'. > > ;; > > ;; To turn it off execute the same command. > > > > ;;; Issues > > > > ;;; Code: > > (require 'org) > > > > (defgroup org-view nil > > "Hide tags in org-headings." > > :prefix "org-view-" > > :group 'org) > > > > (defvar-local org-view-center-credentials nil > > "Whether to align title and author in center or not. > > > > Centering is done pixel wise relative to window width.") > > > > (defcustom org-view-diminish-mode t > > "Hide lighters for individual minor modes when org-view-mode is on." > > :type 'boolean > > :group 'org-view) > > > > (defvar org-view-stars-re "^[ \t]*\\*+" > > "Regex used to recognize leading stars in org-headings.") > > > > (defvar org-view-credentials-re "[ \t]*#\\+\\(TITLE\\|AUTHOR\\):" > > "Regex used to update author and title lines.") > > > > (defun org-view--update-tags (visibility) > > "Update invisible property to VISIBILITY for tags in the current > buffer." > > (save-excursion > > (goto-char (point-min)) > > (with-silent-modifications > > (while (re-search-forward org-view-stars-re nil t) > > (goto-char (line-end-position)) > > (when (re-search-backward org-tag-line-re > (line-beginning-position) t) > > (put-text-property > > (match-beginning 1) (match-end 1) 'invisible visibility)) > > (forward-line))))) > > > > (defun org-view--update-keywords (visibility) > > "Set VISIBILITY for each line starting with a keyword from KEYWORDS > list." > > (org-with-wide-buffer > > (save-excursion > > (with-silent-modifications > > (goto-char (point-min)) > > (while (re-search-forward "^[ \t]*#\\+.*$" nil t) > > (goto-char (match-beginning 0)) > > (unless (looking-at-p org-view-credentials-re) > > (put-text-property > > (1- (match-beginning 0)) (match-end 0) 'invisible > visibility)) > > (goto-char (match-end 0))))))) > > > > (defun org-view--update-properties (visibility) > > "Set invisible property to VISIBILITY for properties in the current > buffer." > > (org-with-wide-buffer > > (save-excursion > > (with-silent-modifications > > (goto-char (point-min)) > > (while (re-search-forward org-property-drawer-re nil t) > > (put-text-property > > (match-beginning 0) (match-end 0) 'invisible visibility)) > > (goto-char (point-min)) > > (while (re-search-forward "^[ \t]*#\\+PROPERTY:.*$" nil t) > > (put-text-property > > (1- (match-beginning 0)) (1+ (match-end 0)) 'invisible > visibility)))))) > > > > (defun org-view--update-stars (visibility) > > "Update invisible property to VISIBILITY for markers in the current > buffer." > > (org-with-wide-buffer > > (save-excursion > > (goto-char (point-min)) > > (with-silent-modifications > > (while (re-search-forward org-view-stars-re nil t) > > (put-text-property > > (match-beginning 0) (match-end 0) 'invisible visibility)))))) > > > > (defun org-view--update-credentials (visibility) > > "Set invisible property to VISIBILITY for export settings." > > (org-with-wide-buffer > > (save-excursion > > (with-silent-modifications > > (goto-char (point-min)) > > (while (re-search-forward org-view-credentials-re nil t) > > (put-text-property > > (match-beginning 0) (match-end 0) 'invisible visibility) > > (when org-view-center-credentials > > (org-view--center-in-window visibility))) > > (goto-char (point-min)))))) > > > > (defun org-view--center-in-window (center) > > "Center a line in a window pixel wise." > > (save-excursion > > (goto-char (line-beginning-position)) > > (let ((end (line-end-position)) > > (beg (line-beginning-position))) > > (if center > > (let* ((line (buffer-substring beg end)) > > (length (/ (string-pixel-width line) 2))) > > (put-text-property > > beg (1+ beg) 'display `(space :align-to (- center > (,length))))) > > (remove-text-properties beg (1+ beg) '(display nil)))))) > > > > ;;;###autoload > > (define-minor-mode org-view-hide-tags-mode > > "Hide/show tags in org-headings." > > :global nil :lighter " org-htm" > > (unless (derived-mode-p 'org-mode) > > (error "Not in org-mode")) > > (org-view--update-tags org-view-hide-tags-mode)) > > > > ;;;###autoload > > (define-minor-mode org-view-hide-stars-mode > > "Hide/show leading stars in org-headings." > > :global nil :lighter " org-hsm" > > (unless (derived-mode-p 'org-mode) > > (error "Not in org-mode")) > > (org-view--update-stars org-view-hide-stars-mode)) > > > > ;;;###autoload > > (define-minor-mode org-view-hide-keywords-mode > > "Hide/show leading stars in org-headings." > > :global nil :lighter " org-hkm" > > (unless (derived-mode-p 'org-mode) > > (error "Not in org-mode")) > > (org-view--update-keywords org-view-hide-stars-mode)) > > > > ;;;###autoload > > (define-minor-mode org-view-hide-properties-mode > > "Hide/show properties and property drawers." > > :global nil :lighter " org-hpm" > > (unless (derived-mode-p 'org-mode) > > (error "Not in org-mode")) > > (org-view--update-properties org-view-hide-properties-mode)) > > > > ;;;###autoload > > (define-minor-mode org-view-pretty-credentials-mode > > "Prettify credentials in org-buffers." > > :global nil :lighter " org-pcm" > > (unless (derived-mode-p 'org-mode) > > (error "Not in org-mode")) > > (org-view--update-credentials org-view-pretty-credentials-mode)) > > > > (defun org-view-quit () > > (interactive) > > (org-view-mode -1) > > (message "org-view mode disabled in current buffer")) > > > > (defvar-keymap org-view-mode-map > > :doc "Keymap for =E2=80=98ORG-view-mode=E2=80=99" > > "c" #'org-view-quit > > "C" #'org-view-quit > > "e" #'org-view-quit > > "E" #'org-view-quit > > "q" #'org-view-quit > > "Q" #'org-view-quit) > > > > ;;;###autoload > > (define-minor-mode org-view-mode > > "Hide/show babel source code blocks on demand." > > :global nil :lighter " org-view" :keymap org-view-mode-map > > (unless (derived-mode-p 'org-mode) > > (error "Not in org-mode")) > > (cond (org-view-mode > > (org-view-hide-tags-mode org-view-mode) > > (org-view-hide-stars-mode org-view-mode) > > (org-view-hide-keywords-mode org-view-mode) > > (org-view-hide-properties-mode org-view-mode) > > (org-view-pretty-credentials-mode org-view-mode) > > (when org-view-diminish-mode > > (dolist (mode '(org-view-hide-tags-mode > > org-view-hide-stars-mode > > org-view-hide-keywords-mode > > org-view-hide-properties-mode > > org-view-pretty-credentials-mode)) > > (let ((mode-str (cdr (assq mode minor-mode-alist)))) > > (setcar mode-str "")))) > > (view-mode +1)) > > (t (view-mode -1) > > (org-view-hide-tags-mode -1) > > (org-view-hide-stars-mode -1) > > (org-view-hide-keywords-mode -1) > > (org-view-hide-properties-mode -1) > > (org-view-pretty-credentials-mode -1)))) > > > > (provide 'org-view-mode) > > > > ;;; org-view-mode.el ends here > > > > ------------------------------------------------------------------ > Russell Adams RLAdams@AdamsInfoServ.com > > PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ > > Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3 > > --0000000000009b162005d6526ed2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Mon, 24 Jan 2022, 11:14 Russell Adams, <RLAdams@adamsinfoserv.com> wrote:
Why not just do an ASCII export to a= temporary read only buffer for
viewing?

Do you mean that you're agreeing with the concept, but findin= g the implementation unnecessarily complicated?

=

I always thought the point of Org was to have minimal markup so that
the native file was plainly legible.

On Sun, Jan 23, 2022 at 08:19:12AM +0100, Arthur Miller wrote:
> Hi mailing list,
>
> is something like this of interest to add to org-mode?
>
> Attached is a prototype to a read-only view mode. It tries to hide as = much of
> markup as possible to make it more "readable". It uses built= -in view-mode to
> make the buffer read only and enable some common commands. I plan to a= dd more
> "dired like" movement though.
>
> I don't claim it is very well written or efficient; I appreciate i= nput on that
> regard. To note is that I use minor-modes as "toggles", to m= ake the
> functionality avialable as "solo pieces" as well as a code g= eneration tool.
>
> I am just checking interest here. More info and a screencast are avial= able at:
>
> https://github.com/amno1/org-view-mode
>

> ;;; org-view-mode.el --- Read-only viewer with less markup clutter in = org mode files=C2=A0 -*- lexical-binding: t; -*-
>
> ;; Copyright (C) 2021=C2=A0 Arthur Miller
>
> ;; Author: Arthur Miller <arthur.miller@live.com>
> ;; Keywords: convenience, outlines, tools
>
> ;; This program is free software; you can redistribute it and/or modif= y
> ;; it under the terms of the GNU General Public License as published b= y
> ;; 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.=C2=A0 See the<= br> > ;; GNU General Public License for more details.
>
> ;; You should have received a copy of the GNU General Public License > ;; along with this program.=C2=A0 If not, see <https= ://www.gnu.org/licenses/>.
>
> ;; Author: Arthur Miller
> ;; Version: 0.0.1
> ;; Keywords: tools convenience
> ;; Package-Requires: ((emacs "24.1"))
> ;; URL: https://github.com/amno1/org-view-mode=
>
> ;;; Commentary:
>
> ;; A minor mode to help reduce clutter in org-mode files by
> ;; hiding/unhiding org-mode markup language
> ;;
> ;; To turn it on execute:
> ;;
> ;;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 `M-x org-view-mode'.
> ;;
> ;; To turn it off execute the same command.
>
> ;;; Issues
>
> ;;; Code:
> (require 'org)
>
> (defgroup org-view nil
>=C2=A0 =C2=A0"Hide tags in org-headings."
>=C2=A0 =C2=A0:prefix "org-view-"
>=C2=A0 =C2=A0:group 'org)
>
> (defvar-local org-view-center-credentials nil
>=C2=A0 =C2=A0"Whether to align title and author in center or not.<= br> >
> Centering is done pixel wise relative to window width.")
>
> (defcustom org-view-diminish-mode t
>=C2=A0 =C2=A0"Hide lighters for individual minor modes when org-vi= ew-mode is on."
>=C2=A0 =C2=A0:type 'boolean
>=C2=A0 =C2=A0:group 'org-view)
>
> (defvar org-view-stars-re "^[ \t]*\\*+"
>=C2=A0 =C2=A0"Regex used to recognize leading stars in org-heading= s.")
>
> (defvar org-view-credentials-re "[ \t]*#\\+\\(TITLE\\|AUTHOR\\):&= quot;
>=C2=A0 =C2=A0"Regex used to update author and title lines.")<= br> >
> (defun org-view--update-tags (visibility)
>=C2=A0 =C2=A0"Update invisible property to VISIBILITY for tags in = the current buffer."
>=C2=A0 =C2=A0(save-excursion
>=C2=A0 =C2=A0 =C2=A0(goto-char (point-min))
>=C2=A0 =C2=A0 =C2=A0(with-silent-modifications
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(while (re-search-forward org-view-stars-re = nil t)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(goto-char (line-end-position))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when (re-search-backward org-tag-lin= e-re (line-beginning-position) t)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(put-text-property
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (match-beginning 1) (m= atch-end 1) 'invisible visibility))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(forward-line)))))
>
> (defun org-view--update-keywords (visibility)
>=C2=A0 =C2=A0"Set VISIBILITY for each line starting with a keyword= from KEYWORDS list."
>=C2=A0 =C2=A0(org-with-wide-buffer
>=C2=A0 =C2=A0 (save-excursion
>=C2=A0 =C2=A0 =C2=A0 (with-silent-modifications
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char (point-min))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (while (re-search-forward "^[ \t]*#\\+= .*$" nil t)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char (match-beginning 0))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (unless (looking-at-p org-view-crede= ntials-re)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (put-text-property
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(1- (match-beginning 0)= ) (match-end 0) 'invisible visibility))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char (match-end 0)))))))
>
> (defun org-view--update-properties (visibility)
>=C2=A0 =C2=A0"Set invisible property to VISIBILITY for properties = in the current buffer."
>=C2=A0 =C2=A0(org-with-wide-buffer
>=C2=A0 =C2=A0 (save-excursion
>=C2=A0 =C2=A0 =C2=A0 (with-silent-modifications
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char (point-min))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (while (re-search-forward org-property-draw= er-re nil t)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (put-text-property
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(match-beginning 0) (match-end= 0) 'invisible visibility))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char (point-min))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (while (re-search-forward "^[ \t]*#\\+= PROPERTY:.*$" nil t)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (put-text-property
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(1- (match-beginning 0)) (1+ (= match-end 0)) 'invisible visibility))))))
>
> (defun org-view--update-stars (visibility)
>=C2=A0 =C2=A0"Update invisible property to VISIBILITY for markers = in the current buffer."
>=C2=A0 =C2=A0(org-with-wide-buffer
>=C2=A0 =C2=A0 (save-excursion
>=C2=A0 =C2=A0 =C2=A0 (goto-char (point-min))
>=C2=A0 =C2=A0 =C2=A0 (with-silent-modifications
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (while (re-search-forward org-view-stars-re= nil t)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (put-text-property
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(match-beginning 0) (match-end= 0) 'invisible visibility))))))
>
> (defun org-view--update-credentials (visibility)
>=C2=A0 =C2=A0"Set invisible property to VISIBILITY for export sett= ings."
>=C2=A0 =C2=A0(org-with-wide-buffer
>=C2=A0 =C2=A0 (save-excursion
>=C2=A0 =C2=A0 =C2=A0 (with-silent-modifications
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char (point-min))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (while (re-search-forward org-view-credenti= als-re nil t)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (put-text-property
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(match-beginning 0) (match-end= 0) 'invisible visibility)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (when org-view-center-credentials >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-view--center-in-window v= isibility)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char (point-min))))))
>
> (defun org-view--center-in-window (center)
>=C2=A0 =C2=A0"Center a line in a window pixel wise."
>=C2=A0 =C2=A0(save-excursion
>=C2=A0 =C2=A0 =C2=A0(goto-char (line-beginning-position))
>=C2=A0 =C2=A0 =C2=A0(let ((end (line-end-position))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(beg (line-beginning-position)= ))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(if center
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((line (buffer-substring= beg end))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (length = (/ (string-pixel-width line) 2)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(put-text-property
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 beg (1+ beg) 'disp= lay `(space :align-to (- center (,length)))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(remove-text-properties beg (1+ beg) = '(display nil))))))
>
> ;;;###autoload
> (define-minor-mode org-view-hide-tags-mode
>=C2=A0 =C2=A0"Hide/show tags in org-headings."
>=C2=A0 =C2=A0:global nil :lighter " org-htm"
>=C2=A0 =C2=A0(unless (derived-mode-p 'org-mode)
>=C2=A0 =C2=A0 =C2=A0(error "Not in org-mode"))
>=C2=A0 =C2=A0(org-view--update-tags org-view-hide-tags-mode))
>
> ;;;###autoload
> (define-minor-mode org-view-hide-stars-mode
>=C2=A0 =C2=A0"Hide/show leading stars in org-headings."
>=C2=A0 =C2=A0:global nil :lighter " org-hsm"
>=C2=A0 =C2=A0(unless (derived-mode-p 'org-mode)
>=C2=A0 =C2=A0 =C2=A0(error "Not in org-mode"))
>=C2=A0 =C2=A0(org-view--update-stars org-view-hide-stars-mode))
>
> ;;;###autoload
> (define-minor-mode org-view-hide-keywords-mode
>=C2=A0 =C2=A0"Hide/show leading stars in org-headings."
>=C2=A0 =C2=A0:global nil :lighter " org-hkm"
>=C2=A0 =C2=A0(unless (derived-mode-p 'org-mode)
>=C2=A0 =C2=A0 =C2=A0(error "Not in org-mode"))
>=C2=A0 =C2=A0(org-view--update-keywords org-view-hide-stars-mode))
>
> ;;;###autoload
> (define-minor-mode org-view-hide-properties-mode
>=C2=A0 =C2=A0"Hide/show properties and property drawers."
>=C2=A0 =C2=A0:global nil :lighter " org-hpm"
>=C2=A0 =C2=A0(unless (derived-mode-p 'org-mode)
>=C2=A0 =C2=A0 =C2=A0(error "Not in org-mode"))
>=C2=A0 =C2=A0(org-view--update-properties org-view-hide-properties-mode= ))
>
> ;;;###autoload
> (define-minor-mode org-view-pretty-credentials-mode
>=C2=A0 =C2=A0"Prettify credentials in org-buffers."
>=C2=A0 =C2=A0:global nil :lighter " org-pcm"
>=C2=A0 =C2=A0(unless (derived-mode-p 'org-mode)
>=C2=A0 =C2=A0 =C2=A0(error "Not in org-mode"))
>=C2=A0 =C2=A0(org-view--update-credentials org-view-pretty-credentials-= mode))
>
> (defun org-view-quit ()
>=C2=A0 =C2=A0(interactive)
>=C2=A0 =C2=A0(org-view-mode -1)
>=C2=A0 =C2=A0(message "org-view mode disabled in current buffer&qu= ot;))
>
> (defvar-keymap org-view-mode-map
>=C2=A0 =C2=A0:doc "Keymap for =E2=80=98ORG-view-mode=E2=80=99"= ;
>=C2=A0 =C2=A0"c" #'org-view-quit
>=C2=A0 =C2=A0"C" #'org-view-quit
>=C2=A0 =C2=A0"e" #'org-view-quit
>=C2=A0 =C2=A0"E" #'org-view-quit
>=C2=A0 =C2=A0"q" #'org-view-quit
>=C2=A0 =C2=A0"Q" #'org-view-quit)
>
> ;;;###autoload
> (define-minor-mode org-view-mode
>=C2=A0 =C2=A0"Hide/show babel source code blocks on demand."<= br> >=C2=A0 =C2=A0:global nil :lighter " org-view" :keymap org-vie= w-mode-map
>=C2=A0 =C2=A0(unless (derived-mode-p 'org-mode)
>=C2=A0 =C2=A0 =C2=A0(error "Not in org-mode"))
>=C2=A0 =C2=A0(cond (org-view-mode
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-view-hide-tags-mode org-view-mo= de)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-view-hide-stars-mode org-view-m= ode)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-view-hide-keywords-mode org-vie= w-mode)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-view-hide-properties-mode org-v= iew-mode)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-view-pretty-credentials-mode or= g-view-mode)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (when org-view-diminish-mode
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (dolist (mode '(org-view-= hide-tags-mode
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 org-view-hide-stars-mode
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 org-view-hide-keywords-mode
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 org-view-hide-properties-mode
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 org-view-pretty-credentials-mode))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((mode-str (cdr (= assq mode minor-mode-alist))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setcar mode-st= r ""))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (view-mode +1))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(t (view-mode -1)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-view-hide-tags-mode -1)<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-view-hide-stars-mode -1)=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-view-hide-keywords-mode = -1)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-view-hide-properties-mod= e -1)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-view-pretty-credentials-= mode -1))))
>
> (provide 'org-view-mode)
>
> ;;; org-view-mode.el ends here



------------------------------------------------------------------
Russell Adams=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RLAdams@AdamsInfoServ.com

PGP Key ID:=C2=A0 =C2=A0 =C2=A00x1160DCB3=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0http://www.adamsinfoserv.com/

Fingerprint:=C2=A0 =C2=A0 1723 D8CA 4280 1EC9 557F=C2=A0 66E8 1154 E018 116= 0 DCB3

--0000000000009b162005d6526ed2--