unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24415: 24.4; issue with big file variable
@ 2016-09-11 21:52 Andrea Rossetti
  2016-09-12  8:45 ` Stephen Berman
  2019-09-16  3:21 ` Stefan Kangas
  0 siblings, 2 replies; 5+ messages in thread
From: Andrea Rossetti @ 2016-09-11 21:52 UTC (permalink / raw)
  To: 24415

[-- Attachment #1: Type: text/plain, Size: 1871 bytes --]

Hi guys,

  if a file variable is a list longer than a certain size, then it's
ignored on file loading. Test case follows:

- start "emacs -Q"
- M-: (add-file-local-variable 'v1 (make-list 2000 1)) RET
- C-x C-w example01.el RET
- close Emacs and restart "emacs -Q"
- C-x C-f example01.el RET
- bad behaviour: at this point a confirm message to load the file
  variable should have appeared ("... safe variables blah blah... do you
  want to apply it? y/n/!")  but it does not, and the variable is not
  initialized

Further observations:

  - if you replay this same test with a shorter v1, for example lowering
    "2000" to "1000", then the behaviour will be fine: the confirm
    message will appear and inspection of the variable will show correct
    value.

  - it doesn't seem to depend on the max length of a single text line:
    you get the error even when you re-run a similar test that saves two
    file-local variables v1 and v2, each being "(make-list 1000 1)".

  Does the test reproduce in the same way on your workstation? Do you
think it's a bug, or am I just hitting some well-known hard limit?

  Thanks for any hint or clarification, kindest regards.

Andrea

In GNU Emacs 24.4.1 (x86_64-w64-mingw32)
of 2014-10-21 on KAEL
Windowing system distributor `Microsoft Corp.', version 6.1.7600
Configured using:
`configure --prefix=/z/emacs --host=x86_64-w64-mingw32
--target=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --with-wide-int
--with-jpeg --with-xpm --with-png --with-tiff --with-rsvg --with-xml2
--with-gnutls --with-xft --with-sound=yes --with-file-notification=yes
--without-dbus --without-imagemagick 'CFLAGS=-Ofast
-fomit-frame-pointer -funroll-loops -g0 -pipe' 'CPPFLAGS=-DNDEBUG
-DDBUS_STATIC_BUILD' 'LDFLAGS=-static-libgcc -static-libstdc++ -static
-s -Wl,-s''

Important settings:
  value of $LANG: ITA
  locale-coding-system: cp1252

[-- Attachment #2: Type: text/html, Size: 2242 bytes --]

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

* bug#24415: 24.4; issue with big file variable
  2016-09-11 21:52 bug#24415: 24.4; issue with big file variable Andrea Rossetti
@ 2016-09-12  8:45 ` Stephen Berman
  2016-09-12 12:23   ` npostavs
  2019-09-16  3:21 ` Stefan Kangas
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Berman @ 2016-09-12  8:45 UTC (permalink / raw)
  To: Andrea Rossetti; +Cc: 24415

On Sun, 11 Sep 2016 23:52:56 +0200 Andrea Rossetti <andrea.rossetti@gmail.com> wrote:

> Hi guys,
>
>   if a file variable is a list longer than a certain size, then it's
> ignored on file loading. Test case follows:
>
> - start "emacs -Q"
> - M-: (add-file-local-variable 'v1 (make-list 2000 1)) RET
> - C-x C-w example01.el RET
> - close Emacs and restart "emacs -Q"
> - C-x C-f example01.el RET
> - bad behaviour: at this point a confirm message to load the file
>   variable should have appeared ("... safe variables blah blah... do you
>   want to apply it? y/n/!")  but it does not, and the variable is not
>   initialized
>
> Further observations:
>
>   - if you replay this same test with a shorter v1, for example lowering
>     "2000" to "1000", then the behaviour will be fine: the confirm
>     message will appear and inspection of the variable will show correct
>     value.
>
>   - it doesn't seem to depend on the max length of a single text line:
>     you get the error even when you re-run a similar test that saves two
>     file-local variables v1 and v2, each being "(make-list 1000 1)".
>
>   Does the test reproduce in the same way on your workstation? Do you
> think it's a bug, or am I just hitting some well-known hard limit?

It's a hard limit in hack-local-variables:

	;; Look for "Local variables:" line in last page.
	(save-excursion
	  (goto-char (point-max))
	  (search-backward "\n\^L" (max (- (point-max) 3000) (point-min))
			   'move)

I don't know how well-known this is; AFAICT it's not documented.

Steve Berman





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

* bug#24415: 24.4; issue with big file variable
  2016-09-12  8:45 ` Stephen Berman
@ 2016-09-12 12:23   ` npostavs
  2016-09-12 13:07     ` Stephen Berman
  0 siblings, 1 reply; 5+ messages in thread
From: npostavs @ 2016-09-12 12:23 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Andrea Rossetti, 24415

Stephen Berman <stephen.berman@gmx.net> writes:

>
> It's a hard limit in hack-local-variables:
>
> 	;; Look for "Local variables:" line in last page.
> 	(save-excursion
> 	  (goto-char (point-max))
> 	  (search-backward "\n\^L" (max (- (point-max) 3000) (point-min))
> 			   'move)
>
> I don't know how well-known this is; AFAICT it's not documented.

It's documented in the manual, (emacs) Specifying File Variables

       Apart from using a `-*-' line, you can define file local variables
    using a "local variables list" near the end of the file.  The start of
    the local variables list should be no more than 3000 characters from
    the end of the file, and must be on the last page if the file is
    divided into pages.





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

* bug#24415: 24.4; issue with big file variable
  2016-09-12 12:23   ` npostavs
@ 2016-09-12 13:07     ` Stephen Berman
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Berman @ 2016-09-12 13:07 UTC (permalink / raw)
  To: npostavs; +Cc: Andrea Rossetti, 24415

On Mon, 12 Sep 2016 08:23:04 -0400 npostavs@users.sourceforge.net wrote:

> Stephen Berman <stephen.berman@gmx.net> writes:
>
>>
>> It's a hard limit in hack-local-variables:
>>
>> 	;; Look for "Local variables:" line in last page.
>> 	(save-excursion
>> 	  (goto-char (point-max))
>> 	  (search-backward "\n\^L" (max (- (point-max) 3000) (point-min))
>> 			   'move)
>>
>> I don't know how well-known this is; AFAICT it's not documented.
>
> It's documented in the manual, (emacs) Specifying File Variables
>
>        Apart from using a `-*-' line, you can define file local variables
>     using a "local variables list" near the end of the file.  The start of
>     the local variables list should be no more than 3000 characters from
>     the end of the file, and must be on the last page if the file is
>     divided into pages.

Mea culpa; I looked there before posting but obviously not closely
enough.

Steve Berman





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

* bug#24415: 24.4; issue with big file variable
  2016-09-11 21:52 bug#24415: 24.4; issue with big file variable Andrea Rossetti
  2016-09-12  8:45 ` Stephen Berman
@ 2019-09-16  3:21 ` Stefan Kangas
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Kangas @ 2019-09-16  3:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 24415-done

Eli Zaretskii <eliz@gnu.org> writes:

> tag 24415 + notabug
> thanks

This was tagged notabug in 2016, but never closed.  Closing now.

Best regards,
Stefan Kangas





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

end of thread, other threads:[~2019-09-16  3:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-11 21:52 bug#24415: 24.4; issue with big file variable Andrea Rossetti
2016-09-12  8:45 ` Stephen Berman
2016-09-12 12:23   ` npostavs
2016-09-12 13:07     ` Stephen Berman
2019-09-16  3:21 ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).