[Top][All Lists]

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

Re: How to see the value of each char in a string?

From: Oliver Scholz
Subject: Re: How to see the value of each char in a string?
Date: Thu, 28 Nov 2002 11:07:40 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-msvc-nt5.1.2600) (David Combs) writes:
> , or, if fill-column happens to be 20:
>  (146 157 157 061 
>  ("f" "o" "o" "2" 
> 063 146 157 157)
> "3" "f" "o" "o")
> Like, maybe running through the string twice, each
> time saving the result, and while generating each one,
> inserting three newlines every so often,

Well, I think it is not possible (or at least very messy) to do this
using the graphical representation of lists. What you wrote above
would be the list

(146 157 157 061 ("f" "o" "o" "2" 063 146 157 157) "3" "f" "o" "o")

I must admit that I am not entirely sure that I understand what you
want, despite your eplanation of your problem with `ls'. Maybe
something like this?

(require 'cl)

(defun dc-display-ascii (string)
  (interactive "sString: ")
  (let ((standard-output (current-buffer)))
    (pp (mapcar* 'cons
                 (mapcar 'string string)
                 (mapcar 'identity string)))))

If you only want a convenient way to browse the ascii value of the
chars in a string or buffer, you might want to have a look at the
package ascii.el <URL:>.

8 Frimaire an 211 de la Révolution
Liberté, Egalité, Fraternité!

reply via email to

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