all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: master 68cc4cb6b1c: Small followup change
       [not found] ` <20240603124021.394CBC12C32@vcs2.savannah.gnu.org>
@ 2024-06-03 17:41   ` Stefan Kangas
  2024-06-03 17:55     ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Kangas @ 2024-06-03 17:41 UTC (permalink / raw)
  To: Po Lu, emacs-devel

Po Lu via Mailing list for Emacs changes <emacs-diffs@gnu.org> writes:

>     * lisp/image.el (create-image): Remove supererogatory instances
>     of pcase.  Recognize new `lambda' values and refrain from
>     specifying a default transform-smoothing when it is returned.
>     (image--default-smoothing): Return lambda if scaling is default.
[...]
> --- a/lisp/image.el
> +++ b/lisp/image.el
> @@ -520,7 +520,7 @@ Images should not be larger than specified by `max-image-size'."
>    (let ((data-format
>           ;; Pass the image format, if any, if this is data.
>           (and data-p (or (plist-get props :format) t))))
> -    ;; It is x_find_image_file in image.c that sets the search path.
> +    ;; It is `x_find_image_fd' in image.c that sets the search path.
>      (setq type (ignore-error unknown-image-type
>                   (image-type file-or-data type data-format)))
>      ;; If we have external image conversion switched on (for exotic,
> @@ -540,12 +540,13 @@ Images should not be larger than specified by `max-image-size'."
>  	           props)))
>        ;; Add default smoothing.
>        (unless (plist-member props :transform-smoothing)
> -        (setq image (nconc image
> -                           (list :transform-smoothing
> -                                 (pcase image-transform-smoothing
> -                                   ('t t)
> -                                   ('nil nil)
> -                                   (func (funcall func image)))))))
> +        (let* ((func image-transform-smoothing)
> +               (value (or (eq func t)
> +                          (and func (funcall func image)))))
> +          (unless (eq value 'lambda)
> +            (setq image (nconc image
> +                               (list :transform-smoothing
> +                                     value))))))

I thought we had decided to refrain from pushing our own style with
regards to `pcase` in random code for no reason.

Am I missing something?



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

* Re: master 68cc4cb6b1c: Small followup change
  2024-06-03 17:41   ` master 68cc4cb6b1c: Small followup change Stefan Kangas
@ 2024-06-03 17:55     ` Eli Zaretskii
  2024-06-03 23:56       ` Po Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2024-06-03 17:55 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: luangruo, emacs-devel

> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Mon, 3 Jun 2024 17:41:44 +0000
> 
> > -        (setq image (nconc image
> > -                           (list :transform-smoothing
> > -                                 (pcase image-transform-smoothing
> > -                                   ('t t)
> > -                                   ('nil nil)
> > -                                   (func (funcall func image)))))))
> > +        (let* ((func image-transform-smoothing)
> > +               (value (or (eq func t)
> > +                          (and func (funcall func image)))))
> > +          (unless (eq value 'lambda)
> > +            (setq image (nconc image
> > +                               (list :transform-smoothing
> > +                                     value))))))
> 
> I thought we had decided to refrain from pushing our own style with
> regards to `pcase` in random code for no reason.

We did.  But TBH, that use of pcase is a bit too much, no?



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

* Re: master 68cc4cb6b1c: Small followup change
  2024-06-03 17:55     ` Eli Zaretskii
@ 2024-06-03 23:56       ` Po Lu
  0 siblings, 0 replies; 3+ messages in thread
From: Po Lu @ 2024-06-03 23:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Stefan Kangas, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> I thought we had decided to refrain from pushing our own style with
>> regards to `pcase` in random code for no reason.
>
> We did.  But TBH, that use of pcase is a bit too much, no?

Yes, and that code was being restructured, so that "not pushing our own
style with regard to pcase" would have implied writing a equally
outrageous form from scratch, which I'm naturally reluctant to do.



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

end of thread, other threads:[~2024-06-03 23:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <171741842084.30104.166240780698880790@vcs2.savannah.gnu.org>
     [not found] ` <20240603124021.394CBC12C32@vcs2.savannah.gnu.org>
2024-06-03 17:41   ` master 68cc4cb6b1c: Small followup change Stefan Kangas
2024-06-03 17:55     ` Eli Zaretskii
2024-06-03 23:56       ` Po Lu

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.