emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: dal-blazej@onenetbeyond.org
To: Shankar Rao <shankar.rao@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Unintended consequences of removing org-speed-commands-user
Date: Sun, 28 Nov 2021 13:15:02 +0100	[thread overview]
Message-ID: <87zgpolbnd.fsf@onenetbeyond.org> (raw)
In-Reply-To: <CAGEgU=gm=hRVw6g5wzjEwRx_1=K8haeWZn1KRQtRYWVGi2z-GQ@mail.gmail.com> (Shankar Rao's message of "Wed, 24 Nov 2021 10:36:37 +0100")


Hi,

If you want to insert a new element in the list after a particular
element, you could do :

#+begin_src emacs-lisp 
(let ((bk (cdr (member '("Agenda Views etc") org-speed-commands))))
  (setf (cdr (member '("Agenda Views etc") org-speed-commands))
        (cons '("@" . my-foobarized-speed-command) bk)))
#+end_src

Use append to insert a list of new elements instead of one.

Also simply add a new list at the end, use append :

#+begin_src emacs-lisp :results code
(setq org-speed-commands 
      (append org-speed-commands '(("my foo commands!")
                                   ("@" . my-foobarized-speed-command)
                                   ("&" . my-barfooized-speed-command))))
#+end_src

However if you define many new commands, simply redefining the whole
list is simpler ;)


  reply	other threads:[~2021-11-28 12:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24  9:36 Unintended consequences of removing org-speed-commands-user Shankar Rao
2021-11-28 12:15 ` dal-blazej [this message]
2021-11-30 12:13   ` Shankar Rao
2021-11-30 14:19 ` [PATCH] New function org-speed-command-add for adding/modifying speed commands Shankar Rao
2022-05-03 10:24   ` Ihor Radchenko
2022-05-17 13:01     ` Shankar Rao
2022-05-18 13:12       ` Ihor Radchenko

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=87zgpolbnd.fsf@onenetbeyond.org \
    --to=dal-blazej@onenetbeyond.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=shankar.rao@gmail.com \
    /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).