From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Amin Bandali <bandali@gnu.org>, 44506@debbugs.gnu.org
Subject: bug#44506: 28.0.50; Segfault on opening a particular message in Gnus in terminal/tty
Date: Sat, 07 Nov 2020 20:03:14 -0800 [thread overview]
Message-ID: <87mtzsbim5.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <83y2jc6hc9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Nov 2020 22:29:42 +0200")
On 11/07/20 22:29 PM, Eli Zaretskii wrote:
>> From: Amin Bandali <bandali@gnu.org>
>> Cc: 44506@debbugs.gnu.org, Eric Abrahamsen <eric@ericabrahamsen.net>
>> Date: Sat, 07 Nov 2020 15:03:53 -0500
>>
>> After some bisecting of my config files, I narrowed the segaulting of
>> Gnus when opening that message down to inclusion of (require 'ebdb-gnus)
>> in my configs. ebdb-gnus is part of EBDB, available on GNU ELPA. I'm
>> Cc'ing Eric, EBDB's creator and maintainer, in case he might have any
>> ideas.
>
> I don't see anything in EBDB that could cause Emacs to use static
> compositions, but maybe I'm missing something.
FWIW I was able to reproduce the segfault in terminal (not in GUI). I
don't know what static compositions are, but the places where EBDB
messes with lower-level character stuff are pasted below. As you can see
it's pretty ad-hoc stuff.
There's also ebdb-i18n.el, but that mostly just involves looking up the
scripts of characters in `char-script-table'.
(defconst ebdb-char-fold-table
(eval-when-compile
(let ((tbl (make-char-table 'char-fold-table))
(uni (unicode-property-table-internal 'decomposition))
;; Lowercase and uppercase alphabet.
(target-seq (append (number-sequence 65 90)
(number-sequence 97 122))))
;; I don't understand what's happening here, but it's necessary.
(let ((func (char-table-extra-slot uni 1)))
(map-char-table (lambda (char v)
(when (consp char)
(funcall func (car char) v uni)))
uni))
;; Create lists of equivalent chars, keyed to the most basic
;; ascii letter.
(map-char-table
(lambda (char decomp)
(when (consp decomp)
(when (symbolp (car decomp))
(setq decomp (cdr decomp)))
(when (memq (car decomp) target-seq)
(aset tbl (car decomp)
(cons char
(aref tbl (car decomp)))))))
uni)
;; Then turn the lists into regexps.
(map-char-table
(lambda (char dec-list)
(let ((re (regexp-opt (cons (char-to-string char)
(mapcar #'string dec-list)))))
(aset tbl char re)))
tbl)
tbl))
"Char-table holding regexps used in char fold searches.
Keys are characters in the upper- and lower-case ascii ranges.
Values are a regexp matching all characters that decompose to the
key character.")
(defun ebdb-char-fold-to-regexp (string)
"A highly simplified version of `char-fold-to-regexp'.
Only converts characters in STRING that decompose to the range
[a-zA-Z]."
(let ((out nil)
(end (length string))
char
(i 0))
(while (< i end)
(setq char (aref string i))
(push
(or (aref ebdb-char-fold-table char)
(string char))
out)
(cl-incf i))
(setq out (apply #'concat (nreverse out)))
(if (> (length out) 5000)
(regexp-quote string)
out)))
next prev parent reply other threads:[~2020-11-08 4:03 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-07 18:39 bug#44506: 28.0.50; Segfault on opening a particular message in Gnus in terminal/tty Amin Bandali
2020-11-07 18:58 ` Eli Zaretskii
2020-11-07 20:03 ` Amin Bandali
2020-11-07 20:29 ` Eli Zaretskii
2020-11-08 4:03 ` Eric Abrahamsen [this message]
2020-11-08 14:56 ` Eli Zaretskii
2020-11-08 18:27 ` Amin Bandali
2020-11-08 18:54 ` Eli Zaretskii
2020-11-08 19:20 ` Eli Zaretskii
2020-11-08 20:39 ` Amin Bandali
2020-11-09 3:31 ` Eli Zaretskii
2020-11-09 4:43 ` Amin Bandali
2020-11-09 7:04 ` Eli Zaretskii
2020-11-09 15:57 ` Eli Zaretskii
2020-11-10 5:42 ` Amin Bandali
2020-11-10 5:48 ` Eric Abrahamsen
2020-11-10 15:31 ` Eli Zaretskii
2020-11-13 5:20 ` Amin Bandali
2020-11-14 12:14 ` Eli Zaretskii
2020-11-14 17:19 ` Amin Bandali
2022-04-22 13:38 ` Lars Ingebrigtsen
2020-11-08 4:05 ` Eric Abrahamsen
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=87mtzsbim5.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=44506@debbugs.gnu.org \
--cc=bandali@gnu.org \
--cc=eliz@gnu.org \
/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).