mirror of
https://github.com/m00natic/vlfi.git
synced 2025-01-18 20:10:47 +00:00
Add convenience macro to disable VLF application during execution of
specific function.
This commit is contained in:
parent
516584e6c9
commit
95e625938e
14
README.org
14
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.
|
||||
|
@ -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))
|
||||
;; 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))))
|
||||
|
||||
(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))))
|
||||
(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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user