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

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

describe-key-briefly writing to wrong buffer


From: dhowells
Subject: describe-key-briefly writing to wrong buffer
Date: Tue, 21 Feb 2006 16:58:51 GMT

If I do C-h c <keycombo>, the text produced by the describe-key-briefly
function will be written into the current buffer, not the minibuffer as I'd
expect. Running M-x describe-key-briefly <keycombo> also has this effect.

I wonder if this is to do with:

(defun describe-key-briefly (&optional key insert untranslated)
...
  (interactive
...
            (prefix-numeric-value current-prefix-arg)
...
  (save-excursion
    (let ((modifiers (event-modifiers (aref key 0)))
          (standard-output (if insert (current-buffer) t))
          window position)
...
          (princ (format (if (windowp window)
...

Where the "let ... standard-output" modifies the output channel used by "princ"
by default to be the current buffer.

But that would seem to imply the insert parameter has been set to something
that evaluates true.

"current-prefix-arg" evaluates to "nil" according to the debugger, but calling
"prefix-numeric-value" returns 1. This value gets assigned to the insert
parameter variable by the "interactive" function, thus inducing this behaviour.

Making this change:

Index: lisp/help.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/help.el,v
retrieving revision 1.299
diff -u -r1.299 help.el
--- lisp/help.el        14 Feb 2006 08:09:28 -0000      1.299
+++ lisp/help.el        21 Feb 2006 16:58:32 -0000
@@ -579,7 +579,7 @@
           (setq key (read-key-sequence "Describe key (or click or menu item): 
"))
           (list
            key
-           (prefix-numeric-value current-prefix-arg)
+           current-prefix-arg
            ;; If KEY is a down-event, read the corresponding up-event
            ;; and use it as the third argument.
            (if (and (consp key) (symbolp (car key))


Seems to fix the problem.





In GNU Emacs 22.0.50.2 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2006-02-21 on warthog.cambridge.redhat.com
X server distributor `The X.Org Foundation', version 11.0.60802000
configured using `configure '--prefix=/warthog/emacs64' 
'--with-x-toolkit=athena''

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: en_GB.utf8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  auto-compression-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  line-number-mode: t

Recent input:
C-h c a <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <menu-bar> <help-menu> 
<report-emacs-bug>

Recent messages:
(emacs -q)
For information about the GNU Project and its goals, type C-h C-p.
Loading emacsbug...
Loading regexp-opt...done
Loading emacsbug...done




reply via email to

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