all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: master 6d4179957a8: Fix test of whether to insert lexical-binding cookies in custom files
@ 2024-05-11 16:36 Eli Zaretskii
  2024-05-11 16:55 ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2024-05-11 16:36 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> +            ;; The previous test `eobp' was written with an appalling
> +            ;; lack of forethought or testing, being easily misled if
> +            ;; the user should have left point at eob in a buffer
> +            ;; visiting the custom file.
> +            (when (eq (point-min) (point-max))

Is this test robust enough?  Why not use buffer-size instead?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master 6d4179957a8: Fix test of whether to insert lexical-binding cookies in custom files
  2024-05-11 16:36 master 6d4179957a8: Fix test of whether to insert lexical-binding cookies in custom files Eli Zaretskii
@ 2024-05-11 16:55 ` Andreas Schwab
  2024-05-11 16:58   ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2024-05-11 16:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Po Lu, emacs-devel

On Mai 11 2024, Eli Zaretskii wrote:

>> +            ;; The previous test `eobp' was written with an appalling
>> +            ;; lack of forethought or testing, being easily misled if
>> +            ;; the user should have left point at eob in a buffer
>> +            ;; visiting the custom file.
>> +            (when (eq (point-min) (point-max))
>
> Is this test robust enough?  Why not use buffer-size instead?

buffer-size also ignores narrowing.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master 6d4179957a8: Fix test of whether to insert lexical-binding cookies in custom files
  2024-05-11 16:55 ` Andreas Schwab
@ 2024-05-11 16:58   ` Andreas Schwab
  2024-05-11 17:09     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2024-05-11 16:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Po Lu, emacs-devel

On Mai 11 2024, Andreas Schwab wrote:

> On Mai 11 2024, Eli Zaretskii wrote:
>
>>> +            ;; The previous test `eobp' was written with an appalling
>>> +            ;; lack of forethought or testing, being easily misled if
>>> +            ;; the user should have left point at eob in a buffer
>>> +            ;; visiting the custom file.
>>> +            (when (eq (point-min) (point-max))
>>
>> Is this test robust enough?  Why not use buffer-size instead?
>
> buffer-size also ignores narrowing.

I missed the preceding (widen), though.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master 6d4179957a8: Fix test of whether to insert lexical-binding cookies in custom files
  2024-05-11 16:58   ` Andreas Schwab
@ 2024-05-11 17:09     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2024-05-11 17:09 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: luangruo, emacs-devel

> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: Po Lu <luangruo@yahoo.com>,  emacs-devel@gnu.org
> Date: Sat, 11 May 2024 18:58:22 +0200
> 
> On Mai 11 2024, Andreas Schwab wrote:
> 
> > On Mai 11 2024, Eli Zaretskii wrote:
> >
> >>> +            ;; The previous test `eobp' was written with an appalling
> >>> +            ;; lack of forethought or testing, being easily misled if
> >>> +            ;; the user should have left point at eob in a buffer
> >>> +            ;; visiting the custom file.
> >>> +            (when (eq (point-min) (point-max))
> >>
> >> Is this test robust enough?  Why not use buffer-size instead?
> >
> > buffer-size also ignores narrowing.
> 
> I missed the preceding (widen), though.

Right, but buffer-size is cheaper.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-11 17:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-11 16:36 master 6d4179957a8: Fix test of whether to insert lexical-binding cookies in custom files Eli Zaretskii
2024-05-11 16:55 ` Andreas Schwab
2024-05-11 16:58   ` Andreas Schwab
2024-05-11 17:09     ` Eli Zaretskii

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.