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

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

[nongnu] elpa/evil 13ae79b 2/3: Refactor `evil-visual-update-x-selection


From: ELPA Syncer
Subject: [nongnu] elpa/evil 13ae79b 2/3: Refactor `evil-visual-update-x-selection`, remove docstring
Date: Tue, 16 Nov 2021 16:57:47 -0500 (EST)

branch: elpa/evil
commit 13ae79b31411a8ee1c0aa1f4288d373cea8f4a86
Author: Tom Dalziel <tom_dl@hotmail.com>
Commit: Tom Dalziel <33435574+tomdl89@users.noreply.github.com>

    Refactor `evil-visual-update-x-selection`, remove docstring
    
    Docstring should be generated by sphinx, not manually
---
 doc/docstringdb.json | 11 -----------
 evil-states.el       | 20 ++++++++++----------
 2 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/doc/docstringdb.json b/doc/docstringdb.json
index 466ef38..96695ec 100644
--- a/doc/docstringdb.json
+++ b/doc/docstringdb.json
@@ -17052,16 +17052,5 @@
     "functionp": true,
     "macrop": null,
     "keymap-inv": null
-  },
-  "evil-visual-update-x-selection-p": {
-    "default": "t",
-    "local": false,
-    "default-type": "symbol",
-    "var-docstring": "Whether to update the X PRIMARY selection with the 
current visual region automatically.",
-    "fn-docstring": null,
-    "arglist": true,
-    "functionp": null,
-    "macrop": null,
-    "keymap-inv": null
   }
 }
\ No newline at end of file
diff --git a/evil-states.el b/evil-states.el
index 3781a65..fcec2e3 100644
--- a/evil-states.el
+++ b/evil-states.el
@@ -365,16 +365,16 @@ otherwise exit Visual state."
 
 (defun evil-visual-update-x-selection (&optional buffer)
   "Update the X selection with the current visual region of BUFFER."
-  (when evil-visual-update-x-selection-p
-    (let ((buf (or buffer (current-buffer))))
-      (when (buffer-live-p buf)
-        (with-current-buffer buf
-          (when (and (evil-visual-state-p)
-                     (display-selections-p)
-                     (not (eq evil-visual-selection 'block)))
-            (evil-set-selection 'PRIMARY (buffer-substring-no-properties
-                                          evil-visual-beginning
-                                          evil-visual-end))))))))
+  (let ((buf (or buffer (current-buffer))))
+    (when (and evil-visual-update-x-selection-p
+               (buffer-live-p buf)
+               (evil-visual-state-p)
+               (display-selections-p)
+               (not (eq evil-visual-selection 'block)))
+      (with-current-buffer buf
+        (evil-set-selection 'PRIMARY (buffer-substring-no-properties
+                                      evil-visual-beginning
+                                      evil-visual-end))))))
 
 (defun evil-visual-activate-hook (&optional _command)
   "Enable Visual state if the region is activated."



reply via email to

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