emacs-devel
[Top][All Lists]
Advanced

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

Re: RFC: DWIM for killing *shell* and a more process-query-on-exit


From: Andreas Röhler
Subject: Re: RFC: DWIM for killing *shell* and a more process-query-on-exit
Date: Sun, 29 Mar 2015 10:04:30 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Hi Daniel,

as changing C-source might turn costly, what about that:

(defun kill-buffer-unconditional (&optional buffer)
  "Kill buffer unconditional, kill buffer-process if existing.

Sometimes being queried sucks..."
  (interactive
   (list (current-buffer)))
  (let ((buffer (or (and (bufferp buffer) buffer)
            (get-buffer (current-buffer))))
    proc kill-buffer-query-functions)
    (if (buffer-live-p buffer)
        (progn
          (setq proc (get-buffer-process buffer))
          (and proc (kill-process proc))
          (set-buffer buffer)
          (set-buffer-modified-p 'nil)
          (kill-buffer (current-buffer)))
      (message "Can't see a buffer %s" buffer))))


At least that's used here mostly when closing a buffer.

Cheers,

Andreas




reply via email to

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