From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Daniel Colascione" Newsgroups: gmane.emacs.devel Subject: Re: dabbrev-expand should escape kbd macros, shouldn't it? Date: Wed, 17 Jul 2019 11:30:54 -0700 Message-ID: References: <4ea4470ad1919b2f1915d6ec77f7d2b8.squirrel@dancol.org> Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="44075"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: SquirrelMail/1.4.23 [SVN] Cc: Daniel Colascione , emacs-devel@gnu.org To: "Andreas Schwab" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 17 20:31:03 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hnohi-000BKw-AO for ged-emacs-devel@m.gmane.org; Wed, 17 Jul 2019 20:31:03 +0200 Original-Received: from localhost ([::1]:59618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnohh-0003Ma-1B for ged-emacs-devel@m.gmane.org; Wed, 17 Jul 2019 14:31:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56381) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnohe-0003M5-P9 for emacs-devel@gnu.org; Wed, 17 Jul 2019 14:30:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hnohd-00066b-Nj for emacs-devel@gnu.org; Wed, 17 Jul 2019 14:30:58 -0400 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:59248) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hnohc-00065U-VP for emacs-devel@gnu.org; Wed, 17 Jul 2019 14:30:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:To:From:Subject:Date:References:In-Reply-To:Message-ID; bh=zBjBH0KSxFcQnyvTKEYpWdZpO/PhxecaCjN+rDh/cdU=; b=kOTFwYPT2k6tU2Gt0/ie6VGtYrfilPX1oRtaYNgjMK/JUsU02vn8P1B3L7SbZ2Gc3XWfORlAOnTqrhDCETqPxQfSf+PrgbqNcZu65ijI2WI5B28VTHiqx2vY4QJ3ybcuy5om0Si+W2SZILBaX7aeSsM+WWXojXx7XrcBb23wlJcwGonsTQjvsNGnrN1ihnilAPPAYLPPKrQsanmBAOw9Gol2JAP1Eq7fcrnhNzkrVfvFQp0Uh51yd08eqHf8XTekt4HsxJ/3nY8juwrvaeHAZshpIrJqWj+q3PL7cQo42zhbFOqKv2U+7BfseVxdNDmZB2TYYhODlUwLMFP9M/Z65A==; Original-Received: from localhost ([127.0.0.1] helo=dancol.org) by dancol.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnoha-0006wP-Ju; Wed, 17 Jul 2019 11:30:54 -0700 Original-Received: from 127.0.0.1 (SquirrelMail authenticated user dancol) by dancol.org with HTTP; Wed, 17 Jul 2019 11:30:54 -0700 In-Reply-To: X-Priority: 3 (Normal) Importance: Normal X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238619 Archived-At: > On Jul 17 2019, "Daniel Colascione" wrote: > >> Right now, if you record a kbd macro and hit M-/, the act of hitting M-/ >> is recorded like any other command in the kbd macro. On replay, we'll >> run >> dabbrev-expand. The problem is that dabbrev-expand produces radically >> different results depending on buffer context, making macro replay >> unpredictable. Should the *result* of dabbrev-expand just get put into >> the >> kbd macro instead? > > How is that different from any other key that is part of the macro? The > point of a kbd macro is to record keys, not their effect (or even their > binding). Sort of. We make keyboard macros in the first place so we can do a thing over and over. It turns out that dumbly recording and replaying keystrokes is a pretty good strategy for lightweight automation. But dumb key recording doesn't work well in some cases, and dabbrev is one of those. I use dabbrev because I want to insert a specific string, cycling through alternatives until I find the one I want. That's going to produce different results on different occasions. Most of the time, recorded keystrokes in macros aren't that sensitive to _temporal_ and _interbuffer_ context, and dabbrev is, so I think we should make an exception for dabbrev.