bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23204: 25.1.50; Strange behaviour of ‘read-char’


From: Mark Karpov
Subject: bug#23204: 25.1.50; Strange behaviour of ‘read-char’
Date: Sun, 03 Apr 2016 16:32:33 +0600

I'm not sure if it's sort of feature (rather undocumented) or a bug.
Let's say I have a command that uses ‘read-char’ repeatedly, and it's
given a custom prompt as the first argument, like this:

  (defun my-command ()
    (interactive)
    (while (read-char "My prompt…" t)))

Now if you call this from lisp or like this: ‘M-x my-command RET’,
everything is fine: you see the prompt and you can type some chars
(press ‘C-g’ to get out of this).

But if you bind the command to key sequence, like this:

  (global-set-key (kbd "<menu> t y") #'my-command)

Then you have a nasty problem when you actually call it. Try to call it
and then type some characters — you will see no prompt and they will
accumulate in echo area indefinitely:

  menu t y h e r e SPC I SPC t y p e SPC t h i n g s SPC a n d SPC i t
  SPC i s SPC g e t t i n g SPC r a t h e r SPC l o n g

Does this work as intended? I would like to continue using ‘read-char’,
is there a way to just display my prompt in this case as well?



In GNU Emacs 25.1.50.9 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9)
 of 2016-03-24 built on arch
Repository revision: 39577d07124ee16895b9c6aab7e2c6e7d41cc715
Windowing system distributor 'The X.Org Foundation', version 11.0.11802000
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: H

Minor modes in effect:
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  vimish-fold-global-mode: t
  vimish-fold-mode: t
  show-paren-mode: t
  rich-minority-mode: t
  minibuffer-electric-default-mode: t
  ivy-mode: t
  global-auto-revert-mode: t
  display-time-mode: t
  delete-selection-mode: t
  cyphejor-mode: t
  ace-popup-menu-mode: t
  smartparens-global-mode: t
  flyspell-lazy-mode: t
  mk-highlight-line-mode: t
  tooltip-mode: t
  global-eldoc-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
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-fill-mode: 1

Recent messages:
Wrote /home/mark/.emacs.d/.git/COMMIT_EDITMSG
Git finished [2 times]
<menu> t y is undefined
typit-advanced-test
Quit
Would you like to play again? (y or n) n
Quit
Type "q" in help window to restore its previous buffer.
Modalka mode enabled in current buffer
Modalka mode disabled in current buffer

Load-path shadows:
/home/mark/.emacs.d/elpa/seq-2.15/seq hides 
/usr/local/share/emacs/25.1.50/lisp/emacs-lisp/seq

Features:
(shadow mail-extr emacsbug sendmail eieio-opt speedbar sb-image ezimage
dframe sort cal-move parse-time map diary-lib diary-loaddefs cal-iso
org-element org-rmail org-mhe org-irc org-info org-gnus org-docview
doc-view jka-compr org-bibtex bibtex org-bbdb org-w3m org-agenda org
org-macro org-footnote org-pcomplete org-list org-faces org-entities
org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs
org-loaddefs cal-menu calendar cal-loaddefs zzz-to-char char-menu
dired-aux compile em-unix em-term term disp-table ehelp em-script
em-prompt em-ls em-hist em-pred em-glob em-dirs em-cmpl em-basic
em-banner em-alias esh-var esh-io esh-cmd esh-opt esh-ext esh-proc
esh-arg esh-groups eshell esh-module esh-mode vc vc-dispatcher
markdown-mode noutline outline linum magit-blame magit-stash
magit-bisect magit-remote magit-commit magit-sequence magit magit-apply
magit-wip magit-log magit-diff smerge-mode magit-core magit-autorevert
magit-process magit-popup magit-mode magit-git crm magit-section
magit-utils git-commit help-fns log-edit message rfc822 mml mml-sec epa
derived epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr
mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log with-editor
async-bytecomp async tramp-sh tramp tramp-compat tramp-loaddefs trampver
shell pcomplete comint ansi-color format-spec image-mode ace-window
hl-line dired dired-loaddefs vc-git diff-mode bookmark pp typit mmt
colir color counsel esh-util etags swiper aggressive-indent easy-mmode
rainbow-delimiters whitespace hl-todo flycheck-haskell haskell-cabal
haskell-utils flycheck-color-mode-line face-remap mk-visual
smart-mode-line solarized-dark-theme solarized mk-texinfo mk-tex
mk-shakespeare mk-prolog mk-org mk-markdown mk-man mk-magit mk-lisp
mk-js mk-ibuffer mk-html mk-gnus mk-eshell mk-erc mk-elisp mk-dired
mk-clojure kill-or-bury-alive mk-calendar mk-c mk-minor-modes
common-lisp-snippets yasnippet whole-line-or-region vimish-fold paren
rich-minority minibuf-eldef ivy ffap autorevert filenotify time delsel
cyphejor ace-popup-menu smartparens-config smartparens thingatpt
flyspell ispell flyspell-lazy cl mk-highlight-line mk-global modalka
edmacro kmacro fix-input quail ace-link xref project mk-python
mk-haskell mk-utils avy-menu avy ring flycheck find-func rx subr-x seq
seq-25 misc server f dash s ucs-normalize finder-inf tex-site fix-word
advice slime-autoloads info package epg-config url-handlers url-parse
auth-source cl-seq eieio byte-opt bytecomp byte-compile cl-extra
help-mode easymenu cconv eieio-core cl-macs gv eieio-loaddefs
cl-loaddefs pcase cl-lib password-cache url-vars time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame
cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote dbusbind inotify
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 554151 56418)
 (symbols 48 48648 0)
 (miscs 40 441 1766)
 (strings 32 115109 20051)
 (string-bytes 1 3514812)
 (vectors 16 79022)
 (vector-slots 8 1938762 165104)
 (floats 8 787 1950)
 (intervals 56 4215 460)
 (buffers 976 70)
 (heap 1024 62381 4356))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]