help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [External] : The function naming convention used by Emacs.


From: Drew Adams
Subject: RE: [External] : The function naming convention used by Emacs.
Date: Mon, 27 Sep 2021 14:53:04 +0000

> > In the Elisp manual, `i' followed by `convention'
> > (if you have substring completion turned on)
> 
> What's the exact vanilla Emacs keystrokes
> corresponding to the above operations?

With vanilla Emacs, enable style `substring' for
user option `completion-styles', if you want to
be able to type just `convention' and see
substring matches (completions) for it.

In the Elisp manual, `i completion-styles RET'
tells you about this.

Then `i convention TAB' does what I described.

If you don't enable substring completion then
`i convention TAB' completes only to `conventions
for writing m', and `TAB' again shows you these
two candidates:

  conventions for writing major modes
  conventions for writing minor modes

Neither of those is relevant for your question.

But you can instead type `i coding c TAB' to
get candidate `coding conventions in Emacs Lisp'.

The problem with that is guessing/knowing more
about what index entries there might be.

This illustrates a general point: vanilla Emacs
completion is limited, out of the box.  But you
can customize it to help you better.  You'll
need to read about `completion-styles' to decide
just how you want to do that.

Personally, I use a completion library (Icicles)
that provides both (1) "prefix" completion
(speaking generally) such as what vanilla Emacs
provides - using `TAB', and (2) "apropos"
completion such as regexp (which includes
substring) matching - using `S-TAB'.  So I use
`i convention S-TAB' to see substring matches.

https://www.emacswiki.org/emacs/Icicles_-_Completion_Methods_and_Styles

[
 I use those names, "prefix" and "apropos", but
 they're a bit misleading.  In Icicles, "prefix"
 completion (`TAB') includes whatever vanilla
 Emacs `completion-styles' you configured (so it
 can include `substring', `flex', etc.).  And it
 includes `fuzzy' and `swank' completion.

 "Apropos" completion includes 2 kinds of "scatter" 
 completion (sometimes called "flex"), and 3 other
 kinds of "fuzzy" completion.  (And you can add
 other matching methods.)

 Having two keys for completion means you can
 use either kind anytime, and you can use them
 together when progressively narrowing.  Each
 has its own advantages.

 (You can also change the method used for either
 `TAB' or `S-TAB' anytime, during completion.)
]

> With swiper, I use the following command to
> access the above Elisp manual built-in Emacs:
> 
> C-h i RET elisp RET cod conv RET

Same with Icicles, and no doubt with other
libraries.

It's enough to type just `cod co'.  But again,
this means you have to guess that there's an
index entry that's something like `coding
conventions'.  Otherwise, how would you come up
with `cod co'?

It's not about how little you can type to match
just what you need.  It's about what you need
to guess, to get to what you need.

Guessing that there's some info (an answer)
about "conventions" is fairly natural, here.

Guessing there might be info for "coding" might
also be natural (or not).  With uncustomized
vanilla Emacs, if you try just `coding TAB'
you'll get about 20 candidates.  If you try just
`convention' you'll get the two candidates I
cited above (neither of which is relevant here).

You might guess "programming" instead of "coding".
And there is an index entry `programming
conventions'.  But that takes you to node
`Programming Tips', which doesn't help with your
quest.

1. My point was to _ask Emacs_, using its index.

(And you can of course also just go directly to
node `Index' and browse/search there, instead of
using `i'.)

2. A secondary point is that you can help yourself
by using a better matching style or system than
the default.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]