unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dan Hitt <dan.hitt@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Tomas Nordin <tomasn@posteo.net>, 46507@debbugs.gnu.org
Subject: bug#46507: 26.1; bold attribute copied into enriched-mode text is not saved
Date: Sat, 13 Mar 2021 23:32:51 -0800	[thread overview]
Message-ID: <CAOphiz+OZ5XC8+x2pF+sFv-P5Wh+P7tCBxvSxLST33KG8OVCUw@mail.gmail.com> (raw)
In-Reply-To: <83zgz6hn9g.fsf@gnu.org>

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

On Sat, Mar 13, 2021 at 11:22 AM Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Dan Hitt <dan.hitt@gmail.com>
> > Date: Sat, 13 Mar 2021 10:47:23 -0800
> > Cc: Tomas Nordin <tomasn@posteo.net>, 46507@debbugs.gnu.org
> >
> > Thanks for your work.
>
> You are welcome.
>
> > The debian system i originally used is unavailable, and i'm using
> xubuntu 20.04 now, emacs 26.3.
> >
> > Nevertheless, i would be happy to test if i can.
> >
> > I guess this means that i have to get a copy of your modified version of
> enriched.el, and instruct emacs to
> > use that instead of /usr/share/emacs/26.3/lisp/textmodes/enriched.elc.
> >
> > So i need instructions on how to do all this in order to test.
>
> Here's the patch which should fix the issue:
>
> diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el
> index c44b69c..e43370c 100644
> --- a/lisp/textmodes/enriched.el
> +++ b/lisp/textmodes/enriched.el
> @@ -389,6 +389,8 @@ enriched-face-ans
>          (apply 'append (mapcar 'enriched-face-ans face)))
>         ((let* ((fg (face-attribute face :foreground))
>                 (bg (face-attribute face :background))
> +                (weight (face-attribute face :weight))
> +                (slant (face-attribute face :slant))
>                 (props (face-font face t))
>                 (ans (cdr (format-annotate-single-property-change
>                            'face nil props enriched-translations))))
> @@ -396,6 +398,10 @@ enriched-face-ans
>              (setq ans (cons (list "x-color" fg) ans)))
>            (unless (eq bg 'unspecified)
>              (setq ans (cons (list "x-bg-color" bg) ans)))
> +           (if (eq weight 'bold)
> +               (setq ans (cons (list "bold") ans)))
> +           (if (eq slant 'italic)
> +               (setq ans (cons (list "italic") ans)))
>            ans))))
>
>  ;;;
>

Thanks Eli!

For the sake of anybody who stumbles across this thread, i tested it by
uncompressing  /usr/share/emacs/26.3/lisp/textmodes/enriched.el.gz into a
new empty directory.

Then i hand-patched in the diffs (i.e., i patched it by cut-and-paste,
using emacs, not using any program that understands diffs).

Then i ran 'emacs -Q', and did M-x load-file to load in the modified
enriched.el file.

Then i did the test: copying in chunks of text from eshell and shell,
setting the mode to enriched, saving, closing, and reopening, and it worked
in all cases.

Presumably what will happen next is that this fix eventually gets pushed
out and adopted by debian and ubuntu and whoever else is downstream, but in
the meantime i can just the modified enriched.el.

Thanks again for figuring out how to fix it.

dan

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

  reply	other threads:[~2021-03-14  7:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-14  2:01 bug#46507: 26.1; bold attribute copied into enriched-mode text is not saved Dan Hitt
2021-03-07 12:46 ` Tomas Nordin
2021-03-07 16:51   ` Dan Hitt
2021-03-07 19:23     ` Tomas Nordin
2021-03-07 19:29       ` Eli Zaretskii
2021-03-07 20:18         ` Dan Hitt
2021-03-08 13:16           ` Eli Zaretskii
2021-03-13 10:28             ` Eli Zaretskii
2021-03-13 18:47               ` Dan Hitt
2021-03-13 19:22                 ` Eli Zaretskii
2021-03-14  7:32                   ` Dan Hitt [this message]
2021-03-14  7:50                     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOphiz+OZ5XC8+x2pF+sFv-P5Wh+P7tCBxvSxLST33KG8OVCUw@mail.gmail.com \
    --to=dan.hitt@gmail.com \
    --cc=46507@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=tomasn@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).