I just found the term I'm looking for: "advice" -- here's an unrelated example: https://emacs.stackexchange.com/questions/17169/change-order-of-buffers-in-helm-buffers-list On Wed, Aug 14, 2019 at 3:36 PM Nathan Neff wrote: > Hello all, > > There are quite a few commands I run in org-mode to jump to > headlines: org-clock-goto org-capture-goto-last-stored, etc. > > Sometimes, I would prefer that those "jump" commands would use > a new window to perform the jump. > > In my quest to learn Lisp a bit better, I'd like to ask for recommended > way(s) to set some kind of flag "e.g. use-other-window", and "wrap" > the various jump commands with code to switch to the other window (or > create one) > and then call the function. > > For example, something like: > > (def decorator njn-switch-or-create-window() ) > (if use-other-window ( switch or create window)) > (call original function) > ) > > (decorate (org-tags-view, org-clock-goto, org-capture-goto-last-stored > njn-switch-or-create-window > > I *know* Lisp has a bunch of ways of doing this, but I would > like to hear the "best" way to attempt something like this :) > > Thanks, > --Nate > > >