all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org, handa@m17n.org
Subject: Re: get-byte
Date: Wed, 01 Oct 2008 20:10:20 +0300	[thread overview]
Message-ID: <utzbwi6mb.fsf@gnu.org> (raw)
In-Reply-To: <jwvej30phfc.fsf-monnier+emacs@gnu.org>

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Kenichi Handa <handa@m17n.org>,  emacs-devel@gnu.org
> 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	other threads:[~2008-10-01 17:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-29 17:13 bug#1051: 23.0.60; rmail decoding bug Richard M. Stallman
2008-09-29 19:03 ` Eli Zaretskii
2008-09-30  4:55   ` Richard M. Stallman
2008-09-30  7:32     ` Eli Zaretskii
2008-09-30  8:40       ` Eli Zaretskii
2008-09-30 10:59         ` Kenichi Handa
2008-09-30 12:00           ` Eli Zaretskii
2008-09-30 23:30             ` Richard M. Stallman
2008-10-01  0:29             ` Kenichi Handa
2008-10-01  8:14               ` get-byte (was: bug#1051: 23.0.60; rmail decoding bug) Eli Zaretskii
2008-10-01 13:36                 ` get-byte Stefan Monnier
2008-10-01 17:10                   ` Eli Zaretskii [this message]
2008-11-08 13:12                     ` get-byte Kenichi Handa
2008-11-08 19:27                       ` get-byte Eli Zaretskii
2008-11-10  1:06                         ` get-byte Kenichi Handa
2008-11-09  2:28                       ` get-byte Stefan Monnier
2008-11-10  2:20                         ` get-byte Kenichi Handa
2008-11-10  3:30                           ` get-byte Stefan Monnier
2008-11-10  5:02                             ` get-byte Kenichi Handa
2008-11-10 14:57                               ` get-byte Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=utzbwi6mb.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=handa@m17n.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.