From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: get-byte Date: Wed, 01 Oct 2008 09:36:29 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1222868221 6608 80.91.229.12 (1 Oct 2008 13:37:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Oct 2008 13:37:01 +0000 (UTC) Cc: emacs-devel@gnu.org, Kenichi Handa To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 01 15:37:58 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kl1tf-000692-Hd for ged-emacs-devel@m.gmane.org; Wed, 01 Oct 2008 15:37:43 +0200 Original-Received: from localhost ([127.0.0.1]:36086 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kl1sc-0008JS-Ft for ged-emacs-devel@m.gmane.org; Wed, 01 Oct 2008 09:36:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kl1sY-0008JL-5A for emacs-devel@gnu.org; Wed, 01 Oct 2008 09:36:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kl1sW-0008Iz-4G for emacs-devel@gnu.org; Wed, 01 Oct 2008 09:36:33 -0400 Original-Received: from [199.232.76.173] (port=54219 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kl1sV-0008Iw-VK for emacs-devel@gnu.org; Wed, 01 Oct 2008 09:36:31 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:45238) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kl1sU-0007gF-O1; Wed, 01 Oct 2008 09:36:30 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArEEACwa40jO+KDT/2dsb2JhbACBZrwrgWqBBg X-IronPort-AV: E=Sophos;i="4.33,343,1220241600"; d="scan'208";a="27799804" Original-Received: from 206-248-160-211.dsl.teksavvy.com (HELO pastel.home) ([206.248.160.211]) by ironport2-out.teksavvy.com with ESMTP; 01 Oct 2008 09:36:30 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 019768040; Wed, 1 Oct 2008 09:36:29 -0400 (EDT) In-Reply-To: (Eli Zaretskii's message of "Wed, 01 Oct 2008 11:14:09 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:104277 Archived-At: >> 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. Stefan