From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Towards a cleaner build: arc-mode Date: Sat, 18 May 2019 06:21:24 +0200 Message-ID: References: <83d0khb888.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="255021"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 18 06:29:24 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hRqyK-0014FN-7s for ged-emacs-devel@m.gmane.org; Sat, 18 May 2019 06:29:24 +0200 Original-Received: from localhost ([127.0.0.1]:57403 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRqyI-0003Cl-II for ged-emacs-devel@m.gmane.org; Sat, 18 May 2019 00:29:22 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRqy6-0003CD-BC for emacs-devel@gnu.org; Sat, 18 May 2019 00:29:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRqqe-0006v7-Ti for emacs-devel@gnu.org; Sat, 18 May 2019 00:21:30 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:46118) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hRqqe-0006u7-NK; Sat, 18 May 2019 00:21:28 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hRqqa-0004C1-Em; Sat, 18 May 2019 06:21:26 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAADFBMVEUyFCpIKVGPeqMZDBO1 3P+ZAAACdUlEQVQokQ2OX0gTcRzAv6KnFJOrdBMH4UOQziePSkI2zpkaxnKT7TZdi1k6p4OorIxg dg9BT5KGTkGUE9x57sIkoTfB7NyKNVnk5p9l2EsPGcHO2xbInb/2/Pnw4QMhzzA1eujNOFsDbWD2 FCLj3sALjT1IAEnZ9sR0546zw1UEMxTle4C2KtpMN7Qwto5R9PHleJuh/hDcdWT4QAsogaQaaB+p JNTOWCqDixw4GSOTuUSmTrwYB30zN71hZAh/LKmeg0pz6k1CrkIqC+cA9Cwa+jW4GCYxNg7ju1f6 Lw6FIn7WYYb+ZDPSUGzx5OSdtxAiy1LqHysr0yPaJdCOOfjW5dLctN43DAQb5LVc7Gjgka8Rnti8 uHaqTu8rtzdBlriv0Mk6wurFstCBDDVo3z5t7vmTBSquYQ55nhRldQN07p+jeZ5/+hnt6aBXaPf7 eH5UIuVuCMq3qVqeX5ZQdQDelXKn8mS8uWTiNWTuTSXyAYqiJijAz/eo8hrVtLBVAd+VeWeDp5k8 akQy8C68MBd0SLk1NQk8J+OyQ/rSN9IPwHoPpE2roGNdoSIQHSfvjaPJCIM0ETDOHA2tWluia/EP +etFQw6bexxWmUoAUIgRw4v6gudsAQbS9pL+KidihE84DYXZWX3RtXRanEfFYFGGlXUoJgYYnQfo 8txDXIiodq1qDvBkhPa7txnFRtGwgT4pq2Z1wGAJIOiiN6J+8xn7rKk3Dk7XhE6J0eUmEmcgYjGV ITB3kQK6AN1fkYgLPbXpnW9T4P75T8GrEl303/oF+I1ssZbrQvTVXUMr6ORAnNxxH7+0k2chvXkL oa3l1GBA7vgPvYEpmMEEOkEAAAAASUVORK5CYII= In-Reply-To: <83d0khb888.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 17 May 2019 15:01:27 +0300") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.91.231.51 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:236688 Archived-At: Eli Zaretskii writes: > Yes. However, I suspect this juggling is no longer need nowadays. If > you just use 'insert', does arc-mode break when you invoke the > commands that end up using these calls? This should be tried also in > a locale whose codeset is not UTF-8. The string bit in (defun insert-unibyte (&rest args) "Like insert but don't make unibyte string and eight-bit char multibyte." (dolist (elt args) (if (integerp elt) (insert (if (< elt 128) elt (decode-char 'eight-bit elt))) (insert (string-to-multibyte elt))))) is used two places; both for renaming (and they don't work). But here's the lzh version: (let ((name (concat newname (substring "\0\0\0\0\0\0\0\0\0\0\0\0\0" (length newname)))) (inhibit-read-only t)) (save-restriction (save-excursion (widen) (goto-char (+ archive-proper-file-start (aref descr 4) 2)) (delete-char 13) (insert-unibyte name))))) If newname is ascii, then the string-to-multibyte thing isn't needed. If newname is not ascii, then it fails, anyway: (setq newname "f=E2=9A=80o") (setq name (concat newname (substring "\0\0\0\0\0\0\0\0\0\0\0\0\0" (length newname)))) =3D> "f=E2=9A=80o^@^@^@^@^@^@^@^@^@^@" (insert-unibyte name) =3D> f=E2=9A=80o^@^@^@^@^@^@^@^@^@^@ And then do a (multibyte-char-to-unibyte (char-after (point))) on the die and get a -1 which doesn't seem very useful, because it'll probably turn into an #ff when the file is read back. byte-after, on the other hand, will bug out: Debugger entered--Lisp error: (error "Not an ASCII nor an 8-bit character: = 9856") get-byte(2524) so you're right -- we can't just replace the calls with get-byte, but will have to add some error handling to be er feature compatible. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no