Dmitry Gutov [Mon, 12 Jan 2015 17:06:31 +0000 (20:06 +0300)]
Split company--process-candidates into -pre and -post
* Call the -pre function before saving to cache.
* Copy the candidates list first thing inside the -post function.
* Replace `company-apply-predicate' with `cl-delete-if-not': it's faster.
Andrey Kotlarski [Thu, 1 Jan 2015 18:35:15 +0000 (20:35 +0200)]
* packages/vlf: Version 1.7
* vlf.el (hexl-bits): Declare.
(vlf-query-replace): New autoload.
(vlf-mode-map): Add key for `vlf-query-replace`.
(vlf-mode): Show VLF info in mode-line instead in buffer name.
Fix hexl-mode switch within read-only buffer.
(vlf-next-batch, vlf-prev-batch, vlf-set-batch-size)
(vlf-beginning-of-file, vlf-end-of-file, vlf-jump-to-chunk):
Adjust hexl-mode tune.
(vlf-hexl-mode-exit): New advice.
(vlf-move-to-batch): Don't pass `minimal` flag.
* vlf-write.el (vlf-save-in-place): New user option.
(vlf-write): Improve speed of remote file save.
(vlf-file-shift-back, vlf-shift-batch, vlf-file-shift-forward)
(vlf-shift-batches): Add optional file parameter.
* vlf-tune.el (vlf-tune-max): Fix default value in case RAM is
improperly calculated.
(vlf-tune-step): Refine.
(vlf-tune-write-bps, vlf-tune-hexl-bps, vlf-tune-dehexlify-bps):
Use global variables.
(vlf-start-pos, hexl-bits, hexl-max-address, hexl-line-displen)
(dehexlify-buffer): Declare.
(vlf-tune-copy-profile, vlf-hexl-adjust-addresses): New
functions.
(vlf-tune-initialize-measurement): Use global vlf-tune-max and
vlf-tune-step values.
(vlf-tune-insert-file-contents-literally, vlf-tune-write): Add
optional file parameter.
(vlf-tune-hexlify): Set hexl-max-address. Adjust line addresses
according to global position in file.
(vlf-tune-dehexlify): Use `dehexlify-buffer`.
(vlf-tune-get-value, vlf-tune-score): Fix fallback constants.
(vlf-tune-linear): Search only known measures.
(vlf-tune-batch): Add optional file parameter. Tune
conservatively for remote files.
(vlf-tune-optimal-load): Fix possibly incorrect value for minimum
boundary.
* vlf-setup.el: Rename vlf-integrate.el.
* vlf-search.el (hexl-bits): Declare.
(vlf-re-search): Add optional `highlight` parameter. Improve
precision where next chunk should start.
(vlf-goto-match): Simplify.
(vlf-re-search-forward, vlf-re-search-backward): Adjust
`vlf-re-search` calls. Restore batch size on interrupt.
(vlf-goto-line): Disable using literary insert because doesn't
work for all encodings.
(vlf-goto-line-hexl): New specialization.
(vlf-query-replace): New command.
* vlf-occur.el (hexl-bits): Declare.
(vlf-occur-visit): Enable multi-line matches. Copy profiling info
when opening new buffer.
(vlf-occur-other-buffer): Use `vlf-tune-copy-profile` to move vlf
profiling info around.
(vlf-occur): Use another buffer when undo information is present.
(vlf-build-occur): Enable multi-line matches. Count lines
separately. Be more precise on boundary line matches. Fix
last batch overlap.
(vlf-occur-save, vlf-occur-load): Support multi-line matches.
* vlf-ediff.el (tramp-verbose): Declare.
(vlf-next-chunk, vlf-prev-chunk): Don't pass minimal flag on
insert.
(vlf-ediff-next): Lower tramp verbosity. Don't update buffer name.
* vlf-base.el
(vlf-before-chunk-update, vlf-after-chunk-update): Rename.
(hexl-bits): Declare.
(vlf-verify-size): Add optional file parameter.
(vlf-update-buffer-name): Remove.
(vlf-move-to-chunk): Remove `minimal` parameter. Force modulo of
hexl-bits chunk boundaries when hexl-mode is active.
(vlf-move-to-chunk-1): Use `vlf-move-to-chunk-2` in more cases.
(vlf-move-to-chunk-2): Skip boundary adjustments when possible.
Use literary insert when hexl-mode is active.
(vlf-insert-file-contents): Minor adjustment.
(vlf-adjust-start): Don't profile micro inserts.
(vlf-byte-position): New function.
João Távora [Tue, 16 Dec 2014 10:10:31 +0000 (10:10 +0000)]
Fix margin calculation yet again.
For scaled char widths the margin width, in columns, also has to be
scaled accordingly.
* darkroom.el (darkroom-verbose): New variable.
(darkroom--window-width): New function.
(darkroom-guess-margins): Use it.
(darkroom--reset-margins): Cleanup.
João Távora [Fri, 12 Dec 2014 12:18:00 +0000 (12:18 +0000)]
Redesign setting of margins, which now works per-window
`darkroom-tentative-mode' is now broken, but the rest now works
better.
* darkroom.el (darkroom-margins): New semantics for function value.
(darkroom--real-window-width): Compensate for margins that might
already be there.
(darkroom--guess-margins-statistics-cache): New variable.
(darkroom-guess-margins): Use a cache.
(darkroom--compute-margins): Take WINDOW aprameter.
(darkroom--buffer-margins): Removed.
(darkroom--set-margins): Redesigned.
(darkroom--reset-margins): New function.
(darkroom-increase-margins): Unimplement.
(darkroom--saved-variables, darkroom--saved-state): New variables.
(darkroom--turn-on): Redesign.
(darkroom--turn-off): Redesign.
(darkroom--maybe-enable): Check for `darkroom--saved-state'.
João Távora [Thu, 11 Dec 2014 11:37:10 +0000 (11:37 +0000)]
Attempt a clearer design of modes
* darkroom.el (darkroom--turn-on): New function.
(darkroom--tentative-mode-driving): Removed this.
(darkroom-mode): Use new `darkroom--turn-on' and
`darkroom--turn-off'.
(darkroom-tentative-mode): Assert that no `darkroom-mode' and
`darkroom-tentative-mode' are mixed.
(darkroom--turn-off): New function.
João Távora [Thu, 11 Dec 2014 11:20:30 +0000 (11:20 +0000)]
Corrections after another review iteration with Rasmus
* darkroom.el (darkroom-margins): New default.
(darkroom-margins): Tweak docstring.
(darkroom-margins): Better type spec.
(darkroom-margins-if-failed-guess): New defcustom.
(darkroom--real-window-width): New function.
(darkroom-guess-margins): Simplified.
(darkroom--compute-margins)
(darkroom--saved-mode-line-format)
(darkroom--saved-header-line-format, darkroom--saved-margins): Add
docstring.
(darkroom-mode): Added an assertion.
(darkroom--tentative-mode-driving): New variable.
(darkroom--maybe-enable): Use `darkroom--tentative-mode-driving'
(darkroom-mode): Attempt to ensure `darkroom--set-margins' always
happens after `darkroom--maybe-enable' in
`window-configuration-change-hook'.
* darkroom.el: Require 'cl-lib
(darkroom-guess-margins): New function for putting in
`darkroom-margins'. But broken due to `window-width' not being
suitable probably.
(darkroom-compute-margins): Redesigned.
(darkroom-set-margins): Don't `darkroom-compute-margins'
(darkroom-mode): Reordered statements.
João Távora [Mon, 8 Dec 2014 20:35:27 +0000 (20:35 +0000)]
Tidy up margin calculation
* darkroom.el (darkroom-compute-margins): Renamed from `darkroom-margins'.
(darkroom-buffer-margins): New variable.
(darkroom-set-margins): Redesign. Set `darkroom-buffer-margins'.
(darkroom-increase-margins): Redesign.
(darkroom-mode-map): Fix whitespace.
(darkroom-mode): Use `set-mark-local-variable'
(darkroom-mode): Save and restore current margins.
(darkroom-tentative-mode): Fix whitespace.
João Távora [Mon, 8 Dec 2014 19:48:25 +0000 (19:48 +0000)]
Integrate another comment from Rasmus
* darkroom.el (darkroom-margin-increment): New defcustom.
(darkroom-increase-margins): Take a parameter.
(darkroom-decrease-margins): Use `darkroom-increase-margins'