From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 YPOWBi5KAGLu+QAAgWs5BA (envelope-from ) for ; Sun, 06 Feb 2022 23:22:38 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id sGnOOi1KAGKBQgEAG6o9tA (envelope-from ) for ; Sun, 06 Feb 2022 23:22:37 +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 B72A830452 for ; Sun, 6 Feb 2022 23:22:37 +0100 (CET) Received: from localhost ([::1]:45344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGpvX-00041F-L0 for larch@yhetil.org; Sun, 06 Feb 2022 17:22:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGpv8-000416-QN for emacs-orgmode@gnu.org; Sun, 06 Feb 2022 17:22:10 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:53926) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGpv6-0003sZ-Cq for emacs-orgmode@gnu.org; Sun, 06 Feb 2022 17:22:10 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D65D9100189; Sun, 6 Feb 2022 17:22:05 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C28FE10000D; Sun, 6 Feb 2022 17:21:59 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1644186119; bh=ufNbv9rl3cSgiiohr4/gyhaS7z9ITUZnJvvKYcUCeGI=; h=From:To:Cc:Subject:Date:From; b=he21dw9VmPBZUdwEW2x5kNSQmFKhTilnD7iAUUI0SPrvY8csTQMGgcqM4cBxIgF3M ClawNP4lZ48v15tNR8I7GRbmzyK3gzJII4PJCwrH04EVNHFWYEirk2WdOBTr7OBdI6 pKsaNlX2r2dpYT0Y6cW/am78lfK2i3pDDWiqlBUUXO4aP5hqoAQGkYmpJhXOOo5bck 8eN43iHmYfd/YB7D6Ry92ngpBSGvHAh7C7wM2UEfiVAIyWJ8RMMVOK13kmAi8/dWZu Fw3XU8FfAuFjYvDczOmM/O1vx9fb82Tb2PaPQOUINp3yOSkKjKCQ3SyRfsYAa6f8JN YgwV6PeEjU9gQ== Received: from ceviche (76-10-138-212.dsl.teksavvy.com [76.10.138.212]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5CEC612059A; Sun, 6 Feb 2022 17:21:59 -0500 (EST) From: Stefan Monnier To: emacs-orgmode@gnu.org Cc: John Wiegley Subject: Minor patch for org-attach.el Message-ID: Date: Sun, 06 Feb 2022 17:21:52 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , 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=1644186157; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=yhECLUqrqsVGdHxYLY0mwERxfRKM5jcBL3VIwTwNBUQ=; b=urkrvi0Ahe5mRIk4AZVMZegWXXG1R3e4QSwfv2AK43JkTiah0NsNlZMROYP6vIE/SpUBay ks0T35jkroVCAJx5JuJMNz7WhmFfQHPltT4VsCUQJk7Ibap/YjY42Yqr+boVblhWTSlUGo 1dsKZCPf0I82dcTjoZAw2LWN2ZNEK19ttPGdqQP+bgki8PzcfN2xzYik/hZORbbx6stf5i 6KPwTjtBtC4vS80xGE6DRcIwT7lJzXWfKoVgeBWTCv2yHWygS/uFZB73obcYlHW0HFXkFY DMU9bguX/0v1/NdiWuOHLwWR8U6cNHidbgNotZze+OkREvWWdbgfUxKed7m6PQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644186157; a=rsa-sha256; cv=none; b=DmilLq03uRsIebJR8ZMb152+OG9ns6mRrgrX2Zx+H/vsTcblaqa+4IXzSU5/UEIeDNRagC wTkqzwF7qsiIWDKf+7zmJNkg/x6I/8RTF4L+CQerRtGNb2iFb5MhbjX/SW8SkFKbFobJp9 GJ3JAcPCgS/2iWrAVl7QlEE5TUnwo58grxeD9kXPx+tg7ciou4fAu9JcHUi2IJFA2sv6dV Qc99wlOoOVJW+Vlcl7WdtdQzLunbrpnzAtXvnOst/86kVOUx7dPOKbZu/462noluNg3kCB l4wfEbXrlzOZ401XRH8psiB2KIxfE3cKdt4yew112l/bx8oA0zvSBLKmdspYlg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=iro.umontreal.ca header.s=mail header.b=he21dw9V; dmarc=pass (policy=quarantine) header.from=iro.umontreal.ca; 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: -8.63 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=iro.umontreal.ca header.s=mail header.b=he21dw9V; dmarc=pass (policy=quarantine) header.from=iro.umontreal.ca; 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: B72A830452 X-Spam-Score: -8.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: vAL3lvaYFEOI 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)