GNU bug report logs -
#32599
25.2; Feature request: input PUA characters by name
Previous Next
Reported by: jsbien <at> mimuw.edu.pl
Date: Fri, 31 Aug 2018 06:53:02 UTC
Severity: wishlist
Tags: moreinfo
Found in version 25.2
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #65 received at 32599 <at> debbugs.gnu.org (full text, mbox):
Let me to approach the problem from another angle.
Input of Unicode characters by name is done by "insert-char" defined in
editfns.c. The code is quite short:
--8<---------------cut here---------------start------------->8---
DEFUN ("insert-char", Finsert_char, Sinsert_char, 1, 3,
"(list (read-char-by-name \"Insert character (Unicode name or hex): \")\
(prefix-numeric-value current-prefix-arg)\
t))",
doc: /* Insert COUNT copies of CHARACTER.
Interactively, prompt for CHARACTER. You can specify CHARACTER in one
of these ways:
- As its Unicode character name, e.g. \"LATIN SMALL LETTER A\".
Completion is available; if you type a substring of the name
preceded by an asterisk `*', Emacs shows all names which include
that substring, not necessarily at the beginning of the name.
[...]
The optional third argument INHERIT, if non-nil, says to inherit text
properties from adjoining text, if those properties are sticky. If
called interactively, INHERIT is t. */)
(Lisp_Object character, Lisp_Object count, Lisp_Object inherit)
{
int i, stringlen;
register ptrdiff_t n;
int c, len;
unsigned char str[MAX_MULTIBYTE_LENGTH];
char string[4000];
CHECK_CHARACTER (character);
if (NILP (count))
XSETFASTINT (count, 1);
else
CHECK_FIXNUM (count);
c = XFIXNAT (character);
if (!NILP (BVAR (current_buffer, enable_multibyte_characters)))
len = CHAR_STRING (c, str);
else
str[0] = c, len = 1;
if (XFIXNUM (count) <= 0)
return Qnil;
if (BUF_BYTES_MAX / len < XFIXNUM (count))
buffer_overflow ();
n = XFIXNUM (count) * len;
stringlen = min (n, sizeof string - sizeof string % len);
for (i = 0; i < stringlen; i++)
string[i] = str[i % len];
while (n > stringlen)
{
maybe_quit ();
if (!NILP (inherit))
insert_and_inherit (string, stringlen);
else
insert (string, stringlen);
n -= stringlen;
}
if (!NILP (inherit))
insert_and_inherit (string, n);
else
insert (string, n);
return Qnil;
}
--8<---------------cut here---------------end--------------->8---
Which part of the code is responsible for prompting, name input and
consulting the character names list?
Best regards
Janusz
--
,
Janusz S. Bien
emeryt (emeritus)
https://sites.google.com/view/jsbien
This bug report was last modified 3 years and 108 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.