From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joseph Turner Newsgroups: gmane.emacs.devel Subject: Re: How to get buffer byte length (not number of characters)? Date: Fri, 23 Aug 2024 09:59:22 -0700 Message-ID: <87o75j5g5x.fsf@ushin.org> References: <87wmkbekjp.fsf@ushin.org> <86o75nwilg.fsf@gnu.org> <87bk1lhkvg.fsf@ushin.org> <86y14pu5rp.fsf@gnu.org> <871q2hfn7c.fsf@ushin.org> <86plq1td4n.fsf@gnu.org> <87ed6hdnpe.fsf@ushin.org> <865xrsu8c8.fsf@gnu.org> <87ttfcl8bn.fsf@ushin.org> <86zfp4qtxn.fsf@gnu.org> <878qwnj3j0.fsf@ushin.org> <86frqvrabj.fsf@gnu.org> <87le0nfzuv.fsf@ushin.org> <865xrrquru.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33128"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, schwab@suse.de, adam@alphapapa.net To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 23 19:25:09 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1shY27-0008PX-QT for ged-emacs-devel@m.gmane-mx.org; Fri, 23 Aug 2024 19:25:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1shY1O-0000Lq-E2; Fri, 23 Aug 2024 13:24:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1shXdX-0001z3-Kf for emacs-devel@gnu.org; Fri, 23 Aug 2024 12:59:43 -0400 Original-Received: from out-187.mta0.migadu.com ([91.218.175.187]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1shXdR-0002bF-JK for emacs-devel@gnu.org; Fri, 23 Aug 2024 12:59:42 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ushin.org; s=key1; t=1724432369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L3glGviSy4e7oqghDrMTRAtRtMTOXgXgUyFqgyHiV5Y=; b=JRlvFhqokTHYs8kCF7saS3Td5ChecByIDjg9Xtg6lxg1kifOA39UoBXF2vUVhW2xfID/Qu NxBtvvr4YQxgI+p0dxnNY4T3gHEJ9Vm4X6P4LHx8Qz/n+Hyy1/gRt3o1ZrI7Wr+Qg9rfFo eFJNqyHuUnnPrVU5umDhKg3zRNok76fNnZl2Gj9+vZ56gwljX+3P9lpLLzR4+KfoOxvVC7 8Vuw6g+z6KRNSyvU48EE+Uy/nLYNpagVhdqEEqUQ0G2YAj4gtjDiRTSY9IYa9kMQcOzuVr 7PXdriNlry6R/LwbV1sLRZxfX9CrumD7d7Etfdyo/J51ltuVgVjBHwQhm/QQ9Q== In-Reply-To: <865xrrquru.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 23 Aug 2024 15:38:13 +0300") X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=91.218.175.187; envelope-from=joseph@ushin.org; helo=out-187.mta0.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 23 Aug 2024 13:24:19 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323095 Archived-At: Eli Zaretskii writes: >> From: Joseph Turner >> Cc: emacs-devel@gnu.org, schwab@suse.de, adam@alphapapa.net >> Date: Fri, 23 Aug 2024 00:43:52 -0700 >>=20 >> I'm surprised that >>=20 >> (with-temp-buffer >> (insert "=E4=BD=A0=E5=A5=BD") >> (set-buffer-file-coding-system 'chinese-big5) >> (car (find-coding-systems-region (point-min) (point-max)))) >>=20 >> returns 'utf-8 and not 'chinese-big5. > > What does coding-system-priority-list returns in your case? 'utf-8 >> Are the codings intended to be >> ordered by priority? > > Yes. > >> If so, should buffer-file-coding-system be at the front of the list >> if it's safe? > > How do you know it's safe? > > If your application needs to prefer buffer-file-coding-system, then > you should see if buffer-file-coding-system is a member of the list > returned by find-coding-systems-region, and if so, use that. I'd have thought that most applications would want to prefer buffer-file-coding-system if it's a member of the list returned by find-coding-systems-region, but perhaps not. I now have a clear path forward for hyperdrive.el. Thank you for your time, Eli!! Joseph