From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: elisp-index-search on current word
Date: Thu, 09 Oct 2008 20:07:55 -0600 [thread overview]
Message-ID: <gcmdcu$1ds$1@ger.gmane.org> (raw)
In-Reply-To: <gcl2dv$pto$1@registered.motzarella.org>
Richard Riley wrote:
> Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>
>> Xah <xahlee@gmail.com> writes:
>>
>>> On Oct 8, 7:21 am, Andy Stewart <lazycat.mana...@gmail.com> wrote:
>>>> Kevin Rodgers <kevin.d.rodg...@gmail.com> writes:
>>>>> Xahwrote:
>>>>>> when i do elisp-index-search, is there a way to make the default
>>>>>> choice the symbol the cursor is on?
>>>>> (defadvice elisp-index-search (before interactive-default activate)
>>>>> "Provide the symbol at point as the default when reading TOPIC interactively."
>>>>> (interactive (list (read-string "Topic: " nil nil (thing-at-point 'symbol)))))
>>>> (defun elisp-index-search+ ()
>>>> "Look up TOPIC in the indices of the Emacs Lisp Reference Manual."
>>>> (interactive)
>>>> (let (topic)
>>>> (setq topic (read-string (concat "Subject to look up: ") nil nil (symbol-name (symbol-at-point))))
>>>> (funcall 'switch-to-buffer-other-window nil)
>>>> (info "elisp")
>>>> (Info-index topic)))
>>> Thierry wrote:
>>> ,----
>>> | (defun tv-get-index-at-point ()
>>> | (interactive)
>>> | (let ((expr (thing-at-point 'sexp)))
>>> | (elisp-index-search expr)))
>>> `----
>>>
>>> among the 3 suggestions, it seems only Thierry's version works for me.
>>>
>>> is there a reason why it shouldn't prompt for current symbol?
>> No you can have a prompt, (use <arrow down> to display thing-at-point)
>>
>> ,----
>> | (defun tv-get-index-at-point (expr)
>> | (interactive
>> | (list (read-from-minibuffer "Search: "
>> | nil
>> | nil
>> | nil
>> | nil
>> | (thing-at-point 'sexp))))
>> | (elisp-index-search expr))
>> `----
>
> Would it be possible to have the thing at point displayed like most
> defaults when you call the function? e.g If you hit search in most
> editors one would normally see the word at point or region preselected
> in the "search" field.
Try moving (thing-at-point 'sexp) from the DEFAULT argument to the
INITIAL-CONTENTS argument, for either read-string or
read-from-minibuffer. Note that the doc string for both functions says
the INITIAL-CONTENTS argument is deprecated.
--
Kevin Rodgers
Denver, Colorado, USA
next prev parent reply other threads:[~2008-10-10 2:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-08 1:31 elisp-index-search on current word Xah
2008-10-08 6:07 ` Thierry Volpiatto
2008-10-08 7:20 ` Kevin Rodgers
[not found] ` <mailman.530.1223450464.25473.help-gnu-emacs@gnu.org>
2008-10-08 14:21 ` Andy Stewart
2008-10-08 16:11 ` Xah
2008-10-08 17:19 ` Thierry Volpiatto
2008-10-09 2:49 ` Kevin Rodgers
[not found] ` <mailman.596.1223486652.25473.help-gnu-emacs@gnu.org>
2008-10-09 13:54 ` Richard Riley
2008-10-10 2:07 ` Kevin Rodgers [this message]
[not found] ` <mailman.751.1223604460.25473.help-gnu-emacs@gnu.org>
2008-10-10 8:41 ` Richard Riley
[not found] ` <mailman.646.1223520579.25473.help-gnu-emacs@gnu.org>
2008-10-09 15:00 ` Xah
2008-10-10 2:18 ` Kevin Rodgers
[not found] ` <mailman.753.1223605127.25473.help-gnu-emacs@gnu.org>
2008-10-10 2:36 ` Xah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='gcmdcu$1ds$1@ger.gmane.org' \
--to=kevin.d.rodgers@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.