From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.bugs Subject: bug#58376: [PATCH] Set the PARENTS argument for language environments Date: Mon, 10 Oct 2022 21:29:03 +0530 Message-ID: <87bkqjwtyw.fsf@gmail.com> References: <83wn9ajrud.fsf@gnu.org> <83tu4eji4l.fsf@gnu.org> <83edvhjt76.fsf@gnu.org> <838rlpjfmr.fsf@gnu.org> <87wn99oxtv.fsf@gmail.com> <87sfjxox3r.fsf@gmail.com> <87o7ulovzj.fsf@gmail.com> <87ilkrwxyd.fsf@gmail.com> 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="35563"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 58376@debbugs.gnu.org To: =?UTF-8?Q?=E0=A4=B8=E0=A4=AE=E0=A5=80=E0=A4=B0_?= =?UTF-8?Q?=E0=A4=B8=E0=A4=BF=E0=A4=82=E0=A4=B9?= Sameer Singh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 10 18:11:57 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ohvNk-00094i-B0 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Oct 2022 18:11:56 +0200 Original-Received: from localhost ([::1]:39016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohvNi-0006Eu-20 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Oct 2022 12:11:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohvCF-0007g3-8y for bug-gnu-emacs@gnu.org; Mon, 10 Oct 2022 12:00:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50537) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohvCE-0003p8-UM for bug-gnu-emacs@gnu.org; Mon, 10 Oct 2022 12:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ohvCE-0000ZK-OE for bug-gnu-emacs@gnu.org; Mon, 10 Oct 2022 12:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Oct 2022 16:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58376 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58376-submit@debbugs.gnu.org id=B58376.16654175542082 (code B ref 58376); Mon, 10 Oct 2022 16:00:02 +0000 Original-Received: (at 58376) by debbugs.gnu.org; 10 Oct 2022 15:59:14 +0000 Original-Received: from localhost ([127.0.0.1]:49610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohvBR-0000XQ-VZ for submit@debbugs.gnu.org; Mon, 10 Oct 2022 11:59:14 -0400 Original-Received: from mail-pf1-f193.google.com ([209.85.210.193]:35766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohvBQ-0000XD-T2 for 58376@debbugs.gnu.org; Mon, 10 Oct 2022 11:59:13 -0400 Original-Received: by mail-pf1-f193.google.com with SMTP id i6so11142977pfb.2 for <58376@debbugs.gnu.org>; Mon, 10 Oct 2022 08:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=D42rCO9N68lE7FUppzHmMQ1Eg4DL2i0bLNyEgh5nkvM=; b=FxWlDdhy8wT0YceVxtFVco9mdHnUVsEOo7ZDkDZPAQ1HqoCuc8EbeJUhiHvX3P8IQ0 zhVnB01J7a48ifc/QusHTU5uAT6q6vQ7qh951aWfCyO/FX3SOixjW8zo5hH/KAaVEoT8 K7gIDKCON5KQJRUsAun4UXj/PvLmvOkTfmvXBbRO0yeiJtT846bgU44t4h++wFrFLrBR ijQOujF6jlIb2QB9Bu9r3FDe2zEag3P6ZutVjz9m0lzBx0hp6JribzCRlSdIlEt079F+ 0Y3TaouGs/sExNSXPEWPrr3bryO/0mtlewcUgNV+l7VV1igUw2odYH16C0yrfPgUKND9 UCXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=D42rCO9N68lE7FUppzHmMQ1Eg4DL2i0bLNyEgh5nkvM=; b=HB3tOuq5/7iyE7n+xbNKhTr48Dp5jqz+y+SBXqV0J4uyUbHxg7UhqxE+DVasS6LZAT O5nU77H7CgByDq9ELv8eKQ3use49hqoWaQ2QSG+B/1U8TeLbvaf9hqgGtcLeXWIqE9Xh gOn2M7vfDAJW5uZtHK9a6aBEAhy0G+1xymRtLZkfWmWQzwR9c06rhWH3ypjpQAuQlOuW jJxSICe7v2OtKuexI6t+/Uf1zgrP29hmPB/Eok7UbaARmOTjYIrhw6AFgGEL/hdWSnKu dZjusaNEVGpIifouVTpE8dZdgIAM0uljWgV7SHxippt+x1yWyUq54wek7Z6KzZydw0m4 ekew== X-Gm-Message-State: ACrzQf3XVj+wu+q1MHBH7pcOCsHyCsR3X7+mhcJaSDoQS17+o/IMqRge UKLe1tklRY7bMzwNxttbRQA= X-Google-Smtp-Source: AMsMyM7izDmatA/Om6hVdN9qAkR051cJamgCyt/dagkFtE0OEGnmUua2fFOEQJYdQVpIdwzreAAqsQ== X-Received: by 2002:a63:1a4c:0:b0:43b:e648:a7a4 with SMTP id a12-20020a631a4c000000b0043be648a7a4mr17504552pgm.7.1665417546899; Mon, 10 Oct 2022 08:59:06 -0700 (PDT) Original-Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id y63-20020a623242000000b005385e2e86eesm7382787pfy.18.2022.10.10.08.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 08:59:06 -0700 (PDT) In-Reply-To: ("=?UTF-8?Q?=E0=A4=B8=E0=A4=AE=E0=A5=80=E0=A4=B0_?= =?UTF-8?Q?=E0=A4=B8=E0=A4=BF=E0=A4=82=E0=A4=B9?= Sameer Singh"'s message of "Mon, 10 Oct 2022 20:08:42 +0530") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:245031 Archived-At: [=E0=AE=A4=E0=AE=BF=E0=AE=99=E0=AF=8D=E0=AE=95=E0=AE=B3=E0=AF=8D =E0=AE=85= =E0=AE=95=E0=AF=8D=E0=AE=9F=E0=AF=8B=E0=AE=AA=E0=AE=B0=E0=AF=8D 10, 2022] = =E0=A4=B8=E0=A4=AE=E0=A5=80=E0=A4=B0 =E0=A4=B8=E0=A4=BF=E0=A4=82=E0=A4=B9 S= ameer Singh wrote: > This one says: "error: corrupt patch at line 8" > > The previous one said: > error: patch failed: lisp/international/mule-cmds.el:1208 > error: lisp/international/mule-cmds.el: patch does not apply > I have no idea why that is the case, and my network connection is too slow to freshly clone the Emacs repo again. Can you replace the old definition of `set-language-info-alist' with the following two forms instead? (defun set-language-info-setup-keymap (lang-env alist describe-map setup-ma= p) "Setup menu items for LANG-ENV. See `set-language-info-alist' for details of other arguments." (let ((doc (assq 'documentation alist))) (when doc (define-key-after describe-map (vector (intern lang-env)) (cons lang-env 'describe-specified-language-support)))) (define-key-after setup-map (vector (intern lang-env)) (cons lang-env 'setup-specified-language-environment))) (defun set-language-info-alist (lang-env alist &optional parents) "Store ALIST as the definition of language environment LANG-ENV. ALIST is an alist of KEY and INFO values. See the documentation of `language-info-alist' for the meanings of KEY and INFO. Optional arg PARENTS is a list of parent menu names; it specifies where to put this language environment in the Describe Language Environment and Set Language Environment menus. For example, (\"European\") means to put this language environment in the European submenu in each of those two menus." (cond ((symbolp lang-env) (setq lang-env (symbol-name lang-env))) ((stringp lang-env) (setq lang-env (purecopy lang-env)))) (if parents (while parents (let (describe-map setup-map parent-symbol parent prompt) (if (symbolp (setq parent-symbol (car parents))) (setq parent (symbol-name parent)) (setq parent parent-symbol parent-symbol (intern parent))) (setq describe-map (lookup-key describe-language-environment-map (vector= parent-symbol))) ;; This prompt string is for define-prefix-command, so ;; that the map it creates will be suitable for a menu. (or describe-map (setq prompt (format "%s Environment" parent))) (unless describe-map (setq describe-map (intern (format "describe-%s-environment-map" (downcase parent)))) (define-prefix-command describe-map nil prompt) (define-key-after describe-language-environment-map (vector parent-sym= bol) (cons parent describe-map))) (setq setup-map (lookup-key setup-language-environment-map (vector paren= t-symbol))) (unless setup-map (setq setup-map (intern (format "setup-%s-environment-map" (downcase parent)))) (define-prefix-command setup-map nil prompt) (define-key-after setup-language-environment-map (vector parent-symbol) (cons parent setup-map))) (setq parents (cdr parents)) (set-language-info-setup-keymap lang-env alist (symbol-value desc= ribe-map) (symbol-value setup-map)))) (set-language-info-setup-keymap lang-env alist describe-language-environment-map setup= -language-environment-map)) (dolist (elt alist) (set-language-info-internal lang-env (car elt) (cdr elt))) (if (equal lang-env current-language-environment) (set-language-environment lang-env)))