emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marco Wahl <marcowahlsoft@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: John Wiegley <johnw@newartisans.com>, emacs-orgmode@gnu.org
Subject: Re: Minor patch for org-attach.el
Date: Mon, 07 Feb 2022 00:02:07 +0100	[thread overview]
Message-ID: <878runwqds.fsf@gmail.com> (raw)
In-Reply-To: <jwvwni7y70r.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sun, 06 Feb 2022 17:21:52 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> 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


  reply	other threads:[~2022-02-06 23:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-06 22:21 Stefan Monnier
2022-02-06 23:02 ` Marco Wahl [this message]
2022-02-07  0:13   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878runwqds.fsf@gmail.com \
    --to=marcowahlsoft@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=johnw@newartisans.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).