all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Hongyi Zhao <hongyi.zhao@gmail.com>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: RE: [External] : The function naming convention used by Emacs.
Date: Mon, 27 Sep 2021 14:53:04 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488CA1DE0B8FC9A49BFFA2DF3A79@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <CAGP6POLWMgH8cCw9MPB2c9aiBGBf+xGr_2ZDOzRCxw_QwqTKYg@mail.gmail.com>

> > 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	other threads:[~2021-09-27 14:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-26 11:05 The function naming convention used by Emacs Hongyi Zhao
2021-09-26 11:27 ` 2QdxY4RzWzUUiLuE
2021-09-26 11:49   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-26 11:50   ` Hongyi Zhao
2021-09-26 11:48 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-26 12:18   ` Hongyi Zhao
2021-09-26 13:34     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-26 17:04 ` [External] : " Drew Adams
2021-09-27  5:46   ` Hongyi Zhao
2021-09-27 14:53     ` Drew Adams [this message]

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=SJ0PR10MB5488CA1DE0B8FC9A49BFFA2DF3A79@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=hongyi.zhao@gmail.com \
    /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.