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

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

[elpa] externals/luwak 8e7da0d089 10/28: making using tor a user option


From: ELPA Syncer
Subject: [elpa] externals/luwak 8e7da0d089 10/28: making using tor a user option
Date: Tue, 25 Oct 2022 15:57:53 -0400 (EDT)

branch: externals/luwak
commit 8e7da0d0894d3347991f14f4ccbe94d09bdfbec8
Author: Yuchen Pei <hi@ypei.me>
Commit: Yuchen Pei <hi@ypei.me>

    making using tor a user option
---
 luwak.el | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/luwak.el b/luwak.el
index 224ce836bb..59a1ab148b 100644
--- a/luwak.el
+++ b/luwak.el
@@ -28,6 +28,16 @@
 (defcustom luwak-url-rewrite-function 'identity
   "Function to rewrite url before loading."
   :group 'luwak :type '(function))
+(defcustom luwak-tor-switch nil
+  "Switch behaviour of prefix arg concerning the use of tor.
+
+When nil, use tor by default, and not use it with a prefix arg.  
+When non-nill, swap the tor-switch in prefix-arg effect."
+  :group 'luwak :type '(boolean))
+
+(defun luwak-toggle-tor-switch ()
+  (interactive)
+  (setq luwak-tor-switch (not luwak-tor-switch)))
 
 (defun luwak-mode-name ()
   (concat "luwak "
@@ -53,7 +63,8 @@
 
 (defun luwak-open (url)
   (interactive "sUrl to open: ")
-  (luwak-open-internal url current-prefix-arg 'luwak-add-to-history))
+  (luwak-open-internal
+   url (xor luwak-tor-switch current-prefix-arg) 'luwak-add-to-history))
 
 (defun luwak-copy-url ()
   (interactive)



reply via email to

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