emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[ELPA-diffs] [elpa] 01/02: * packages/uni-confusables/uni-confusables.el


From: Stefan Monnier
Subject: [ELPA-diffs] [elpa] 01/02: * packages/uni-confusables/uni-confusables.el: Add ELPA metadata. * packages/uni-confusables/uni-confusables-pkg.el: Delete. * packages/uni-confusables/gen-confusables.el: Use cl-lib. (gen-confusables-write): Generate a file header that better complies with the coding conventions (and includes the ELPA metadata).
Date: Thu, 30 Jan 2014 02:32:05 +0000

monnier pushed a commit to branch master
in repository elpa.

commit fe973b18ee7d6ca5c005408b85a684a6c51de800
Author: Stefan Monnier <address@hidden>
Date:   Wed Jan 29 21:31:50 2014 -0500

    * packages/uni-confusables/uni-confusables.el: Add ELPA metadata.
    * packages/uni-confusables/uni-confusables-pkg.el: Delete.
    * packages/uni-confusables/gen-confusables.el: Use cl-lib.
    (gen-confusables-write): Generate a file header that better complies with
    the coding conventions (and includes the ELPA metadata).
---
 packages/uni-confusables/gen-confusables.el     |   31 ++++++++++++++---------
 packages/uni-confusables/uni-confusables-pkg.el |    1 -
 packages/uni-confusables/uni-confusables.el     |    8 +++++-
 3 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/packages/uni-confusables/gen-confusables.el 
b/packages/uni-confusables/gen-confusables.el
index b3c2f02..3e17c5e 100644
--- a/packages/uni-confusables/gen-confusables.el
+++ b/packages/uni-confusables/gen-confusables.el
@@ -1,6 +1,6 @@
 ;;; gen-confusables.el --- generate uni-confusables.el from confusables.txt
 
-;; Copyright (C) 2011, 2012  Free Software Foundation, Inc.
+;; Copyright (C) 2011, 2012, 2014  Free Software Foundation, Inc.
 
 ;; Author: Teodor Zlatanov <address@hidden>
 
@@ -21,14 +21,14 @@
 
 ;;; Code:
 
-(require 'cl)
+(require 'cl-lib)
 
 (defvar gen-confusables-char-table-single)
 (defvar gen-confusables-char-table-multiple)
 
 (defun gen-confusables-read (file)
   (interactive "fConfusables filename: \n")
-  (flet ((reader (h) (string-to-number h 16)))
+  (cl-flet ((reader (h) (string-to-number h 16)))
     (let ((stable (make-char-table 'confusables-single-script))
           (mtable (make-char-table 'confusables-multiple-script))
           (count 0)
@@ -44,8 +44,8 @@
         (insert-file-contents file)
         (goto-char (point-min))
         (while (re-search-forward confusable-line-regexp nil t)
-          (incf count)
-          (when (and (called-interactively-p)
+          (cl-incf count)
+          (when (and (called-interactively-p 'interactive)
                      (zerop (mod count 100)))
             (message "processed %d lines" count))
           (let* ((from (match-string 1))
@@ -61,16 +61,21 @@
   (interactive "FDumped filename: \n")
   (let ((coding-system-for-write 'utf-8-emacs))
     (with-temp-file file
-      (insert ";; Copyright (C) 1991-2009, 2010 Unicode, Inc.
+      (insert ";;; uni-confusables.el --- Unicode confusables table
+;; Copyright (C) 1991-2009, 2010 Unicode, Inc.
 ;; This file was generated from the Unicode confusables list at
 ;; http://www.unicode.org/Public/security/revision-04/confusables.txt.
 ;; See lisp/international/README in the Emacs trunk
-;; for the copyright and permission notice.\n\n")
+;; for the copyright and permission notice.
+
+;; Version: 0.1
+;; Maintainer: Teodor Zlatanov <address@hidden>
+
+;;; Code:\n\n")
       (dolist (type '(single multiple))
         (let* ((tablesym (intern (format "uni-confusables-char-table-%s" 
type)))
                (oursym (intern (format "gen-confusables-char-table-%s" type)))
                (ourtable (symbol-value oursym))
-               (ourtablename (symbol-name oursym))
                (tablename (symbol-name tablesym))
                (prop (format "confusables-%s-script" type))
                props)
@@ -98,11 +103,13 @@
                             (nth (* 2 offset) props)
                             (nth (1+ (* 2 offset)) props))))
           (insert ")\n\n")))
+      ;; Use \s escapes in the string, so that this text isn't mis-recognized
+      ;; as applying to this file, but only to the generated file.
       (insert "
-;; Local Variables:
-;; coding: utf-8
-;; no-byte-compile: t
-;; End:
+;;\sLocal\sVariables:
+;;\scoding: utf-8
+;;\sno-byte-compile: t
+;;\sEnd:
 
 ;; uni-confusables.el ends here"))))
 
diff --git a/packages/uni-confusables/uni-confusables-pkg.el 
b/packages/uni-confusables/uni-confusables-pkg.el
deleted file mode 100644
index 53a0295..0000000
--- a/packages/uni-confusables/uni-confusables-pkg.el
+++ /dev/null
@@ -1 +0,0 @@
-(define-package "uni-confusables" "0.1" "Unicode confusables table")
diff --git a/packages/uni-confusables/uni-confusables.el 
b/packages/uni-confusables/uni-confusables.el
index b324f46..4224bd9 100644
--- a/packages/uni-confusables/uni-confusables.el
+++ b/packages/uni-confusables/uni-confusables.el
@@ -1,9 +1,15 @@
+;;; uni-confusables.el --- Unicode confusables table
 ;; Copyright (C) 1991-2009, 2010 Unicode, Inc.
 ;; This file was generated from the Unicode confusables list at
 ;; http://www.unicode.org/Public/security/revision-04/confusables.txt.
 ;; See lisp/international/README in the Emacs trunk
 ;; for the copyright and permission notice.
 
+;; Version: 0.1
+;; Maintainer: Teodor Zlatanov <address@hidden>
+
+;;; Code:
+
 (defvar uni-confusables-char-table-single (make-char-table 
'confusables-single-script))
 
 (let ((k nil) (v nil) (ranges '(195101 "𪘀" 195100 "鼻" 195099 "鼖" 195098 "鼏" 
195097 "鼅" 195096 "黾" 195095 "黹" 195094 "䵖" 195093 "麻" 195092 "𪊑" 195091 "𪈎" 
195090 "𪄅" 195089 "䳸" 195088 "𪃎" 195087 "鵧" 195086 "䳭" 195085 "䳎" 195084 "鳽" 
195083 "鱀" 195082 "鬒" 195081 "𩬰" 195080 "䯎" 195079 "駾" 195078 "駂" 195077 "馧" 
195076 "餩" 195075 "䬳" 195074 "飢" 195073 "𩖶" 195072 "頩" 195071 "頋" 195070 "頋" 
195069 "𩒖" 195068 "䪲" 195067 "𩐊" 195066 "韠" 195065 "䩶" 195064 "䩮" 195063 "𩈚" 
195062 "𩅅" 195061 "霣" 195060 "嶲 [...]
@@ -74,4 +80,4 @@
 ;; no-byte-compile: t
 ;; End:
 
-;; uni-confusables.el ends here
\ No newline at end of file
+;; uni-confusables.el ends here



reply via email to

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