all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Quickly finding out a function or a variable you need?
@ 2010-08-06 14:29 Elena
  2010-08-06 14:50 ` Elena
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Elena @ 2010-08-06 14:29 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

while writing Emacs Lisp code, I often use `describe-function' and
`describe-variable' to search for functions and variables related to
the task at hand.

This commands, however - unlike `apropos' - require you to know the
first characters. This means you'll have an hard time, for instance,
finding `kill-buffer' when looking for functions which operate on
buffers. Moreover, in both `describe-*', completion buffer is lost as
soon as you choose a completion, thus if you want to check another
interesting function/variable you just saw, you have to start all over
again.

I know I must be missing something... Maybe there is some super-search
facility inside Emacs which I don't know about (besides using Internet
search engines I mean)? How do you quickly find out a function or a
variable you need in your code, instead?

Thanks for sharing.


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

* Re: Quickly finding out a function or a variable you need?
  2010-08-06 14:29 Quickly finding out a function or a variable you need? Elena
@ 2010-08-06 14:50 ` Elena
       [not found]   ` <87mxszvjpu.fsf@kuiper.lan.informatimago.com>
  2010-08-06 15:33 ` Pascal J. Bourguignon
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Elena @ 2010-08-06 14:50 UTC (permalink / raw)
  To: help-gnu-emacs

Damn! Just discovered that `apropos' looks for both functions and
variables. I've always been using it just for commands.

Sorry for asking.



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

* Re: Quickly finding out a function or a variable you need?
  2010-08-06 14:29 Quickly finding out a function or a variable you need? Elena
  2010-08-06 14:50 ` Elena
@ 2010-08-06 15:33 ` Pascal J. Bourguignon
  2010-08-07  0:26 ` Tim X
  2010-08-08 21:44 ` Stefan Monnier
  3 siblings, 0 replies; 6+ messages in thread
From: Pascal J. Bourguignon @ 2010-08-06 15:33 UTC (permalink / raw)
  To: help-gnu-emacs

Elena <egarrulo@gmail.com> writes:

> Hello,
>
> while writing Emacs Lisp code, I often use `describe-function' and
> `describe-variable' to search for functions and variables related to
> the task at hand.
>
> This commands, however - unlike `apropos' - require you to know the
> first characters. 

Not anymore.  Starting from version 23, emacs can complete on the other
words too.  Just type:  M-x describe-function RET -buffer TAB

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/


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

* Re: Quickly finding out a function or a variable you need?
       [not found]   ` <87mxszvjpu.fsf@kuiper.lan.informatimago.com>
@ 2010-08-06 22:20     ` Elena
  0 siblings, 0 replies; 6+ messages in thread
From: Elena @ 2010-08-06 22:20 UTC (permalink / raw)
  To: help-gnu-emacs

On 6 Ago, 17:34, p...@informatimago.com (Pascal J. Bourguignon) wrote:
> For commands, you'd use M-x apropos-command RET

Which is bound to "C-h a". I got confused because I thought that every
help command was bound to a key, but this is not the case for
`apropos' and other `apropos-*' commands.


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

* Re: Quickly finding out a function or a variable you need?
  2010-08-06 14:29 Quickly finding out a function or a variable you need? Elena
  2010-08-06 14:50 ` Elena
  2010-08-06 15:33 ` Pascal J. Bourguignon
@ 2010-08-07  0:26 ` Tim X
  2010-08-08 21:44 ` Stefan Monnier
  3 siblings, 0 replies; 6+ messages in thread
From: Tim X @ 2010-08-07  0:26 UTC (permalink / raw)
  To: help-gnu-emacs

Elena <egarrulo@gmail.com> writes:

> Hello,
>
> while writing Emacs Lisp code, I often use `describe-function' and
> `describe-variable' to search for functions and variables related to
> the task at hand.
>
> This commands, however - unlike `apropos' - require you to know the
> first characters. This means you'll have an hard time, for instance,
> finding `kill-buffer' when looking for functions which operate on
> buffers. Moreover, in both `describe-*', completion buffer is lost as
> soon as you choose a completion, thus if you want to check another
> interesting function/variable you just saw, you have to start all over
> again.
>
> I know I must be missing something... Maybe there is some super-search
> facility inside Emacs which I don't know about (besides using Internet
> search engines I mean)? How do you quickly find out a function or a
> variable you need in your code, instead?
>

I find that in addition to the apropos set of commands and the describe
facilities, that the elisp manual is extremely useful. Normally, I open
a frame with info running on the elisp manual. When looking for
something which I suspect is there, but have no idea what its name is, I
jump to the manual. Using either the menus, which are group into fairly
high level topics, such as buffers, strings, regexp, etc a quick read of
one of the relevant subsedtions usually gives me what I want fairly
quickly. The search facilities of info are also  very useful and then of
course their is the indexes. This combination seems to work pretty well.

Tim


-- 
tcross (at) rapttech dot com dot au


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

* Re: Quickly finding out a function or a variable you need?
  2010-08-06 14:29 Quickly finding out a function or a variable you need? Elena
                   ` (2 preceding siblings ...)
  2010-08-07  0:26 ` Tim X
@ 2010-08-08 21:44 ` Stefan Monnier
  3 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2010-08-08 21:44 UTC (permalink / raw)
  To: help-gnu-emacs

> while writing Emacs Lisp code, I often use `describe-function' and
> `describe-variable' to search for functions and variables related to
> the task at hand.
> This commands, however - unlike `apropos' - require you to know the
> first characters. This means you'll have an hard time, for instance,
> finding `kill-buffer' when looking for functions which operate on
> buffers.

While these are clearly not the end-all-be-all of documentation, the
particular problem above is somewhat addressed in Emacs-23 by the new
completion facility where * is understand as a glob-character.  I.e.
C-h f *buffer TAB will list all functions that contain "buffer" in
their name.  Sadly, these are probably too many if you're looking for
kill-buffer.


        Stefan


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

end of thread, other threads:[~2010-08-08 21:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-06 14:29 Quickly finding out a function or a variable you need? Elena
2010-08-06 14:50 ` Elena
     [not found]   ` <87mxszvjpu.fsf@kuiper.lan.informatimago.com>
2010-08-06 22:20     ` Elena
2010-08-06 15:33 ` Pascal J. Bourguignon
2010-08-07  0:26 ` Tim X
2010-08-08 21:44 ` Stefan Monnier

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.