all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#35230: char-displayable-p return code is conflictingly documented
@ 2019-04-11 14:49 Robert Pluim
  2019-04-12 12:51 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Pluim @ 2019-04-11 14:49 UTC (permalink / raw)
  To: 35230

(This comes as a result of the stackexchange question at
https://emacs.stackexchange.com/questions/48810)

char-displayable-p docstring says

     Return non-nil if we should be able to display CHAR.

The elisp manual says something subtly different:

     This function returns ‘t’ if Emacs ought to be able to display
     CHAR.  More precisely, if the selected frame’s fontset has a font
     to display the character set that CHAR belongs to.

The function itself is more in line with the docstring:

(char-displayable-p #xE01EF) => unicode

since I donʼt have a font with a glyph for that character, so it ends
up displayed as a box with the unicode code point inside it. The code
that results in 'unicode has the comment 	     

    ;; On a text terminal without glyph codes, CHAR is displayable
    ;; if the coding system for the terminal can encode it.

but Iʼm very much on a graphical terminal here, not a text terminal.

For comparison, when I do have a font:

(char-displayable-p #x2502) => <font-object
"-*-Menlo-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1">

The question is: what should the docstring/manual say? The original
intent of char-displayable-p seems to be as a wrapper around
internal-char-font to allow asking "do I have a glyph for this
character", but thatʼs not what it does today.

Robert





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

end of thread, other threads:[~2020-10-11  1:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-11 14:49 bug#35230: char-displayable-p return code is conflictingly documented Robert Pluim
2019-04-12 12:51 ` Eli Zaretskii
2019-04-14  9:51   ` Robert Pluim
2019-04-14 14:10     ` Eli Zaretskii
2020-08-21 15:09       ` Lars Ingebrigtsen
2020-10-11  1:50         ` Lars Ingebrigtsen

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.