unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: Julien Danjou <julien@danjou.info>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] url-cache (url-store-in-cache): Make `buff' argument really optional
Date: Fri, 10 Sep 2010 17:25:09 -0400	[thread overview]
Message-ID: <b4tylxgukq.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <1283950260-13227-1-git-send-email-julien@danjou.info> (Julien Danjou's message of "Wed\, 8 Sep 2010 14\:51\:00 +0200")

Julien Danjou wrote:

>  (defun url-store-in-cache (&optional buff)
>    "Store buffer BUFF in the cache."
> -  (if (not (and buff (get-buffer buff)))
> -      nil
> -    (save-current-buffer
> -      (and buff (set-buffer buff))
> -      (let* ((fname (url-cache-create-filename (url-view-url t))))
> -	(if (url-cache-prepare fname)
> -	    (let ((coding-system-for-write 'binary))
> -	      (write-region (point-min) (point-max) fname nil 5)))))))
> +    (with-current-buffer (get-buffer (or buff (current-buffer)))
> +      (let ((fname (url-cache-create-filename (url-view-url t))))
> +        (if (url-cache-prepare fname)
> +            (let ((coding-system-for-write 'binary))
> +              (write-region (point-min) (point-max) fname nil 5))))))


I think the original version was attempting to guard against the
possibility of BUFF naming a dead or non-existent buffer, and your
version has lost that feature.



  reply	other threads:[~2010-09-10 21:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-08 12:51 [PATCH] url-cache (url-store-in-cache): Make `buff' argument really optional Julien Danjou
2010-09-10 21:25 ` Glenn Morris [this message]
2010-09-10 21:40   ` Glenn Morris
2010-09-10 22:43     ` Julien Danjou
2010-09-13 14:33     ` Julien Danjou
2010-09-13 16:17       ` Glenn Morris

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=b4tylxgukq.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=julien@danjou.info \
    /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).