unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Has enriched-mode become enriched?
@ 2021-07-12  8:19 Colin Baxter
  2021-07-13 12:20 ` Eli Zaretskii
  2021-07-13 13:05 ` Stefan Monnier
  0 siblings, 2 replies; 8+ messages in thread
From: Colin Baxter @ 2021-07-12  8:19 UTC (permalink / raw)
  To: emacs-devel

Hello,

I noticed a couple of changes in enriched-mode exhibited by the latest
emacs, which are not present in emacs-27.2.

1. It used to be the case that I could set a local variable as

#+begin_src elisp
# Local Variables:
# mode: enriched-mode
# End:
#+end_src

Now the addition of mode after the hyphen gives a File local-variables
error: (void-function enriched-mode-mode). I now have to use

#+begin_src elisp
# Local Variables:
# mode: enriched
# End:
#+end_src

2. It seems I now have to set flyspell explicitly, as in

#+begin_src elisp
(add-hook 'enriched-mode-hook 'turn-on-flyspell)
#+end_src

It used to be the case that

#+begin_src elisp
(add-hook 'text-mode-hook
          (lambda ()
            (flyspell-mode)))
#+end_src

was sufficient for enriched-mode too.

I am wondering if these changes are intended.

Best wishes,

Colin Baxter.



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

* Re: Has enriched-mode become enriched?
  2021-07-12  8:19 Has enriched-mode become enriched? Colin Baxter
@ 2021-07-13 12:20 ` Eli Zaretskii
  2021-07-13 13:39   ` Phil Sainty
  2021-07-13 13:05 ` Stefan Monnier
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2021-07-13 12:20 UTC (permalink / raw)
  To: Colin Baxter; +Cc: emacs-devel

> From: Colin Baxter <m43cap@yandex.com>
> Cc: 
> Date: Mon, 12 Jul 2021 09:19:18 +0100
> 
> 1. It used to be the case that I could set a local variable as
> 
> #+begin_src elisp
> # Local Variables:
> # mode: enriched-mode
> # End:
> #+end_src
> 
> Now the addition of mode after the hyphen gives a File local-variables
> error: (void-function enriched-mode-mode). I now have to use
> 
> #+begin_src elisp
> # Local Variables:
> # mode: enriched
> # End:
> #+end_src
> 
> 2. It seems I now have to set flyspell explicitly, as in
> 
> #+begin_src elisp
> (add-hook 'enriched-mode-hook 'turn-on-flyspell)
> #+end_src
> 
> It used to be the case that
> 
> #+begin_src elisp
> (add-hook 'text-mode-hook
>           (lambda ()
>             (flyspell-mode)))
> #+end_src
> 
> was sufficient for enriched-mode too.
> 
> I am wondering if these changes are intended.

I don't think so.

Could the reason be that enriched.el nowadays uses lexical-binding?



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

* Re: Has enriched-mode become enriched?
  2021-07-12  8:19 Has enriched-mode become enriched? Colin Baxter
  2021-07-13 12:20 ` Eli Zaretskii
@ 2021-07-13 13:05 ` Stefan Monnier
  2021-07-13 16:46   ` Colin Baxter
  1 sibling, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2021-07-13 13:05 UTC (permalink / raw)
  To: Colin Baxter; +Cc: emacs-devel

> I noticed a couple of changes in enriched-mode exhibited by the latest
> emacs, which are not present in emacs-27.2.
>
> 1. It used to be the case that I could set a local variable as
>
> #+begin_src elisp
> # Local Variables:
> # mode: enriched-mode
> # End:
> #+end_src
>
> Now the addition of mode after the hyphen gives a File local-variables
> error: (void-function enriched-mode-mode).

I just tried it with Debian's 27.1 and it doesn't work either.
AFAIK it's always been the case that the `mode:` thingy needs to have
the major mode spelled without the `-mode` trailer (this is important
for security reasons, since it would otherwise make it possible to call
any function).

