From d75a354e9259bfe47a1c80540b7637925b0d18f8 Mon Sep 17 00:00:00 2001 From: Zachary Date: Wed, 25 Jan 2023 19:34:24 -0500 Subject: [PATCH 1/2] Add variable for python interpreter. --- README.md | 2 +- visual-regexp-steroids.el | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 073d528..6cc3162 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ You can choose the engine (e.g. to fall back to the Emacs regexp engine) with `v (define-key esc-map (kbd "C-r") 'vr/isearch-backward) ;; C-M-r (define-key esc-map (kbd "C-s") 'vr/isearch-forward) ;; C-M-s ``` -To customize, use `M-x customize-group [RET] visual-regexp`. You can specify which engine to use by modifying `vr/engine` (defaults to Python), and how the Python interpreter is invoked by modifying the `vr/command-python` variable. The default is `python /path/to/visual-regexp-steroids/regexp.py`. +To customize, use `M-x customize-group [RET] visual-regexp`. You can specify which engine to use by modifying `vr/engine` (defaults to Python), and how the Python interpreter is invoked by modifying the `vr--python-interpreter` variable. The default is `python`. ## Examples diff --git a/visual-regexp-steroids.el b/visual-regexp-steroids.el index 83105a7..aab2e11 100644 --- a/visual-regexp-steroids.el +++ b/visual-regexp-steroids.el @@ -44,9 +44,10 @@ (require 'visual-regexp) ;;; variables +(defvar vr--python-interpreter "python") (defvar vr--command-python-default - (format "python %s" (expand-file-name "regexp.py" (file-name-directory load-file-name)))) + (format "%s %s" vr--python-interpreter (expand-file-name "regexp.py" (file-name-directory load-file-name)))) (defcustom vr/command-python vr--command-python-default "External command used for the Python engine." From e8f79ae38385b70ff7a368f5f413347006ac7d69 Mon Sep 17 00:00:00 2001 From: Zachary Date: Mon, 27 Feb 2023 20:38:22 -0500 Subject: [PATCH 2/2] Changed to use defcustom. --- visual-regexp-steroids.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/visual-regexp-steroids.el b/visual-regexp-steroids.el index aab2e11..b806685 100644 --- a/visual-regexp-steroids.el +++ b/visual-regexp-steroids.el @@ -44,10 +44,13 @@ (require 'visual-regexp) ;;; variables -(defvar vr--python-interpreter "python") +(defcustom vr/python-interpreter "python3" + "Name of current python interpreter on current machine." + :type 'string + :group 'visual-regexp) (defvar vr--command-python-default - (format "%s %s" vr--python-interpreter (expand-file-name "regexp.py" (file-name-directory load-file-name)))) + (format "%s %s" vr/python-interpreter (expand-file-name "regexp.py" (file-name-directory load-file-name)))) (defcustom vr/command-python vr--command-python-default "External command used for the Python engine."