all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Alex Bochannek <alex@bochannek.com>
Cc: 49033@debbugs.gnu.org
Subject: bug#49033: 28.0.50; [PATCH] Feature suggestion, url-cache-expiry-alist to override expire time for cache pruning
Date: Tue, 15 Jun 2021 16:11:23 +0200	[thread overview]
Message-ID: <87r1h3tdys.fsf@gnus.org> (raw)
In-Reply-To: <m2pmwnado2.fsf@bochannek.com> (Alex Bochannek's message of "Mon,  14 Jun 2021 22:40:29 -0700")

Alex Bochannek <alex@bochannek.com> writes:

> +(defcustom url-cache-expiry-alist nil
> +  "Alist of URL regular expressions to override the `url-cache-expire-time'."
> +  :version "28.1"
> +  :type 'alist
> +  :group 'url-cache)

Sure, adding this makes sense to me.

> +(defun url-cache-create-url-from-file (file)

I thought this existed, but I guess not...  

> +		(let ((expire-time
> +		       (remove
> +			nil
> +			(mapcar
> +			 (lambda (alist)
> +			   (let ((key (car alist))
> +				(value (cdr alist)))
> +			     (if
> +				 (string-match
> +				  key
> +				  (url-cache-create-url-from-file file))
> +				  value)))
> +			url-cache-expiry-alist))))
> +		 (if (consp expire-time) (apply 'min expire-time) nil))
> +	       url-cache-expire-time))
>  	     now)
>  	    (delete-file file)
>  	    (setq deleted-files (1+ deleted-files))))))
>
> I also didn't really like the way the code ended up being formatted. Is
> there some guidance around splitting functions and their arguments
> across multiple lines?

Well, we never do:

> +			     (if
> +				 (string-match

But in general, we just try to keep it readable, which means not going
too far in either horizontal nor vertical directions.  (So there's
really no rules for formatting beyond that.)  Your code in this patch
generally seems to be way too vertical.

> -                 ;; Twelve hours.
> -                 (* 12 60 60))))
> +                 gravatar-cache-ttl)))

I don't mind that -- but is this really something that somebody would
want to control?  It just seemed unlikely to me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2021-06-15 14:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15  5:40 bug#49033: 28.0.50; [PATCH] Feature suggestion, url-cache-expiry-alist to override expire time for cache pruning Alex Bochannek
2021-06-15 14:11 ` Lars Ingebrigtsen [this message]
2021-06-15 22:55   ` Alex Bochannek
2021-06-19 12:14     ` Lars Ingebrigtsen
2021-06-19 19:32       ` Alex Bochannek
2021-06-21 12:21         ` Lars Ingebrigtsen
2021-06-21 18:25           ` Alex Bochannek
2021-10-24  7:27             ` Stefan Kangas
2021-10-27 16:36               ` Alex Bochannek
2021-10-27 16:50                 ` Stefan Kangas
2021-06-19 12:56     ` Benjamin Riefenstahl
2021-06-19 19:24       ` Alex Bochannek

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

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

  git send-email \
    --in-reply-to=87r1h3tdys.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=49033@debbugs.gnu.org \
    --cc=alex@bochannek.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.