From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.help Subject: Prefix for command to save it as a Lisp expression Date: Sat, 19 Feb 2022 23:45:22 +0000 (UTC) Message-ID: <875ypav2su.fsf@catern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9098"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 20 03:15:21 2022 Return-path: Envelope-to: geh-help-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 1nLbkt-00026x-Ov for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Feb 2022 03:15:20 +0100 Original-Received: from localhost ([::1]:55784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nLbks-00076O-AB for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 19 Feb 2022 21:15:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLZPt-0003Ls-81 for help-gnu-emacs@gnu.org; Sat, 19 Feb 2022 18:45:29 -0500 Original-Received: from wrqvvpks.outbound-mail.sendgrid.net ([149.72.131.22]:61498) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nLZPo-0005S4-GY for help-gnu-emacs@gnu.org; Sat, 19 Feb 2022 18:45:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:mime-version:to:content-type:content-transfer-encoding; s=s1; bh=L1+Fog4v2OO+S8HGLnOZFI6ZSkUwYLCLIVn+sgyIlI8=; b=TL90oXC0+hxGy+nBbS/VNzVd2zd4vcsPkZcLvwn/uxF5EwbrJQBByfY4ZQpxTo9HYBkz KR8MQddqjr23Efhb6h/X4CvpPwcZJDDZwdVdbODq64AE60WvCm6b0IJhYFrCdBuAWJqOBV G1bPcw192Ul4Mm4UCG5csr5UKcaJz6Ds+zWX7VuzexYSmK2kBrOrncI3Pqyp1ShS4YLrQW d1bkMJKqXpgqtW2gE00LAgA5O/7w3vMygf1ZEIf06F8Y3SdWo03/KYSx1eGhMD+XuJ1TK7 Z7oCakhuADVajvz3Kdc1KS5xucOh8eoMSsmrbFddRiePP+BWyoBqPGzCOh8gRO5A== Original-Received: by filterdrecv-7bc86b958d-pcmn7 with SMTP id filterdrecv-7bc86b958d-pcmn7-1-62118112-1 2022-02-19 23:45:22.042996697 +0000 UTC m=+14779502.440248585 Original-Received: from earth.catern.com (unknown) by ismtpd0190p1iad2.sendgrid.net (SG) with ESMTP id yt-rYYwQRPenTgUrQcw6RA for ; Sat, 19 Feb 2022 23:45:21.940 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost; envelope-from=sbaugh@catern.com; receiver= Original-Received: from localhost (localhost [IPv6:::1]) by earth.catern.com (Postfix) with ESMTPSA id 48E9860059 for ; Sat, 19 Feb 2022 18:45:21 -0500 (EST) X-SG-EID: =?us-ascii?Q?GW3oCMoYnalRiojMOuLzE6x2H5kORXvlCdz1UwQVRMVT4fbh9ODEfCogOe74cO?= =?us-ascii?Q?rI4e0V+MFZgakz9Re5a6=2FCgkYIXIHpmhh3n44Gt?= =?us-ascii?Q?c2DxYKickF0=2Fib+Kjd6rO4ccU+jJiHDT=2FVyU10Y?= =?us-ascii?Q?UQNnWK74SKztF4Ha953aBvIwLWWaLFXikYQ+7yo?= =?us-ascii?Q?XoFuJvE38EtJGNYkiQJjDyQuAFffymXc3u3PRfx?= =?us-ascii?Q?ZUnQ9tWR0uo5jKpTpEGGS2R1sMksvWOPhYgGU3?= X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== Received-SPF: pass client-ip=149.72.131.22; envelope-from=bounces+21787432-cf9a-help-gnu-emacs=gnu.org@em8926.catern.com; helo=wrqvvpks.outbound-mail.sendgrid.net 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, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 19 Feb 2022 21:13:52 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:136033 Archived-At: Hi, Is there any prefix I can type before entering a command which will add that command as a Lisp expression to my kill ring? For example, [prefix] C-n would add "(next-line)" to my kill-ring. The specific use case I have in mind is [prefix] M-x global-set-key, where after I finish running the global-set-key I'd have a Lisp expression I can put into my init.el. Currently, I can do this after the fact by looking at list-command-history and kill things out of that. But it would be cool if I could type some prefix and just automatically have the command be added to my kill ring. Alternatively, maybe there's a way to yank things directly from command-history? Then I could just do that after the fact, rather than using a prefix ahead of time, which might be even nicer. Thanks!