emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/hexl.el


From: Masatake YAMATO
Subject: [Emacs-diffs] Changes to emacs/lisp/hexl.el
Date: Mon, 27 Dec 2004 07:15:36 -0500

Index: emacs/lisp/hexl.el
diff -c emacs/lisp/hexl.el:1.90 emacs/lisp/hexl.el:1.91
*** emacs/lisp/hexl.el:1.90     Sun Nov 21 00:38:34 2004
--- emacs/lisp/hexl.el  Mon Dec 27 11:59:49 2004
***************
*** 111,121 ****
--- 111,129 ----
  (defvar hexl-mode-old-isearch-search-fun-function)
  (defvar hexl-mode-old-require-final-newline)
  (defvar hexl-mode-old-syntax-table)
+ (defvar hexl-mode-old-font-lock-keywords)
  
  (defvar hexl-ascii-overlay nil
    "Overlay used to highlight ASCII element corresponding to current point.")
  (make-variable-buffer-local 'hexl-ascii-overlay)
  
+ (defvar hexl-font-lock-keywords
+   '(("^\\([0-9a-f]+:\\).\\{40\\}  \\(.+$\\)"
+      ;; "^\\([0-9a-f]+:\\).+  \\(.+$\\)"
+      (1 'hexl-address-area t t)
+      (2 'hexl-ascii-area t t)))
+   "Font lock keywords used in `hexl-mode'.")
+ 
  ;; routines
  
  (put 'hexl-mode 'mode-class 'special)
***************
*** 265,270 ****
--- 273,283 ----
      (make-local-variable 'require-final-newline)
      (setq require-final-newline nil)
  
+     (make-local-variable 'hexl-mode-old-font-lock-keywords)
+     (setq hexl-mode-old-font-lock-keywords font-lock-defaults)
+     (make-local-variable 'font-lock-defaults)
+     (setq font-lock-defaults '(hexl-font-lock-keywords t))
+ 
      ;; Add hooks to rehexlify or dehexlify on various events.
      (add-hook 'after-revert-hook 'hexl-after-revert-hook nil t)
  
***************
*** 376,381 ****
--- 389,395 ----
    (setq isearch-search-fun-function hexl-mode-old-isearch-search-fun-function)
    (use-local-map hexl-mode-old-local-map)
    (set-syntax-table hexl-mode-old-syntax-table)
+   (setq font-lock-defaults hexl-mode-old-font-lock-keywords)
    (setq major-mode hexl-mode-old-major-mode)
    (force-mode-line-update))
  
***************
*** 684,698 ****
      (apply 'call-process-region (point-min) (point-max)
           (expand-file-name hexl-program exec-directory)
           t t nil (split-string hexl-options))
-     (save-excursion
-       (goto-char (point-min))
-       (while (re-search-forward "^[0-9a-f]+:" nil t)
-       (put-text-property (match-beginning 0) (match-end 0)
-                          'font-lock-face 'hexl-address-area))
-       (goto-char (point-min))
-       (while (re-search-forward "  \\(.+$\\)" nil t)
-       (put-text-property (match-beginning 1) (match-end 1) 
-                          'font-lock-face 'hexl-ascii-area)))
      (if (> (point) (hexl-address-to-marker hexl-max-address))
        (hexl-goto-address hexl-max-address))))
  
--- 698,703 ----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]