From: Vitalie Spinu Date: Sun, 28 Feb 2016 15:02:55 +0000 (+0100) Subject: Merge math-symbol-lists X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/29972ef7578ee79cffc77471497be60aef813a8e Merge math-symbol-lists --- 29972ef7578ee79cffc77471497be60aef813a8e diff --cc packages/math-symbol-lists/.dir-locals.el index 000000000,000000000..064a938a4 new file mode 100644 --- /dev/null +++ b/packages/math-symbol-lists/.dir-locals.el @@@ -1,0 -1,0 +1,3 @@@ ++ ++((emacs-lisp-mode ++ (indent-tabs-mode))) diff --cc packages/math-symbol-lists/.gitignore index 9b4291b7f,000000000..10facf031 mode 100644,000000..100644 --- a/packages/math-symbol-lists/.gitignore +++ b/packages/math-symbol-lists/.gitignore @@@ -1,5 -1,0 +1,5 @@@ +# Compiled +*.elc - +# Packaging +.cask ++data/ diff --cc packages/math-symbol-lists/math-symbol-lists.el index 414742a01,ff19e7d72..4502c9cc8 --- a/packages/math-symbol-lists/math-symbol-lists.el +++ b/packages/math-symbol-lists/math-symbol-lists.el @@@ -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 ;; 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.") + + ;; 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