unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17705: [PATCH] lisp/help.el (where-is): don't recreate completing-read's functionality for defaults
@ 2014-06-05 18:08 Cameron Desautels
  2014-06-12  2:21 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Cameron Desautels @ 2014-06-05 18:08 UTC (permalink / raw)
  To: 17705

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

`where-is` was looking for empty string return values from
`completing-read` and swapping in a default value in that
case. Updated now to use the default-handling mechanism provided by
`completing-read`, rather than recreating it.

This also provides a bit of extra capability because now the user can
insert the default value into the minibuffer (for modification) via
`next-history-element` (so-called "future history", described in the
elisp manual).

-- 
Cameron Desautels <camdez@gmail.com>

[-- Attachment #2: 0001-lisp-help.el-where-is-don-t-recreate-completing-read.patch --]
[-- Type: application/octet-stream, Size: 1437 bytes --]

From b3429c0e1e79a4cfba97fa59acea05c06412a9d9 Mon Sep 17 00:00:00 2001
From: Cameron Desautels <camdez@gmail.com>
Date: Thu, 5 Jun 2014 12:37:35 -0500
Subject: [PATCH] lisp/help.el (where-is): don't recreate completing-read's
 functionality for defaults

`where-is` was looking for empty string return values from
`completing-read` and swapping in a default value in that
case. Updated now to use the default-handling mechanism provided by
`completing-read`, rather than recreating it.

This also provides a bit of extra capability because now the user can
insert the default value into the minibuffer (for modification) via
`next-history-element` (so-called "future history", described in the
elisp manual).
---
 lisp/help.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/help.el b/lisp/help.el
index 9322702..739eac4 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -517,8 +517,10 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer."
 		(if fn
 		    (format "Where is command (default %s): " fn)
 		  "Where is command: ")
-		obarray 'commandp t))
-     (list (if (equal val "") fn (intern val)) current-prefix-arg)))
+		obarray 'commandp t nil nil
+		(and fn (symbol-name fn))))
+     (list (unless (equal val "") (intern val))
+	   current-prefix-arg)))
   (unless definition (error "No command"))
   (let ((func (indirect-function definition))
         (defs nil)
-- 
2.0.0


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

* bug#17705: [PATCH] lisp/help.el (where-is): don't recreate completing-read's functionality for defaults
  2014-06-05 18:08 bug#17705: [PATCH] lisp/help.el (where-is): don't recreate completing-read's functionality for defaults Cameron Desautels
@ 2014-06-12  2:21 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2014-06-12  2:21 UTC (permalink / raw)
  To: Cameron Desautels; +Cc: 17705-done

> `where-is` was looking for empty string return values from
> `completing-read` and swapping in a default value in that
> case. Updated now to use the default-handling mechanism provided by
> `completing-read`, rather than recreating it.

Thank you, installed.
Note that we now have many small contributions from you, adding up to
a non-trivial amount of code, so we won't be able to accept further
patches from you without some copyright paperwork.
If you intend to submit more patches (which I hope you do), please fill
the form below and send it to the FSF as instructed so they can send you
the appropriate paperwork to sign.


        Stefan


Please email the following information to assign@gnu.org, and we
will send you the assignment form for your past and future changes.

Please use your full legal name (in ASCII characters) as the subject
line of the message.
----------------------------------------------------------------------
REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES

[What is the name of the program or package you're contributing to?]
Emacs

[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]


[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]


[For the copyright registration, what country are you a citizen of?]


[What year were you born?]


[Please write your email address here.]


[Please write your postal address here.]





[Which files have you changed so far, and which new files have you written
so far?]





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

end of thread, other threads:[~2014-06-12  2:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-05 18:08 bug#17705: [PATCH] lisp/help.el (where-is): don't recreate completing-read's functionality for defaults Cameron Desautels
2014-06-12  2:21 ` Stefan Monnier

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).