emacs-devel
[Top][All Lists]
Advanced

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

Re: get-byte


From: Eli Zaretskii
Subject: Re: get-byte
Date: Wed, 01 Oct 2008 20:10:20 +0300

> From: Stefan Monnier <address@hidden>
> Cc: Kenichi Handa <address@hidden>,  address@hidden
> Date: Wed, 01 Oct 2008 09:36:29 -0400
> 
> >> Ah!  How about something like this?
> >> 
> >> (defun get-byte (pos &optional string)
> >> "Return a byte at position POS of the current buffer..
> >> If POS is nil, it defaults to point.
> >> If the second optional arg STRING is non-nil, return a byte in
> >> STRING at index POS.
> >> An error is signaled if the character at POS is not ASCII
> >> nor eight-bit character."
> >> ...)
> 
> > Yes, that's what I had in mind.
> 
> It really seems to me that encode-char is a better solution.  More to
> the point it's the most natural and flexible solution.  E.g. it's
> trivial to write get-byte using encode-char, whereas it's much less
> trivial to write encode-char with get-byte.

Then let's write get-byte using encode-char.  I don't care how trivial
is it (I think it isn't, not unless you know very well how raw bytes
are handled in Emacs buffers and strings), I think we do need such an
API.




reply via email to

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