GNU bug report logs - #35058
[PATCH] Use display-graphic-p in more cases

Previous Next

Package: emacs;

Reported by: Alex <agrambot <at> gmail.com>

Date: Sat, 30 Mar 2019 23:39:01 UTC

Severity: wishlist

Tags: patch

Done: Alex <agrambot <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 35058 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Alex <agrambot <at> gmail.com>
Cc: 35058 <at> debbugs.gnu.org
Subject: Re: bug#35058: [PATCH] Use display-graphic-p in more cases
Date: Sun, 31 Mar 2019 13:45:50 +0100
Just a minor comment from me.

Alex <agrambot <at> gmail.com> writes:

> diff --git a/lisp/frame.el b/lisp/frame.el
> index 6cb1247372..f5ad3152a0 100644
> --- a/lisp/frame.el
> +++ b/lisp/frame.el
> @@ -2078,12 +2069,12 @@ display-planes
>  If DISPLAY is omitted or nil, it defaults to the selected frame's display."
>    (let ((frame-type (framep-on-display display)))
>      (cond
> -     ((memq frame-type '(x w32 ns))
> -      (x-display-planes display))
>       ((eq frame-type 'pc)
>        4)
> +     ((memq frame-type '(nil t))
> +      (truncate (log (length (tty-color-alist)) 2)))
>       (t
> -      (truncate (log (length (tty-color-alist)) 2))))))
> +      (x-display-planes display)))))
>  
>  (declare-function x-display-color-cells "xfns.c" (&optional terminal))

I suggest also changing (truncate (log (length (tty-color-alist)) 2))
to (logb (length (tty-color-alist))).

Thanks,

-- 
Basil




This bug report was last modified 6 years and 124 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.