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: Fri, 17 May 2019 12:35:47 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="108886"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 17 13:03:52 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 1hRaeW-000SDw-2Z for ged-emacs-devel@m.gmane.org; Fri, 17 May 2019 13:03:52 +0200 Original-Received: from localhost ([127.0.0.1]:46468 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRaeU-0002b2-UG for ged-emacs-devel@m.gmane.org; Fri, 17 May 2019 07:03:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRaDS-0004h7-SO for emacs-devel@gnu.org; Fri, 17 May 2019 06:35:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRaDQ-0006vn-W4 for emacs-devel@gnu.org; Fri, 17 May 2019 06:35:54 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:32848) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hRaDQ-0006tY-Km for emacs-devel@gnu.org; Fri, 17 May 2019 06:35:52 -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 1hRaDL-0001tD-Lh for emacs-devel@gnu.org; Fri, 17 May 2019 12:35:50 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWpm356Wj16Lh58RS0D AgIOCQlXGRRYnXIxAAACVElEQVQ4jXWUwY6kIBCGizbdZ0oyngXSnIFKfAKd88z24nnUyPs/whai k01mt6KR8PEXxQ8I6T8B47+jgGne2tVqzC6XSPzuFdhwswrAKEOGQ8fYVbAEoZUHE00NK06wIXiE G/fY0r96qGBcAlAPjbFVEgAuhefR0JQJmEUP2I0Tg/fFNwxEBbbnVgULqtb0AMTYktGsHU6AGBDA N2QjGQBU3TfACrhiW8Awlck3RCqAOCxpCW3sDsAKKqmi8dFw3YDtBRQDCexItAxEOFNxVwUWW8tf gdgdtqOogCvQir83BkUxnQoeiJaL8DcKw2HJFyguzBeF0gikVKheLVJl/E7FCgziAJ+oNna0pOIF SX9TJ+Bys6ygtcorQVakv0BJRRRpFVlUwBbOUEFAkiosF1DbpWh1DCp8nSCleQ5FIiV21P2K/Qk+ cQvY8ezQmWGNkQ/DBXAvkvuLFA1lKbKCF257UMcCW9dZbjUVzOVczgy4RxN1H/JM9cq5mAsoMITg spTn5DOnPqpCiC5pKy/FnJfiIcAD8QWyzPGolpB/BH+ADiWqTxBvDKZRZmhyMeUtdZjc/qFvFfgd 7qmA+7inxI9u3WXJPmcGrXuOk9nTuuYTpJkbfLAY5H1Kq/kGv/mscjQp3VwejKnlTnx3tqHUm1eX Vu1WAxeYclc2d89unY1rz63lbr0naNkQfFs3o9v+BLOhVwMtb4N/5N64tW9OxUjzEwUBBE/HDXke QLvd7kk1RLyJwLdOiLrAORnzfOdb4wVnYwzKnal4JeOPv0/6+eeZysg/xgfLfevm13MAAAAASUVO RK5CYII= In-Reply-To: (Lars Ingebrigtsen's message of "Fri, 17 May 2019 04:15:46 +0200") 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:236644 Archived-At: This is the most head-scratchiest of all the string-to-multibyte stuff. (eval-when-compile (defsubst byte-after (pos) "Like char-after but an eight-bit char is converted to unibyte." (multibyte-char-to-unibyte (char-after pos))) (defsubst 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))))) ) First of all, it defines defsubsts in the global namespace, but (decode-char 'eight-bit 130) => 4194178 Hm... Oh! Is it working in a multibyte buffer, so it wants to insert bytes that are in Emacs' "byte plane"? (insert (decode-char 'eight-bit 130)) => \202 I guess. Well, that's one way of doing it... er... I think... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no