unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 39207@debbugs.gnu.org, gijs@hillenius.net
Subject: bug#39207: WITH dgb symbols Re: bug#39207: 28.0.50; crash when sending gnus message
Date: Wed, 22 Jan 2020 21:39:46 +0100	[thread overview]
Message-ID: <m2wo9jmdil.fsf@gmail.com> (raw)
In-Reply-To: <83v9p3tmtb.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 22 Jan 2020 19:37:04 +0200")

>>>>> On Wed, 22 Jan 2020 19:37:04 +0200, Eli Zaretskii <eliz@gnu.org> said:

    >> From: Robert Pluim <rpluim@gmail.com>
    >> Cc: gijs@hillenius.net,  39207@debbugs.gnu.org
    >> Date: Wed, 22 Jan 2020 17:58:12 +0100
    >> 
    >> (gdb) pp BVAR(current_buffer,enable_multibyte_characters)
    >> t
    >> (gdb)
    >> (gdb) pp BVAR(buffer,enable_multibyte_characters)
    >> t
    >> 
    >> Thereʼs one stray \342 in there, but the rest looks like ASCII. The
    >> character gnus should be trying to insert is #x2713, which is
    >> represented as #xE2 #x9C #x93 (\342 \234 \223), so it looks like there
    >> are some bytes missing.

    Eli> Where's the gap start address? are you sure \342 is not inside the
    Eli> gap?

gpt and gpt_byte are both 439 and that \342 is at byte pos 435

    Eli> Does Gnus make the buffer unibyte and then multibyte again or
    Eli> something?  Or maybe it uses some trick to replace a character in a
    Eli> string, when it inserts the tickmark, and that trick doesn't work with
    Eli> non-ASCII characters?

Hmm:

(defun gnus-summary-update-mark (mark type)
  (let ((forward (cdr (assq type gnus-summary-mark-positions)))
	(inhibit-read-only t))
    (re-search-backward "[\n\r]" (point-at-bol) 'move-to-limit)
    (when forward
      (when (looking-at "\r")
	(cl-incf forward))
      (when (<= (+ forward (point)) (point-max))
	;; Go to the right position on the line.
	(goto-char (+ forward (point)))
	;; Replace the old mark with the new mark.
        (let ((to-insert
               (subst-char-in-string
		(char-after) mark
		(buffer-substring (point) (1+ (point))))))
          (delete-region (point) (1+ (point)))
          (insert to-insert))

If in an emacs in *scratch* I do

(insert (subst-char-in-string (char-after) ?✓
    (buffer-substring-no-properties (point) (1+ (point)))))

that emacs displays several ^@ characters at the end of the buffer,
and then crashes the same way as with Gnus.

Perhaps Iʼm missing something, but isnʼt this just

(delete-region (point) (1+ (point)))
(insert mark)

(that seems to fix the gnus crash for me)

Robert





  reply	other threads:[~2020-01-22 20:39 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-20 16:28 bug#39207: 28.0.50; crash when sending gnus message Gijs Hillenius
2020-01-20 16:50 ` Robert Pluim
2020-01-21  9:06   ` Gijs Hillenius
2020-01-21  9:32     ` Robert Pluim
2020-01-21  9:43       ` Gijs Hillenius
2020-01-21 10:39         ` Robert Pluim
2020-01-21 10:44           ` Andreas Schwab
2020-01-21 10:46             ` Gijs Hillenius
2020-01-21 11:08             ` bug#39207: WITH dgb symbols " Gijs Hillenius
2020-01-21 13:36               ` Robert Pluim
2020-01-21 15:39               ` Eli Zaretskii
2020-01-21 16:11                 ` Gijs Hillenius
2020-01-21 17:06                   ` Robert Pluim
2020-01-22  7:17                     ` Gijs Hillenius
2020-01-22  7:47                       ` Robert Pluim
     [not found]                         ` <87lfpzsvq5.fsf@hillenius.net>
2020-01-22 12:12                           ` Robert Pluim
2020-01-22 16:13                             ` Eli Zaretskii
2020-01-22 16:58                               ` Robert Pluim
2020-01-22 17:37                                 ` Eli Zaretskii
2020-01-22 20:39                                   ` Robert Pluim [this message]
2020-01-22 20:57                                     ` Andreas Schwab
2020-01-22 21:15                                       ` bug#39207: WITH dgb symbols Re: bug✓39207: " Robert Pluim
2020-01-22 21:43                                         ` Andreas Schwab
2020-01-22 21:13                                     ` bug#39207: WITH dgb symbols Re: bug#39207: " Andreas Schwab
2020-01-23  7:52                                       ` Paul Eggert
2020-01-23  8:48                                         ` Robert Pluim
2020-01-23  9:02                                           ` Paul Eggert
2020-01-23  5:54 ` 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=m2wo9jmdil.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=39207@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=gijs@hillenius.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).