emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Towards a cleaner build: arc-mode


From: Eli Zaretskii
Subject: Re: Towards a cleaner build: arc-mode
Date: Sat, 18 May 2019 08:57:27 +0300

> From: Lars Ingebrigtsen <address@hidden>
> Cc: address@hidden
> Date: Sat, 18 May 2019 06:36:25 +0200
> 
> Eli Zaretskii <address@hidden> writes:
> 
> > Yes.  However, I suspect this juggling is no longer need nowadays.  If
> > you just use 'insert', does arc-mode break when you invoke the
> > commands that end up using these calls?  This should be tried also in
> > a locale whose codeset is not UTF-8.
> 
> Yes, if I just insert the bytes, things break.  In a zip file, I did a
> chmod change to 0777 and in the new file, I got:
> 
>   -rwxrwxrwx         5  18-May-2019  05:27:06  text.txt
> 
> If I do the same, but replace
> 
>       (insert (if (< elt 128) elt (decode-char 'eight-bit elt)))
> 
> with just
> 
>         (insert elt)
> 
> I get:
> 
>   crws--S-wx         5  18-May-2019  05:27:06  address@hidden@text.t

Sorry, that's not what I meant.  (I guess I've misunderstood what you
were asking about, and thus my "juggling" was misinterpreted.)  I
meant to do this instead:

  (defun insert-unibyte (&rest args)
    "Like insert but don't make unibyte string and eight-bit char multibyte."
    (dolist (elt args)
      (if (integerp elt)
          (insert (if (< elt 128) elt (decode-char 'eight-bit elt)))
        (insert elt))))

IOW, just lose the string-to-multibyte part, as I don't think it's
needed nowadays, since 'insert' already does the equivalent of
string-to-multibyte when needed.  The warning we want to get rid off
is about string-to-multibyte, not about decode-char, right?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]