branch: externals/dired-preview commit e30b859ba9bbdcfafe1027dcca6672cd763eddfd Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Remove needless option for hexl-mode We simply document that C-c C-c toggles it. --- README.org | 4 ++++ dired-preview.el | 12 +----------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/README.org b/README.org index 209a372b20..a161f70870 100644 --- a/README.org +++ b/README.org @@ -95,6 +95,10 @@ PDFs, and EPUBs. [ In the near future, we may find ways to quickly preview any file type without affecting the performance of Emacs. ] +Binary files are previewed in ~hexl-mode~ mode. This is more useful +than the raw, unreadable output. The user can disable this mode by +typing =C-c C-c=. + I took inspiration for ~dired-preview~ from the now unmaintained ~peep-dired~ package by Adam Sokolnicki: <https://github.com/asok/peep-dired>. My original plan was to volunteer to maintain ~peep-dired~ but I diff --git a/dired-preview.el b/dired-preview.el index 2acc917afd..6ca1c7afe4 100644 --- a/dired-preview.el +++ b/dired-preview.el @@ -109,15 +109,6 @@ details." :group 'dired-preview :type 'natnum) -(defcustom dired-preview-binary-as-hexl t - "Whether non-text (binary) files should be previewed in `hexl-mode'. - -Irrespective of this option, you can switch between raw/hexl -views at any time using `dired-preview-hexl-toggle'." - :group 'dired-preview - :package-version '(dired-preview . "0.2.0") - :type 'boolean) - (defvar dired-preview--buffers nil "List with buffers of previewed files.") @@ -295,8 +286,7 @@ The size of the leading chunk is specified by ;; We create a buffer with a partial preview (buffer-disable-undo) (insert-file-contents file nil 1 dired-preview-chunk-size 'replace) - (when (and (eq buffer-file-coding-system 'no-conversion) - dired-preview-binary-as-hexl) + (when (eq buffer-file-coding-system 'no-conversion) (hexl-mode)) (dired-preview--add-truncation-message) (read-only-mode t)