;ELC   
;;; compiled by rms@psilocin.gnu.ai.mit.edu on Mon Jun 10 17:38:37 1996
;;; from file /home/fsf/rms/e19/lisp/hexl.el
;;; emacs version 19.31.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.29")))
    (error "`hexl.el' was compiled for Emacs 19.29 or later"))


#@157 The program that will hexlify and dehexlify its stdin.
`hexl-program' will always be concatenated with `hexl-options'
and "-de" when dehexlifying a buffer.
(defvar hexl-program "hexl" (#$ . 468))
#@98 If your emacs can handle ISO characters, this should be set to
"-iso" otherwise it should be "".
(defvar hexl-iso "" (#$ . 670))
#@47 Options to hexl-program that suit your needs.
(defvar hexl-options (format "-hex %s" hexl-iso) (#$ . 805))
#@41 The command to use to hexlify a buffer.
(defvar hexlify-command (format "%s%s %s" exec-directory hexl-program hexl-options) (#$ . 918))
#@43 The command to use to unhexlify a buffer.
(defvar dehexlify-command (format "%s%s -de %s" exec-directory hexl-program hexl-options) (#$ . 1060))
#@34 Maximum offset into hexl buffer.
(defvar hexl-max-address 0 (#$ . 1211))
(byte-code "! BBBBBBB" [boundp hexl-mode-map nil current-load-list hexl-mode-old-local-map hexl-mode-old-mode-name hexl-mode-old-major-mode hexl-mode-old-write-contents-hooks hexl-mode-old-require-final-newline hexl-mode-old-syntax-table] 2)
#@3278 \<hexl-mode-map>
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.
(defalias 'hexl-mode #[(&optional arg) "= !  `S	\nm( o( S=B B  SΥ_\\O  S \n!!!,! !!!!  !!#\"!\"!'&!'!$!$!" [major-mode hexl-mode error "You are already in hexl mode" buffer-modified-p t nil max-address original-point inhibit-read-only modified arg 1 buffer-size 68 16 15 hexlify-buffer set-buffer-modified-p make-local-variable hexl-max-address hexl-goto-address 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 hexl-mode-old-syntax-table syntax-table set-syntax-table standard-syntax-table hexl-mode-old-write-contents-hooks write-contents-hooks add-hook hexl-save-buffer hexl-mode-old-require-final-newline require-final-newline make-local-hook after-revert-hook hexl-after-revert-hook change-major-mode-hook hexl-maybe-dehexlify-buffer run-hooks hexl-mode-hook] 5 (#$ . 1563) "p"])
(defalias 'hexl-after-revert-hook #[nil " !" [hexlify-buffer set-buffer-modified-p nil] 2])
(byte-code "! B" [boundp hexl-in-save-buffer nil current-load-list] 2)
#@66 Save a hexl format buffer as binary in visited file if modified.
(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 (#$ . 6034) nil])
#@106 Edit file FILENAME in hexl-mode.
Switch to a buffer visiting file FILENAME, creating one in none exists.
(defalias 'hexl-find-file #[(filename) "=\f = \f! \f!=?!  " [system-type ms-dos windows-nt find-file-binary filename find-file major-mode hexl-mode] 2 (#$ . 6554) "fFilename: "])
#@79 Exit Hexl mode, returning to previous mode.
With arg, don't unhexlify buffer.
(defalias 'hexl-mode-exit #[(&optional arg) "=\n &   T \"!b+##\n!! " [arg 1 buffer-modified-p t hexl-current-address original-point inhibit-read-only modified dehexlify-buffer remove-hook write-contents-hooks hexl-save-buffer set-buffer-modified-p after-revert-hook hexl-after-revert-hook change-major-mode-hook hexl-maybe-dehexlify-buffer hexl-mode-old-write-contents-hooks hexl-mode-old-require-final-newline require-final-newline hexl-mode-old-mode-name mode-name use-local-map hexl-mode-old-local-map set-syntax-table hexl-mode-old-syntax-table hexl-mode-old-major-mode major-mode force-mode-line-update] 4 (#$ . 6863) "p"])
#@72 Convert a hexl format buffer to binary.
Ask the user for confirmation.
(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-hooks hexl-save-buffer set-buffer-modified-p] 3 (#$ . 7636)])
#@30 Return current hexl-address.
(defalias 'hexl-current-address #[(&optional validate) "`ZW  ! `_\fY, \fZ3 \fʥZ˥\\*" [68 11 0 hexl-address current-column validate error "Point is not on a character in the file" 16 41 5 2] 5 (#$ . 8038) nil])
#@28 Return marker for ADDRESS.
(defalias 'hexl-address-to-marker #[(address) "__ĥ\\\\" [address 16 68 5 2 11] 3 (#$ . 8316) "nAddress: "])
#@81 Goto hexl-mode (decimal) address ADDRESS.
Signal error if ADDRESS out of range.
(defalias 'hexl-goto-address #[(address) "W\f \nV !!b" [address 0 hexl-max-address error "Out of hexl region." hexl-address-to-marker] 2 (#$ . 8468) "nAddress: "])
#@96 Go to hexl-mode address (hex string) HEX-ADDRESS.
Signal error if HEX-ADDRESS is out of range.
(defalias 'hexl-goto-hex-address #[(hex-address) "\n!!" [hexl-goto-address hexl-hex-string-to-integer hex-address] 3 (#$ . 8730) "sHex Address: "])
#@40 Return decimal integer for HEX-STRING.
(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 (#$ . 8982) "sHex number: "])
#@42 Return decimal integer for OCTAL-STRING.
(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 (#$ . 9224) "sOctal number: "])
#@62 Move to left ARG bytes (right if ARG negative) in hexl-mode.
(defalias 'hexl-backward-char #[(arg) " \nZ!" [hexl-goto-address hexl-current-address arg] 3 (#$ . 9475) "p"])
#@59 Move right ARG bytes (left if ARG negative) in hexl-mode.
(defalias 'hexl-forward-char #[(arg) " \n\\!" [hexl-goto-address hexl-current-address arg] 3 (#$ . 9656) "p"])
#@63 Move to left ARG shorts (right if ARG negative) in hexl-mode.
(defalias 'hexl-backward-short #[(arg) " Wj [VQ \n\n\"5 \nV- !J \n\"J \nVF !J \n\\S \nVb ! \n\" V \n\n\" \n\" \nĚ \nZ !Sk \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 (#$ . 9834) "p"])
#@60 Move right ARG shorts (left if ARG negative) in hexl-mode.
(defalias 'hexl-forward-short #[(arg) "	[!" [hexl-backward-short arg] 2 (#$ . 10282) "p"])
#@62 Move to left ARG words (right if ARG negative) in hexl-mode.
(defalias 'hexl-backward-word #[(arg) " Wj [VQ \n\n\"5 \nV- !J \n\"J \nVF !J \n\\S \nVb ! \n\" V \n\n\" \n\" \nĚ \nZ !Sk \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 (#$ . 10440) "p"])
#@59 Move right ARG words (left if ARG negative) in hexl-mode.
(defalias 'hexl-forward-word #[(arg) "	[!" [hexl-backward-word arg] 2 (#$ . 10887) "p"])
#@153 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.
(defalias 'hexl-previous-line #[(arg) "	[!" [hexl-next-line arg] 2 (#$ . 11043) "p"])
#@156 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.
(defalias 'hexl-next-line #[(arg) " \n_\\\nW  \fW  ! æN \fV8 æ\fæW8 N \fVN !\" æ\\\f)!" [hexl-goto-address hexl-current-address arg 16 address 0 message "Out of hexl region." hexl-max-address logand -16] 4 (#$ . 11290) "p"])
#@158 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.
(defalias 'hexl-beginning-of-buffer #[(arg) "`!\nS!" [push-mark hexl-goto-address arg] 2 (#$ . 11718) "p"])
#@37 Go to `hexl-max-address' minus ARG.
(defalias 'hexl-end-of-buffer #[(arg) "`!\nSZ!" [push-mark hexl-goto-address hexl-max-address arg] 3 (#$ . 11993) "p"])
#@38 Goto beginning of line in hexl mode.
(defalias 'hexl-beginning-of-line #[nil "`_\\b" [68 11] 2 (#$ . 12160) nil])
#@32 Goto end of line in hexl mode.
(defalias 'hexl-end-of-line #[nil " \"V \f)!" [hexl-goto-address logior hexl-current-address 15 address hexl-max-address] 5 (#$ . 12285) nil])
#@76 Scroll hexl buffer window upward ARG lines; or near full window if no ARG.
(defalias 'hexl-scroll-down #[(arg) "  S ![!" [arg window-height prefix-numeric-value hexl-scroll-up] 2 (#$ . 12477) "P"])
#@76 Scroll hexl buffer window upward ARG lines; or near full window if no ARG.
(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 (#$ . 12694) "P"])
#@33 Go to beginning of 1k boundary.
(defalias 'hexl-beginning-of-1k-page #[nil " \"!" [hexl-goto-address logand hexl-current-address -1024] 4 (#$ . 13054) nil])
#@27 Go to end of 1k boundary.
(defalias 'hexl-end-of-1k-page #[nil " \"V \f)!" [hexl-goto-address logior hexl-current-address 1023 address hexl-max-address] 5 (#$ . 13222) nil])
#@39 Go to beginning of 512 byte boundary.
(defalias 'hexl-beginning-of-512b-page #[nil " \"!" [hexl-goto-address logand hexl-current-address -512] 4 (#$ . 13414) nil])
#@33 Go to end of 512 byte boundary.
(defalias 'hexl-end-of-512b-page #[nil " \"V \f)!" [hexl-goto-address logior hexl-current-address 511 address hexl-max-address] 5 (#$ . 13589) nil])
#@160 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
(defalias 'hexl-quoted-insert #[(arg) " \n\"" [hexl-insert-char read-quoted-char arg] 3 (#$ . 13789) "p"])
#@86 Convert a binary buffer to hexl format.
This discards the buffer's undo information.
(defalias 'hexlify-buffer #[nil " ! !Ɖed\n$+" [buffer-undo-list y-or-n-p "Converting to hexl format discards undo info; ok? " error "Aborted" nil t binary-process-input binary-process-output shell-command-on-region hexlify-command] 5 (#$ . 14064) nil])
#@86 Convert a hexl format buffer to binary.
This discards the buffer's undo information.
(defalias 'dehexlify-buffer #[nil " ! !ed\n$+" [buffer-undo-list y-or-n-p "Converting from hexl format discards undo info; ok? " error "Aborted" nil t binary-process-input binary-process-output shell-command-on-region dehexlify-command] 5 (#$ . 14431) nil])
#@44 Return char for ASCII hex digits at point.
(defalias 'hexl-char-after-point #[nil "`f`Tf\"" [hexl-htoi] 3 (#$ . 14804)])
#@37 Hex (char) LH (char) RH to integer.
(defalias 'hexl-htoi #[(lh rh) "	!_!\\" [hexl-hex-char-to-integer lh 16 rh] 3 (#$ . 14933)])
#@60 Take a char and return its value as if it was a hex digit.
(defalias 'hexl-hex-char-to-integer #[(character) "Y X Z\"Y' X' Z+ \")" [character 48 57 logior 32 ch 97 102 87 error "Invalid hex digit `%c'."] 4 (#$ . 15073)])
#@62 Take a char and return its value as if it was a octal digit.
(defalias 'hexl-oct-char-to-integer #[(character) "Y X Z\"" [character 48 55 error "Invalid octal digit `%c'."] 3 (#$ . 15328)])
#@47 Return a displayable string for character CH.
(defalias 'hexl-printable-character #[(ch) "\n  W Y W ǂ1 1 W, Y0 ǂ1 \"" [format "%c" hexl-iso ch 32 127 160 46] 4 (#$ . 15539)])
#@24 Insert this character.
(defalias 'hexl-self-insert-command #[(arg) "	\n\"" [hexl-insert-char last-command-char arg] 3 (#$ . 15747) "p"])
#@38 Insert a character in a hexl buffer.
(defalias 'hexl-insert-char #[(ch num) "!V| \nť_\nŦ_\\\nŦǥ\\\\\nť_\nŦ\\\\\f`\fU9 b!\"c\fb!!c\n=` \nT\n!t yu\nŦu+S )" [hexl-current-address t address num 0 16 68 2 11 52 nil at-ascii-position ascii-position hex-position delete-char format "%02x" ch 1 hexl-printable-character hexl-max-address hexl-goto-address 51] 5 (#$ . 15892)])
#@72 Insert a ASCII char ARG times at point for a given hexadecimal number.
(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 (#$ . 16335) "p"])
#@68 Insert a ASCII char ARG times at point for a given decimal number.
(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 (#$ . 16628) "p"])
#@66 Insert a ASCII char ARG times at point for a given octal number.
(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 (#$ . 16916) "p"])
(byte-code " ###################$!!= $!#############5W 5\"#5T5 )####@ #A #B #C #D #E #F #G #H #I #J K #L #M #N #O #P #Q #R #S T #U #V #W X #Y #Z #[ #\\ ] #^ _ #` #a #b c #d #e #f #g #h #i #j #k #l #m #n #o #p #q #r #s t #u v #w x #y z #{ #| } #~ #" [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 [prior] hexl-scroll-down [home] hexl-beginning-of-buffer [deletechar] undefined [deleteline] [insertline] [S-delete] "" "" hexl-beginning-of-line "" "" "" 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-end-of-buffer "" hexl-mode-exit "[" hexl-beginning-of-1k-page "]" hexl-end-of-1k-page "" "" hexl-save-buffer ""] 6)
