[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vlf 95e6259 188/310: Add convenience macro to disable V
From: |
Stefan Monnier |
Subject: |
[elpa] externals/vlf 95e6259 188/310: Add convenience macro to disable VLF application during execution of |
Date: |
Sat, 28 Nov 2020 00:33:13 -0500 (EST) |
branch: externals/vlf
commit 95e625938e71c0cc5632a1e14e6147f245decc97
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>
Add convenience macro to disable VLF application during execution of
specific function.
---
README.org | 14 ++++++++++++++
vlf-integrate.el | 31 +++++++++++++++++--------------
2 files changed, 31 insertions(+), 14 deletions(-)
diff --git a/README.org b/README.org
index d88ca3f..538d44f 100644
--- a/README.org
+++ b/README.org
@@ -59,6 +59,20 @@ that vlf-mode automatically launches for large files:
'(vlf-application 'dont-ask))
#+END_EXAMPLE
+*** Disable for specific mode
+
+To disable automatic usage of VLF for a major mode, add it to
+*vlf-forbidden-modes-list*.
+
+*** Disable for specific function
+
+To disable automatic usage of VLF for a function, for example named
+*func* defined in file *file.el*:
+
+#+BEGIN_EXAMPLE
+(vlf-disable-for-function func "file.el")
+#+END_EXAMPLE
+
** Keymap
All VLF operations are grouped under the *C-c C-v* prefix by default.
diff --git a/vlf-integrate.el b/vlf-integrate.el
index 6ba8aa1..cf21898 100644
--- a/vlf-integrate.el
+++ b/vlf-integrate.el
@@ -124,20 +124,23 @@ OP-TYPE specifies the file operation being performed over
FILENAME."
((memq char '(?a ?A))
(error "Aborted"))))))))
-(eval-after-load "etags"
- '(progn
- (defadvice tags-verify-table (around vlf-tags-verify-table
- compile activate)
- "Temporarily disable `vlf-mode'."
- (let ((vlf-application nil))
- ad-do-it))
-
- (defadvice tag-find-file-of-tag-noselect
- (around vlf-tag-find-file-of-tag compile activate)
- "Temporarily disable `vlf-mode'."
- (let ((vlf-application nil))
- ad-do-it))))
-
+;; disable for some functions
+(defmacro vlf-disable-for-function (func file)
+ "Build advice to disable VLF during execution of FUNC\
+defined in FILE."
+ `(eval-after-load ,file
+ '(defadvice ,func (around ,(intern (concat "vlf-"
+ (symbol-name func)))
+ compile activate)
+ "Temporarily disable `vlf-mode'."
+ (let ((vlf-application nil))
+ ad-do-it))))
+
+(vlf-disable-for-function tags-verify-table "etags")
+(vlf-disable-for-function tag-find-file-of-tag-noselect "etags")
+(vlf-disable-for-function helm-etags-create-buffer "helm-tags")
+
+;; dired
(defun dired-vlf ()
"In Dired, visit the file on this line in VLF mode."
(interactive)
- [elpa] externals/vlf 931ca52 145/310: Stylistic refinements., (continued)
- [elpa] externals/vlf 931ca52 145/310: Stylistic refinements., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 2ac3e7d 146/310: Fix prematurely ending search/occur not to ask for modified buffer, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 0080991 154/310: Fix chunk end adjustment and save for trunk Emacs., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf a3901b8 157/310: Fix deletion when moving to partially overlapping chunk and enable more, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 371c560 158/310: Bump version and remove warning - save is now reliable., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf c68c34e 160/310: Add vlf-application customization which refines control over when, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf a0cafa7 161/310: Explicitly offer vlf-prefix-map so user can easily define another prefix, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf ea46386 168/310: Don't apply VLF by default over image and pdf files., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 2470fc0 181/310: Fix vlf-shift-undo-list to reverse resulting list., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 161a4ec 184/310: Prevent inserting of too small file regions for GNU Emacs later than, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 95e6259 188/310: Add convenience macro to disable VLF application during execution of,
Stefan Monnier <=
- [elpa] externals/vlf 66db665 189/310: Fix follow functionality and explicitly set variable as buffer local., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 38e8f6c 199/310: Update file size when moving to end of buffer., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 47c154c 194/310: Fix detection of good chunk start., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 1a1ce27 212/310: Add progress reporters for the optimized part of line search., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf e747de4 204/310: Unify and optimize deletion., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 9510c70 215/310: Retry decoding when the initial attempt seems wrong., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 5c604c4 211/310: Optimize vlf-goto-line not to decode batches as long as possible., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf a71ee32 216/310: Skip adjustment in some cases of overlapping chunk., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf b235cf9 224/310: Execute vlf-after-batch-functions hook even on user quit command before, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 6bb60b7 225/310: Fix hexl scroll up called from scroll down behavior., Stefan Monnier, 2020/11/28