• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/

Lines Matching defs:mode

29 ;; This package implements a major mode for editing binary files.  It uses
32 ;; binary. For full instructions, invoke `hexl-mode' on an empty buffer and
33 ;; do M-x `describe-mode'.
82 (defcustom hexl-mode-hook '(hexl-follow-line hexl-activate-ruler)
83 "Normal hook run when entering Hexl mode."
85 :options '(hexl-follow-line hexl-activate-ruler turn-on-eldoc-mode)
90 "Face used in address area of hexl-mode buffer."
95 "Face used in ascii area of hexl-mode buffer."
101 (defvar hexl-mode-map nil)
104 (defvar ruler-mode)
105 (defvar ruler-mode-ruler-function)
106 (defvar hl-line-mode)
111 (defvar hexl-mode-old-hl-line-mode)
112 (defvar hexl-mode-old-hl-line-range-function)
113 (defvar hexl-mode-old-hl-line-face)
114 (defvar hexl-mode-old-local-map)
115 (defvar hexl-mode-old-mode-name)
116 (defvar hexl-mode-old-major-mode)
117 (defvar hexl-mode-old-ruler-mode)
118 (defvar hexl-mode-old-ruler-function)
119 (defvar hexl-mode-old-isearch-search-fun-function)
120 (defvar hexl-mode-old-require-final-newline)
121 (defvar hexl-mode-old-syntax-table)
122 (defvar hexl-mode-old-font-lock-keywords)
133 "Font lock keywords used in `hexl-mode'.")
137 (put 'hexl-mode 'mode-class 'special)
140 (defun hexl-mode (&optional arg)
141 "\\<hexl-mode-map>A mode for editing binary files in hex dump format.
142 This is not an ordinary major mode; it alters some aspects
143 of the current mode's behavior, but not all; also, you can exit
144 Hexl mode and return to the previous mode using `hexl-mode-exit'.
158 If `hexl-mode' is invoked with an argument the buffer is assumed to be
186 There are several ways to change text in hexl mode:
205 \\[hexl-mode-exit] will exit hexl-mode.
210 You can use \\[hexl-find-file] to visit a file in Hexl mode.
214 (unless (eq major-mode 'hexl-mode)
220 ;; If `hexl-mode' is invoked with an argument the buffer is assumed to
242 ;; We do not turn off the old major mode; instead we just
244 (make-local-variable 'hexl-mode-old-local-map)
245 (setq hexl-mode-old-local-map (current-local-map))
246 (use-local-map hexl-mode-map)
248 (make-local-variable 'hexl-mode-old-mode-name)
249 (setq hexl-mode-old-mode-name mode-name)
250 (setq mode-name "Hexl")
252 (set (make-local-variable 'hexl-mode-old-isearch-search-fun-function)
257 (make-local-variable 'hexl-mode-old-major-mode)
258 (setq hexl-mode-old-major-mode major-mode)
259 (setq major-mode 'hexl-mode)
261 (make-local-variable 'hexl-mode-old-ruler-mode)
262 (setq hexl-mode-old-ruler-mode
263 (and (boundp 'ruler-mode) ruler-mode))
265 (make-local-variable 'hexl-mode-old-hl-line-mode)
266 (setq hexl-mode-old-hl-line-mode
267 (and (boundp 'hl-line-mode) hl-line-mode))
269 (make-local-variable 'hexl-mode-old-syntax-table)
270 (setq hexl-mode-old-syntax-table (syntax-table))
275 (make-local-variable 'hexl-mode-old-require-final-newline)
276 (setq hexl-mode-old-require-final-newline require-final-newline)
280 (make-local-variable 'hexl-mode-old-font-lock-keywords)
281 (setq hexl-mode-old-font-lock-keywords font-lock-defaults)
289 (add-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer nil t)
299 (run-mode-hooks 'hexl-mode-hook))
322 (remove-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer t))
325 (hexl-mode))
361 and edit the file in `hexl-mode'."
366 ;; Ignore the user's setting of default-major-mode.
367 (let ((default-major-mode 'fundamental-mode))
369 (if (not (eq major-mode 'hexl-mode))
370 (hexl-mode)))
372 (defun hexl-mode-exit (&optional arg)
373 "Exit Hexl mode, returning to previous mode.
393 (remove-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer t)
397 (if (and (boundp 'ruler-mode) ruler-mode (not hexl-mode-old-ruler-mode))
398 (ruler-mode 0))
399 (when (boundp 'hexl-mode-old-ruler-function)
400 (setq ruler-mode-ruler-function hexl-mode-old-ruler-function))
402 (if (and (boundp 'hl-line-mode) hl-line-mode (not hexl-mode-old-hl-line-mode))
403 (hl-line-mode 0))
404 (when (boundp 'hexl-mode-old-hl-line-range-function)
405 (setq hl-line-range-function hexl-mode-old-hl-line-range-function))
406 (when (boundp 'hexl-mode-old-hl-line-face)
407 (setq hl-line-face hexl-mode-old-hl-line-face))
409 (setq require-final-newline hexl-mode-old-require-final-newline)
410 (setq mode-name hexl-mode-old-mode-name)
411 (setq isearch-search-fun-function hexl-mode-old-isearch-search-fun-function)
412 (use-local-map hexl-mode-old-local-map)
413 (set-syntax-table hexl-mode-old-syntax-table)
414 (setq font-lock-defaults hexl-mode-old-font-lock-keywords)
415 (setq major-mode hexl-mode-old-major-mode)
416 (force-mode-line-update))
460 "Goto hexl-mode (decimal) address ADDRESS.
468 "Go to hexl-mode address (hex string) HEX-ADDRESS.
497 "Move to left ARG bytes (right if ARG negative) in hexl-mode."
502 "Move to right ARG bytes (left if ARG negative) in hexl-mode."
507 "Move to left ARG shorts (right if ARG negative) in hexl-mode."
541 "Move to right ARG shorts (left if ARG negative) in hexl-mode."
546 "Move to left ARG words (right if ARG negative) in hexl-mode."
580 "Move to right ARG words (left if ARG negative) in hexl-mode."
585 "Move vertically up ARG lines [16 bytes] (down if ARG negative) in hexl-mode.
591 "Move vertically down ARG lines [16 bytes] (up if ARG negative) in hexl-mode.
625 "Goto beginning of line in hexl mode."
630 "Goto end of line in hexl mode."
948 "Activate `ruler-mode'."
949 (require 'ruler-mode)
950 (unless (boundp 'hexl-mode-old-ruler-function)
951 (set (make-local-variable 'hexl-mode-old-ruler-function)
952 ruler-mode-ruler-function))
953 (set (make-local-variable 'ruler-mode-ruler-function)
954 'hexl-mode-ruler)
955 (ruler-mode 1))
958 "Activate `hl-line-mode'."
960 (unless (boundp 'hexl-mode-old-hl-line-range-function)
961 (set (make-local-variable 'hexl-mode-old-hl-line-range-function)
963 (unless (boundp 'hexl-mode-old-hl-line-face)
964 (set (make-local-variable 'hexl-mode-old-hl-line-face)
970 (hl-line-mode 1))
974 This function is assumed to be used as callback function for `hl-line-mode'."
988 (defun hexl-mode-ruler ()
989 "Return a string ruler for hexl mode."
1013 (if hexl-mode-map
1015 (setq hexl-mode-map (make-keymap))
1019 (define-key hexl-mode-map [remap self-insert-command] 'hexl-self-insert-command)
1021 (define-key hexl-mode-map "\C-m" 'hexl-self-insert-command)
1022 (define-key hexl-mode-map [left] 'hexl-backward-char)
1023 (define-key hexl-mode-map [right] 'hexl-forward-char)
1024 (define-key hexl-mode-map [up] 'hexl-previous-line)
1025 (define-key hexl-mode-map [down] 'hexl-next-line)
1026 (define-key hexl-mode-map [M-left] 'hexl-backward-short)
1027 (define-key hexl-mode-map [?\e left] 'hexl-backward-short)
1028 (define-key hexl-mode-map [M-right] 'hexl-forward-short)
1029 (define-key hexl-mode-map [?\e right] 'hexl-forward-short)
1030 (define-key hexl-mode-map [next] 'hexl-scroll-up)
1031 (define-key hexl-mode-map [prior] 'hexl-scroll-down)
1032 (define-key hexl-mode-map [home] 'hexl-beginning-of-line)
1033 (define-key hexl-mode-map [end] 'hexl-end-of-line)
1034 (define-key hexl-mode-map [C-home] 'hexl-beginning-of-buffer)
1035 (define-key hexl-mode-map [C-end] 'hexl-end-of-buffer)
1036 (define-key hexl-mode-map [deletechar] 'undefined)
1037 (define-key hexl-mode-map [deleteline] 'undefined)
1038 (define-key hexl-mode-map [insertline] 'undefined)
1039 (define-key hexl-mode-map [S-delete] 'undefined)
1040 (define-key hexl-mode-map "\177" 'undefined)
1042 (define-key hexl-mode-map "\C-a" 'hexl-beginning-of-line)
1043 (define-key hexl-mode-map "\C-b" 'hexl-backward-char)
1044 (define-key hexl-mode-map "\C-d" 'undefined)
1045 (define-key hexl-mode-map "\C-e" 'hexl-end-of-line)
1046 (define-key hexl-mode-map "\C-f" 'hexl-forward-char)
1050 (define-key hexl-mode-map (char-to-string help-char) 'undefined))
1052 (define-key hexl-mode-map "\C-k" 'undefined)
1053 (define-key hexl-mode-map "\C-n" 'hexl-next-line)
1054 (define-key hexl-mode-map "\C-o" 'undefined)
1055 (define-key hexl-mode-map "\C-p" 'hexl-previous-line)
1056 (define-key hexl-mode-map "\C-q" 'hexl-quoted-insert)
1057 (define-key hexl-mode-map "\C-t" 'undefined)
1058 (define-key hexl-mode-map "\C-v" 'hexl-scroll-up)
1059 (define-key hexl-mode-map "\C-w" 'undefined)
1060 (define-key hexl-mode-map "\C-y" 'undefined)
1063 (define-key hexl-mode-map "\e" 'hexl-ESC-prefix)
1064 (define-key hexl-mode-map "\e\C-a" 'hexl-beginning-of-512b-page)
1065 (define-key hexl-mode-map "\e\C-b" 'hexl-backward-short)
1066 (define-key hexl-mode-map "\e\C-d" 'hexl-insert-decimal-char)
1067 (define-key hexl-mode-map "\e\C-e" 'hexl-end-of-512b-page)
1068 (define-key hexl-mode-map "\e\C-f" 'hexl-forward-short)
1069 (define-key hexl-mode-map "\e\C-i" 'undefined)
1070 (define-key hexl-mode-map "\e\C-j" 'undefined)
1071 (define-key hexl-mode-map "\e\C-k" 'undefined)
1072 (define-key hexl-mode-map "\e\C-o" 'hexl-insert-octal-char)
1073 (define-key hexl-mode-map "\e\C-q" 'undefined)
1074 (define-key hexl-mode-map "\e\C-t" 'undefined)
1075 (define-key hexl-mode-map "\e\C-x" 'hexl-insert-hex-char)
1076 (define-key hexl-mode-map "\eb" 'hexl-backward-word)
1077 (define-key hexl-mode-map "\ec" 'undefined)
1078 (define-key hexl-mode-map "\ed" 'undefined)
1079 (define-key hexl-mode-map "\ef" 'hexl-forward-word)
1080 (define-key hexl-mode-map "\eg" 'hexl-goto-hex-address)
1081 (define-key hexl-mode-map "\ei" 'undefined)
1082 (define-key hexl-mode-map "\ej" 'hexl-goto-address)
1083 (define-key hexl-mode-map "\ek" 'undefined)
1084 (define-key hexl-mode-map "\el" 'undefined)
1085 (define-key hexl-mode-map "\eq" 'undefined)
1086 (define-key hexl-mode-map "\es" 'undefined)
1087 (define-key hexl-mode-map "\et" 'undefined)
1088 (define-key hexl-mode-map "\eu" 'undefined)
1089 (define-key hexl-mode-map "\ev" 'hexl-scroll-down)
1090 (define-key hexl-mode-map "\ey" 'undefined)
1091 (define-key hexl-mode-map "\ez" 'undefined)
1092 (define-key hexl-mode-map "\e<" 'hexl-beginning-of-buffer)
1093 (define-key hexl-mode-map "\e>" 'hexl-end-of-buffer)
1095 (fset 'hexl-C-c-prefix (copy-keymap mode-specific-map))
1096 (define-key hexl-mode-map "\C-c" 'hexl-C-c-prefix)
1097 (define-key hexl-mode-map "\C-c\C-c" 'hexl-mode-exit)
1100 (define-key hexl-mode-map "\C-x" 'hexl-C-x-prefix)
1101 (define-key hexl-mode-map "\C-x[" 'hexl-beginning-of-1k-page)
1102 (define-key hexl-mode-map "\C-x]" 'hexl-end-of-1k-page)
1103 (define-key hexl-mode-map "\C-x\C-p" 'undefined)
1104 (define-key hexl-mode-map "\C-x\C-s" 'hexl-save-buffer)
1105 (define-key hexl-mode-map "\C-x\C-t" 'undefined))