unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add `notes' function to store random notes across Emacs restarts.
@ 2013-06-17 16:13 Michal Nazarewicz
  2013-06-17 16:44 ` Stefan Monnier
  2013-06-17 17:00 ` Juanma Barranquero
  0 siblings, 2 replies; 9+ messages in thread
From: Michal Nazarewicz @ 2013-06-17 16:13 UTC (permalink / raw)
  To: Glenn Morris, Stefan Monnier; +Cc: Ted Zlatanov, emacs-devel

From: Michal Nazarewicz <mina86@mina86.com>

You may think of it as a *scratch* buffer whose content is preserved.
In fact, it was designed as a replacement for *scratch* buffer and can
be used that way by setting `initial-buffer-choice' to 'notes an
`notes-buffer-name' to "*scratch*".  Without the second
change, *scratch* buffer will still be there for notes that do not
need to be preserved.

* list/startup.el (notes): New function creating notes buffer.
(notes-file, notes-recover-from-auto-save-file, notes-buffer-name)
(initial-notes-major-mode): New customize variables for customizing
behaviour of the notes buffer.
(notes--bury-on-kill-buffer, notes--insert-content): New helper
functions for `notes' function.
(notes--buffer): New helper variable for `notes' function.
(notes--initial-message): New helper constant for `notes' function.
---
 etc/NEWS        |   8 +++
 lisp/ChangeLog  |   8 +++
 lisp/notes.el   | 205 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 lisp/startup.el |   3 +-
 lisp/window.el  |  10 +++
 5 files changed, 233 insertions(+), 1 deletion(-)
 create mode 100644 lisp/notes.el

diff --git a/etc/NEWS b/etc/NEWS
index 843234a..83cab11 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -87,6 +87,14 @@ simply disabling Transient Mark mode does the same thing.
 ** `initial-buffer-choice' can now specify a function to set up the
 initial buffer.
 
+** `notes' function creates a buffer whose content is saved on kill-emacs.
+You may think of it as a *scratch* buffer whose content is preserved.
+In fact, it was designed as a replacement for *scratch* buffer and can
+be used that way by setting `initial-buffer-choice' to 'notes an
+`notes-buffer-name' to "*scratch*".  Without the second
+change, *scratch* buffer will still be there for notes that do not
+need to be preserved.
+
 ** `write-region-inhibit-fsync' now defaults to t in batch mode.
 
 ** ACL support has been added.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 632c909..bb4dc37 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
+2013-06-17  Michal Nazarewicz  <mina86@mina86.com>
+
+	Add `notes' function to store random notes across Emacs restarts.
+	* notes.el: New file.
+	* startup.el (initial-buffer-choice): Added notes to custom type.
+	* window.el (save-and-bury-buffer): New function doing what the
+	name says.
+
 2013-06-17  Dmitry Gutov  <dgutov@yandex.ru>
 
 	* emacs-lisp/package.el (package-load-descriptor): Do not call
