* INTERVAL_EXPRESSLY_WRITABLE_P
@ 2024-05-01 13:24 Eli Zaretskii
2024-05-01 14:04 ` INTERVAL_EXPRESSLY_WRITABLE_P Po Lu
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2024-05-01 13:24 UTC (permalink / raw)
To: Po Lu; +Cc: emacs-devel
> +/* Is this interval writable by virtue of an explicit inhibit-read-only
> + property, or the specific presence of its Qread_only property in
> + Vinhibit_read_only? */
> +#define INTERVAL_EXPRESSLY_WRITABLE_P(i, ro) \
> + (!NILP (textget ((i)->plist, Qinhibit_read_only)) \
> + || (!NILP (ro) \
> + && CONSP (Vinhibit_read_only) \
> + && !NILP (Fmemq ((ro), Vinhibit_read_only))))
The comment is IMO misleading, since the code doesn't use Qread_only.
OTOH, why did you need the RO argument if it is always set to the
Qread_only property of the interval's text?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: INTERVAL_EXPRESSLY_WRITABLE_P
2024-05-01 13:24 INTERVAL_EXPRESSLY_WRITABLE_P Eli Zaretskii
@ 2024-05-01 14:04 ` Po Lu
2024-05-01 14:57 ` INTERVAL_EXPRESSLY_WRITABLE_P Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Po Lu @ 2024-05-01 14:04 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
> The comment is IMO misleading, since the code doesn't use Qread_only.
It does, through RO.
> OTOH, why did you need the RO argument if it is always set to the
> Qread_only property of the interval's text?
To avoid calling textget twice (or thrice, if an error should be
signaled in response to the interval's being non-writable).
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: INTERVAL_EXPRESSLY_WRITABLE_P
2024-05-01 14:04 ` INTERVAL_EXPRESSLY_WRITABLE_P Po Lu
@ 2024-05-01 14:57 ` Eli Zaretskii
2024-05-02 1:25 ` INTERVAL_EXPRESSLY_WRITABLE_P Po Lu
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2024-05-01 14:57 UTC (permalink / raw)
To: Po Lu; +Cc: emacs-devel
> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Wed, 01 May 2024 22:04:25 +0800
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > The comment is IMO misleading, since the code doesn't use Qread_only.
>
> It does, through RO.
And you think I didn't see it? My point is that the comment should
talk about RO, not about Qread_only, because the latter is nowhere in
sight.
> > OTOH, why did you need the RO argument if it is always set to the
> > Qread_only property of the interval's text?
>
> To avoid calling textget twice (or thrice, if an error should be
> signaled in response to the interval's being non-writable).
That could be done by using a local variable.
Anyway, my point is that the documentation of these macros "needs
work".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: INTERVAL_EXPRESSLY_WRITABLE_P
2024-05-01 14:57 ` INTERVAL_EXPRESSLY_WRITABLE_P Eli Zaretskii
@ 2024-05-02 1:25 ` Po Lu
0 siblings, 0 replies; 4+ messages in thread
From: Po Lu @ 2024-05-02 1:25 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
> That could be done by using a local variable.
Which is being passed to the macro as RO.
> Anyway, my point is that the documentation of these macros "needs
> work".
Okay.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-05-02 1:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-01 13:24 INTERVAL_EXPRESSLY_WRITABLE_P Eli Zaretskii
2024-05-01 14:04 ` INTERVAL_EXPRESSLY_WRITABLE_P Po Lu
2024-05-01 14:57 ` INTERVAL_EXPRESSLY_WRITABLE_P Eli Zaretskii
2024-05-02 1:25 ` INTERVAL_EXPRESSLY_WRITABLE_P Po Lu
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.