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

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

[nongnu] elpa/org-present 6c57386522 36/47: Fixed that read-only functio


From: ELPA Syncer
Subject: [nongnu] elpa/org-present 6c57386522 36/47: Fixed that read-only function erase cursor
Date: Sat, 8 Jan 2022 13:58:31 -0500 (EST)

branch: elpa/org-present
commit 6c573865227102229281e4733de41bdc617c2bbe
Author: komem3 <komata392@gmail.com>
Commit: komem3 <komata392@gmail.com>

    Fixed that read-only function erase cursor
    
    Read-only function erase cursor, but there is a function to
    hide cursor. That's why I moved removing cursor process to
    the function to hide cursor.
    Also, added a conditional expression because if the
    org-present-hide-cursor runs in duplicate, the cursor
    remains gone when leave the org-present-mode.
---
 org-present.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/org-present.el b/org-present.el
index 74d12607c4..dd56227329 100644
--- a/org-present.el
+++ b/org-present.el
@@ -206,25 +206,27 @@
   "Make buffer read-only."
   (interactive)
   (setq buffer-read-only t)
-  (setq org-present-cursor-cache cursor-type
-        cursor-type nil)
   (define-key org-present-mode-keymap (kbd "SPC") 'org-present-next))
 
 (defun org-present-read-write ()
   "Make buffer read-only."
   (interactive)
   (setq buffer-read-only nil)
-  (setq cursor-type org-present-cursor-cache)
   (define-key org-present-mode-keymap (kbd "SPC") 'self-insert-command))
 
 (defun org-present-hide-cursor ()
   "Hide the cursor for current window."
   (interactive)
+  (if cursor-type
+      (setq-local org-present-cursor-cache cursor-type
+            cursor-type nil))
   (internal-show-cursor (selected-window) nil))
 
 (defun org-present-show-cursor ()
   "Show the cursor for current window."
   (interactive)
+  (if org-present-cursor-cache
+      (setq-local cursor-type org-present-cursor-cache))
   (internal-show-cursor (selected-window) t))
 
 ;;;###autoload



reply via email to

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