Subject: bug#13599: closed (Re: bug#32562: 26; `read-char(-exclusive)' and `characterp')

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 10 Sep 2018 10:02:03 +0000

Your bug report

#32562: 24.2; (max-char) is too low (and hard to change)

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
32562: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32562
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#32562: 26; `read-char(-exclusive)' and `characterp'
From: Eli Zaretskii <[email-masked]>
To: Drew Adams <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Mon, 10 Sep 2018 13:01:11 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Tue, 28 Aug 2018 14:24:36 -0700 (PDT)
> From: Drew Adams <[email-masked]>
> Cc: [email-masked]
> 
> is `read-char' necessarily about chars that satisfy `characterp'?

No.  It returns a character event, not a character.

> The doc string of `text-char-description' says "file-character CHARACTER". What's a "file character"? A character that can appear in a file name?

No, text-char-description accepts only valid character codes, those
which satisfy the 'characterp' test.  This is unlike
single-key-description, which accepts _events_, and thus will happily
process character input events that are not valid character codes,
i.e. fail the 'characterp' test.  I've now made that clear in the
respective doc strings.

> This stuff is not clear more generally, I think - beyond the max value of `max-char'. Do we have or want to have different kinds of "characters" returned from or passed as args to different "character" functions? Why (or why not)?

The basic difference is between a character code and a character input
event.

