branch: elpa/flx commit 24dd436463cf622668b826ffdeace36899783f32 Author: Le Wang <le.w...@agworld.com.au> Commit: Le Wang <le.w...@agworld.com.au>
Fix compilation errors. --- flx.el | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/flx.el b/flx.el index ba96806b97..1de0131b57 100644 --- a/flx.el +++ b/flx.el @@ -56,26 +56,6 @@ "Face used by flx for highlighting flx match characters." :group 'flx) - -(defun flx-get-hash-for-string (str heatmap-func) - "Return hash-table for string where keys are characters value - is a sorted list of indexes for character occurrences." - (let* ((res (make-hash-table :test 'eq :size 32)) - (str-len (length str)) - down-char) - (cl-loop for index from (1- str-len) downto 0 - for char = (aref str index) - do (progn - ;; simulate `case-fold-search' - (if (flx-capital-p char) - (progn - (push index (gethash char res)) - (setq down-char (downcase char))) - (setq down-char char)) - (push index (gethash down-char res)))) - (puthash 'heatmap (funcall heatmap-func str) res) - res)) - ;;; Do we need more word separators than ST? (defsubst flx-word-p (char) "Check if CHAR is a word character." @@ -113,6 +93,25 @@ from BEG (inclusive) to end (not inclusive). (cl-incf beg)) vec) +(defun flx-get-hash-for-string (str heatmap-func) + "Return hash-table for string where keys are characters value + is a sorted list of indexes for character occurrences." + (let* ((res (make-hash-table :test 'eq :size 32)) + (str-len (length str)) + down-char) + (cl-loop for index from (1- str-len) downto 0 + for char = (aref str index) + do (progn + ;; simulate `case-fold-search' + (if (flx-capital-p char) + (progn + (push index (gethash char res)) + (setq down-char (downcase char))) + (setq down-char char)) + (push index (gethash down-char res)))) + (puthash 'heatmap (funcall heatmap-func str) res) + res)) + ;; So we store one fixnum per character. Is this too memory inefficient? (defun flx-get-heatmap-str (str &optional group-separator) "Generate heat map vector of string.