[Top][All Lists]

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

Re: Imports / inclusion of s.el into Emacs

From: 조성빈
Subject: Re: Imports / inclusion of s.el into Emacs
Date: Sun, 3 May 2020 03:01:03 +0900

Eli Zaretskii <address@hidden> 작성:

From: Philippe Vaucher <address@hidden>
Date: Sat, 2 May 2020 17:20:16 +0200
Cc: Eli Zaretskii <address@hidden>, Emacs developers <address@hidden>,
        Stefan Monnier <address@hidden>, Richard Stallman <address@hidden>, Dmitry 
Gutov <address@hidden>

Say I want to quickly remember how strings work in Emacs, how you manipulate them, etc. With a few
keystrokes I end up on
https://www.gnu.org/software/emacs/manual/html_node/elisp/Strings-and-Characters.html. From there I have to select a topics, read it partially, go back, read another topic, all that while skipping paragraphs most
of the time (but that can be improved with my keep-lines trick).

There is no manual entry where I see all these classified string functions at once, and "C-h d string" makes my emacs so laggy that I cannot use it, also most of the entries are irrelevant.

It sounds very strange to me that the method of learning about strings
is by looking at the list of string-related APIs.

Unless one doesn’t have any programming experience, IMO one can learn
(or refresh old memory) of how strings work from the API list.

(And if that doesn’t work, that’s a design failure. Function names exist for meanings.)

If you want to
learn about strings in Emacs, you should read the entire chapter
"Strings and Characters", including all of its sections and
subsections.  This is how a certain topic should be learned for the
first time, or after a long break when you no longer sure you remember
enough of the basics.

Does every Emacs user have to go through the long manual to write some short functions?

Now compare that to https://ruby-doc.org/core-2.6/String.html. Do you see how faster that is or is just my
lack of habit of using the manual?

What should I look at there?  I see a very long list of functions,
each one followed by 5 to 10 lines of description.  How is it
different from what we have in the ELisp manual?

Or with https://ruby-doc.org/core-2.6/Thread.html, see how you directly
have an example of common usage?

How can a single example of "typical usage" help you understand a
complex topic such as threads?

A single example is of course not for understanding the whole complex
topic, but it serves as a reminder.

 And what is "typical usage" of
threads, anyway?  I could use threads in umpteen different ways, all
of them "typical".  What am I missing?

I guess you could argue that I'm not used to having to read big chunks of text to get the information I'm
looking for, that's I think a valid criticism.

What big chunks of text are you alluding to?  Are you saying that the
smaller is the documentation of a function, the better?

In the ELisp manual we describe each function with as many words as
required to describe its functionality.  (There are people who think
we need to tell more.)  We also provide "continuity" text to serve as
a "glue" which is supposed to help the reader understand the topic
better and see each API in its context and relation to others.

Yes, that’s great when one doesn’t know about programming in general or
how Emacs work. It’s not great when you forgot what string API Emacs
provides, and trying to find out what operations exist, to write my
custom interactive function in the cleanest way possible.

"Manuals" that are just lists of APIs with minimum explanatory text,
a-la JavaDoc, are _bad_ manuals.  They don't tell you enough about the
topics for you to understand when use one class of APIs and when to
use another.  If you want to see a representative of such bad manuals,
look at the GTK docs.  Is this what you'd like to see in the ELisp

No, of course not. I’m pretty sure nobody wants a manual like that.
Just that it would be better if there’s a good way to view all of
the string operations that Emacs supports without text.

I think this is going too far from the original discussion.
The original discussion was adding prefixes to *some* functions
that aren’t that controversial. (Like make-string, for example.)

One of the arguments was that it’s easier to find, remind & predict,
which aids in discoverability.

The prefix-scheme means that, when one tries to write code, it’s easy
to guess based on faint memory or just from pure speculation. And
that’s important, especially in Emacs, because one shouldn’t need to
read through the manual just to write some interactive functions for
a personal configuration.

I think a lot of people here are misunderstanding why this is a
virtue -  understandable since most here are already Elisp masters,
can guess make-string or split-string based on memory, write out
code without searching. But that’s not true for a lot of Emacs users,
including a lot of users who have used Emacs for a long time without
writing lots of Elisp or written any packages, and for those people,
it’s very useful to guess and write code.

reply via email to

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