unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17109: 24.4.50; REGRESSION: `with-output-to-temp-buffer' is broken
@ 2014-03-26 20:08 Drew Adams
  2014-03-27  0:05 ` Leo Liu
  0 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2014-03-26 20:08 UTC (permalink / raw)
  To: 17109

In a build as recent as this one there was no such problem:

In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-03-21 on ODIEONE
Bzr revision: 116829 dancol@dancol.org-20140321121023-5tjxtiws6qa4qyod
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/snapshot/trunk
 --enable-checking=yes,glyphs 'CFLAGS=-O0 -g3' 'CPPFLAGS=-DGC_MCHECK=1
 -Ic:/Devel/emacs/include' LDFLAGS=-Lc:/Devel/emacs/lib'

The problem exists in this build:

In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-03-23 on ODIEONE
Bzr revision: 116869 yamaoka@jpl.org-20140324004210-m3ek4k40qwamyabx
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/snapshot/trunk
 --enable-checking=yes,glyphs 'CFLAGS=-O0 -g3'
 LDFLAGS=-Lc:/Devel/emacs/lib 'CPPFLAGS=-DGC_MCHECK=1
 -Ic:/Devel/emacs/include''

Recipe:

emacs -Q

Evaluate this:


(defun describe-keymap (keymap)         ; Bound to `C-h M-k'
  "Describe bindings in KEYMAP, a variable whose value is a keymap.
Completion is available for the keymap name."
  (interactive
   (list (intern
          (completing-read
           "Keymap: " obarray
           (lambda (m) (and (boundp m)
                       (keymapp (symbol-value m))))
           t nil 'variable-name-history))))
  (unless (and (symbolp keymap)  (boundp keymap)
               (keymapp (symbol-value keymap)))
    (error "`%S' is not a keymapp" keymap))
  (let ((name  (symbol-name keymap))
        (doc   (documentation-property
                keymap 'variable-documentation)))
    (help-setup-xref
     (list #'describe-keymap keymap)
     (called-interactively-p 'interactive))
    (with-output-to-temp-buffer "*Help*" ; NO GOOD with this
      ;; (with-help-window "*Help*" ; <======== OK with this
      (princ name) (terpri)
      (princ (make-string (length name) ?-))
      (terpri) (terpri)
      (when doc
        (princ doc) (terpri) (terpri))
      (with-current-buffer "*Help*"
        (insert (substitute-command-keys
                 (concat "\\{" name "}")))))))

M-x describe-keymap RET ctl-x-map RET

Buffer *Help* is not in Help mode, as it should be.
It is in Fundamental mode.

Change `with-output-to-temp-buffer' to `with-help-window' and the
problem goes away.

This does not seem right.  We should not have to replace the former with
the latter everywhere.  And the former still exists.  It just does not
do the right thing anymore.





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

end of thread, other threads:[~2014-03-29  1:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-26 20:08 bug#17109: 24.4.50; REGRESSION: `with-output-to-temp-buffer' is broken Drew Adams
2014-03-27  0:05 ` Leo Liu
2014-03-27  1:52   ` Drew Adams
2014-03-27  9:55   ` Nicolas Richard
2014-03-27 15:09     ` Drew Adams
2014-03-28 21:45       ` Drew Adams
2014-03-29  0:58         ` Leo Liu
2014-03-29  1:39           ` Drew Adams

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).