GNU bug report logs - #9030
`where-is' doesn't play well `with with-output-to-string'

Previous Next

Package: emacs;

Reported by: PJ Weisberg <pj <at> irregularexpressions.net>

Date: Sat, 9 Jul 2011 02:40:02 UTC

Severity: normal

Fixed in version 24.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9030 in the body.
You can then email your comments to 9030 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9030; Package emacs. (Sat, 09 Jul 2011 02:40:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to PJ Weisberg <pj <at> irregularexpressions.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 09 Jul 2011 02:40:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: PJ Weisberg <pj <at> irregularexpressions.net>
To: bug-gnu-emacs <at> gnu.org
Subject: `where-is' doesn't play well `with with-output-to-string'
Date: Fri, 8 Jul 2011 19:39:24 -0700
This expression:

(with-output-to-string
  (where-is 'yank))

returns nil, and prints a message in the echo area.  This one-line
change fixes it:

diff --git a/lisp/help.el b/lisp/help.el
index e6496f6..53e99e7 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -527,7 +527,7 @@ If INSERT (the prefix arg) is non-nil, insert the
message in the buffer."
   (unless definition (error "No command"))
   (let ((func (indirect-function definition))
         (defs nil)
-        (standard-output (if insert (current-buffer) t)))
+        (standard-output (if insert (current-buffer) standard-output)))
     ;; In DEFS, find all symbols that are aliases for DEFINITION.
     (mapatoms (lambda (symbol)
 		(and (fboundp symbol)




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9030; Package emacs. (Tue, 12 Jul 2011 22:34:02 GMT) Full text and rfc822 format available.

Message #8 received at 9030 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: PJ Weisberg <pj <at> irregularexpressions.net>
Cc: 9030 <at> debbugs.gnu.org
Subject: Re: bug#9030: `where-is' doesn't play well `with
	with-output-to-string'
Date: Tue, 12 Jul 2011 18:33:42 -0400
PJ Weisberg wrote:

> (with-output-to-string
>   (where-is 'yank))
>
> returns nil, and prints a message in the echo area.  This one-line
> change fixes it:
[...]
> --- a/lisp/help.el
> +++ b/lisp/help.el
> @@ -527,7 +527,7 @@ If INSERT (the prefix arg) is non-nil, insert the
> message in the buffer."
>    (unless definition (error "No command"))
>    (let ((func (indirect-function definition))
>          (defs nil)
> -        (standard-output (if insert (current-buffer) t)))
> +        (standard-output (if insert (current-buffer) standard-output)))
>      ;; In DEFS, find all symbols that are aliases for DEFINITION.
>      (mapatoms (lambda (symbol)
>  		(and (fboundp symbol)


Tangentially, I wonder why where-is needs an optional INSERT argument
that means "don't print the result, instead insert it (oh, and use a
slightly different format)".




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9030; Package emacs. (Wed, 13 Jul 2011 03:55:02 GMT) Full text and rfc822 format available.

Message #11 received at 9030 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 9030 <at> debbugs.gnu.org, PJ Weisberg <pj <at> irregularexpressions.net>
Subject: Re: bug#9030: `where-is' doesn't play well `with
	with-output-to-string'
Date: Tue, 12 Jul 2011 23:54:41 -0400
> Tangentially, I wonder why where-is needs an optional INSERT argument
> that means "don't print the result, instead insert it (oh, and use a
> slightly different format)".

It's clearly meant for interactive use.  I'm not sure if it answers your
question, tho.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9030; Package emacs. (Wed, 13 Jul 2011 04:45:03 GMT) Full text and rfc822 format available.

Message #14 received at 9030 <at> debbugs.gnu.org (full text, mbox):

From: PJ Weisberg <pj <at> irregularexpressions.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: "9030 <at> debbugs.gnu.org" <9030 <at> debbugs.gnu.org>, Glenn Morris <rgm <at> gnu.org>,
	PJ Weisberg <pj <at> irregularexpressions.net>
Subject: Re: bug#9030: `where-is' doesn't play well `with
	with-output-to-string'
Date: Tue, 12 Jul 2011 21:44:26 -0700
On Tuesday, July 12, 2011, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
>> Tangentially, I wonder why where-is needs an optional INSERT argument
>> that means "don't print the result, instead insert it (oh, and use a
>> slightly different format)".
>
> It's clearly meant for interactive use.  I'm not sure if it answers your
> question, tho.

For what it's worth, the code that gives what I was actually trting to
get from `what-is' is `(mapcar 'key-description (where-is-internal
foo))'.  I don't know if there's a way to get that without using a
function with "internal" in the name.

-- 

-PJ




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9030; Package emacs. (Sun, 07 Aug 2011 17:23:02 GMT) Full text and rfc822 format available.

Message #17 received at 9030 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: PJ Weisberg <pj <at> irregularexpressions.net>
Cc: "9030 <at> debbugs.gnu.org" <9030 <at> debbugs.gnu.org>, Glenn Morris <rgm <at> gnu.org>
Subject: Re: bug#9030: `where-is' doesn't play well `with
	with-output-to-string'
Date: Sun, 07 Aug 2011 13:21:42 -0400
>>> Tangentially, I wonder why where-is needs an optional INSERT argument
>>> that means "don't print the result, instead insert it (oh, and use a
>>> slightly different format)".
>> It's clearly meant for interactive use.  I'm not sure if it answers your
>> question, tho.
> For what it's worth, the code that gives what I was actually trting to
> get from `what-is' is `(mapcar 'key-description (where-is-internal
> foo))'.  I don't know if there's a way to get that without using a
> function with "internal" in the name.

Yes, this is not quite right: where-is-internal is not nearly as
internal as the name implies.  It's just the natural function to use,
whereas where-is is the corresponding command.
Maybe we should fix the names to make where-is-internal less scary.


        Stefan




Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Tue, 13 Sep 2011 07:24:01 GMT) Full text and rfc822 format available.

Notification sent to PJ Weisberg <pj <at> irregularexpressions.net>:
bug acknowledged by developer. (Tue, 13 Sep 2011 07:24:02 GMT) Full text and rfc822 format available.

Message #22 received at 9030-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 9030-done <at> debbugs.gnu.org
Subject: Re: bug#9030: `where-is' doesn't play well `with
	with-output-to-string'
Date: Tue, 13 Sep 2011 03:18:34 -0400
Version: 24.1

Thanks; applied.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 11 Oct 2011 11:24:02 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 209 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.