Skip to main content
edited body
Source Link
Drew
  • 79.1k
  • 10
  • 123
  • 257

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 adviceadvise 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?

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 advice 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?

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?

edited tags
Link
shynur
  • 5.9k
  • 1
  • 5
  • 28
Source Link
scaramouche
  • 1.8k
  • 11
  • 26

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 advice 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?