Subject: Re: bug#35480: insert-wide-parentheses

From: Eli Zaretskii <[email-masked]>
Date: Mon, 06 May 2019 05:35:12 +0300

> From: Andreas Schwab <[email-masked]>
> Date: Mon, 06 May 2019 00:27:20 +0200
> Cc: 積丹尼 Dan Jacobson <[email-masked]>,
> 	[email-masked]
> 
> > OK, this adds all Unicode pairs to the default:
> >
> > diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
> > index d10d5f0d10..f73dbb269d 100644
> > --- a/lisp/emacs-lisp/lisp.el
> > +++ b/lisp/emacs-lisp/lisp.el
> > @@ -646,7 +646,13 @@ narrow-to-defun
> >        (narrow-to-region beg end))))
> >  
> >  (defvar insert-pair-alist
> > -  '((?\( ?\)) (?\[ ?\]) (?\{ ?\}) (?\< ?\>) (?\" ?\") (?\' ?\') (?\` ?\'))
> > +  (append '((?\< ?\>) (?\" ?\") (?\' ?\') (?\` ?\'))
> > +          (let (alist)
> > +            (map-char-table
> > +             (lambda (open close)
> > +               (when (< open close) (push (list open close) alist)))
> > +             (unicode-property-table-internal 'paired-bracket))
> > +            (nreverse alist)))
> 
> Loading /home/abuild/rpmbuild/BUILD/emacs-27.0.50/lisp/emacs-lisp/lisp.el (source)...
> Wrong type argument: char-table-p, nil
> make[2]: *** [Makefile:808: bootstrap-emacs.pdmp] Error 255

This change has another, IMO more serious, problem: it uses the
bidi-bracket property of characters entirely out of its intended
domain.  The _only_ valid usage of that property is in the context of
the UBA, the Unicode Bidirectional Algorithm, used for reordering
bidirectional text for display.  Pairing syntactical units in program
text is something entirely different.