diff --git a/lisp/notes.el b/lisp/notes.el
new file mode 100644
index 0000000..d5de55f
--- /dev/null
+++ b/lisp/notes.el
@@ -0,0 +1,205 @@
+;;; notes.el --- notes preserved across sessions  -*- lexical-binding: t -*-
+
+;; Copyright (C) 2013 Free Software Foundation, Inc.
+
+;; Author: Michal Nazarewicz <mina86@mina86.com>
+;; Maintainer: FSF
+;; Keywords: todo pim notes
+;; Package: emacs
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file defines a `notes' function which creates a buffer whose
+;; content is saved on kill-emacs.
+;;
+;; You may think of it as a *scratch* buffer whose content is preserved.
+;; In fact, it was designed as a replacement for *scratch* buffer and can
+;; be used that way by doing the following:
+;;
+;;   (setq initial-buffer-choice 'notes
+;;         notes-buffer-name "*scratch*")
+;;
+;; Without setting `notes-buffer-name', *scratch* buffer will still be
+;; there for notes that do not need to be preserved.
+;;
+;; To quickly access notes buffer, you might want to bind `notes' or
+;; `toggle-notes' function.
+
+;;; Code:
+
+(defvar notes--buffer nil
+  "The notes buffer.")
+
+(defcustom notes-file (locate-user-emacs-file "notes" ".notes")
+  "File to save notes in.
+When set via customize `buffer-file-name' variable of the notes buffer
+\(if it exists) will be changed."
+  :type 'string
+  :set (lambda (symbol value)
+	 (set-default symbol value)
+	 (when (buffer-live-p notes--buffer)
+	   (with-current-buffer notes--buffer
+	     (setq buffer-file-name value))))
+  :group 'initialization)
+
+(defcustom notes-recover-from-auto-save-file 'ask
+  "What to do if notes autosave file is newer than the notes file.
+
+t means to always recover content from auto-save file, 'ask means
+to ask user, and nil means never to recover auto-save file (which
+also disables `auto-save-mode' in the notes buffer.
+
+When set via customize, `auto-save-mode' will be enabled or disabled
+in the notes buffer according to this variable's value."
+  :type '(choice (const :tag "Always recover auto-save" t)
+                 (const :tag "Never recover auto-save" nil)
+                 (const :tag "Ask whether to recover auto-save" ask))
+  :set (lambda (symbol value)
+	 (set-default symbol value)
+	 (when (buffer-live-p notes--buffer)
+	   (with-current-buffer notes--buffer
+	     (auto-save-mode (if value 1 -1)))))
+  :group 'initialization)
+
+(defcustom notes-buffer-name "*notes*"
+  "Name of the notes buffer.
+Setting it to *scratch* will hijack the *scratch* buffer for the
+purpose of storing notes."
+  :type 'string
+  :group 'initialization)
+
+(defcustom initial-notes-major-mode t
+  "Major mode to set to notes buffer when it's created.
+If set to t will use the same mode as `initial-major-mode'."
+  :type '(choice (const    :tag "Same as `initial-major-mode'" t)
+		 (function :tag "Major mode" text-mode))
+  :group 'initialization)
+
+(defcustom bury-notes-on-kill t
+  "Whether to bury notes buffer instead of killing."
+  :type 'boolean
+  :group 'initialization)
+
+(defconst notes--initial-message (purecopy "\
+;; This buffer is for notes and for Lisp evaluation.
+;; If you want to create a file, visit that file with C-x C-f,
+;; then enter the text in that file's own buffer.
+;; Contents of this buffer will be saved across restarts.
+
+"))
+
+(defvar notes-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "\C-c\C-c" 'save-and-bury-buffer)
+    map))
+
+;;;###autoload
+(defun notes ()
+  "Creates notes buffer and switches to it if called interactively.
+
+Name of the created buffer is taken from `notes-buffer-name' variable
+and if buffer with that name already exist (but was not created by
+`notes' function), its content will be overwritten.
+
+`notes-map' is active in the notes buffer which by default contains
+only one C-c C-c binding which saves and buries the buffer.
+
+Function returns notes buffer.
+
+Notes buffer is meant for keeping random notes which you'd like to
+preserve across Emacs restarts."
+  (interactive)
+  (unless (buffer-live-p notes--buffer)
+    (setq notes--buffer (get-buffer-create notes-buffer-name))
+    (with-current-buffer notes--buffer
+      (funcall (if (eq initial-notes-major-mode t)
+		   initial-major-mode
+		 initial-notes-major-mode))
+      (setq buffer-file-name notes-file
+	    buffer-save-without-query t)
+      (auto-save-mode (if notes-recover-from-auto-save-file 1 -1))
+      ;; We don't want a "Buffer modified" prompt from kill-buffer so
+      ;; we have to use advice rather than a hook.
+      (advice-add 'kill-buffer :around 'notes--kill-buffer-advice)
+      (setq minor-mode-overriding-map-alist
+	    (cons (cons 'notes--buffer notes-map)
+		  minor-mode-overriding-map-alist))
+      (notes--insert-content)))
+  (when (called-interactively-p 'all)
+    (switch-to-buffer notes--buffer))
+  notes--buffer)
+
+;;;###autoload
+(defun toggle-notes ()
+  "Switches to notes buffer unless already there in which case buries it."
+  (interactive)
+  (if (eq (current-buffer) notes--buffer)
+      (bury-buffer)
+    (switch-to-buffer (notes))))
+
+(defun notes--insert-content ()
+  (let* ((have-file (file-readable-p buffer-file-name))
+	 (have-auto-save (and buffer-auto-save-file-name
+			      (file-readable-p buffer-auto-save-file-name))))
+    ;; If autosave is older, pretend it does not exist.
+    (and have-file
+	 have-auto-save
+	 (not (file-newer-than-file-p buffer-auto-save-file-name
+				       buffer-file-name))
+	 (setq have-auto-save nil))
+    ;; If user wants us to always recover, pretend there's no base file.
+    (and have-auto-save
+	 (eq t notes-recover-from-auto-save-file)
+	 (setq have-file nil))
+    ;; Ask user what to do.
+    (and have-file
+	 have-auto-save
+	 (if (y-or-n-p "Recover notes file? ")
+	     (setq have-file nil)
+	   (setq have-auto-save nil)))
+    (let ((file (cond (have-file buffer-file-name)
+		      (have-auto-save buffer-auto-save-file-name))))
+      (cond (file
+	     (insert-file-contents file nil nil nil t)
+	     (set-buffer-modified-p nil))
+	    ((zerop (buffer-size))
+	     (insert notes--initial-message)
+	     (set-buffer-modified-p t))))))
+
+(defun notes--kill-buffer-advice (func &optional buffer)
+  (if (null notes--buffer)
+      (funcall func buffer)
+    (setq buffer (cond ((null    buffer) (current-buffer))
+		       ((stringp buffer) (get-buffer buffer))
+		       (buffer)))
+    (and (buffer-live-p buffer)
+	 (not (when (eq buffer notes--buffer)
+		(when (buffer-modified-p buffer)
+		  (with-current-buffer buffer
+		    (save-buffer)))
+		(when bury-notes-on-kill
+		  (bury-buffer (unless (eq buffer (current-buffer)) buffer))
+		  t)))
+	 (funcall func buffer)
+	 (progn
+	   (when (eq buffer notes--buffer)
+	     (advice-remove 'kill-buffer 'notes--kill-buffer-advice)
+	     (setq notes--buffer nil))
+	   t))))
+
+;;; notes.el ends here
diff --git a/lisp/startup.el b/lisp/startup.el
index 52dd6b0..7fc1a04 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -53,7 +53,8 @@ or directory when no target file is specified."
 	  (const     :tag "Startup screen" nil)
 	  (directory :tag "Directory" :value "~/")
 	  (file      :tag "File" :value "~/.emacs")
-          (function  :tag "Function")
+	  (const     :tag "Notes buffer" notes)
+	  (function  :tag "Function")
 	  (const     :tag "Lisp scratch buffer" t))
   :version "24.4"
   :group 'initialization)
diff --git a/lisp/window.el b/lisp/window.el
index 5b00198..096b7bb 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -3429,6 +3429,16 @@ displayed there."
     ;; Always return nil.
     nil))
 
+(defun save-and-bury-buffer ()
+  "Saves and buries current buffer.
+If `buffer-modified-p' return non-nil current buffer will be
+saved via the `save-buffer' function. Regardless of modification
+state, it will also be buried with `burre-buffer'."
+  (interactive)
+  (when (buffer-modified-p)
+    (save-buffer))
+  (bury-buffer))
+
 (defun unbury-buffer ()
   "Switch to the last buffer in the buffer list."
   (interactive)
-- 
1.8.3




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `notes' function to store random notes across Emacs restarts.
  2013-06-17 16:13 [PATCH] Add `notes' function to store random notes across Emacs restarts Michal Nazarewicz
@ 2013-06-17 16:44 ` Stefan Monnier
  2013-06-17 20:24   ` Michal Nazarewicz
  2013-06-17 17:00 ` Juanma Barranquero
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2013-06-17 16:44 UTC (permalink / raw)
  To: Michal Nazarewicz; +Cc: Ted Zlatanov, emacs-devel

> * list/startup.el (notes): New function creating notes buffer.
> (notes-file, notes-recover-from-auto-save-file, notes-buffer-name)
> (initial-notes-major-mode): New customize variables for customizing
> behaviour of the notes buffer.
> (notes--bury-on-kill-buffer, notes--insert-content): New helper
> functions for `notes' function.
> (notes--buffer): New helper variable for `notes' function.
> (notes--initial-message): New helper constant for `notes' function.

Hmm... this ChangeLog hasn't been updated to reflect the fact that the
code was moved to notes.el.

+(defcustom notes-file (locate-user-emacs-file "notes" ".notes")

The ".notes" part is supposed to be for compatibility with previous
versions of the code which used ~/.notes, but these don't exist AFAIK,
so please just use (locate-user-emacs-file "notes").

BTW, the more I look at it, the more I think it belongs in GNU ELPA.


        Stefan



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `notes' function to store random notes across Emacs restarts.
  2013-06-17 16:13 [PATCH] Add `notes' function to store random notes across Emacs restarts Michal Nazarewicz
  2013-06-17 16:44 ` Stefan Monnier
@ 2013-06-17 17:00 ` Juanma Barranquero
  2013-06-17 20:39   ` Michal Nazarewicz
  1 sibling, 1 reply; 9+ messages in thread
From: Juanma Barranquero @ 2013-06-17 17:00 UTC (permalink / raw)
  To: Michal Nazarewicz; +Cc: Ted Zlatanov, Stefan Monnier, Emacs developers

On Mon, Jun 17, 2013 at 6:13 PM, Michal Nazarewicz <mpn@google.com> wrote:

> +(defcustom notes-file (locate-user-emacs-file "notes" ".notes")

This is a new feature, so no need to check for .notes. Use just
(locate-user-emacs-file "notes")

> +  "File to save notes in.
> +When set via customize `buffer-file-name' variable of the notes buffer
> +\(if it exists) will be changed."

The wording is a bit weird. What you do mean is that it will set the
visited file of the buffer.

> +Name of the created buffer is taken from `notes-buffer-name' variable
> +and if buffer with that name already exist (but was not created by

if /a/ buffer

> +`notes' function), its content will be overwritten.

> +only one C-c C-c binding which saves and buries the buffer.

Use \\[notes-save-and-bury] instead of hard-coded C-c C-c

> +      ;; We don't want a "Buffer modified" prompt from kill-buffer so
> +      ;; we have to use advice rather than a hook.
> +      (advice-add 'kill-buffer :around 'notes--kill-buffer-advice)

Why cannot  that be done from kill-buffer-hook?

> +(defun save-and-bury-buffer ()
> +  "Saves and buries current buffer.
> +If `buffer-modified-p' return non-nil current buffer will be
> +saved via the `save-buffer' function. Regardless of modification

Why it is important to note that it will be saved via `save-buffer'?

> +state, it will also be buried with `burre-buffer'."

/bury-buffer/

   J



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `notes' function to store random notes across Emacs restarts.
  2013-06-17 16:44 ` Stefan Monnier
@ 2013-06-17 20:24   ` Michal Nazarewicz
  0 siblings, 0 replies; 9+ messages in thread
From: Michal Nazarewicz @ 2013-06-17 20:24 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Ted Zlatanov, emacs-devel

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

On Mon, Jun 17 2013, Stefan Monnier wrote:
>> * list/startup.el (notes): New function creating notes buffer.

> Hmm... this ChangeLog hasn't been updated to reflect the fact that the
> code was moved to notes.el.

Sorry.  The correct one is obviously in the change to ChangeLog file.

> +(defcustom notes-file (locate-user-emacs-file "notes" ".notes")
>
> The ".notes" part is supposed to be for compatibility with previous
> versions of the code which used ~/.notes, but these don't exist AFAIK,
> so please just use (locate-user-emacs-file "notes").

Will do.

> BTW, the more I look at it, the more I think it belongs in GNU ELPA.

You're absolutely right.  For some reason I was under the impression
that ELPA packages are initialised *after* the initial-buffer-choice
function is called but upon checking it turns out that that is not the
case.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--

[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `notes' function to store random notes across Emacs restarts.
  2013-06-17 17:00 ` Juanma Barranquero
@ 2013-06-17 20:39   ` Michal Nazarewicz
  2013-06-17 21:06     ` Juanma Barranquero
  0 siblings, 1 reply; 9+ messages in thread
From: Michal Nazarewicz @ 2013-06-17 20:39 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Ted Zlatanov, Stefan Monnier, Emacs developers

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

On Mon, Jun 17 2013, Juanma Barranquero wrote:
>> +only one C-c C-c binding which saves and buries the buffer.
>
> Use \\[notes-save-and-bury] instead of hard-coded C-c C-c

I'm not certain how that's supposed to work.  The binding is not in
global key map after all.

>> +      ;; We don't want a "Buffer modified" prompt from kill-buffer so
>> +      ;; we have to use advice rather than a hook.
>> +      (advice-add 'kill-buffer :around 'notes--kill-buffer-advice)
>
> Why cannot  that be done from kill-buffer-hook?

Because kill-buffer-hook is called after kill-buffer checks whether file
is modified:

DEFUN ("kill-buffer", Fkill_buffer, Skill_buffer, 0, 1, "bKill buffer: ",
       doc: /* … */)
  (Lisp_Object buffer_or_name)
/* … */

  /* Query if the buffer is still modified.  */
  if (INTERACTIVE && !NILP (BVAR (b, filename))
      && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
    {
      GCPRO1 (buffer);
      tem = do_yes_or_no_p (format2 ("Buffer %s modified; kill anyway? ",
				     BVAR (b, name), make_number (0)));
      UNGCPRO;
      if (NILP (tem))
	return Qnil;
    }

  /* Run hooks with the buffer to be killed the current buffer.  */
  {
    ptrdiff_t count = SPECPDL_INDEX ();
    Lisp_Object arglist[1];

    record_unwind_protect (save_excursion_restore, save_excursion_save ());
    set_buffer_internal (b);

    /* First run the query functions; if any query is answered no,
       don't kill the buffer.  */
    arglist[0] = Qkill_buffer_query_functions;
    tem = Frun_hook_with_args_until_failure (1, arglist);
    if (NILP (tem))
      return unbind_to (count, Qnil);

    /* Then run the hooks.  */
    Frun_hooks (1, &Qkill_buffer_hook);
    unbind_to (count, Qnil);
  }
/* … */
}

I'll add some more explanation to the comment but other than that, short
of creating a new hook, I see no other satisfactory solution.


(All other comments applied to the code).

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--

[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `notes' function to store random notes across Emacs restarts.
  2013-06-17 20:39   ` Michal Nazarewicz
@ 2013-06-17 21:06     ` Juanma Barranquero
  2013-06-17 23:47       ` Michal Nazarewicz
  0 siblings, 1 reply; 9+ messages in thread
From: Juanma Barranquero @ 2013-06-17 21:06 UTC (permalink / raw)
  To: Michal Nazarewicz; +Cc: Ted Zlatanov, Stefan Monnier, Emacs developers

On Mon, Jun 17, 2013 at 10:39 PM, Michal Nazarewicz <mina86@mina86.com> wrote:

>> Use \\[notes-save-and-bury] instead of hard-coded C-c C-c
>
> I'm not certain how that's supposed to work.  The binding is not in
> global key map after all.

Adding \\<notes-map> to the docstring should work. (elisp) "24.3
Substituting Key Bindings in Documentation":

`\<MAPVAR>'
     stands for no text itself.  It is used only for a side effect: it
     specifies MAPVAR's value as the keymap for any following
     `\[COMMAND]' sequences in this documentation string.


> Because kill-buffer-hook is called after kill-buffer checks whether file
> is modified:

Hmm. You're right. Weird to have to resort to an advice.

   J



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `notes' function to store random notes across Emacs restarts.
  2013-06-17 21:06     ` Juanma Barranquero
@ 2013-06-17 23:47       ` Michal Nazarewicz
  2013-06-18  7:20         ` martin rudalics
  0 siblings, 1 reply; 9+ messages in thread
From: Michal Nazarewicz @ 2013-06-17 23:47 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Ted Zlatanov, Stefan Monnier, Emacs developers

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

> On Mon, Jun 17, 2013 at 10:39 PM, Michal Nazarewicz <mina86@mina86.com> wrote:
>> I'm not certain how that's supposed to work.  The binding is not in
>> global key map after all.

On Mon, Jun 17 2013, Juanma Barranquero wrote:
> Adding \\<notes-map> to the docstring should work. (elisp) "24.3
> Substituting Key Bindings in Documentation":
>
> `\<MAPVAR>'
>      stands for no text itself.  It is used only for a side effect: it
>      specifies MAPVAR's value as the keymap for any following
>      `\[COMMAND]' sequences in this documentation string.

Thanks, that worked.

>> Because kill-buffer-hook is called after kill-buffer checks whether file
>> is modified:

> Hmm. You're right. Weird to have to resort to an advice.

Yeah, I'm not happy about it either.  In fact I think it would make
sense to move the check after kill-buffer-query-functions are called,
but at this point that might be too much of a change.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--

[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `notes' function to store random notes across Emacs restarts.
  2013-06-17 23:47       ` Michal Nazarewicz
@ 2013-06-18  7:20         ` martin rudalics
  2013-06-18 12:24           ` Michal Nazarewicz
  0 siblings, 1 reply; 9+ messages in thread
From: martin rudalics @ 2013-06-18  7:20 UTC (permalink / raw)
  To: Michal Nazarewicz
  Cc: Juanma Barranquero, Ted Zlatanov, Stefan Monnier,
	Emacs developers

 > Yeah, I'm not happy about it either.  In fact I think it would make
 > sense to move the check after kill-buffer-query-functions are called,
 > but at this point that might be too much of a change.

I think we should swap these two sections.  The only thing that might
happen is that questions will be asked in some unintuitive way but ISTR
that this happens already.

martin



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add `notes' function to store random notes across Emacs restarts.
  2013-06-18  7:20         ` martin rudalics
@ 2013-06-18 12:24           ` Michal Nazarewicz
  0 siblings, 0 replies; 9+ messages in thread
From: Michal Nazarewicz @ 2013-06-18 12:24 UTC (permalink / raw)
  To: martin rudalics
  Cc: Juanma Barranquero, Ted Zlatanov, Stefan Monnier,
	Emacs developers

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

On Tue, Jun 18 2013, martin rudalics wrote:
>  > Yeah, I'm not happy about it either.  In fact I think it would make
>  > sense to move the check after kill-buffer-query-functions are called,
>  > but at this point that might be too much of a change.
>
> I think we should swap these two sections.  The only thing that might
> happen is that questions will be asked in some unintuitive way but ISTR
> that this happens already.

KK.  I'll take care of that.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--

[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-06-18 12:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-17 16:13 [PATCH] Add `notes' function to store random notes across Emacs restarts Michal Nazarewicz
2013-06-17 16:44 ` Stefan Monnier
2013-06-17 20:24   ` Michal Nazarewicz
2013-06-17 17:00 ` Juanma Barranquero
2013-06-17 20:39   ` Michal Nazarewicz
2013-06-17 21:06     ` Juanma Barranquero
2013-06-17 23:47       ` Michal Nazarewicz
2013-06-18  7:20         ` martin rudalics
2013-06-18 12:24           ` Michal Nazarewicz

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).