;ELC ;;; compiled by rms@mole.gnu.ai.mit.edu on Wed Jul 20 01:41:18 1994 ;;; from file /home/fsf/rms/e19/lisp/hexl.el ;;; emacs version 19.25.90.2. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "`/home/fsf/rms/e19/lisp/hexl.el' was compiled for Emacs 19")) (defvar hexl-program "hexl" "\ The program that will hexlify and de-hexlify its stdin. `hexl-program' will always be concatenated with `hexl-options' and \"-de\" when dehexlfying a buffer.") (defvar hexl-iso "" "\ If your emacs can handle ISO characters, this should be set to \"-iso\" otherwise it should be \"\".") (defvar hexl-options (format "-hex %s" hexl-iso) "\ Options to hexl-program that suit your needs.") (defvar hexlify-command (format "%s%s %s" exec-directory hexl-program hexl-options) "\ The command to use to hexlify a buffer.") (defvar dehexlify-command (format "%s%s -de %s" exec-directory hexl-program hexl-options) "\ The command to use to unhexlify a buffer.") (defvar hexl-max-address 0 "\ Maximum offset into hexl buffer.") (byte-code "!‡" [boundp hexl-mode-map nil] 2) (defalias 'hexl-mode #[(&optional arg) "=\n! !  !! \n ! !\"!!\" `S=jj Sܥ_\\{ S !!+" [major-mode hexl-mode error "You are already in hexl mode." kill-all-local-variables make-local-variable hexl-mode-old-local-map current-local-map use-local-map hexl-mode-map hexl-mode-old-mode-name mode-name "Hexl" hexl-mode-old-major-mode write-contents-hooks add-hook hexl-save-buffer hexl-max-address change-major-mode-hook hexl-maybe-dehexlify-buffer buffer-modified-p t original-point inhibit-read-only modified arg 1 buffer-size 68 16 15 hexlify-buffer set-buffer-modified-p hexl-goto-address] 3 "\ \\ A major mode for editing binary files in hex dump format. This function automatically converts a buffer into the hexl format using the function `hexlify-buffer'. Each line in the buffer has an \"address\" (displayed in hexadecimal) representing the offset into the file that the characters on this line are at and 16 characters from the file (displayed as hexadecimal values grouped every 16 bits) and as their ASCII values. If any of the characters (displayed as ASCII characters) are unprintable (control or meta characters) they will be replaced as periods. If `hexl-mode' is invoked with an argument the buffer is assumed to be in hexl format. A sample format: HEX ADDR: 0001 0203 0405 0607 0809 0a0b 0c0d 0e0f ASCII-TEXT -------- ---- ---- ---- ---- ---- ---- ---- ---- ---------------- 00000000: 5468 6973 2069 7320 6865 786c 2d6d 6f64 This is hexl-mod 00000010: 652e 2020 4561 6368 206c 696e 6520 7265 e. Each line re 00000020: 7072 6573 656e 7473 2031 3620 6279 7465 presents 16 byte 00000030: 7320 6173 2068 6578 6164 6563 696d 616c s as hexadecimal 00000040: 2041 5343 4949 0a61 6e64 2070 7269 6e74 ASCII.and print 00000050: 6162 6c65 2041 5343 4949 2063 6861 7261 able ASCII chara 00000060: 6374 6572 732e 2020 416e 7920 636f 6e74 cters. Any cont 00000070: 726f 6c20 6f72 206e 6f6e 2d41 5343 4949 rol or non-ASCII 00000080: 2063 6861 7261 6374 6572 730a 6172 6520 characters.are 00000090: 6469 7370 6c61 7965 6420 6173 2070 6572 displayed as per 000000a0: 696f 6473 2069 6e20 7468 6520 7072 696e iods in the prin 000000b0: 7461 626c 6520 6368 6172 6163 7465 7220 table character 000000c0: 7265 6769 6f6e 2e0a region.. Movement is as simple as movement in a normal emacs text buffer. Most cursor movement bindings are the same (ie. Use \\[hexl-backward-char], \\[hexl-forward-char], \\[hexl-next-line], and \\[hexl-previous-line] to move the cursor left, right, down, and up). Advanced cursor movement commands (ala \\[hexl-beginning-of-line], \\[hexl-end-of-line], \\[hexl-beginning-of-buffer], and \\[hexl-end-of-buffer]) are also supported. There are several ways to change text in hexl mode: ASCII characters (character between space (0x20) and tilde (0x7E)) are bound to self-insert so you can simply type the character and it will insert itself (actually overstrike) into the buffer. \\[hexl-quoted-insert] followed by another keystroke allows you to insert the key even if it isn't bound to self-insert. An octal number can be supplied in place of another key to insert the octal number's ASCII representation. \\[hexl-insert-hex-char] will insert a given hexadecimal value (if it is between 0 and 0xFF) into the buffer at the current point. \\[hexl-insert-octal-char] will insert a given octal value (if it is between 0 and 0377) into the buffer at the current point. \\[hexl-insert-decimal-char] will insert a given decimal value (if it is between 0 and 255) into the buffer at the current point. \\[hexl-mode-exit] will exit hexl-mode. Note: saving the file with any of the usual Emacs commands will actually convert it back to binary format while saving. You can use \\[hexl-find-file] to visit a file in hexl-mode. \\[describe-bindings] for advanced commands." "p"]) (byte-code "!‡" [boundp hexl-in-save-buffer nil] 2) (defalias 'hexl-save-buffer #[nil "?c [! ed \n \f q\f\n #\fq Љ * ed| \n # !.`!!Ї" [hexl-in-save-buffer set-buffer-modified-p buffer-modified-p generate-new-buffer " hexl" buffer-name buffer-file-name nil modified end start file-name name buf insert-buffer-substring dehexlify-buffer t buffer-file-type save-buffer kill-buffer message "(No changes need to be saved)"] 8 "\ Save a hexl format buffer as binary in visited file if modified." nil]) (defalias 'hexl-find-file #[(filename) "= ! ! =? " [system-type ms-dos find-file-binary filename find-file major-mode hexl-mode] 2 "\ Edit file FILENAME in hexl-mode. Switch to a buffer visiting file FILENAME, creating one in none exists." "fFilename: "]) (defalias 'hexl-mode-exit #[(&optional arg) "=\n& T \"! b+ ! " [arg 1 buffer-modified-p t hexl-current-address original-point inhibit-read-only modified dehexlify-buffer remove-hook write-contents-hook hexl-save-buffer set-buffer-modified-p hexl-mode-old-mode-name mode-name use-local-map hexl-mode-old-local-map hexl-mode-old-major-mode major-mode force-mode-line-update] 3 "\ Exit Hexl mode, returning to previous mode. With arg, don't unhexlify buffer." "p"]) (defalias 'hexl-maybe-dehexlify-buffer #[nil "!! T \"! b+" [y-or-n-p "Convert contents back to binary format? " buffer-modified-p t hexl-current-address original-point inhibit-read-only modified dehexlify-buffer remove-hook write-contents-hook hexl-save-buffer set-buffer-modified-p] 3 "\ Convert a hexl format buffer to binary. Ask the user for confirmation."]) (defalias 'hexl-current-address #[nil "`Z`_\fƥZǥ\\*" [68 11 0 hexl-address current-column 16 5 2] 5 "\ Return current hexl-address." nil]) (defalias 'hexl-address-to-marker #[(address) "__ĥ\\\\" [address 16 68 5 2 11] 3 "\ Return marker for ADDRESS." "nAddress: "]) (defalias 'hexl-goto-address #[(address) "W\f\nV!!b" [address 0 hexl-max-address error "Out of hexl region." hexl-address-to-marker] 2 "\ Goto hexl-mode (decimal) address ADDRESS. Signal error if ADDRESS out of range." "nAddress: "]) (defalias 'hexl-goto-hex-address #[(hex-address) "\n!!" [hexl-goto-address hexl-hex-string-to-integer hex-address] 3 "\ Go to hexl-mode address (hex string) HEX-ADDRESS. Signal error if HEX-ADDRESS is out of range." "sHex Address: "]) (defalias 'hexl-hex-string-to-integer #[(hex-string) "\nÚ _\n!!\\\nO )" [0 hex-num hex-string "" 16 hexl-hex-char-to-integer string-to-char 1 nil] 5 "\ Return decimal integer for HEX-STRING." "sHex number: "]) (defalias 'hexl-octal-string-to-integer #[(octal-string) "\nÚ _\n!!\\\nO )" [0 oct-num octal-string "" 8 hexl-oct-char-to-integer string-to-char 1 nil] 5 "\ Return decimal integer for OCTAL-STRING." "sOctal number: "]) (defalias 'hexl-backward-char #[(arg) " \nZ!" [hexl-goto-address hexl-current-address arg] 3 "\ Move to left ARG bytes (right if ARG negative) in hexl-mode." "p"]) (defalias 'hexl-forward-char #[(arg) " \n\\!" [hexl-goto-address hexl-current-address arg] 3 "\ Move right ARG bytes (left if ARG negative) in hexl-mode." "p"]) (defalias 'hexl-backward-short #[(arg) "  Wj [VQ\n\n\"5\nV-!J\n\"J\nVF!J\n\\ S\nVb!\n\" V\n\n\"\n\"\nĚ\nZ! Sk\n)!" [hexl-goto-address hexl-current-address address arg 0 logior 3 hexl-max-address message "End of buffer." 4 logand -4 "Beginning of buffer."] 6 "\ Move to left ARG shorts (right if ARG negative) in hexl-mode." "p"]) (defalias 'hexl-forward-short #[(arg) " [!" [hexl-backward-short arg] 2 "\ Move right ARG shorts (left if ARG negative) in hexl-mode." "p"]) (defalias 'hexl-backward-word #[(arg) "  Wj [VQ\n\n\"5\nV-!J\n\"J\nVF!J\n\\ S\nVb!\n\" V\n\n\"\n\"\nĚ\nZ! Sk\n)!" [hexl-goto-address hexl-current-address address arg 0 logior 7 hexl-max-address message "End of buffer." 8 logand -8 "Beginning of buffer."] 6 "\ Move to left ARG words (right if ARG negative) in hexl-mode." "p"]) (defalias 'hexl-forward-word #[(arg) " [!" [hexl-backward-word arg] 2 "\ Move right ARG words (left if ARG negative) in hexl-mode." "p"]) (defalias 'hexl-previous-line #[(arg) " [!" [hexl-next-line arg] 2 "\ Move vertically up ARG lines [16 bytes] (down if ARG negative) in hexl-mode. If there is byte at the target address move to the last byte in that line." "p"]) (defalias 'hexl-next-line #[(arg) " \n_\\\nW \fW ! æN\fV8æ\fæW8N\fVN!\" æ\\\f)!" [hexl-goto-address hexl-current-address arg 16 address 0 message "Out of hexl region." hexl-max-address logand -16] 4 "\ Move vertically down ARG lines [16 bytes] (up if ARG negative) in hexl-mode. If there is no byte at the target address move to the last byte in that line." "p"]) (defalias 'hexl-beginning-of-buffer #[(arg) "`!\nS!" [push-mark hexl-goto-address arg] 2 "\ Move to the beginning of the hexl buffer. Leaves `hexl-mark' at previous position. With prefix arg N, puts point N bytes of the way from the true beginning." "p"]) (defalias 'hexl-end-of-buffer #[(arg) "`!\n SZ!" [push-mark hexl-goto-address hexl-max-address arg] 3 "\ Go to `hexl-max-address' minus ARG." "p"]) (defalias 'hexl-beginning-of-line #[nil "`_\\b" [68 11] 2 "\ Goto beginning of line in hexl mode." nil]) (defalias 'hexl-end-of-line #[nil " \" V \f)!" [hexl-goto-address logior hexl-current-address 15 address hexl-max-address] 5 "\ Goto end of line in hexl mode." nil]) (defalias 'hexl-scroll-down #[(arg) " S![!" [arg window-height prefix-numeric-value hexl-scroll-up] 2 "\ Scroll hexl buffer window upward ARG lines; or near full window if no ARG." "P"]) (defalias 'hexl-scroll-up #[(arg) " S!_  \\V* \\W0!: \\!!*" [arg window-height prefix-numeric-value 16 hexl-current-address address movement hexl-max-address 0 message "Out of hexl region." hexl-goto-address recenter] 3 "\ Scroll hexl buffer window upward ARG lines; or near full window if no ARG." "P"]) (defalias 'hexl-beginning-of-1k-page #[nil " \"!" [hexl-goto-address logand hexl-current-address -1024] 4 "\ Goto to beginning of 1k boundry." nil]) (defalias 'hexl-end-of-1k-page #[nil " \" V \f)!" [hexl-goto-address logior hexl-current-address 1023 address hexl-max-address] 5 "\ Goto to end of 1k boundry." nil]) (defalias 'hexl-beginning-of-512b-page #[nil " \"!" [hexl-goto-address logand hexl-current-address -512] 4 "\ Goto to beginning of 512 byte boundry." nil]) (defalias 'hexl-end-of-512b-page #[nil " \" V \f)!" [hexl-goto-address logior hexl-current-address 511 address hexl-max-address] 5 "\ Goto to end of 512 byte boundry." nil]) (defalias 'hexl-quoted-insert #[(arg) " \n\"" [hexl-insert-char read-quoted-char arg] 3 "\ Read next input character and insert it. Useful for inserting control characters. You may also type up to 3 octal digits, to insert a character with that code" "p"]) (defalias 'hexlify-buffer #[nil "ed $*" [nil t binary-process-input binary-process-output shell-command-on-region hexlify-command] 5 "\ Convert a binary buffer to hexl format." nil]) (defalias 'dehexlify-buffer #[nil "ed $*" [t nil binary-process-input binary-process-output shell-command-on-region dehexlify-command] 5 "\ Convert a hexl format buffer to binary." nil]) (defalias 'hexl-char-after-point #[nil "`f`Tf\"" [hexl-htoi] 3 "\ Return char for ASCII hex digits at point."]) (defalias 'hexl-htoi #[(lh rh) " !_ !\\" [hexl-hex-char-to-integer lh 16 rh] 3 "\ Hex (char) LH (char) RH to integer."]) (defalias 'hexl-hex-char-to-integer #[(character) "YXZ\"Y' X' Z- \"!)" [character 48 57 logior 32 ch 97 102 87 error format "Invalid hex digit `%c'."] 5 "\ Take a char and return its value as if it was a hex digit."]) (defalias 'hexl-oct-char-to-integer #[(character) "YXZ\"!" [character 48 55 error format "Invalid octal digit `%c'."] 4 "\ Take a char and return its value as if it was a octal digit."]) (defalias 'hexl-printable-character #[(ch) "\n W Y Wǂ1 1 W, Y0ǂ1 \"" [format "%c" hexl-iso ch 32 127 160 46] 4 "\ Return a displayable string for character CH."]) (defalias 'hexl-self-insert-command #[(arg) " \n\"" [hexl-insert-char last-command-char arg] 3 "\ Insert this character." "p"]) (defalias 'hexl-insert-char #[(ch num) " \nV@!\"c ɥ_ ɦ\\\\b!!c =5 T !\nS)" [hexl-current-address address num 0 delete-char 2 format "%02x" ch 16 68 52 1 hexl-printable-character hexl-max-address hexl-goto-address] 4 "\ Insert a character in a hexl buffer."]) (defalias 'hexl-insert-hex-char #[(arg) "!!V W!  \")" [hexl-hex-string-to-integer read-string "Hex number: " num 255 0 error "Hex number out of range." hexl-insert-char arg] 4 "\ Insert a ASCII char ARG times at point for a given hexadecimal number." "p"]) (defalias 'hexl-insert-decimal-char #[(arg) "!!V W!  \")" [string-to-int read-string "Decimal Number: " num 255 0 error "Decimal number out of range." hexl-insert-char arg] 4 "\ Insert a ASCII char ARG times at point for a given decimal number." "p"]) (defalias 'hexl-insert-octal-char #[(arg) "!!V W!  \")" [hexl-octal-string-to-integer read-string "Octal Number: " num 255 0 error "Decimal number out of range." hexl-insert-char arg] 4 "\ Insert a ASCII char ARG times at point for a given octal number." "p"]) (byte-code " #############!!=i!#############.W.\"#.T.)###########@#A#B#CD#E#F#G#H#I#J#K#LM#N#O#PQ#R#S#T#UV#WX#Y#Z#[\\#]#^#_#`#a#b#c#d#e#f#g#h#i#j#kl#mn#op#qr#st#u#vw#x#" [hexl-mode-map make-sparse-keymap define-key [left] hexl-backward-char [right] hexl-forward-char [up] hexl-previous-line [down] hexl-next-line [M-left] hexl-backward-short [M-right] hexl-forward-short [next] hexl-scroll-up [prev] hexl-scroll-down "" hexl-beginning-of-line "" "" undefined "" hexl-end-of-line "" key-binding char-to-string help-char help-command " " hexl-self-insert-command "\n" " " " " "" "" "" "" hexl-quoted-insert "" "" "" "" 32 ch 127 format "%c" "" hexl-beginning-of-512b-page "" "" "" hexl-insert-decimal-char "" hexl-end-of-512b-page "" "" "" " " "\n" " " "\f" " " "" "" hexl-insert-octal-char "" "" "" "" "" "" "" "" hexl-insert-hex-char "" "a" "b" hexl-backward-word "c" "d" "e" "f" hexl-forward-word "g" hexl-goto-hex-address "h" "i" "j" hexl-goto-address "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "y" "z" "<" hexl-beginning-of-buffer ">" hexl-end-of-buffer "" hexl-mode-exit "[" hexl-beginning-of-1k-page "]" hexl-end-of-1k-page "" "" hexl-save-buffer ""] 6)