all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@online.de>
To: emacs-devel@gnu.org
Cc: Daniel Colascione <dancol@dancol.org>,
	Andreas Schwab <schwab@linux-m68k.org>
Subject: Re: RFC: DWIM for killing *shell* and a more process-query-on-exit
Date: Sun, 29 Mar 2015 10:04:30 +0200	[thread overview]
Message-ID: <5517B20E.5020804@online.de> (raw)
In-Reply-To: <55179479.2030109@dancol.org>

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




  parent reply	other threads:[~2015-03-29  8:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-29  5:58 RFC: DWIM for killing *shell* and a more process-query-on-exit Daniel Colascione
2015-03-29  7:23 ` Andreas Schwab
2015-03-29  8:23   ` Daniel Colascione
2015-03-29  8:30     ` Andreas Schwab
2015-03-29  8:04 ` Andreas Röhler [this message]
2015-03-29  8:23   ` Daniel Colascione
2015-03-29 13:22     ` Andreas Röhler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5517B20E.5020804@online.de \
    --to=andreas.roehler@online.de \
    --cc=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.