From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/86113 Path: news.gmane.org!not-for-mail From: Peter Davis Newsgroups: gmane.emacs.gnus.general Subject: Re: Macro suddenly broken Date: Wed, 19 Aug 2015 19:23:36 -0400 Message-ID: References: <87tws1q39b.fsf@gnu.org> <6sw6c737zlyhdc.fsf@dhcp-6-148.hmco.com> <87r3n2xtzg.fsf@gnu.org> <6sw6c7vbcew1jj.fsf@dhcp-6-148.hmco.com> <87h9nx2g4z.fsf@gnu.org> <6sw6c7a8towzl5.fsf@dhcp-6-148.hmco.com> <87egj01yde.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1440026694 13567 80.91.229.3 (19 Aug 2015 23:24:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Aug 2015 23:24:54 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M34347@lists.math.uh.edu Thu Aug 20 01:24:42 2015 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZSCil-00088S-Ap for ding-account@gmane.org; Thu, 20 Aug 2015 01:24:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.85) (envelope-from ) id 1ZSChs-0002Ux-OC; Wed, 19 Aug 2015 18:23:44 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1ZSChp-0002Ua-U8 for ding@lists.math.uh.edu; Wed, 19 Aug 2015 18:23:42 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1ZSCho-0005zb-97 for ding@lists.math.uh.edu; Wed, 19 Aug 2015 18:23:41 -0500 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by quimby.gnus.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1ZSChm-0008KN-Kz for ding@gnus.org; Thu, 20 Aug 2015 01:23:38 +0200 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D5B002031A for ; Wed, 19 Aug 2015 19:23:36 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Wed, 19 Aug 2015 19:23:36 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=5MoBTo7ACRNvNt4b9O7RpXYFM44=; b=GlKur mxHo+YSgk0qLn6RxXJ0wlLJbLk9EUasXy8qSzPwNezghhZEvZxBVKeGntJnLYQ0l PkHfb0XjafAm0CTH9SQ92HCUCp+yRK5ST8uTwrYHdKj8tT/EniinI+5DzS03BQmp 4omNmnDu7FmHAudupcyvK1dx5M3867hPV+WyOo= X-Sasl-enc: e1AoC03Sh4NtMbYwcv+idYeJWtm0wD0SA2WMlpLkNqns 1440026616 Original-Received: from PFDStudio-Air.home (pool-98-110-161-120.bstnma.fios.verizon.net [98.110.161.120]) by mail.messagingengine.com (Postfix) with ESMTPA id 94F47C00012; Wed, 19 Aug 2015 19:23:36 -0400 (EDT) In-Reply-To: <87egj01yde.fsf@gnu.org> (Tassilo Horn's message of "Tue, 18 Aug 2015 16:10:05 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.51 (darwin) X-Spam-Score: -2.9 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:86113 Archived-At: On 8/18/15 10:10 AM, Tassilo Horn wrote: > > Binding keys to vectors of keys is not the best way to persist keyboard > macros. Basically, I'd recommend you re-record your macro using > > 1. Start recording with . > > 2. Perform the actions you want to record, e.g., expire the current > message and move on to the next one. You can use key bindings for > that but also the menu or tool bar or M-x ... > > 3. Finish recording of the macro with . > > 4. Give the last recently recorded keyboard macro a name, e.g., > `pd/gnus-expire-and-move-on' using `C-x C-k n' > > 5. Open your ~/.emacs, move point to some empty line and do ` M-x > insert-kbd-macro RET pd/gnus-expire-and-move-on RET'. This will > insert a command definition for the given keyboard macro. Then you > can bind that command rather than a plain key sequence in your > `pm/alter-*-map' functions which I guess are run in > `gnus-summary-mode-hook' and `gnus-article-mode-hook'. > Thanks very much for the detailed instructions. This will certainly be useful in the future. However, ... I did this, resulting in: (fset 'pd/gnus-expire-and-show-next (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ("E " 0 "%d")) arg))) (defun pm/alter-summary-map () ; (local-set-key "d" [?M ?M ?e ?e down ?g]) (local-set-key "d" 'pd/gnus-expire-and-show-next) (local-set-key "vj" "BmINBOX.Junk Mail") ) Unfortunately, I'm *still* getting: After 0 kbd macro iterations: undefined: Keyboard macro terminated by a command ringing the bell Ah, well. Thank you! -pd -- ---- Peter Davis The Tech Curmudgeon www.techcurmudgeon.com