0

Context: Emacs version 29.0.60 ; function goto-char

An example of misleading symbol/function naming making it necessary to consult the documentation in order to use it the right way is the Emacs function goto-char.

The function name suggests that there is movement involved (go to), so the expected outcome can be intuitively deducted as moving the point to a position in a buffer. This turns out to be actually the case and what the function does. OK.

The misleading part of the symbol/function naming is the term char, because the spoken language meaning of 'go to a character' suggests movement to a single given character, where the function actually takes an integer value specifying a position in a buffer to which the point is to move.

A more meaningful naming for example goto-position or goto-pos instead of goto-char would make it possible to use the function the proper way without the necessity of consulting its documentation first.

In this context, my question is:

Do contributors to Emacs code intend to implement more meaningful symbol naming in future Emacs versions?

Claudio
  • 410
  • 2
  • 11
  • 2
    I’m voting to close this question because this question is not appropriate for this site. It should have been asked on the Emacs devel list. – NickD Apr 10 '23 at 13:28
  • 2
    Maybe you're right, `goto-char`'s name can be confusing to newcomers. BUT that's not the question to ask here, you should ask Emacs developers. Most community volunteers cannot answer such questions. – shynur Apr 10 '23 at 13:36
  • 1
    What is Emacs devel list??? – Claudio Apr 10 '23 at 14:39
  • 1
    https://lists.gnu.org/mailman/listinfo/emacs-devel – NickD Apr 10 '23 at 14:43

1 Answers1

0

As I am not an Emacs code contributor knowing about intentions of the core developer group, I can't tell you if there are plans to implement more meaningful symbol naming, but I can provide an example showing that there was some effort in this direction in the past.

For evidence of the above statement see the documentation of 'point-at-bol'

point-at-bol is an alias for ‘line-beginning-position’ in ‘subr.el’. This function is obsolete since 29.1; use `line-beginning-position' or 'pos-bol' instead.

The confusing naming will become obsolete in future Emacs versions in favor of usage of more meaningful namings 'line-beginning-position' and 'pos-bol' which both suggest as outcome a position of a line beginning. 'bol' is maybe a bit cryptic but in my eyes relatively easy to guess and memorize in the context of pos-bol as (b)eginning (o)f (l)ine.

Claudio
  • 410
  • 2
  • 11