From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Thu, 9 Nov 2023 13:38:24 +0000 Message-ID: References: <871qd8sfdx.fsf@posteo.net> <838r7g8pys.fsf@gnu.org> <87bkcbrgnr.fsf@posteo.net> <25924.21015.19614.951576@orion.rgrjr.com> <87bkc4jpja.fsf@dataswamp.org> <12da6bcb-1818-7fbe-12af-8d4607724332@gutov.dev> <83sf5fyx60.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="4982"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, dmitry@gutov.dev, bjorn.bidar@thaodan.de, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 09 14:39:31 2023 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 1r15Fq-00017i-Cw for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Nov 2023 14:39:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r15F5-00033w-20; Thu, 09 Nov 2023 08:38:43 -0500 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 1r15F3-00033Y-FK for emacs-devel@gnu.org; Thu, 09 Nov 2023 08:38:41 -0500 Original-Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r15F1-0007fI-Gw; Thu, 09 Nov 2023 08:38:41 -0500 Original-Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-507ad511315so1216622e87.0; Thu, 09 Nov 2023 05:38:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699537117; x=1700141917; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5d/tDxTg8JyDl5c0pYkaiRCmYh0eyQhbb3WW6XYCXgo=; b=elzIof0hBTCtBCkER6ODeqKnXvB+j6H8Ol6vgabGtGvGoDke7PjbuSHSF+NPjAqj92 xbltaIT4Q3QVfRS74V5/CC+gWkiJhalStjvJZ/6RJi88+7W0fcb18laSIHWTI/yOwspo S042TzVzYZVzUDROrqNQ4dickWYFZF5yUsKory8UyLFHgMCSNnwzk3uJiPji0LZ/nRy1 hhoRHsM60GmrNOEaq4SRkAUfXs1QYH+uuvZeN3EXOA5vUrcHk7jcQc6CLyLwQ3E+ke55 k6qG2Y6zBMBqBe0mG89vp+Xtt1WiKQbnoOGwdhk9bwClkyw5tqlmSHSiqsGYvfmFlXWn NNQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699537117; x=1700141917; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5d/tDxTg8JyDl5c0pYkaiRCmYh0eyQhbb3WW6XYCXgo=; b=ekG7apjoUb20K3TuxspYWBE+MGEIxnfp53MtUUz0Ae+1u3cl6cnujnBdbdDpBp54lh 45IOHao+6W+cDrbl37pVDbamFa0IHnsY4Veow5Xe5xj2HOvh+TsFOTsml4Wp/M0Q10Yq lJwqtTjcKSRfHbdTD3j9UgZBbGarRZlG8WbcKS00cDBe0SsxYJ3oRsP/36cap31EkB2i ivrWoJN7fXv7huH+GNBQzfe9eOqgFRYQnYLZCr2F7XxBKM9+1DaV5aTws+WOSKFAaWAG hmsry8p2auhTqZ1TdJrVBTYwT/KxkzTEJ1zS/90oRj0OQKsTkXEhYmeoFFkC777zaj5r WoUw== X-Gm-Message-State: AOJu0Yya1mINVdUjaYD8fQmsBLhHw6C55S40zAmpmq/I79AG5c/xHUvX uG0oiCGr8AVVKimiI6a1/FFNY30dnB5UfRvhN7Dr+tErq6cXVw== X-Google-Smtp-Source: AGHT+IHCctDV+jvut+yw9ZXtSsSRJ/ZIxObncgxApcnL9HcqRCClN0NCA/2lkiMgpQeqkNPyAltt8Q5HLxNO3Sg9Wcw= X-Received: by 2002:ac2:58d3:0:b0:4f9:54f0:b6db with SMTP id u19-20020ac258d3000000b004f954f0b6dbmr1153613lfo.13.1699537116627; Thu, 09 Nov 2023 05:38:36 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x135.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:312407 Archived-At: On Thu, Nov 9, 2023 at 12:34=E2=80=AFPM Jo=C3=A3o T=C3=A1vora wrote: > > The following is left as an exercise for the interested readers: take > > a non-trivial piece of code that you never in your life have laid your > > eyes upon, and decide what to do with a serious bug report about that > > code, with or without a patch proposed by someone. A recent case in > > point: bug#66970. Bonus points for doing this with code in a > > programming language you don't command 110%, like C if you are mainly > > a Lisp programmer or vice versa. > I'll have a better look later. At first sight, didn't seem terribly hard. I gave it some basic testing seems to work like the OP in that bug would like it to. Could be a start I guess. Let me know if you don't like the style. diff --git a/lisp/leim/quail/hangul.el b/lisp/leim/quail/hangul.el index 46a2e5a6ba2..c97362b1250 100644 --- a/lisp/leim/quail/hangul.el +++ b/lisp/leim/quail/hangul.el @@ -146,21 +146,26 @@ hangul-insert-character (progn (delete-region (region-beginning) (region-end)) (deactivate-mark))) - (quail-delete-region) - (let ((first (car queues))) - (insert - (hangul-character - (+ (aref first 0) (hangul-djamo 'cho (aref first 0) (aref first 1))) - (+ (aref first 2) (hangul-djamo 'jung (aref first 2) (aref first 3))= ) - (+ (aref first 4) (hangul-djamo 'jong (aref first 4) (aref first 5))= )))) - (move-overlay quail-overlay (overlay-start quail-overlay) (point)) - (dolist (queue (cdr queues)) - (insert - (hangul-character - (+ (aref queue 0) (hangul-djamo 'cho (aref queue 0) (aref queue 1))) - (+ (aref queue 2) (hangul-djamo 'jung (aref queue 2) (aref queue 3))= ) - (+ (aref queue 4) (hangul-djamo 'jong (aref queue 4) (aref queue 5))= ))) - (move-overlay quail-overlay (1+ (overlay-start quail-overlay)) (point)= ))) + (let* ((things-to-insert + (with-temp-buffer + (dolist (queue queues (mapcar #'identity (buffer-string))) + (insert + (hangul-character + (+ (aref queue 0) (hangul-djamo 'cho (aref queue 0) (aref queue 1))) + (+ (aref queue 2) (hangul-djamo 'jung (aref queue 2) (aref queue 3))) + (+ (aref queue 4) (hangul-djamo 'jong (aref queue 4) (aref queue 5)))))))) + (may-have-to-overwrite-p + (or (=3D (overlay-start quail-overlay) (overlay-end quail-overla= y)) + (cdr things-to-insert)))) + (quail-delete-region) + (dolist (c things-to-insert) + (let ((last-command-event c) + (overwrite-mode (and overwrite-mode + may-have-to-overwrite-p + overwrite-mode))) + (self-insert-command 1) + (setq may-have-to-overwrite-p nil))) + (move-overlay quail-overlay (1- (point)) (point)))) (defun hangul-djamo (jamo char1 char2) "Return the double Jamo index calculated from the arguments.