unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Michal Nazarewicz <mpn@google.com>
Cc: Ted Zlatanov <tzz@lifelogs.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: [PATCH] Add `notes' function to store random notes across Emacs restarts.
Date: Mon, 17 Jun 2013 19:00:06 +0200	[thread overview]
Message-ID: <CAAeL0SR6kxtuMpco2=MXOYcbFBoDN1cHqmVWXu9c+mVkos7uJw@mail.gmail.com> (raw)
In-Reply-To: <aae7ac7b461e285690e266c7c48f9b2a7c9446e8.1371479710.git.mina86@mina86.com>

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



  parent reply	other threads:[~2013-06-17 17:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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='CAAeL0SR6kxtuMpco2=MXOYcbFBoDN1cHqmVWXu9c+mVkos7uJw@mail.gmail.com' \
    --to=lekktu@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=mpn@google.com \
    --cc=tzz@lifelogs.com \
    /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).