From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hong Xu Newsgroups: gmane.emacs.bugs Subject: bug#74999: [PATCH v3] Recommend `keymap-set' instead of `define-key' in emacs lisp intro Date: Thu, 26 Dec 2024 13:58:33 -0800 Message-ID: <87msgip0mu.fsf@topbug.net> References: <86y1098pvj.fsf@gnu.org> <20241221080552.259664-1-hong@topbug.net> <86ed1uzwhw.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36670"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.12.8; emacs 29.4 Cc: 74999@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 26 22:59:28 2024 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 1tQvt9-0009Nq-UE for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Dec 2024 22:59:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQvsn-0000wL-Lj; Thu, 26 Dec 2024 16:59:05 -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 1tQvsl-0000vo-5u for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 16:59:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQvsk-0007ad-T7 for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 16:59:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=1nqMZdNxWnpsFFLUlb8KQE1cxMmLJL5sp0PVzdoGHqg=; b=Enq7etF1aIndi0VNDsOZ9dNFWNgWyPdi+uhaj7e8Ex93uh8UybnabQPudcEso2mlBpKEK0oZQMd3iSabjYhz/hwqAzXS71xkjQV9gy9W1jKdFDT/zQeaGFKwWR91PIwOReeP+yTiW1zywXEm73uRNkpsdZG3oIE7XtNLdamIU4XJQr8QWHXHtbwZ1OtfuPsatqV+ZtyqaC35LIwRJk6vHL44LV/yeFcw2okEJVHc1xI9M7RlyjTclHc1tHUl7BJNFRV9EwTwO3XIbPtu1JDYB1PznaZYgCfhCbBilVXMtHzeTW6FBov+cn/H17XGbWRu6cXkE8Ue0cWni+P5+hl3yQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQvsj-0004Ye-NU for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2024 16:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Hong Xu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Dec 2024 21:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74999 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74999-submit@debbugs.gnu.org id=B74999.173525033217503 (code B ref 74999); Thu, 26 Dec 2024 21:59:01 +0000 Original-Received: (at 74999) by debbugs.gnu.org; 26 Dec 2024 21:58:52 +0000 Original-Received: from localhost ([127.0.0.1]:42545 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQvsa-0004YF-1n for submit@debbugs.gnu.org; Thu, 26 Dec 2024 16:58:52 -0500 Original-Received: from sender4-of-o52.zoho.com ([136.143.188.52]:21298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQvsT-0004Y3-VE for 74999@debbugs.gnu.org; Thu, 26 Dec 2024 16:58:50 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1735250317; cv=none; d=zohomail.com; s=zohoarc; b=j8Yw84fy4wTKXvGHjq8eDmvS9HAKOgh5RmxoDP9PMbXsnY5CrxlfolRNhS86bdBZKZM8xmTao7yw5uDvUp5lthUEuR/lfUTHRxKA01mxpDPKaoveelIRcDf2nERRnwsxqIZ8iF3xNQe7HJ2Y3rDx5GwVuGUU2tuAPnv35Mhr6aQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1735250317; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=1nqMZdNxWnpsFFLUlb8KQE1cxMmLJL5sp0PVzdoGHqg=; b=QZRsUlu8KTqoXUtRgLH5gcsPV6WNesdyop+ER/VRrwrHtDLCWkO56geOd35FkoKvydO1RTrtxd+OiDYWzTUi+qmIHsE5Nk7C0Da3smuMQc1+iOtTOdTkegrYumQ0yq5OoCw3mw4P90RtPUXhWP2TbrSFTZaddOoC6tnCX04elXI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=topbug.net; spf=pass smtp.mailfrom=hong@topbug.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1735250317; s=zoho; d=topbug.net; i=hong@topbug.net; h=From:From:To:To:Cc:Cc:Subject:Subject:In-Reply-To:References:Date:Date:Message-ID:MIME-Version:Content-Type:Message-Id:Reply-To; bh=1nqMZdNxWnpsFFLUlb8KQE1cxMmLJL5sp0PVzdoGHqg=; b=gG+0vmpbtC+HiaaUyQ72tTYFCjWBP5+KN5KsCDrlSD3uZtfR7dG1gW9pOfQYe9AF YfcbN3vhyvzBuZujvogn83T4ljmoRQtvuvLTcuaJmoxe4V0cHFuPNwwE712yv6knwrM iTjF/+NKMofRsJyYbtQoFBl1eMrJ7QkKA4iVpgPY= Original-Received: by mx.zohomail.com with SMTPS id 1735250314677111.68920987576792; Thu, 26 Dec 2024 13:58:34 -0800 (PST) In-Reply-To: <86ed1uzwhw.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 26 Dec 2024 10:20:11 +0200") X-ZohoMailClient: External 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297795 Archived-At: Thanks for reviewing. Please see my followup patch. On 2024-12-26 Thu 00:20 GMT-08, Eli Zaretskii wrote: >> From: Hong Xu >> Date: Sat, 21 Dec 2024 00:03:54 -0800 >> >> * Since `define-key' is considered legacy and we encourage `keymap-set' >> now. >> --- >> doc/lispintro/emacs-lisp-intro.texi | 25 ++++++++++++++++++------- >> 1 file changed, 18 insertions(+), 7 deletions(-) > > Thanks. I tried to install this, but the git-commit hook rejected the > commit because Subject line is too long: > > Line longer than 78 characters in commit message > Commit aborted; please see the file CONTRIBUTE > > Please format the patch using "git format-patch", and please commit > the patch locally before you do so (assuming you have the hooks in > your local clone), to make sure these problems are corrected before > you send the patch here. I could apply these patches without line length complaints, and the hooks were in effect. An inspection into the patch file also shows no line is longer than 78 characters. Git is supposed to abandon the "[Patch vN]" prefix when applying the patch. > More generally, global-set-key, discussed earlier in this section, is > also obsolete, and we nowadays prefer keymap-global-set instead. So, > if we want to modernize this part of the Emacs Lisp Intro manual, I > think we should replace all the key-binding examples and the > surrounding text in the manual to use the new keymap-* functions. It > makes little sense to replace only define-key and leave the rest as > they were. > > Would you like to submit a patch that takes care of these issues in a > more thorough manner? Addressed. > >> +While you are encouraged to use @code{keymap-set}, you likely would >> +encounter @code{define-key} in various places. Historically, keymaps >> +are bound using a lower-level function, @code{define-key}, which >> +is now considered legacy. > > These two sentences should be in reverse order: first tell that > historically we used define-key, then say that the reader is > encouraged to use keymap-set. > Addressed.