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))
|
'(vlf-application 'dont-ask))
|
||||||
#+END_EXAMPLE
|
#+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
|
** Keymap
|
||||||
|
|
||||||
All VLF operations are grouped under the *C-c C-v* prefix by default.
|
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))
|
((memq char '(?a ?A))
|
||||||
(error "Aborted"))))))))
|
(error "Aborted"))))))))
|
||||||
|
|
||||||
(eval-after-load "etags"
|
;; disable for some functions
|
||||||
'(progn
|
(defmacro vlf-disable-for-function (func file)
|
||||||
(defadvice tags-verify-table (around vlf-tags-verify-table
|
"Build advice to disable VLF during execution of FUNC\
|
||||||
compile activate)
|
defined in FILE."
|
||||||
"Temporarily disable `vlf-mode'."
|
`(eval-after-load ,file
|
||||||
(let ((vlf-application nil))
|
'(defadvice ,func (around ,(intern (concat "vlf-"
|
||||||
ad-do-it))
|
(symbol-name func)))
|
||||||
|
compile activate)
|
||||||
|
"Temporarily disable `vlf-mode'."
|
||||||
|
(let ((vlf-application nil))
|
||||||
|
ad-do-it))))
|
||||||
|
|
||||||
(defadvice tag-find-file-of-tag-noselect
|
(vlf-disable-for-function tags-verify-table "etags")
|
||||||
(around vlf-tag-find-file-of-tag compile activate)
|
(vlf-disable-for-function tag-find-file-of-tag-noselect "etags")
|
||||||
"Temporarily disable `vlf-mode'."
|
(vlf-disable-for-function helm-etags-create-buffer "helm-tags")
|
||||||
(let ((vlf-application nil))
|
|
||||||
ad-do-it))))
|
|
||||||
|
|
||||||
|
;; dired
|
||||||
(defun dired-vlf ()
|
(defun dired-vlf ()
|
||||||
"In Dired, visit the file on this line in VLF mode."
|
"In Dired, visit the file on this line in VLF mode."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user