GNU bug report logs - #33855
27.0.50; Can't see markup in HELLO

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Date: Sun, 23 Dec 2018 22:17:01 UTC

Severity: wishlist

Tags: moreinfo

Found in version 27.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33855 in the body.
You can then email your comments to 33855 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#33855; Package emacs. (Sun, 23 Dec 2018 22:17:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 23 Dec 2018 22:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; Can't see markup in HELLO
Date: Sun, 23 Dec 2018 17:15:57 -0500
Severity: wishlist
Package: Emacs
Version: 27.0.50


I can't seem to figure out how to conveniently edit the markup.
In modes like image-mode, postscript-mode, doc-view-mode, ..., we can
choose between the "edit source" and "view rendering", but for
enriched-mode buffers, all I find is find-file-literally which not only
makes the markup explicit but also shows me the bytes rather than the
chars, which is not what I want.

I think we should add a way to see (and edit) the markup.
Maybe the corresponding command can be `enriched-mode` (tho currently
that command doesn't do this).
And maybe it can be bound to C-c C-c.


        Stefan



In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2018-12-14 built on pastel
Repository revision: fbae0090fe9595ba1669fdfd5ef88f1ee3172edc
Repository branch: work
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description: Debian GNU/Linux 9 (stretch)

Recent messages:
Quit

Enriched: decoding document...
Indenting...
View mode: type C-h for help, h for commands, q to quit.
Quit
Auto-saving...
Warning: hide-sublevels is obsolete!
Mark saved where search started
Enriched mode disabled in current buffer




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33855; Package emacs. (Wed, 18 May 2022 13:09:02 GMT) Full text and rfc822 format available.

Message #8 received at 33855 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 33855 <at> debbugs.gnu.org
Subject: Re: bug#33855: 27.0.50; Can't see markup in HELLO
Date: Wed, 18 May 2022 15:07:59 +0200
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:

> I can't seem to figure out how to conveniently edit the markup.
> In modes like image-mode, postscript-mode, doc-view-mode, ..., we can
> choose between the "edit source" and "view rendering", but for
> enriched-mode buffers, all I find is find-file-literally which not only
> makes the markup explicit but also shows me the bytes rather than the
> chars, which is not what I want.
>
> I think we should add a way to see (and edit) the markup.
> Maybe the corresponding command can be `enriched-mode` (tho currently
> that command doesn't do this).
> And maybe it can be bound to C-c C-c.

This doesn't seem like it should be that difficult to implement.
Round-tripping with

(enriched-encode (point-min) (point-max) (current-buffer))

and

(enriched-decode (point-min) (point-max))

seems to work fine (well, with some post-processing after the first to
get rid of colours, so they're not doubly encoded).

I'm not quite sure that having the `C-c C-c' command be `enriched-mode'
would be all that helpful, though -- was there any particular reason for
that in the feature spec?  

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 18 May 2022 13:09:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33855; Package emacs. (Wed, 18 May 2022 14:32:01 GMT) Full text and rfc822 format available.

Message #13 received at 33855 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33855 <at> debbugs.gnu.org
Subject: Re: bug#33855: 27.0.50; Can't see markup in HELLO
Date: Wed, 18 May 2022 10:31:10 -0400
> I'm not quite sure that having the `C-c C-c' command be `enriched-mode'
> would be all that helpful, though -- was there any particular reason for
> that in the feature spec?  

No, it just seemed like a natural binding for it.
But it'd likely be used so rarely that it's not worth having
a key-binding.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33855; Package emacs. (Wed, 18 May 2022 14:55:02 GMT) Full text and rfc822 format available.

Message #16 received at 33855 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 33855 <at> debbugs.gnu.org
Subject: Re: bug#33855: 27.0.50; Can't see markup in HELLO
Date: Wed, 18 May 2022 16:53:56 +0200
>>>>> On Wed, 18 May 2022 10:31:10 -0400, Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> said:

    >> I'm not quite sure that having the `C-c C-c' command be `enriched-mode'
    >> would be all that helpful, though -- was there any particular reason for
    >> that in the feature spec?  

    Stefan> No, it just seemed like a natural binding for it.
    Stefan> But it'd likely be used so rarely that it's not worth having
    Stefan> a key-binding.

How about "C-c '", for consistency with org-mode.

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33855; Package emacs. (Thu, 19 May 2022 23:19:01 GMT) Full text and rfc822 format available.

Message #19 received at 33855 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 33855 <at> debbugs.gnu.org
Subject: Re: bug#33855: 27.0.50; Can't see markup in HELLO
Date: Fri, 20 May 2022 01:18:35 +0200
Robert Pluim <rpluim <at> gmail.com> writes:

>     Stefan> No, it just seemed like a natural binding for it.
>     Stefan> But it'd likely be used so rarely that it's not worth having
>     Stefan> a key-binding.

I've now added a new command 'enriched-toggle-markup' to Emacs 29.

> How about "C-c '", for consistency with org-mode.

I left it unbound for now -- I'm not quite sure whether it's something
that many people would want to use, even if it's useful for debugging.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 33855 <at> debbugs.gnu.org and Stefan Monnier <monnier <at> IRO.UMontreal.CA> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 19 May 2022 23:19:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33855; Package emacs. (Fri, 20 May 2022 12:34:02 GMT) Full text and rfc822 format available.

Message #24 received at 33855 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Robert Pluim <rpluim <at> gmail.com>, 33855 <at> debbugs.gnu.org
Subject: Re: bug#33855: 27.0.50; Can't see markup in HELLO
Date: Fri, 20 May 2022 08:33:43 -0400
Lars Ingebrigtsen [2022-05-20 01:18:35] wrote:
> Robert Pluim <rpluim <at> gmail.com> writes:
>>     Stefan> No, it just seemed like a natural binding for it.
>>     Stefan> But it'd likely be used so rarely that it's not worth having
>>     Stefan> a key-binding.
> I've now added a new command 'enriched-toggle-markup' to Emacs 29.

Thanks.

>> How about "C-c '", for consistency with org-mode.
> I left it unbound for now -- I'm not quite sure whether it's something
> that many people would want to use, even if it's useful for debugging.

Agreed.

Looking a bit more into it, I wonder if 'enriched-toggle-markup' should
be merged with the `enriched-mode` command itself.

Currently, doing something like:

    C-x C-f .../HELLO    # Open an enriched-mode file
    M-x enriched-mode    # Disable enriched-mode
    foobar               # Insert arbitrary text
    C-x C-s              # Save

throws away all the annotations without any warning.

WDYT?


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33855; Package emacs. (Fri, 20 May 2022 13:17:02 GMT) Full text and rfc822 format available.

Message #27 received at 33855 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: larsi <at> gnus.org, rpluim <at> gmail.com, 33855 <at> debbugs.gnu.org
Subject: Re: bug#33855: 27.0.50; Can't see markup in HELLO
Date: Fri, 20 May 2022 16:16:30 +0300
> Cc: Robert Pluim <rpluim <at> gmail.com>, 33855 <at> debbugs.gnu.org
> Date: Fri, 20 May 2022 08:33:43 -0400
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Currently, doing something like:
> 
>     C-x C-f .../HELLO    # Open an enriched-mode file
>     M-x enriched-mode    # Disable enriched-mode
>     foobar               # Insert arbitrary text
>     C-x C-s              # Save
> 
> throws away all the annotations without any warning.
> 
> WDYT?

What other method would you suggest for removing the annotations?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33855; Package emacs. (Fri, 20 May 2022 14:25:02 GMT) Full text and rfc822 format available.

Message #30 received at 33855 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, rpluim <at> gmail.com, 33855 <at> debbugs.gnu.org
Subject: Re: bug#33855: 27.0.50; Can't see markup in HELLO
Date: Fri, 20 May 2022 10:24:12 -0400
>> Cc: Robert Pluim <rpluim <at> gmail.com>, 33855 <at> debbugs.gnu.org
>> Date: Fri, 20 May 2022 08:33:43 -0400
>> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> 
>> Currently, doing something like:
>> 
>>     C-x C-f .../HELLO    # Open an enriched-mode file
>>     M-x enriched-mode    # Disable enriched-mode
>>     foobar               # Insert arbitrary text
>>     C-x C-s              # Save
>> 
>> throws away all the annotations without any warning.
>> 
>> WDYT?
>
> What other method would you suggest for removing the annotations?

Maybe a more explicit one, like `C-x h M-x write-region`?

I can't see any part of my above recipe which says that the user (me in
this case, I was just trying things out, tho admittedly I disabled
`enriched-mode` via the menu on the "Enriched" word in the mode line
instead of via `M-x enriched-mode`) intended to remove the annotations.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33855; Package emacs. (Fri, 20 May 2022 15:50:02 GMT) Full text and rfc822 format available.

Message #33 received at 33855 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: larsi <at> gnus.org, rpluim <at> gmail.com, 33855 <at> debbugs.gnu.org
Subject: Re: bug#33855: 27.0.50; Can't see markup in HELLO
Date: Fri, 20 May 2022 18:49:04 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: larsi <at> gnus.org,  rpluim <at> gmail.com,  33855 <at> debbugs.gnu.org
> Date: Fri, 20 May 2022 10:24:12 -0400
> 
> > What other method would you suggest for removing the annotations?
> 
> Maybe a more explicit one, like `C-x h M-x write-region`?

Yuck!  Users shouldn't need to use that command.

> I can't see any part of my above recipe which says that the user (me in
> this case, I was just trying things out, tho admittedly I disabled
> `enriched-mode` via the menu on the "Enriched" word in the mode line
> instead of via `M-x enriched-mode`) intended to remove the annotations.

That's what Emacs understood: disabling Enriched means you give up on
saving the faces and the other annotations, because Emacs never does
that.  E.g., if you save a buffer in CC mode with all the faces set by
font-lock, you don't expect the file on disk to have any traces of
those faces, right?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33855; Package emacs. (Fri, 20 May 2022 18:57:02 GMT) Full text and rfc822 format available.

Message #36 received at 33855 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, rpluim <at> gmail.com, 33855 <at> debbugs.gnu.org
Subject: Re: bug#33855: 27.0.50; Can't see markup in HELLO
Date: Fri, 20 May 2022 14:56:43 -0400
Eli Zaretskii [2022-05-20 18:49:04] wrote:
>> Maybe a more explicit one, like `C-x h M-x write-region`?
> Yuck!  Users shouldn't need to use that command.

At least, for this user here, it is what I would do if I ever needed to
do that (and I think it's a fairly rare occurrence).

>> I can't see any part of my above recipe which says that the user (me in
>> this case, I was just trying things out, tho admittedly I disabled
>> `enriched-mode` via the menu on the "Enriched" word in the mode line
>> instead of via `M-x enriched-mode`) intended to remove the annotations.
> That's what Emacs understood:

I know but it very much surprised me, so I expect it could surprise
other users just as well.  Maybe `enriched-mode` should prompt the user
to confirm that this is what they intend.  And if they don't intend
to do that, it could do what `enriched-toggle-markup` does.

Similarly when enabling `enriched-mode` if it notices that the buffer is
already in a valid format for decoding, it could prompt to decide
whether to do the `enriched-toggle-markup` in reverse or to convert
the buffer to enriched-mode like it currently does.

> disabling Enriched means you give up on saving the faces and the other
> annotations,

I don't see any reason why the user should expect that.  Obviously some
users (e.g. you) would expect that, but since it throws away information
it seems better not to make such an assumption.

Usually our priority is to avoid throwing away information unless the
user says so explicitly and I don't think that disabling a minor mode
can be taken as a request to throw away information.

> because Emacs never does that.  E.g., if you save a buffer in CC mode
> with all the faces set by font-lock, you don't expect the file on disk
> to have any traces of those faces, right?

I think this assumes too much knowledge on the part of the user about
how `enriched-mode` works internally.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33855; Package emacs. (Fri, 20 May 2022 19:08:01 GMT) Full text and rfc822 format available.

Message #39 received at 33855 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: larsi <at> gnus.org, rpluim <at> gmail.com, 33855 <at> debbugs.gnu.org
Subject: Re: bug#33855: 27.0.50; Can't see markup in HELLO
Date: Fri, 20 May 2022 22:07:42 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: larsi <at> gnus.org,  rpluim <at> gmail.com,  33855 <at> debbugs.gnu.org
> Date: Fri, 20 May 2022 14:56:43 -0400
> 
> > because Emacs never does that.  E.g., if you save a buffer in CC mode
> > with all the faces set by font-lock, you don't expect the file on disk
> > to have any traces of those faces, right?
> 
> I think this assumes too much knowledge on the part of the user about
> how `enriched-mode` works internally.

Not at all.  Enriched mode is the _only_ mode that is capable of
preserving the faces when saving buffers to files.  The documentation
of Enriched mode spells that out at the beginning.

I'm quite sure any Emacs user knows that faces are lost when you save
a buffer to disk.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33855; Package emacs. (Fri, 20 May 2022 20:57:01 GMT) Full text and rfc822 format available.

Message #42 received at 33855 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, rpluim <at> gmail.com, 33855 <at> debbugs.gnu.org
Subject: Re: bug#33855: 27.0.50; Can't see markup in HELLO
Date: Fri, 20 May 2022 16:56:24 -0400
>> I think this assumes too much knowledge on the part of the user about
>> how `enriched-mode` works internally.
> Not at all.  Enriched mode is the _only_ mode that is capable of
> preserving the faces when saving buffers to files.  The documentation
> of Enriched mode spells that out at the beginning.

So you're absolutely sure that I'm one of the very rarest of users who
could fall into this trap?

I still can't see why even if you're right it wouldn't be beneficial to
merge `enriched-mode` with `enriched-toggle-markup` by prompting the users
to know which behavior they want.

When enabling `enriched-mode` we already prompt the user (to know what
to do about hard/soft newlines).


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33855; Package emacs. (Sat, 21 May 2022 05:35:02 GMT) Full text and rfc822 format available.

Message #45 received at 33855 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: larsi <at> gnus.org, rpluim <at> gmail.com, 33855 <at> debbugs.gnu.org
Subject: Re: bug#33855: 27.0.50; Can't see markup in HELLO
Date: Sat, 21 May 2022 08:34:23 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: larsi <at> gnus.org,  rpluim <at> gmail.com,  33855 <at> debbugs.gnu.org
> Date: Fri, 20 May 2022 16:56:24 -0400
> 
> I still can't see why even if you're right it wouldn't be beneficial to
> merge `enriched-mode` with `enriched-toggle-markup` by prompting the users
> to know which behavior they want.
> 
> When enabling `enriched-mode` we already prompt the user (to know what
> to do about hard/soft newlines).

I don't think I have a clear idea what kind of prompt do you have in
mind.  Please tell more.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33855; Package emacs. (Sat, 21 May 2022 11:59:02 GMT) Full text and rfc822 format available.

Message #48 received at 33855 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Robert Pluim <rpluim <at> gmail.com>, 33855 <at> debbugs.gnu.org
Subject: Re: bug#33855: 27.0.50; Can't see markup in HELLO
Date: Sat, 21 May 2022 13:58:19 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> Looking a bit more into it, I wonder if 'enriched-toggle-markup' should
> be merged with the `enriched-mode` command itself.
>
> Currently, doing something like:
>
>     C-x C-f .../HELLO    # Open an enriched-mode file
>     M-x enriched-mode    # Disable enriched-mode
>     foobar               # Insert arbitrary text
>     C-x C-s              # Save
>
> throws away all the annotations without any warning.
>
> WDYT?

(Then more discussion followed.)

I don't really have much of an opinion here -- I think that
enriched-mode is a weird thing to have as a minor mode.  If you switch
it on in a programming mode, and then save the file, you've destroyed
the file -- silently.  (You can often undestroyify it by loading it into
Emacs, and then writing out the buffer text to a file, but would a user
know that?)

It's a thing that only makes sense as a major mode, inheriting from text
mode, and it should have its own file ending, like HELLO.enriched.

Fortunately, the only file in existence in the entire universe➀ that uses
this format (and minor mode) is etc/HELLO, so it's not a major issue
(except for the file-destroying bit for unfortunate users, but
fortunately most people don't know about it so they don't try to use
it).

➀ Fact not officially notarized.
-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33855; Package emacs. (Sat, 21 May 2022 12:43:01 GMT) Full text and rfc822 format available.

Message #51 received at 33855 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: rpluim <at> gmail.com, monnier <at> iro.umontreal.ca, 33855 <at> debbugs.gnu.org
Subject: Re: bug#33855: 27.0.50; Can't see markup in HELLO
Date: Sat, 21 May 2022 15:42:41 +0300
> Cc: Robert Pluim <rpluim <at> gmail.com>, 33855 <at> debbugs.gnu.org
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Sat, 21 May 2022 13:58:19 +0200
> 
> Fortunately, the only file in existence in the entire universe➀ that uses
> this format (and minor mode) is etc/HELLO

There's also etc/enriched.txt.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 19 Jun 2022 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 312 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.