comparison lisp/hexl.el @ 107617:c5f9e4613394

Merge from mainline.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 16 Jan 2010 06:57:09 -0500
parents a3b4c6fc276c
children cc035ccb9275 376148b31b5e
comparison
equal deleted inserted replaced
107616:fa5ad3eee9f5 107617:c5f9e4613394
1 ;;; hexl.el --- edit a file in a hex dump format using the hexl filter 1 ;;; hexl.el --- edit a file in a hex dump format using the hexl filter
2 2
3 ;; Copyright (C) 1989, 1994, 1998, 2001, 2002, 2003, 2004, 3 ;; Copyright (C) 1989, 1994, 1998, 2001, 2002, 2003, 2004,
4 ;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 4 ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
5 5
6 ;; Author: Keith Gabryelski <ag@wheaties.ai.mit.edu> 6 ;; Author: Keith Gabryelski <ag@wheaties.ai.mit.edu>
7 ;; Maintainer: FSF 7 ;; Maintainer: FSF
8 ;; Keywords: data 8 ;; Keywords: data
9 9
777 (- character ?0) 777 (- character ?0)
778 (error "Invalid octal digit `%c'" character))) 778 (error "Invalid octal digit `%c'" character)))
779 779
780 (defun hexl-printable-character (ch) 780 (defun hexl-printable-character (ch)
781 "Return a displayable string for character CH." 781 "Return a displayable string for character CH."
782 (format "%c" (if hexl-iso 782 (format "%c" (if (equal hexl-iso "")
783 (if (or (< ch 32) (and (>= ch 127) (< ch 160))) 783 (if (or (< ch 32) (>= ch 127))
784 46 784 46
785 ch) 785 ch)
786 (if (or (< ch 32) (>= ch 127)) 786 (if (or (< ch 32) (and (>= ch 127) (< ch 160)))
787 46 787 46
788 ch)))) 788 ch))))
789 789
790 (defun hexl-insert-multibyte-char (ch num) 790 (defun hexl-insert-multibyte-char (ch num)
791 "Insert a possibly multibyte character CH NUM times. 791 "Insert a possibly multibyte character CH NUM times.