Skip to main content
3 of 3
edited body
Drew
  • 79.1k
  • 10
  • 123
  • 257

Using advice-add to redefine a function call within another function

The function outshine-cycle (part of Outshine) calls the function indent-relative. I would like that instead, it called the function indent-for-tab-command.

To do this, I want to advise the function outshine-cycle. I imagine this could look like the following (which is not working):

(defun my-indent (orig-fun &rest args)
  (cl-flet ((indent-relative () (indent-for-tab-command)))))

(advice-add 'outshine-cycle :around #'my-indent)

Any ideas?

scaramouche
  • 1.8k
  • 11
  • 26