[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vlf 5dd9e2c 281/310: Adjust address parts of hexlified
From: |
Stefan Monnier |
Subject: |
[elpa] externals/vlf 5dd9e2c 281/310: Adjust address parts of hexlified buffer according to vlf-start-pos. |
Date: |
Sat, 28 Nov 2020 00:33:32 -0500 (EST) |
branch: externals/vlf
commit 5dd9e2cd02d56118c7cb28aa2fa43fcc512fc79d
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>
Adjust address parts of hexlified buffer according to vlf-start-pos.
---
vlf-tune.el | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/vlf-tune.el b/vlf-tune.el
index a098461..6498ef7 100644
--- a/vlf-tune.el
+++ b/vlf-tune.el
@@ -171,13 +171,27 @@ FILE-NAME if given is to be used instead of
`buffer-file-name'."
(or (file-remote-p file) ;writing to remote files can include network
copying
(vlf-tune-add-measurement vlf-tune-write-bps size time))))
+(defun vlf-hexl-adjust-addresses ()
+ "Adjust hexl address indicators according to `vlf-start-pos'."
+ (let ((pos (point))
+ (address vlf-start-pos))
+ (goto-char (point-min))
+ (while (re-search-forward "^[0-9a-f]+" nil t)
+ (replace-match (format "%08x" address))
+ (setq address (+ address hexl-bits)))
+ (goto-char pos)))
+
(defun vlf-tune-hexlify ()
"Activate `hexl-mode' and save time it takes."
- (let ((time (car (vlf-time (hexlify-buffer)))))
+ (let* ((no-adjust (zerop vlf-start-pos))
+ (time (car (vlf-time (hexlify-buffer)
+ (or no-adjust
+ (vlf-hexl-adjust-addresses))))))
(setq hexl-max-address (+ (* (/ (1- (buffer-size))
(hexl-line-displen)) 16) 15))
- (vlf-tune-add-measurement vlf-tune-hexl-bps
- hexl-max-address time)))
+ (or no-adjust
+ (vlf-tune-add-measurement vlf-tune-hexl-bps
+ hexl-max-address time))))
(defun vlf-tune-dehexlify ()
"Exit `hexl-mode' and save time it takes."
- [elpa] externals/vlf 48a014f 250/310: Fix write measuring and endless loop in nearby approximation., (continued)
- [elpa] externals/vlf 48a014f 250/310: Fix write measuring and endless loop in nearby approximation., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf ee7409b 254/310: Tune batch size in more cases., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 5651ee3 252/310: Rename vlf-tune-optimal to vlf-tune-batch., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 06b4f85 262/310: Respect disabled tune settings and move custom options., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 199209f 263/310: Fix vlf-tune-optimal-load with no optional arguments supplied., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 023ee70 267/310: Declare hexl functions to please byte compiler., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf c3a308c 271/310: Optimize save performance over the temp file if such is used. Add, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf ce13609 278/310: Fix vlf-ediff at the borders of hexl buffers., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf f43ada1 282/310: Fix byte compilation warnings., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 305d802 280/310: Use shared profiling info for encode, write and hexl operations., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 5dd9e2c 281/310: Adjust address parts of hexlified buffer according to vlf-start-pos.,
Stefan Monnier <=
- [elpa] externals/vlf 68d6c1b 289/310: vlf-occur changes:, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 0fa6248 288/310: Optimize unconditional chunk loading and prefer it in more cases of, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf bd5f9ca 286/310: Back to using per buffer profiling for encode speed., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 726f50b 294/310: Fix byte-compilation warnings on install., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf eaa3629 299/310: Fix cursor position after search, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf ac1aa16 296/310: Standard naming for chunk update hooks., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf cc02f25 306/310: Fix typos, Stefan Monnier, 2020/11/28