[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/logos bbc89495e3 08/25: Add section with sample configu
From: |
ELPA Syncer |
Subject: |
[elpa] externals/logos bbc89495e3 08/25: Add section with sample configuration |
Date: |
Fri, 11 Mar 2022 08:58:00 -0500 (EST) |
branch: externals/logos
commit bbc89495e3fbd9b0a01cbcdb63276c8c36be2837
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add section with sample configuration
---
README.org | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
diff --git a/README.org b/README.org
index a585361e0c..9c0c008de7 100644
--- a/README.org
+++ b/README.org
@@ -165,6 +165,63 @@ Finally, in your =init.el= (or equivalent) evaluate this:
Everything is in place to set up the package.
+* Sample configuration
+:PROPERTIES:
+:CUSTOM_ID: h:6ed7f2fd-faad-48c9-bdd2-7e909639128d
+:END:
+#+cindex: Package configuration
+
+Logos does not bind its own keys and does not make any opinionated
+changes out-of-the-box:
+
++ To get the do-what-I-mean page motions add your own key bindings. In
+ the example below, they take the stead of ~forward-page~ (=C-x ]=) and
+ ~backward-page~ (=C-x [=). The command ~logos-narrow-dwim~ need not
+ be bound, especially if you are already familiar with the various
+ narrowing commands (otherwise it maps to =C-x n n= in this example,
+ assuming the default keys).
+
++ To have quick access to ~logos-focus-mode~, bind it to a key. This
+ mode checks the variables ~logos-hide-mode-line~, ~logos-scroll-lock~,
+ ~logos-variable-pitch~ and applies their effects if they are non-nil.
+ Note that everything is buffer-local, so it is possible to use file
+ variables as described in the Emacs manual.
+
++ If you want to center the buffer in its window, use the =olivetti=
+ package by Paul W. Rankin and simply apply some glue code to activate
+ ~olivetti-mode~ when ~logos-focus-mode~ is active.
+
+#+begin_src emacs-lisp
+(require 'logos)
+
+(setq logos-outlines-are-pages t)
+(setq logos-outline-regexp-alist
+ `((emacs-lisp-mode . "^;;;+ ")
+ (org-mode . "^\\*+ +")
+ (t . ,(or outline-regexp logos--page-delimiter))))
+
+;; These apply when `logos-focus-mode' is enabled
+(setq logos-hide-mode-line nil)
+(setq logos-scroll-lock nil)
+(setq logos-variable-pitch nil)
+
+;; glue code for `logos-focus-mode' and `olivetti-mode'
+(defun prot/logos--olivetti-mode ()
+ "Toggle `olivetti-mode'."
+ (if (or (bound-and-true-p olivetti-mode)
+ (null (logos--focus-p)))
+ (olivetti-mode -1)
+ (olivetti-mode 1)))
+
+(add-hook 'logos-focus-mode-hook #'prot/logos--olivetti-mode)
+
+(let ((map global-map))
+ (define-key map [remap narrow-to-region] #'logos-narrow-dwim)
+ (define-key map [remap forward-page] #'logos-forward-page-dwim)
+ (define-key map [remap backward-page] #'logos-backward-page-dwim)
+ (define-key map (kbd "<f9>") #'logos-focus-mode))
+#+end_src
+
* GNU Free Documentation License
:PROPERTIES:
:APPENDIX: t
- [elpa] branch externals/logos created (now dc52fc3f04), ELPA Syncer, 2022/03/11
- [elpa] externals/logos 804f39e21e 03/25: Make the "focus mode" variables local, ELPA Syncer, 2022/03/11
- [elpa] externals/logos d41217e007 05/25: Tweak documentation and Commentary, ELPA Syncer, 2022/03/11
- [elpa] externals/logos c0a2074a85 01/25: Initial commit for logos.el and related, ELPA Syncer, 2022/03/11
- [elpa] externals/logos f03cf3ebd9 06/25: Fix fallback value of logos-outline-regexp-alist, ELPA Syncer, 2022/03/11
- [elpa] externals/logos 7f5010f3a0 10/25: Add Org/Outline reveal sample; update docs, ELPA Syncer, 2022/03/11
- [elpa] externals/logos 60f7eaf5f7 13/25: Update Commentary with code sample for Org/Outline, ELPA Syncer, 2022/03/11
- [elpa] externals/logos 95000cf597 04/25: Minor rewording in the Commentary, ELPA Syncer, 2022/03/11
- [elpa] externals/logos bbc89495e3 08/25: Add section with sample configuration,
ELPA Syncer <=
- [elpa] externals/logos 28e2d2ae27 12/25: Reword comment, ELPA Syncer, 2022/03/11
- [elpa] externals/logos 07cd1b412f 17/25: Update sample code for outline-mode, ELPA Syncer, 2022/03/11
- [elpa] externals/logos a63d1ab315 20/25: Always reveal Org/Outline entry, ELPA Syncer, 2022/03/11
- [elpa] externals/logos 26ecd9b72f 22/25: Update description, ELPA Syncer, 2022/03/11
- [elpa] externals/logos 88b2a7ca61 11/25: Tweak sample code for local variables, ELPA Syncer, 2022/03/11
- [elpa] externals/logos 69cabed870 09/25: Run hook after page motion, ELPA Syncer, 2022/03/11
- [elpa] externals/logos 230828bd2e 16/25: Rewrite the manual, ELPA Syncer, 2022/03/11
- [elpa] externals/logos 86ec38e795 19/25: Clarify manual's wording about outline regexp, ELPA Syncer, 2022/03/11
- [elpa] externals/logos 90ec28cd10 21/25: Delete trailing parenthesis, ELPA Syncer, 2022/03/11
- [elpa] externals/logos dc52fc3f04 25/25: Merge redundant make-variable-buffer-local calls into defcustom, ELPA Syncer, 2022/03/11