From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wAvoKKdTAGJHNAEAgWs5BA (envelope-from ) for ; Mon, 07 Feb 2022 00:03:03 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mG1SJadTAGKFzQAAauVa8A (envelope-from ) for ; Mon, 07 Feb 2022 00:03:03 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3535B31351 for ; Mon, 7 Feb 2022 00:03:03 +0100 (CET) Received: from localhost ([::1]:35052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGqYf-0001Vz-Qe for larch@yhetil.org; Sun, 06 Feb 2022 18:03:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGqY4-0001Vi-FH for emacs-orgmode@gnu.org; Sun, 06 Feb 2022 18:02:24 -0500 Received: from [2a00:1450:4864:20::533] (port=35749 helo=mail-ed1-x533.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGqY2-0000zj-EM for emacs-orgmode@gnu.org; Sun, 06 Feb 2022 18:02:24 -0500 Received: by mail-ed1-x533.google.com with SMTP id f17so8983289edd.2 for ; Sun, 06 Feb 2022 15:02:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=PQB6j8heL8Cjr4a4XPbX1yLNB0jUxn/IG/43/KXdWKs=; b=D47Q3k1lEewUzUrQmt/QjmjXsZg1Bm08rPdjeeWQbwdMT3KxfeSdPwZYKgI/eStpKf CSvUz7BwCyagIc5h4Xr+xwDJA95KyZ4YzKR/ZZxYPpqNpDAOhTV0DSNL1d0EHo1LpIXZ C8Eb8NNRqvV1kZdAXzLCC5mI6cy32B898aEE4rgJPCNbFLCb+hF900PEPVs1nn+LYDxb Vc2Z23T9WjKtLJqb/c25nI1JuSFqdbk0R1fNfU0DKordv9UQ+Ya1A+oVhbIdYI40XiHg jN9L2Hi5sjulJBSXzGBSl/UyP+8mwOBGUp39i7qDSh+puwe2W0hHnQ6dApQaZDscZxmS Rm4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=PQB6j8heL8Cjr4a4XPbX1yLNB0jUxn/IG/43/KXdWKs=; b=wMe7DRRoVKzj+F6NK0HmhrC2GRE2S5R6HOs+/0nuqZN0nAQBcqSGbs7PlVpkC4XDNg geBAdrTxJ0m9QeEk1xROrhA5s9m1nu6WHS7NhDlPkssBytMbXObHiuxwlHHMp7AXfHJi 6PRBrh2Kw9UTxGtxRiFoVdghmBYOeq1trhnHOwI2V3gZng9YhRiZK7WSOpK8FAWSrvPM UJQ7M2wHhr+camkVmAW5vhIEP7AHc8/VnliRYw4quJO+7OSrbwKmuwYrHyfCbqNwqndb vfs9FTYTAY227afUuy4b4MsrGUKlGMPhuHfbu3YmaJF9gYOkaASFDrbZQgmU5Yy1U+8u rlUA== X-Gm-Message-State: AOAM53286Nn/yq9VregUvfCp+3FnXGxQW7duKpOLdnZbdd/Xmp7ohijc /PrEAkNDDzVOeAVG2dLvRSI= X-Google-Smtp-Source: ABdhPJzwawrQpH6Pa7MzfZPIDCpXUoJMrHMq8InouLyZIXtKFO1s0FIGyGagDCm2ayC6UMNJ8n1ATw== X-Received: by 2002:a05:6402:348c:: with SMTP id v12mr10785324edc.384.1644188540347; Sun, 06 Feb 2022 15:02:20 -0800 (PST) Received: from aspire-5942 (p200300d867371d00a08e53d75dda2d14.dip0.t-ipconnect.de. [2003:d8:6737:1d00:a08e:53d7:5dda:2d14]) by smtp.gmail.com with ESMTPSA id f25sm2488409edr.64.2022.02.06.15.02.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Feb 2022 15:02:19 -0800 (PST) From: Marco Wahl To: Stefan Monnier Subject: Re: Minor patch for org-attach.el References: Date: Mon, 07 Feb 2022 00:02:07 +0100 In-Reply-To: (Stefan Monnier's message of "Sun, 06 Feb 2022 17:21:52 -0500") Message-ID: <878runwqds.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::533 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=marcowahlsoft@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Wiegley , emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644188583; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=PQB6j8heL8Cjr4a4XPbX1yLNB0jUxn/IG/43/KXdWKs=; b=HK3kY/dT9E4xRrPgiayv1p5QwmbBFqnF6pgnu8m5uOPbjVjfL9OlXAddastp4wX8KQsHA5 jblXTGXn5UrKnxGfeYS/9fgekvosmgitfOmudEorBlxFPdBVyQHys9S9MfNu0DJ7ynPP+1 VXF7WQSeDKIAecazZmdK2i2gNqli63ttZhwkK+9kR82u/GVKcm9YvbLcsIYYii6bXfCuiV mkm0Mem9YEHCvNRRibZVkrtaI46lV3YB2MEYdFT63F6k5UVy1vkFHBk+nHlnFpldSvOFaZ 2Uvl98+6iJVncK9aNl4dmeljkzmhX85QgEGQexbgkcfVegirSwr/PGuSXIEriA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644188583; a=rsa-sha256; cv=none; b=TiSby98M8kBAkoXp0r4X+HcZv4F2c0G2kOIseoJ/jpVQbJAAsIQA9EpU8p0sE+3+qBA5uU 65AUDu+gdHZNsDQ/feYMnFJ1z4cqZx8N/DD8V/MMHG9Q7SLMELDhUQ0upy3Oq2pt/IVsj6 qFPT3VVKHciwAQzgcFD5Cf9AMgEqC4glW7Z+6ovH3AFhI7fDwO3a34+3jtGqFqnD9oqMfe BERI6H4MobRXKzuEG6M4t1YM+DZXtJPbkBqU5vSkgHaakHTXvVezC6VviUM2odz6XC4Okw U5ia78ab4bVaKuSJeMikaCSka42kbt4RnSwmOrmrF6YsXS8yiLzRtb2FoiuboA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=D47Q3k1l; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.33 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=D47Q3k1l; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3535B31351 X-Spam-Score: -3.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9fgYer5EmdD0 Stefan Monnier writes: > Here's a patch which cleans up some magic numbers in > `org-attach.el` and gets rif of the use of the second arg of `commandp`, > by making `org-attach-commands` accept any commands (including keyboard > macros). > > > Stefan > > > diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el > index 36c21b7021..bba7fd7690 100644 > --- a/lisp/org/org-attach.el > +++ b/lisp/org/org-attach.el > @@ -314,14 +314,14 @@ org-attach > (concat (mapcar #'caar org-attach-commands))))) > (message msg) > (while (and (setq c (read-char-exclusive)) > - (memq c '(14 16 22 134217846))) > + (memq c '(?\C-n ?\C-p ?\C-v ?\M-v))) > (org-scroll c t))) > (and (get-buffer "*Org Attach*") (kill-buffer "*Org Attach*")))) > (let ((command (cl-some (lambda (entry) > (and (memq c (nth 0 entry)) (nth 1 entry))) > org-attach-commands))) > - (if (commandp command t) > - (call-interactively command) > + (if (commandp command) > + (command-execute command) > (error "No such attachment command: %c" c)))))) > > (defun org-attach-dir (&optional create-if-not-exists-p no-fs-check) Thanks Stefan! I pushed this to the development branch 'main' of Org. Bye, -- Marco