> I now have to use
>
> #+begin_src elisp
> # Local Variables:
> # mode: enriched
> # End:
> #+end_src

That's the normal form.  Not sure how/why the other one worked for you
in the past.

> It used to be the case that
>
> #+begin_src elisp
> (add-hook 'text-mode-hook
>           (lambda ()
>             (flyspell-mode)))
> #+end_src

I think this will depend on the file name: enriched mode is a *minor*
mode, so whether it gets put in `text-mode` or some other mode will
depend on the file's name.

> I am wondering if these changes are intended.

I think you need to investigate on your side to make sure where those
changes come from because I don't think they come from Emacs-27 vs
Emacs-28 (or if they do, I don't think they come from changes in
`enriched-mode`).


        Stefan




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

* Re: Has enriched-mode become enriched?
  2021-07-13 12:20 ` Eli Zaretskii
@ 2021-07-13 13:39   ` Phil Sainty
  0 siblings, 0 replies; 8+ messages in thread
From: Phil Sainty @ 2021-07-13 13:39 UTC (permalink / raw)
  To: Colin Baxter; +Cc: Eli Zaretskii, emacs-devel

Colin Baxter wrote:

> 1. It used to be the case that I could set a local variable as
> 
> # Local Variables:
> # mode: enriched-mode
> # End:
> 
> Now the addition of mode after the hyphen gives a File local-variables
> error: (void-function enriched-mode-mode). I now have to use
> 
> # Local Variables:
> # mode: enriched
> # End:

The latter has, to my knowledge, always been the correct/supported
syntax.

Perhaps there was once support for people inadvertently including
a -mode suffix in a "mode:" file-local, but if so then that must
have been removed a while ago.  (I don't have an older version than
26.3 installed on this machine, but that certainly doesn't support
"mode: FOO-mode".)

I see that `enriched-mode' is a minor mode rather than a major mode,
though, so I'm guessing you were doing this in a version of Emacs
earlier than 24.1; either or both of these NEWS.24 entries may well
be relevant:

*** Using "mode: MINOR-MODE" to enable a minor mode is deprecated.
Instead, use "eval: (minor-mode 1)".

*** `set-auto-mode' now respects mode: local variables at the end
of files, as well as those in the -*- line.


-Phil




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

* Re: Has enriched-mode become enriched?
  2021-07-13 13:05 ` Stefan Monnier
@ 2021-07-13 16:46   ` Colin Baxter
  2021-07-13 17:12     ` John ff
  0 siblings, 1 reply; 8+ messages in thread
From: Colin Baxter @ 2021-07-13 16:46 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

First, I wish to thank everyone for their help and suggestions.

Local variable should be 'enriched' and not 'enriched-mode' in emacs-27
and also emacs-28. I hadn't noticed the warning in emacs-27 but I did in
emacs-28 because I had set the latter is set to debug on error.

I'm sorry I didn't look properly at the output. However, I have learnt
that its better not to use 'mode: enriched' at all as a local variable
for the following reason.

1. emacs -Q <RET> (works with emacs-28.0.50 and emacs-27.2)
2. C-x C-f test.txt <RET>
3. Enter some text.
4. M-x enriched-mode <RET>
   Mode-line reads 'Text Enriched'
5. Save the file and kill the buffer.
6. C-f test.txt <RET>
   Mode-line reads 'Text Enriched'
7. Enter
   # Local Variables:
   # mode: enriched
   # End:
   and save.
   Mode-line reads 'Text Enriched'
8. Kill the buffer and open test.txt again
   Mode-line now reads 'Fundamental Enriched'
9. Remove the local variables, save and kill buffer.
10. Open file test.txt again
    Mode-line now restored to 'Text Enriched'

Any text-only options such as flyspell will be lost if 'mode: enriched'
is used.

I have removed 'mode: enriched' from all my enriched-mode files,
which are now well-behaved.


Thanks again,

Colin Baxter.



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

* Re: Has enriched-mode become enriched?
  2021-07-13 16:46   ` Colin Baxter
