]> code.delx.au - gnu-emacs/blobdiff - lisp/hexl.el
* emacs-lisp/package.el (package-untar-buffer): Handle problematic tarfile content...
[gnu-emacs] / lisp / hexl.el
index db4f3319b791d6d5756e3f81367de1d46d65e1c2..7dd398079559c93a58250e1cd1b5446bc4d3610e 100644 (file)
@@ -41,7 +41,7 @@
 ;;; Code:
 
 (require 'eldoc)
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
 
 ;;
 ;; vars here
@@ -57,7 +57,8 @@
                  (const 16)
                  (const 32)
                  (const 64))
-  :group 'hexl)
+  :group 'hexl
+  :version "24.3")
 
 (defcustom hexl-program "hexl"
   "The program that will hexlify and dehexlify its stdin.
@@ -221,7 +222,7 @@ as that will override any bit grouping options set here."
      (2 'hexl-ascii-region t t)))
   "Font lock keywords used in `hexl-mode'.")
 
-(defun hexl-rulerise (string bits)
+(defun hexl-rulerize (string bits)
   (let ((size (/ bits 4)) (strlen (length string)) (pos 0) (ruler ""))
     (while (< pos strlen)
       (setq ruler (concat ruler " " (substring string pos (+ pos size))))
@@ -233,7 +234,7 @@ as that will override any bit grouping options set here."
    (lambda (bits)
      (cons bits
            (concat " 87654321  "
-                   (hexl-rulerise "00112233445566778899aabbccddeeff" bits)
+                   (hexl-rulerize "00112233445566778899aabbccddeeff" bits)
                    "  0123456789abcdef")))
    '(8 16 32 64)))
 ;; routines
@@ -419,8 +420,7 @@ You can use \\[hexl-find-file] to visit a file in Hexl mode.
                                   " \\(?: .+\n[a-f0-9]+: \\)?"))
              textre))
         bound noerror count))
-    (let ((isearch-search-fun-function nil))
-      (isearch-search-fun))))
+    (isearch-search-fun-default)))
 
 (defvar hexl-in-save-buffer nil)
 
@@ -462,7 +462,7 @@ and edit the file in `hexl-mode'."
     (let ((completion-ignored-extensions nil))
       (read-file-name "Filename: " nil nil 'ret-must-match))))
   ;; Ignore the user's setting of default major-mode.
-  (letf (((default-value 'major-mode) 'fundamental-mode))
+  (cl-letf (((default-value 'major-mode) 'fundamental-mode))
     (find-file-literally filename))
   (if (not (eq major-mode 'hexl-mode))
       (hexl-mode)))
@@ -963,11 +963,7 @@ CH must be a unibyte character whose value is between 0 and 255."
       (error "Invalid character 0x%x -- must be in the range [0..255]" ch))
   (let ((address (hexl-current-address t)))
     (while (> num 0)
-      (let ((hex-position
-            (+ (* (/ address 16) (hexl-line-displen))
-               10 (point-min)
-               (* 2 (% address 16))
-               (/ (% address 16) 2)))
+      (let ((hex-position (hexl-address-to-marker address))
            (ascii-position
             (+ (* (/ address 16) (hexl-line-displen))
                 (hexl-ascii-start-column)