unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Vasilij Schneidermann <v.schneidermann@gmail.com>
Cc: 25656@debbugs.gnu.org
Subject: bug#25656: [PATCH] 25.1; remember-notes-mode makes every temporary buffer created from it unkillable
Date: Fri, 24 Feb 2017 08:40:34 +0100	[thread overview]
Message-ID: <20170224074034.GA615@odonien.localdomain> (raw)
In-Reply-To: <CAPGgwWSnNOqjfns2xfipKGksvynDdtuES3JeK286_DLisT8bTw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 122 bytes --]

I wrote a simple patch for merely checking whether the buffer about to
be killed happens to be the remember-notes buffer.

[-- Attachment #2: 0001-Make-only-remember-notes-buffer-unkillable.patch --]
[-- Type: text/x-diff, Size: 1070 bytes --]

From b1f95cf53fdb3574525f3644df668f357405f4a1 Mon Sep 17 00:00:00 2001
From: Vasilij Schneidermann <v.schneidermann@gmail.com>
Date: Fri, 24 Feb 2017 08:36:38 +0100
Subject: [PATCH] Make only remember-notes buffer unkillable

* remember.el (remember-notes--kill-buffer-query): Check whether
  buffer to be killed is the remember-notes buffer
---
 lisp/textmodes/remember.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el
index 388e49cfdc..a217357471 100644
--- a/lisp/textmodes/remember.el
+++ b/lisp/textmodes/remember.el
@@ -649,7 +649,8 @@ Save the current buffer if modified.  If `remember-notes-bury-on-kill'
 is non-nil, bury it and return nil; otherwise return t."
   (when (buffer-modified-p)
     (save-buffer))
-  (if remember-notes-bury-on-kill
+  (if (and remember-notes-bury-on-kill
+           (equal (buffer-name (current-buffer)) remember-notes-buffer-name))
       (progn
         ;; bury-buffer always returns nil, but let's be explicit.
         (bury-buffer)
-- 
2.11.0


  reply	other threads:[~2017-02-24  7:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08 23:12 bug#25656: 25.1; remember-notes-mode makes every temporary buffer created from it unkillable Vasilij Schneidermann
2017-02-24  7:40 ` Vasilij Schneidermann [this message]
2017-02-25  1:16   ` bug#25656: [PATCH] " npostavs
2017-02-25  9:47     ` Vasilij Schneidermann
2017-02-25 12:12     ` Vasilij Schneidermann
2017-02-25 12:15 ` Vasilij Schneidermann

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=20170224074034.GA615@odonien.localdomain \
    --to=v.schneidermann@gmail.com \
    --cc=25656@debbugs.gnu.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).