emacs-devel
[Top][All Lists]
Advanced

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

Re: updating macuvs.h?


From: Stephen Leake
Subject: Re: updating macuvs.h?
Date: Wed, 14 Jan 2015 14:43:46 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (windows-nt)

Eli Zaretskii <address@hidden> writes:

>> From: Stephen Leake <address@hidden>
>> Date: Tue, 13 Jan 2015 14:58:58 -0600
>> 
>> I just did 'git pull' on master, and recompiled, on Windows with msys2
>> mingw64. Now git status shows 'src/macuvs.h' as changed. It has DOS line
>> endings instead of Unix; no other changes.
>
> This most probably means some of the tools involved in producing that
> file are not MSYS programs, but native Windows (MinGW) programs.  MSYS
> programs behave Posix-like and produce Unix-style EOLs.  Finds those
> tools and replace them by their MSYS namesakes, and the problem will
> go away.

I think this is the makefile line that produces that file (from
admin/unidata/Makefile):

${top_srcdir}/src/macuvs.h: ${srcdir}/uvs.el ${srcdir}/IVD_Sequences.txt | \
  ${srcdir}/uvs.elc
        $(AM_V_GEN)${emacs} -L ${srcdir} -l uvs \
          --eval '(uvs-print-table-ivd (unmsys--file-name 
"${srcdir}/IVD_Sequences.txt") "Adobe-Japan1")' \
          > $@


This runs Emacs, which is a native MinGW program at this point. I don't
think we want to build an MSYS version just for this :).

That invokes this fuction (in admin/unidata/uvs.el):

(defun uvs-print-table-ivd (filename collection-id
                                     &optional sequence-id-to-glyph-func)
  "Print a C array definition of a UVS table for IVD Sequences.
FILENAME specifies the IVD Sequences file.  COLLECTION-ID is a
string specifying the identifier of the collection to
extract (e.g., \"Adobe-Japan1\").  SEQUENCE-ID-TO-GLYPH-FUNC is a
function to convert an identifier string of the sequence to a
glyph number, and nil means to convert \"CID\\+[0-9]+\" to the
corresponding number."
  (or sequence-id-to-glyph-func
      (setq sequence-id-to-glyph-func
            (lambda (sequence-id)
              (string-match "\\`CID\\+\\([[:digit:]]+\\)\\'" sequence-id)
              (string-to-number (match-string 1 sequence-id)))))
  (let ((uvs-alist
         (with-temp-buffer
           (insert-file-contents filename)
           (uvs-alist-from-ivd collection-id
                               sequence-id-to-glyph-func))))
    (princ "/* Automatically generated by uvs.el.  */\n")
    (princ
     (format "static const unsigned char mac_uvs_table_%s_bytes[] =\n  {\n"
             (replace-regexp-in-string "[^_[:alnum:]]" "_"
                                       (downcase collection-id))))
    (with-temp-buffer
      (set-buffer-multibyte nil)
      (uvs-insert-alist-as-bytes uvs-alist)
      (uvs-dump))
    (princ "  };\n")))


`uvs-dump' uses `terpri' to insert the newline; that inserts "\n". So this
needs a `set-buffer-file-coding-system'?

I don't see where the buffer is actually written to the file.


On the other hand, why has no other MinGW builder seen this before?

-- 
-- Stephe



reply via email to

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