emacs-diffs
[Top][All Lists]
Advanced

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

master edec35a: * admin/unidata/uvs.el: Use lexical-binding


From: Stefan Monnier
Subject: master edec35a: * admin/unidata/uvs.el: Use lexical-binding
Date: Tue, 5 Nov 2019 15:05:43 -0500 (EST)

branch: master
commit edec35aa9472dca3a80966c62131f00e5288ee49
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * admin/unidata/uvs.el: Use lexical-binding
---
 admin/unidata/uvs.el | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/admin/unidata/uvs.el b/admin/unidata/uvs.el
index dfea479..2d0f924 100644
--- a/admin/unidata/uvs.el
+++ b/admin/unidata/uvs.el
@@ -1,4 +1,4 @@
-;;; uvs.el --- utility for UVS (format 14) cmap subtables in OpenType fonts.
+;;; uvs.el --- utility for UVS (format 14) cmap subtables in OpenType fonts  
-*- lexical-binding:t -*-
 
 ;; Copyright (C) 2014-2019 Free Software Foundation, Inc.
 
@@ -30,7 +30,7 @@
 ;;; Code:
 
 (defun uvs-fields-total-size (fields)
-  (apply '+ (mapcar (lambda (field) (get field 'uvs-field-size)) fields)))
+  (apply #'+ (mapcar (lambda (field) (get field 'uvs-field-size)) fields)))
 
 ;;; Fields in Format 14 header.
 (defconst uvs-format-14-header-fields
@@ -85,7 +85,8 @@ where selectors and bases are sorted in ascending order."
                    "\\(?:" (regexp-quote collection-id) "\\)"
                    "[[:blank:]]*;[[:blank:]]*"
                    "\\([^\n[:blank:]]+\\)"
-                   "[[:blank:]]*$") nil t)
+                   "[[:blank:]]*$")
+           nil t)
       (let* ((base (string-to-number (match-string 1) 16))
             (selector (string-to-number (match-string 2) 16))
             (sequence-id (match-string 3))
@@ -105,7 +106,7 @@ where selectors and bases are sorted in ascending order."
   "Convert integer VALUE to a list of SIZE bytes.
 The most significant byte comes first."
   (let (result)
-    (dotimes (i size)
+    (dotimes (_ size)
       (push (logand value #xff) result)
       (setq value (ash value -8)))
     result))
@@ -118,7 +119,7 @@ respectively.  Byte length of each value is determined by 
the
   (while fields
     (let ((field (car fields))
          (value (car values)))
-      (insert (apply 'unibyte-string
+      (insert (apply #'unibyte-string
                     (uvs-int-to-bytes value (get field 'uvs-field-size))))
       (setq fields (cdr fields) values (cdr values)))))
 
@@ -126,9 +127,9 @@ respectively.  Byte length of each value is determined by 
the
   "Insert UVS-ALIST as a sequence of bytes to the current buffer."
   (let* ((nrecords (length uvs-alist)) ; # of selectors
         (total-nmappings
-         (apply '+ (mapcar
-                    (lambda (selector-bgs) (length (cdr selector-bgs)))
-                    uvs-alist)))
+         (apply #'+ (mapcar
+                     (lambda (selector-bgs) (length (cdr selector-bgs)))
+                     uvs-alist)))
         (non-default-offset
          (+ uvs-format-14-header-size
             (* uvs-variation-selector-record-size nrecords))))
@@ -158,15 +159,15 @@ respectively.  Byte length of each value is determined by 
the
                                    (car base-glyph)
                                    (cdr base-glyph))))))
 
-(defun uvs-dump (&optional bytes-per-line separator separator-eol line-prefix)
+(defun uvs-dump (&optional bytes-per-line separator separator-eol bol-prefix)
   "Print the current buffer as in representation of C array contents."
   (or bytes-per-line (setq bytes-per-line 8))
   (or separator (setq separator ", "))
   (or separator-eol (setq separator-eol ","))
-  (or line-prefix (setq line-prefix "    "))
+  (or bol-prefix (setq bol-prefix "    "))
   (goto-char (point-min))
   (while (> (- (point-max) (point)) bytes-per-line)
-    (princ line-prefix)
+    (princ bol-prefix)
     (princ (mapconcat (lambda (byte) (format "0x%02x" byte))
                      (string-to-unibyte
                       (buffer-substring (point) (+ (point) bytes-per-line)))
@@ -174,7 +175,7 @@ respectively.  Byte length of each value is determined by 
the
     (princ separator-eol)
     (terpri)
     (forward-char bytes-per-line))
-  (princ line-prefix)
+  (princ bol-prefix)
   (princ (mapconcat (lambda (byte) (format "0x%02x" byte))
                    (string-to-unibyte
                     (buffer-substring (point) (point-max)))



reply via email to

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