Subject: bug#17948: 24.3; cperl: Needs an equivalent to `c-file-style'

From: Stefan Kangas <[email-masked]>
Date: Tue, 2 Jan 2024 09:33:32 -0800

reopen 17948
thanks

Lars Ingebrigtsen <[email-masked]> writes:

> Samuel Bronson <[email-masked]> writes:
>
>> The package `cperl' could *really* benefit from a way to do the
>> equivalent of `cperl-set-style' from a Local Variables block or
>> .dir-locals.el file.
>
> I've now added this to Emacs 29 (under the name cperl-file-style).

Harald Jörg <[email-masked]> writes:

> The current implementation might need some reconsideration, though... I
> have been playing around with it and am a bit confused.
>
> As far as I understand it, `cperl-file-style' is supposed to be set in
> .dir-locals.el.  If I define it there as "PBP", then that style going to
> be local in buffers visiting files from the same directory.  Fine so
> far.
>
> However, the individual settings like `cperl-indent-level' are not
> buffer-local, nor made buffer-local by cperl-set-style.  Therefore, if I
> run `cperl-set-style' in any buffer (or from a customize :set function
> or from another .dir-locals.el), then it will override the value ... in
> all buffers, regardless of their local style settings.
>
> The C modes (which are the example after which cperl-file-style was
> built) solve this with a special value 'set-from-style - I guess
> cperl-mode needs something in the same spirit.

So I don't think the feature is working in its current form.