[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to advice save-buffers-kill-terminal?

From: Emanuel Berg
Subject: Re: How to advice save-buffers-kill-terminal?
Date: Wed, 20 Apr 2016 00:52:40 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Shiyao Ma <address@hidden> writes:

> For the following code:
> (advice-add 'save-buffers-kill-terminal :around
> #'(lambda (oldfunc &rest r) (cl-flet ((yes-or-no-p
> (msg)


Did I ever hear of I guy who succeeded doing anything
with advices? Yes: several times!


Here is what I would do. In the now commented-out
"kill-everything" function is where you shut
everything down gracefully, e.g., Gnus and any other
software you might run.

    (defun no-confirm-emacs-quit ()
      ; (kill-everything)
      (save-buffers-kill-terminal t) ) ; silently save ... kill

    (define-key (current-global-map)
      [remap save-buffers-kill-terminal] #'no-confirm-emacs-quit)

Full example source:

Sensible blog post on this theme:

underground experts united ....
Emacs Gnus Blogomatic .........
                   - so far: 25 Blogomatic articles -                   

reply via email to

[Prev in Thread] Current Thread [Next in Thread]