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

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

[elpa] externals/logos f55f57d85b: Add user option logos-hide-cursor


From: ELPA Syncer
Subject: [elpa] externals/logos f55f57d85b: Add user option logos-hide-cursor
Date: Mon, 12 Sep 2022 12:57:49 -0400 (EDT)

branch: externals/logos
commit f55f57d85bc105c7d94761952d5178898b808913
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Add user option logos-hide-cursor
    
    Optionally hides the cursor when logos-focus-mode is enabled.
    
    Thanks to Marcel Ventosa for suggesting the idea of hiding the cursor.
    This was done via a private channel and is shared with permission.
---
 README.org | 25 ++++++++++++++++---------
 logos.el   | 24 ++++++++++++++++++++----
 2 files changed, 36 insertions(+), 13 deletions(-)

diff --git a/README.org b/README.org
index c5025a5a9c..4fdc28ce59 100644
--- a/README.org
+++ b/README.org
@@ -107,6 +107,7 @@ following them up with either =]= or =[=.  The repetition 
stops when
 another command is invoked.
 
 #+findex: logos-focus-mode
+#+vindex: logos-hide-cursor
 #+vindex: logos-hide-mode-line
 #+vindex: logos-scroll-lock
 #+vindex: logos-variable-pitch
@@ -116,8 +117,9 @@ another command is invoked.
 #+vindex: logos-hide-fringe
 Logos provides some optional aesthetic tweaks which come into effect
 when the buffer-local ~logos-focus-mode~ is enabled.  These will hide
-the mode line (~logos-hide-mode-line~), disable the buffer boundary
-indicators (~indicate-buffer-boundaries~), enable ~scroll-lock-mode~
+the cursor (~logos-hide-cursor~), hide the mode line
+(~logos-hide-mode-line~), disable the buffer boundary indicators
+(~indicate-buffer-boundaries~), enable ~scroll-lock-mode~
 (~logos-scroll-lock~), use ~variable-pitch-mode~ in non-programming
 buffers (~logos-variable-pitch~), make the buffer read-only
 (~logos-buffer-read-only~), center the buffer in its window if the
@@ -125,6 +127,8 @@ buffers (~logos-variable-pitch~), make the buffer read-only
 ~fringe~ face (~logos-hide-fringe~).  All these variables are
 buffer-local.
 
+[ Note that ~logos-hide-cursor~ is part of {{{development-version}}}. ]
+
 #+vindex: logos-focus-mode-map
 Furthermore, the ~logos-focus-mode~ establishes a bespoke keymap, which
 can be used to, for example, bind the arrow keys to page motions.  The
@@ -210,12 +214,14 @@ changes out-of-the-box 
([[#h:2bb57369-352a-43bf-afe3-0bed2fcc7359][Extra tweaks]
   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~, ~logos-hide-buffer-boundaries~,
-  ~logos-buffer-read-only~, ~logos-olivetti~ (requires =olivetti=
-  package) 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.
+  mode checks the variables ~logos-hide-cursor~, ~logos-hide-mode-line~,
+  ~logos-scroll-lock~, ~logos-variable-pitch~,
+  ~logos-hide-buffer-boundaries~, ~logos-buffer-read-only~,
+  ~logos-olivetti~ (requires =olivetti= package) 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.
+
+[ Note that ~logos-hide-cursor~ is part of {{{development-version}}}. ]
 
 #+begin_src emacs-lisp
 (require 'logos)
@@ -230,7 +236,8 @@ changes out-of-the-box 
([[#h:2bb57369-352a-43bf-afe3-0bed2fcc7359][Extra tweaks]
 
 ;; These apply when `logos-focus-mode' is enabled.  Their value is
 ;; buffer-local.
-(setq-default logos-hide-mode-line t
+(setq-default logos-hide-cursor nil
+              logos-hide-mode-line t
               logos-hide-buffer-boundaries t
               logos-hide-fringe t
               logos-variable-pitch nil
diff --git a/logos.el b/logos.el
index 7174dbb6ec..9d691c280d 100644
--- a/logos.el
+++ b/logos.el
@@ -60,8 +60,9 @@
 ;;
 ;; Logos provides some optional aesthetic tweaks which come into effect
 ;; when the buffer-local `logos-focus-mode' is enabled.  These will hide
-;; the mode line (`logos-hide-mode-line'), disable the buffer boundary
-;; indicators (`indicate-buffer-boundaries'), enable `scroll-lock-mode'
+;; the cursor (`logos-hide-cursor'), hide the mode line
+;; (`logos-hide-mode-line'), disable the buffer boundary indicators
+;; (`indicate-buffer-boundaries'), enable `scroll-lock-mode'
 ;; (`logos-scroll-lock'), use `variable-pitch-mode' in non-programming
 ;; buffers (`logos-variable-pitch'), make the buffer read-only
 ;; (`logos-buffer-read-only'), center the buffer in its window if the
@@ -125,6 +126,14 @@ the latter."
   :package-version '(logos . "0.1.0")
   :group 'logos)
 
+(defcustom logos-hide-cursor nil
+  "When non-nil hide the cursor.
+This is only relevant when `logos-focus-mode' is enabled."
+  :type 'boolean
+  :group 'logos
+  :package-version '(logos . "1.0.0")
+  :local t)
+
 (defcustom logos-hide-mode-line nil
   "When non-nil hide the modeline.
 This is only relevant when `logos-focus-mode' is enabled."
@@ -413,8 +422,9 @@ alternate, thus toggling MODE."
   "Buffer-local mode for focused editing.
 When enabled it sets the buffer-local value of these user
 options: `logos-scroll-lock', `logos-variable-pitch',
-`logos-hide-mode-line', `logos-hide-buffer-boundaries',
-`logos-buffer-read-only', `logos-olivetti', `logos-hide-fringe'."
+`logos-hide-cursor', `logos-hide-mode-line',
+`logos-hide-buffer-boundaries', `logos-buffer-read-only',
+`logos-olivetti', `logos-hide-fringe'."
   :init-value nil
   :global nil
   :keymap logos-focus-mode-map
@@ -433,6 +443,7 @@ options: `logos-scroll-lock', `logos-variable-pitch',
   (logos--scroll-lock)
   (logos--olivetti)
   ;; variables
+  (logos--hide-cursor)
   (logos--hide-mode-line)
   (logos--indicate-buffer-boundaries)
   (logos--buffer-read-only)
@@ -454,6 +465,11 @@ options: `logos-scroll-lock', `logos-variable-pitch',
   (when logos-hide-buffer-boundaries
     (logos--set 'indicate-buffer-boundaries nil)))
 
+(defun logos--hide-cursor ()
+  "Set `logos-hide-cursor'."
+  (when logos-hide-cursor
+    (logos--set 'cursor-type nil)))
+
 ;; FIXME 2022-03-13: The mode line is not redrawn properly.  Not even
 ;; with `force-mode-line-update', unless something happens like
 ;; switching to the other window.  Using `redisplay' does not fix the



reply via email to

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