Closed super-tomcat closed 3 years ago
Hi, is there anyway to intercept the user pressing C-g when they cancel the popup menu, so that i can take some action before my program ends?
Hi, I don't want do you mean here. Do you mean that you want to do some execution before the popup menu ends? 😕
Hi, is there anyway to intercept the user pressing C-g when they cancel the popup menu, so that i can take some action before my program ends?
Hi, I don't want do you mean here. Do you mean that you want to do some execution before the popup menu ends? 😕
Yes, i need to set some variables back before quitting.
I think you can add advice after popup-delete
function? Not sure if this will work.
(advice-add 'popup-delete :after (lambda (popup) (message "do somthing"))
I think you can add advice after
popup-delete
function? Not sure if this will work.(advice-add 'popup-delete :after (lambda (popup) (message "do somthing"))
I couldnt get that to work, i am using... popup-menu not popup-create.... would that work for popup-menu ??
I found a way using (inhibit-quit t)
with:
(unless (with-local-quit
(progn
etc
After user presses C-g i can then intercept, do what i need and set Quit flag to t with (setq quit-flag t)
Glad you figure it out yourself! ;)
Close this now!
Hi, is there anyway to intercept the user pressing C-g when they cancel the popup menu, so that i can take some action before my program ends?
It seems to me that when using popup-menu* it just cancels without informing the calling program.
thanks