emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Add `notes' function to store random notes across Emacs rest


From: Juanma Barranquero
Subject: Re: [PATCH] Add `notes' function to store random notes across Emacs restarts.
Date: Mon, 17 Jun 2013 19:00:06 +0200

On Mon, Jun 17, 2013 at 6:13 PM, Michal Nazarewicz <address@hidden> 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



reply via email to

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