> Wrt my original problem: taking a value of `M-:' from `read-char' and passing it to `text-char-description', Emacs has a regression of sorts. Older Emacs versions "work", whereas recent versions raise an error. E.g. Emacs 20 `read-char' returns -134217670, and passing that to `text-char-description' gives "\272". Whatever `read-char' can read, it seems, `text-char-description' can describe (perhaps imperfectly?).

It's not a regression: text-char-description wants a valid character
code.

I'm closing this bug, as I think this is a documentation issue which
is now fixed.

Thanks.

Subject: 24.2; (max-char) is too low (and hard to change)
From: Magnar Sveen <[email-masked]>
To: [email-masked]
Date: Thu, 31 Jan 2013 19:42:27 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Due to my weird norwegian keyboard, I'm trying to map my s-8 to [.

Doing a M-: (read-char) s-8 gives me the key value of 8388664.

Following that up with (keyboard-translate 8388664 ?\[) does not work,
since it fails the (characterp) test. Turns out that (max-char) is a C
function that returns the highest allowed keycode. On my Emacs, that
is 4194303.

Since (max-char) is a function and not a variable, and a C function at
that (not advisable when called from another C function (characterp)) -
I am left without options to rectify it. Or maybe I could use a hex
editor. :-)

So, is this a bug? Is it weird that max-char is a function? In C? Ought
4194303 chars be enough for anybody? That's up to you guys to decide.

Kind regards,
Magnar Sveen

In GNU Emacs 24.2.1 (x86_64-apple-darwin10.8.0, NS apple-appkit-1038.36)
 of 2012-09-04 on fi-bp-202.local
Windowing system distributor `Apple', version 10.3.1038
Configured using:
 `configure '--prefix=/usr/local/Cellar/emacs/24.2' '--without-dbus'
 '--enable-locallisppath=/usr/local/share/emacs/site-lisp'
 '--infodir=/usr/local/Cellar/emacs/24.2/share/info/emacs' '--with-ns'
 '--disable-ns-self-contained' 'CC=/usr/bin/gcc-4.2' 'CFLAGS=-Os -w
 -pipe -march=core2 -msse4 -mmacosx-version-min=10.6'
 'LDFLAGS=-L/usr/local/lib''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  elisp-slime-nav-mode: t
  hardcore-mode: t
  show-paren-mode: t
  global-hl-line-mode: t
  ido-ubiquitous-mode: t
  eproject-mode: t
  paredit-mode: t
  persp-mode: t
  yas/global-mode: t
  yas/minor-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  global-subword-mode: t
  subword-mode: t
  recentf-mode: t
  delete-selection-mode: t
  global-auto-revert-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
c s-8 <down-mouse-1> <mouse-1> C-y C-x C-e s-8 C-_ 
C-a M-f - u n C-d C-e C-b C-w C-_ <backspace> <backspace> 
<backspace> <backspace> C-e C-x C-e s-8 s-8 C-_ C-_ 
C-_ C-_ C-_ C-e C-x C-e s-8 C-q s-8 C-_ C-_ M-_ M-_ 
M-_ M-_ C-d C-d C-d C-b <backspace> <backspace> <backspace> 
<backspace> C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b 
C-b C-b C-b C-b C-b C-b C-b C-b C-b C-u C-n C-p C-p 
C-p C-p u n C-e C-x C-e C-a C-k C-b C-x C-e q s-8 s-8 
C-q s-8 <f1> f r e a d - c h a r <return> M-: ( r e 
a d - c h a r ) <return> s-8 <f1> k C-q <S-right> <tab> 
<return> C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-q s-8 M-: <up> <return> s-8 
C-n C-n C-n C-n C-n C-x b <return> C-x C-e <S-right> 
q M-: <up> <return> s-8 C-x C-e <S-left> <S-right> 
<tab> <tab> <return> <S-right> <up> <up> <return> C-n 
C-n C-n C-n <f1> f c h a r a c t e r p <return> <S-right> 
M-: ( m a x - x h a r <backspace> <backspace> <backspace> 
<backspace> c h a r ) <return> M-: <up> C-g <f1> f 
m a x - c h a r <return> <S-right> <tab> <return> C-g 
q <f1> f c h a r a c t e r p <return> <S-right> <tab> 
C-n C-n C-n C-n C-a M-w <S-tab> <return> C-g q M-x 
e m a c s - r e b <backspace> p o <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> r e p o r t <r
eturn>

Recent messages:
4194303 (#o17777777, #x3fffff)
Quit

windmove-do-window-select: No window right from selected window
mouse-2, RET: find function's definition
Quit
Type "q" in help window to restore its previous buffer.
mouse-2, RET: find function's definition
Copied to end of line
mouse-2, RET: find function's definition
Quit

Load-path shadows:
/Users/fimasvee/.emacs.d/elpa/hardcore-mode-1.0.0/hardcore-mode hides /Users/fimasvee/.emacs.d/site-lisp/hardcore-mode/hardcore-mode
/Users/fimasvee/.emacs.d/site-lisp/fill-column-indicator/fill-column-indicator hides /Users/fimasvee/.emacs.d/site-lisp/fill-column-indicator
~/.emacs.d/users/fimasvee/init hides ~/.emacs.d/init
/Users/fimasvee/.emacs.d/elpa/magit-20130109.2027/rebase-mode hides /usr/local/share/emacs/site-lisp/rebase-mode
/Users/fimasvee/.emacs.d/site-lisp/delsel/delsel hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/delsel
~/.emacs.d/custom hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/custom
/usr/local/share/emacs/site-lisp/trampver hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/trampver
/usr/local/share/emacs/site-lisp/tramp hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp
/usr/local/share/emacs/site-lisp/tramp-uu hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-uu
/usr/local/share/emacs/site-lisp/tramp-smb hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-smb
/usr/local/share/emacs/site-lisp/tramp-sh hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-sh
/usr/local/share/emacs/site-lisp/tramp-loaddefs hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-loaddefs
/usr/local/share/emacs/site-lisp/tramp-gw hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-gw
/usr/local/share/emacs/site-lisp/tramp-ftp hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-ftp
/usr/local/share/emacs/site-lisp/tramp-compat hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-compat
/usr/local/share/emacs/site-lisp/tramp-cmds hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-cmds
/usr/local/share/emacs/site-lisp/tramp-cache hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-cache
/Users/fimasvee/.emacs.d/elpa/magit-20130109.2027/.dir-locals hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/gnus/.dir-locals

Features:
(shadow sort mail-extr emacsbug debug dired-aux git-commit-mode rx
php-mode flymake cc-langs setup-magit magit-svn magit-bisect
magit-key-mode magit diff-mode log-edit pcvs-util add-log mule-util
zencoding-mode rename-sgml-tag crappy-jsp-mode js-mode-expansions js
json cc-mode-expansions cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs jsp-expansions
html-mode-expansions tagedit sgml-mode hippie-exp css-mode-expansions
css-mode misearch multi-isearch tabify conf-mode newcomment org-wl
org-w3m org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs
org-html org-exp ob-exp org-exp-blocks find-func org-agenda org-info
org-gnus org-docview org-bibtex bibtex org-bbdb network-stream starttls
tls vc-git adventur-mode alternatives-mode adv-refill refill
adv-indentation adv-keybindings adv-defuns adv-refactorings
adv-new-number adv-named-rooms adv-search adv-enter adv-tab adv-escape
adv-dash adv-jump-candidate adv-syntax-highlighting adv-intelli nrepl
arc-mode archive-mode setup-clojure-mode clj-refactor
clojure-mode-expansions clojure-mode inf-lisp tramp tramp-compat
tramp-loaddefs setup-shell shell-command shell adv-utils adv-regexes
regex-dsl unsafep elisp-slime-nav etags oppdrag-mode my-defuns
hardcore-mode server setup-mu4e mu4e mu4e-speedbar speedbar sb-image
ezimage dframe mu4e-main mu4e-view epa epg epg-config browse-url
longlines mu4e-headers mu4e-compose mu4e-actions org-capture org-mks
setup-org org-mode-expansions org ob-emacs-lisp ob-tangle ob-ref ob-lob
ob-table org-footnote org-src ob-comint ob-keys ob ob-eval org-pcomplete
pcomplete org-list org-faces org-compat org-entities org-macs noutline
outline cal-menu calendar cal-loaddefs rfc2368 smtpmail auth-source
gnus-util password-cache sendmail mu4e-mark mu4e-message html2text
mu4e-proc mu4e-utils doc-view jka-compr image-mode setup-dired
dired-details dired mu4e-about mu4e-vars message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader
mu4e-meta diminish mac my-misc appearance zoom-frm frame-cmds frame-fns
avoid paren hl-line key-bindings windmove smex setup-ido ido-ubiquitous
ido browse-kill-ring fill-column-indicator multifiles change-inner
smart-forward wgrep setup-rgrep grep compile comint ansi-color eproject
esh-var esh-io esh-cmd esh-ext esh-proc esh-arg eldoc esh-groups eshell
esh-module esh-mode esh-util ace-jump-mode jump-char multiple-cursors
mc-insert-numbers rectangular-region-mode mc-mark-more thingatpt
mc-cycle-cursors mc-edit-lines multiple-cursors-core rect
inline-string-rectangle mark-more-like-this mark-multiple expand-region
text-mode-expansions expand-region-custom expand-region-core file-defuns
imenu mode-mappings setup-paredit s dash regexp-opt paredit
setup-html-mode setup-ffip find-file-in-project setup-perspective
perspective setup-yasnippet buster-snippets buster-snippet-helpers
yasnippet dropdown-list derived help-mode view assoc setup-hippie
exec-path-from-shell sane-defaults uniquify undo-tree edmacro kmacro
diff cl smooth-scrolling warnings advice help-fns advice-preload subword
winner ring recentf tree-widget wid-edit easymenu delsel easy-mmode
autorevert setup-package elisp-slime-nav-autoloads es-lib-autoloads
exec-path-from-shell-autoloads gist-autoloads gh-autoloads eieio
byte-opt bytecomp byte-compile cconv macroexp git-commit-mode-autoloads
gitconfig-mode-autoloads gitignore-mode-autoloads
goto-last-change-autoloads hardcore-mode-autoloads htmlize-autoloads
logito-autoloads magit-autoloads move-text-autoloads nrepl-autoloads
clojure-mode-autoloads paredit-autoloads pcache-autoloads finder-inf
popwin-autoloads slime-js-autoloads slime-repl-autoloads slime-autoloads
package tabulated-list saveplace time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel ns-win tool-bar dnd fontset image fringe
lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process ns multi-tty
emacs)