]> code.delx.au - gnu-emacs-elpa/commitdiff
Merge math-symbol-lists
authorVitalie Spinu <spinuvit@gmail.com>
Sun, 28 Feb 2016 15:02:55 +0000 (16:02 +0100)
committerVitalie Spinu <spinuvit@gmail.com>
Sun, 28 Feb 2016 15:02:55 +0000 (16:02 +0100)
1  2 
packages/math-symbol-lists/.dir-locals.el
packages/math-symbol-lists/.gitignore
packages/math-symbol-lists/math-symbol-lists.el

index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..064a938a43cbb8c365ffd01ea99ab1f85d4b782b
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,3 @@@
++
++((emacs-lisp-mode
++  (indent-tabs-mode)))
index 9b4291b7fe84bd3c7ec2b4a483280a06f5bbebf5,0000000000000000000000000000000000000000..10facf0315f32d1fb067b52a9d4b6734433529da
mode 100644,000000..100644
--- /dev/null
@@@ -1,5 -1,0 +1,5 @@@
 +# Compiled
 +*.elc
 +# Packaging
 +.cask
++data/
index 414742a011729aadf8019bb10b1c2f263a87333c,ff19e7d726775451337f0566d6f9f6120f76607f..4502c9cc8e12fd2ed065f02e38f1655999415ed0
@@@ -1,10 -1,10 +1,10 @@@
  ;;; math-symbol-lists.el --- Lists of Unicode math symbols and latex commands
  ;;
 -;; Copyright (C) 2014 Free Software Foundation, Inc.
 -;; Author: Vitalie Spinu
 +;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
 +;; Author: Vitalie Spinu <spinuvit@gmail.com>
  ;; URL: https://github.com/vspinu/math-symbol-lists
  ;; Keywords: Unicode, symbols, mathematics
- ;; Version: 1.0
+ ;; Version: 1.1
  ;;
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;
@@@ -3063,5 -3061,41 +3061,42 @@@ unicode-math standard."
      "width" "year")
    "List of the latex commands.")
  
\f
+ ;; IMPORT UTILITIES
+ (defun msl--read-LUCR-list (file &optional print)
+   "Read in LUCR list from [1] and optionally PRINT.
+ LUCR list is a super-set of unicode-math list [2]. FILE is a
+ local file from [3].
+  [1] http://milde.users.sourceforge.net/LUCR/Math/
+  [2] https://github.com/wspr/unicode-math/blob/master/unicode-math-table.tex
+  [3] http://milde.users.sourceforge.net/LUCR/Math/data/unimathsymbols.txt
+ "
+   (let* ((lines (with-temp-buffer
+                   (insert-file-contents file)
+                   (split-string (buffer-string) "\n" t)))
+          (symb (cl-loop for l in lines
+                         unless (string-match-p "^#" l)
+                         for words = (split-string l "\\^")
+                         if (> (length (nth 3 words)) 0)
+                         collect (list (nth 5 words) (nth 3 words) (nth 0 words) (substring (nth 1 words) -1))
+                         ;; if (and (> (length (nth 3 words)) 0)
+                         ;;         (not (string= (nth 2 words) (nth 3 words))))
+                         ;; collect (list (nth 5 words) (nth 2 words) (nth 0 words) (substring (nth 1 words) -1))
+                         ))
+          (symb (cl-sort symb (lambda (a b) (string-lessp (concat (car a) (cadr a)) (concat (car b) (cadr b)))))))
+     (if print
+         (let ((out-buff (get-buffer-create "*symbol-list*")))
+           (with-current-buffer out-buff
+             (erase-buffer)
+             (insert "(")
+             (dolist (w symb)
+               (insert (apply 'format "(\"%s\" \"\\%s\" #X%s \"%s\")\n" w )))
+             (insert ")")
+             (goto-char (point-min)))
+           (switch-to-buffer out-buff))
+       symb)))
  (provide 'math-symbol-lists)
 +;;; math-symbol-lists.el ends here