Questions tagged [advice]

is for the Elisp advice feature that changes an existing definition of a function in a way that lets you undo the change easily. This tag applies to both old and new advice features. The old advice feature uses `defadvice`. The new advice feature uses functions and macros such as `advice-add` and `add-function`.

14 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
348 views

How to set the colors for pdf-tools annotations individually?

I would like to be able to set the annotation colors to be different (e.g. strike-out "black" while keeping highlight "yellow"). I asked about this as an issue at the github page for pdftools and was ...
3
votes
0answers
669 views

mu4e without mu server process

Occasionally I get error from mu4e error in process sentinel: Database is locked by another process. To solve this issue I usually end up to kill the process in list-process or sometimes pkill emacs ...
3
votes
0answers
55 views

Passing advice to mode line

I'd like to advise format-mode-line to collapse whitespace across the whole string. The following attempt does not work for me. (advice-add 'format-mode-line :filter-return 'collapse-whitespace) ...
2
votes
0answers
59 views

how to “extend” an existing function?

What I want to do: have the function evil-delete do one more task after its usual code. (I'm presuming that evil-delete is the underlying workhorse that is called by evil-delete-line and about five ...
2
votes
0answers
65 views

How to find out what advice has been defined for a function?

I accidentally added a lambda function that wasn't done being written to the advice of a function, and the function doesn't work. I don't know the exact text of the lambda function. Obviously, I could ...
2
votes
0answers
295 views

Faces not set immediately after load-theme

I'm trying to set the faces of highlight-indent-guides automatically whenever a new theme is loaded by making small adjustments to the background color of the default face. I have everything working ...
1
vote
0answers
32 views

Get time since last keystroke

I would like to know how many seconds have passed since the last keystroke (or character that showed up in the screen, whatever is easier). Is there a timer that is associated to self-insert-command? ...
1
vote
0answers
33 views

Why doesn't the window begin and end update after `outline-show-all`?

I'm using this test code. (defun +outline~show-all (orig-fn &rest args) "Show all." (let ((beg1 (window-start)) (end1 (window-end)) (beg2) (end2)) (apply orig-fn args) ...
1
vote
0answers
86 views

advise around org-add-note behaves differnt in Windows and macOS

I have the following in my init.el file: (defun my::with-no-drawer (func &rest args) (interactive "P") (let ((org-log-into-drawer (car args))) (funcall-interactively func args))) ...
1
vote
0answers
140 views

Find where advice is defined (defadvice)

When a function documentation page tells me that a function has advice, is there any way to find out where that piece of advice is defined? This is advice that was created using the defadvice ...
0
votes
0answers
20 views

How to properly advise macros used by functions if earlier byte-compilation is present?

I am trying to customize the looks of org-agenda and, in order to do so, I would like to advice the macro org-agenda--insert-overriding-header; this macro appears to be used in several functions. ...
0
votes
0answers
25 views

How do I stop checkdoc from flagging header/footer in org-src-edit buffers?

When editing Emacs Lisp source blocks in org-mode via org-src-edit, if flycheck is enabled (which I'd like to keep that way) checkdoc rather annoyingly remarks that I'm missing headers and footers and ...
0
votes
0answers
63 views

Using advices to flatten a single subfolder

One of Github's features i like is that it "flattens" path if a folder contains only one subfolder, i.e you have a src folder which has only main folder, so by clicking on src you go to the content of ...
0
votes
0answers
40 views

Updating advice in function

I've noticed that if function f is used to advise function g through advice-add, and function f is then redefined, function g's advice is not updated. After digging into advice-add a bit, it is clear ...