From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: Is `kbd' idempotent? Date: Tue, 01 Dec 2015 15:25:09 +0100 Message-ID: <87mvtu6ybe.fsf@web.de> References: <87a8pvqzij.fsf@web.de> <87bnabv6m6.fsf@fencepost.gnu.org> <87610jqxx6.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1448979985 13306 80.91.229.3 (1 Dec 2015 14:26:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Dec 2015 14:26:25 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 01 15:26:15 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a3lsY-000682-6i for ged-emacs-devel@m.gmane.org; Tue, 01 Dec 2015 15:26:02 +0100 Original-Received: from localhost ([::1]:52944 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3lsX-0001vL-4f for ged-emacs-devel@m.gmane.org; Tue, 01 Dec 2015 09:26:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3ls7-0001qm-5H for emacs-devel@gnu.org; Tue, 01 Dec 2015 09:25:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3ls3-00039E-3t for emacs-devel@gnu.org; Tue, 01 Dec 2015 09:25:35 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:58768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3ls2-00039A-TN for emacs-devel@gnu.org; Tue, 01 Dec 2015 09:25:31 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1a3lrt-00058T-OW for emacs-devel@gnu.org; Tue, 01 Dec 2015 15:25:21 +0100 Original-Received: from ip-90-186-3-210.web.vodafone.de ([90.186.3.210]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 Dec 2015 15:25:21 +0100 Original-Received: from michael_heerdegen by ip-90-186-3-210.web.vodafone.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 Dec 2015 15:25:21 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip-90-186-3-210.web.vodafone.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:i4l0BXvWQAYCL6aU+kul0u8+Pwc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:195672 Archived-At: Random832 writes: > What exactly do you define as "any format that Emacs > understands" - do you want to allow backslash-escapes (even > though no characters requiring such are used in keyboard macro > format)? Control characters typed directly with C-q? A vector > literal such as "[?\\M-x]" representing [134217848]? The string > "(kbd \"foo\")"? Emacs understands all of these. > Basically, what other formats, specifically, do you want to > accept? What formats do you think your documentation will cause > your users to be inclined to type? The input from the user is `read' and evaluated. Any expression that evaluates to something that would be accepted by `define-key' should be accepted as input. I'm deliberating if I'm doing the user a favor if I pass any `stringp' input implicitly to `kbd', because the keyboard macro format seems to be quite popular. That would spare him to wrap his input into `kbd' by himself. But if the result of `kbd' can change the "semantics" of a string describing a key sequence - as your counterexamples demonstrate - I can't do that. Thanks for all answers, Michael.