@ 2021-07-13 17:12     ` John ff
  2021-07-13 17:37       ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: John ff @ 2021-07-13 17:12 UTC (permalink / raw)
  To: Colin Baxter
  Cc: Stefan Monnier, Andrea Corallo via Emacs development discussions.

J

⁣Sent from TypeApp ​

On Jul 13, 2021, 17:55, at 17:55, Colin Baxter <m43cap@yandex.com> wrote:
>First, I wish to thank everyone for their help and suggestions.
>
>Local variable should be 'enriched' and not 'enriched-mode' in emacs-27
>and also emacs-28. I hadn't noticed the warning in emacs-27 but I did
>in
>emacs-28 because I had set the latter is set to debug on error.
>
>I'm sorry I didn't look properly at the output. However, I have learnt
>that its better not to use 'mode: enriched' at all as a local variable
>for the following reason.
>
>1. emacs -Q <RET> (works with emacs-28.0.50 and emacs-27.2)
>2. C-x C-f test.txt <RET>
>3. Enter some text.
>4. M-x enriched-mode <RET>
>   Mode-line reads 'Text Enriched'
>5. Save the file and kill the buffer.
>6. C-f test.txt <RET>
>   Mode-line reads 'Text Enriched'
>7. Enter
>   # Local Variables:
>   # mode: enriched
>   # End:
>   and save.
>   Mode-line reads 'Text Enriched'
>8. Kill the buffer and open test.txt again
>   Mode-line now reads 'Fundamental Enriched'
>9. Remove the local variables, save and kill buffer.
>10. Open file test.txt again
>    Mode-line now restored to 'Text Enriched'
>
>Any text-only options such as flyspell will be lost if 'mode: enriched'
>is used.
>
>I have removed 'mode: enriched' from all my enriched-mode files,
>which are now well-behaved.
>
>
>Thanks again,
>
>Colin Baxter.




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

* Re: Has enriched-mode become enriched?
  2021-07-13 17:12     ` John ff
@ 2021-07-13 17:37       ` Stefan Monnier
  2021-07-13 17:50         ` tomas
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2021-07-13 17:37 UTC (permalink / raw)
  To: John ff; +Cc: Colin Baxter, Andrea Corallo via Emacs development discussions.

John ff [2021-07-13 18:12:21] wrote:
> J
>
> ⁣Sent from TypeApp ​

I was about to recommend you don't advertise proprietary products on
gnu.org mailing-lists, but the above message seems eloquent enough to
recommend against the product anyway ;-)


        Stefan




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

* Re: Has enriched-mode become enriched?
  2021-07-13 17:37       ` Stefan Monnier
@ 2021-07-13 17:50         ` tomas
  0 siblings, 0 replies; 8+ messages in thread
From: tomas @ 2021-07-13 17:50 UTC (permalink / raw)
  To: emacs-devel

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

On Tue, Jul 13, 2021 at 01:37:11PM -0400, Stefan Monnier wrote:
> John ff [2021-07-13 18:12:21] wrote:
> > J
> >
> > ⁣Sent from TypeApp ​
> 
> I was about to recommend you don't advertise proprietary products on
> gnu.org mailing-lists, but the above message seems eloquent enough to
> recommend against the product anyway ;-)

Yeah, but perhaps this eloquence only talks to people who would run
away screaming at the idea of using that app anyway :-/

Cheers
 - t

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

end of thread, other threads:[~2021-07-13 17:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-12  8:19 Has enriched-mode become enriched? Colin Baxter
2021-07-13 12:20 ` Eli Zaretskii
2021-07-13 13:39   ` Phil Sainty
2021-07-13 13:05 ` Stefan Monnier
2021-07-13 16:46   ` Colin Baxter
2021-07-13 17:12     ` John ff
2021-07-13 17:37       ` Stefan Monnier
2021-07-13 17:50         ` tomas

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