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: Ihor Radchenko
Subject: Re: master 48aacbf292 2/2: Make many seldom-used generalized variables obsolete
Date: Sat, 10 Sep 2022 15:02:00 +0800

Lars Ingebrigtsen <larsi@gnus.org> writes:

> "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

Well. What about `replace-buffer-contents'?

(For context, this is a very minor issue, and I am not pushing hard for
it. Just a minor annoyance.)

>> 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.

Sure, but not all the generalized variables were obsoleted. Do you claim
that all the remaining generalized variables are simple enough to not
require documentation? I am pretty sure that third-party setters may
still do non-obvious things.

Would it be possible to accept docstring in gv-define-setter and then
display it in the help buffer for the relevant variable?

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



reply via email to

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