emacs-devel
[Top][All Lists]
Advanced

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

Re: master 48aacbf292 2/2: Make many seldom-used generalized variables o


From: Lars Ingebrigtsen
Subject: Re: master 48aacbf292 2/2: Make many seldom-used generalized variables obsolete
Date: Sat, 10 Sep 2022 08:45:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Ihor Radchenko <yantar92@gmail.com> writes:

> This commit also obsoleted a number of generalized variables used by
> Org. In particular, `buffer-substring', and `buffer-string'.
>
> While it is indeed possible to set buffer contents without the above
> variables, it cannot (AFAIK) be done using a single function call.
> Would it be possible to provide a function replacement for setting a
> buffer text in the whole buffer/buffer region?

"Setting a buffer text" is something that is un-Emacsey, in my opinion.
That is, (setf (buffer-substring ...) ...) is pretending that we're
operating on some object, but instead we're altering global (buffer)
state.

Just delete and insert instead

> Also, obsoleting `buffer-file-name' revealed one potentially concerning
> fact about generalized variables. The expansion of `buffer-file-name'
> setter, `set-visited-file-name' "... also renames the buffer to
> correspond to the new file." I am now wondering if there are any
> non-obvious side effects when using other generalized variables - there
> is (AFAIK) no documentation about what exactly various setters for
> generalized variables do other than occasional paragraph in the manual.

All these obsoleted generalised variables had non-obvious side effects,
which is why I obsoleted them.

I don't think anybody could guess what (setf (point-min) 2) actually
does without reading the expanded code.



reply via email to

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