1
0
mirror of https://github.com/m00natic/vlfi.git synced 2025-01-18 12:05:31 +00:00

Plug option for vlf when opening files on package load.

This commit is contained in:
Andrey Kotlarski 2013-01-13 15:24:56 +02:00
parent e740b91bb6
commit 2564c9af77
2 changed files with 2 additions and 36 deletions

View File

@ -2,14 +2,3 @@
An Emacs mode that allows viewing files in chunks. This is a fork
that builds on the GNU ELPA vlf.el.
* Usage tips
When opening file, by default Emacs checks its size against
`large-file-warning-threshold' and if larger asks for confirmation.
To add vlf as an option in these cases:
#+BEGIN_SRC emacs-lisp
(if (fboundp 'vlf-if-file-too-large)
(fset 'abort-if-file-too-large 'vlf-if-file-too-large))
#+END_SRC

27
vlf.el
View File

@ -185,8 +185,6 @@ With FROM-END prefix, view from the back."
(eval-after-load "dired"
'(define-key dired-mode-map "V" 'dired-vlf))
;;; use this to hijack `abort-if-file-too-large'
;;;###autoload
(defun vlf-if-file-too-large (size op-type filename)
"If file SIZE larger than `large-file-warning-threshold', \
allow user to view file with `vlf', open it normally or abort.
@ -210,29 +208,8 @@ OP-TYPE specifies the file operation being performed over FILENAME."
((memq char '(?a ?A))
(error "Aborted"))))))
;;;; ChangeLog:
;; 2012-11-29 Sam Steingold <sds@gnu.org>
;;
;; hook into dired
;;
;; 2012-06-17 Chong Yidong <cyd@gnu.org>
;;
;; vlf.el: Improve commentary.
;;
;; 2012-06-15 Sam Steingold <sds@gnu.org>
;;
;; fix vlf-change-batch-size binding
;;
;; 2012-06-14 Sam Steingold <sds@gnu.org>
;;
;; complete rewrite by Sam Steingold
;;
;; 2012-06-14 Sam Steingold <sds@gnu.org>
;;
;; View Large Files from Mathias Dahl
;;
;;; hijack `abort-if-file-too-large'
(fset 'abort-if-file-too-large 'vlf-if-file-too-large)
(provide 'vlf)