Comments (5)
Hi! Thanks for trying it out. Uhm, could you (require 'cl-lib)
and then try again? As far as I know incf
comes from there and moldable-emacs.el requires that library.
If that does not change anything, I will look into how to setup straight.el to give a try on my system.
from moldable-emacs.
I tried that but it didn't seem to change anything
Here's the debug log when I call the stats mold:
Debugger entered--Lisp error: (void-function incf)
incf(0)
me-count-raw-word-list(("." "'" "." "'" "," "'" "," "." "." "," "," "." "." "'" "," "." "." "," "," "." "," "." "'" "," "'" "." "." "." "," "." "'" "," "." "\"" "," "\"" "\"" "." "\"" "\"" "." "\"" "'" "'" "\"" "\"" "\"" "." "." "\"" ...))
me-word-stats("#+TITLE: My Emacsen (Emacs Configuration)\n#+AUTHOR...")
(let ((list (me-word-stats contents)) (i 0) it it-index) (ignore it it-index) (while list (setq it (pop list) it-index i i (1+ i)) (when (> (length (car it)) 2) (push it result))))
(--each (me-word-stats contents) (when (> (length (car it)) 2) (push it result)))
(let (result) (--each (me-word-stats contents) (when (> (length (car it)) 2) (push it result))) (nreverse result))
(--filter (> (length (car it)) 2) (me-word-stats contents))
(let* ((old-buffer (buffer-name)) (buffer (get-buffer-create "Statistics")) (buffersize (buffer-size)) (self (me-mold-treesitter-to-parse-tree)) (contents (buffer-substring-no-properties (point-min) (point-max))) (lines (count-lines-page)) (words (call-interactively 'count-words)) (book-pages (me-get-book-pages contents)) (reading-time (me-get-reading-time contents)) (word-analysis (--filter (> (length (car it)) 2) (me-word-stats contents))) (word-analysis-stats (-concat (-take 3 word-analysis) (reverse (-take 3 (reverse word-analysis))))) (funs (when self (length (me-by-type 'function_definition self)))) (methods (when self (length (me-by-type 'method_declaration self)))) (ifs (when self (length (--filter (or (eq ... ...) (eq ... ...)) self)))) (classes (when self (length (--filter (or (eq ... ...) (eq ... ...)) self)))) (comments (when self (length (me-by-type 'comment self))))) (with-current-buffer buffername (erase-buffer) (org-mode) (insert "* Generic Stats\n\n") (insert (format "- Reading time: %s minutes \n" reading-time)) (insert (format "- %s\n" lines)) (insert (format "- %s\n" words)) (insert (format "- Average book pages for this text: %s\n\n" book-pages)) (insert (format "- Buffer size in KiloBytes: %s\n\n" buffersize)) (insert "- Up to three most and least used words:\n\n") (--each word-analysis-stats (insert (format " %s | %s\n" (substring (concat (number-to-string ...) (s-repeat 5 " ")) 0 3) (car it)))) (insert "\n") (when funs (insert "* Programming Stats\n\n") (insert "\n") (insert "-- Code Stats --\n\n") (insert (format "#Functions: %s \n" funs)) (insert (format "#Methods: %s \n" methods)) (insert (format "#If-else: %s \n" ifs)) (insert (format "#Classes: %s \n" classes)) (insert (format "#Comments: %s \n" comments))) (insert "\n") (when self (insert "* Duplication Stats\n\n") (insert "-- Code Duplication By Token Type --\n\n") (let* ((nodes-with-duplication (me-nodes-with-duplication self)) (texts-by-type (--map (cons ... ...) (--group-by ... self)))) (me-require 'tree-sitter-query) (me-insert-treesitter-follow-overlay nodes-with-duplication (lambda (node) (let (... ...) (format "%s: %s/%s\n" type ... ...))))))))
(progn (get-buffer-create buffername) (let* ((old-buffer (buffer-name)) (buffer (get-buffer-create "Statistics")) (buffersize (buffer-size)) (self (me-mold-treesitter-to-parse-tree)) (contents (buffer-substring-no-properties (point-min) (point-max))) (lines (count-lines-page)) (words (call-interactively 'count-words)) (book-pages (me-get-book-pages contents)) (reading-time (me-get-reading-time contents)) (word-analysis (--filter (> (length (car it)) 2) (me-word-stats contents))) (word-analysis-stats (-concat (-take 3 word-analysis) (reverse (-take 3 (reverse word-analysis))))) (funs (when self (length (me-by-type 'function_definition self)))) (methods (when self (length (me-by-type 'method_declaration self)))) (ifs (when self (length (--filter (or ... ...) self)))) (classes (when self (length (--filter (or ... ...) self)))) (comments (when self (length (me-by-type 'comment self))))) (with-current-buffer buffername (erase-buffer) (org-mode) (insert "* Generic Stats\n\n") (insert (format "- Reading time: %s minutes \n" reading-time)) (insert (format "- %s\n" lines)) (insert (format "- %s\n" words)) (insert (format "- Average book pages for this text: %s\n\n" book-pages)) (insert (format "- Buffer size in KiloBytes: %s\n\n" buffersize)) (insert "- Up to three most and least used words:\n\n") (--each word-analysis-stats (insert (format " %s | %s\n" (substring (concat ... ...) 0 3) (car it)))) (insert "\n") (when funs (insert "* Programming Stats\n\n") (insert "\n") (insert "-- Code Stats --\n\n") (insert (format "#Functions: %s \n" funs)) (insert (format "#Methods: %s \n" methods)) (insert (format "#If-else: %s \n" ifs)) (insert (format "#Classes: %s \n" classes)) (insert (format "#Comments: %s \n" comments))) (insert "\n") (when self (insert "* Duplication Stats\n\n") (insert "-- Code Duplication By Token Type --\n\n") (let* ((nodes-with-duplication (me-nodes-with-duplication self)) (texts-by-type (--map ... ...))) (me-require 'tree-sitter-query) (me-insert-treesitter-follow-overlay nodes-with-duplication (lambda (node) (let ... ...))))))) (ignore-errors (switch-to-buffer-other-window (get-buffer buffername))))
(cond ((equal '(:then) '(:given)) 't) ((equal '(:then) '(:then)) (progn (get-buffer-create buffername) (let* ((old-buffer (buffer-name)) (buffer (get-buffer-create "Statistics")) (buffersize (buffer-size)) (self (me-mold-treesitter-to-parse-tree)) (contents (buffer-substring-no-properties (point-min) (point-max))) (lines (count-lines-page)) (words (call-interactively 'count-words)) (book-pages (me-get-book-pages contents)) (reading-time (me-get-reading-time contents)) (word-analysis (--filter (> ... 2) (me-word-stats contents))) (word-analysis-stats (-concat (-take 3 word-analysis) (reverse ...))) (funs (when self (length ...))) (methods (when self (length ...))) (ifs (when self (length ...))) (classes (when self (length ...))) (comments (when self (length ...)))) (with-current-buffer buffername (erase-buffer) (org-mode) (insert "* Generic Stats\n\n") (insert (format "- Reading time: %s minutes \n" reading-time)) (insert (format "- %s\n" lines)) (insert (format "- %s\n" words)) (insert (format "- Average book pages for this text: %s\n\n" book-pages)) (insert (format "- Buffer size in KiloBytes: %s\n\n" buffersize)) (insert "- Up to three most and least used words:\n\n") (--each word-analysis-stats (insert (format " %s | %s\n" ... ...))) (insert "\n") (when funs (insert "* Programming Stats\n\n") (insert "\n") (insert "-- Code Stats --\n\n") (insert (format "#Functions: %s \n" funs)) (insert (format "#Methods: %s \n" methods)) (insert (format "#If-else: %s \n" ifs)) (insert (format "#Classes: %s \n" classes)) (insert (format "#Comments: %s \n" comments))) (insert "\n") (when self (insert "* Duplication Stats\n\n") (insert "-- Code Duplication By Token Type --\n\n") (let* (... ...) (me-require ...) (me-insert-treesitter-follow-overlay nodes-with-duplication ...))))) (ignore-errors (switch-to-buffer-other-window (get-buffer buffername))))) (t :then))
(pcase '(:then) ('(:given) 't) ('(:then) (progn (get-buffer-create buffername) (let* ((old-buffer (buffer-name)) (buffer (get-buffer-create "Statistics")) (buffersize (buffer-size)) (self (me-mold-treesitter-to-parse-tree)) (contents (buffer-substring-no-properties (point-min) (point-max))) (lines (count-lines-page)) (words (call-interactively 'count-words)) (book-pages (me-get-book-pages contents)) (reading-time (me-get-reading-time contents)) (word-analysis (--filter (> ... 2) (me-word-stats contents))) (word-analysis-stats (-concat (-take 3 word-analysis) (reverse ...))) (funs (when self (length ...))) (methods (when self (length ...))) (ifs (when self (length ...))) (classes (when self (length ...))) (comments (when self (length ...)))) (with-current-buffer buffername (erase-buffer) (org-mode) (insert "* Generic Stats\n\n") (insert (format "- Reading time: %s minutes \n" reading-time)) (insert (format "- %s\n" lines)) (insert (format "- %s\n" words)) (insert (format "- Average book pages for this text: %s\n\n" book-pages)) (insert (format "- Buffer size in KiloBytes: %s\n\n" buffersize)) (insert "- Up to three most and least used words:\n\n") (--each word-analysis-stats (insert (format " %s | %s\n" ... ...))) (insert "\n") (when funs (insert "* Programming Stats\n\n") (insert "\n") (insert "-- Code Stats --\n\n") (insert (format "#Functions: %s \n" funs)) (insert (format "#Methods: %s \n" methods)) (insert (format "#If-else: %s \n" ifs)) (insert (format "#Classes: %s \n" classes)) (insert (format "#Comments: %s \n" comments))) (insert "\n") (when self (insert "* Duplication Stats\n\n") (insert "-- Code Duplication By Token Type --\n\n") (let* (... ...) (me-require ...) (me-insert-treesitter-follow-overlay nodes-with-duplication ...))))) (ignore-errors (switch-to-buffer-other-window (get-buffer buffername))))) (_ :then))
(let* nil (pcase '(:then) ('(:given) 't) ('(:then) (progn (get-buffer-create buffername) (let* ((old-buffer (buffer-name)) (buffer (get-buffer-create "Statistics")) (buffersize (buffer-size)) (self (me-mold-treesitter-to-parse-tree)) (contents (buffer-substring-no-properties ... ...)) (lines (count-lines-page)) (words (call-interactively ...)) (book-pages (me-get-book-pages contents)) (reading-time (me-get-reading-time contents)) (word-analysis (--filter ... ...)) (word-analysis-stats (-concat ... ...)) (funs (when self ...)) (methods (when self ...)) (ifs (when self ...)) (classes (when self ...)) (comments (when self ...))) (with-current-buffer buffername (erase-buffer) (org-mode) (insert "* Generic Stats\n\n") (insert (format "- Reading time: %s minutes \n" reading-time)) (insert (format "- %s\n" lines)) (insert (format "- %s\n" words)) (insert (format "- Average book pages for this text: %s\n\n" book-pages)) (insert (format "- Buffer size in KiloBytes: %s\n\n" buffersize)) (insert "- Up to three most and least used words:\n\n") (--each word-analysis-stats (insert ...)) (insert "\n") (when funs (insert "* Programming Stats\n\n") (insert "\n") (insert "-- Code Stats --\n\n") (insert ...) (insert ...) (insert ...) (insert ...) (insert ...)) (insert "\n") (when self (insert "* Duplication Stats\n\n") (insert "-- Code Duplication By Token Type --\n\n") (let* ... ... ...)))) (ignore-errors (switch-to-buffer-other-window (get-buffer buffername))))) (_ :then)))
(let ((buffername (concat "*moldable-emacs-" (or nil "Stats") "*"))) (let* nil (pcase '(:then) ('(:given) 't) ('(:then) (progn (get-buffer-create buffername) (let* ((old-buffer ...) (buffer ...) (buffersize ...) (self ...) (contents ...) (lines ...) (words ...) (book-pages ...) (reading-time ...) (word-analysis ...) (word-analysis-stats ...) (funs ...) (methods ...) (ifs ...) (classes ...) (comments ...)) (with-current-buffer buffername (erase-buffer) (org-mode) (insert "* Generic Stats\n\n") (insert ...) (insert ...) (insert ...) (insert ...) (insert ...) (insert "- Up to three most and least used words:\n\n") (--each word-analysis-stats ...) (insert "\n") (when funs ... ... ... ... ... ... ... ...) (insert "\n") (when self ... ... ...))) (ignore-errors (switch-to-buffer-other-window (get-buffer buffername))))) (_ :then))))
(progn (let ((buffername (concat "*moldable-emacs-" (or nil "Stats") "*"))) (let* nil (pcase '(:then) ('(:given) 't) ('(:then) (progn (get-buffer-create buffername) (let* (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) (with-current-buffer buffername ... ... ... ... ... ... ... ... ... ... ... ... ... ...)) (ignore-errors (switch-to-buffer-other-window ...)))) (_ :then)))))
eval((progn (let ((buffername (concat "*moldable-emacs-" (or nil "Stats") "*"))) (let* nil (pcase '(:then) ('(:given) 't) ('(:then) (progn (get-buffer-create buffername) (let* ... ...) (ignore-errors ...))) (_ :then))))) t)
me-mold-run-then((:key "Stats" :docs "View some generic buffer stats like reading time a..." :given (:fn 't) :then (:fn (let* ((old-buffer (buffer-name)) (buffer (get-buffer-create "Statistics")) (buffersize (buffer-size)) (self (me-mold-treesitter-to-parse-tree)) (contents (buffer-substring-no-properties (point-min) (point-max))) (lines (count-lines-page)) (words (call-interactively 'count-words)) (book-pages (me-get-book-pages contents)) (reading-time (me-get-reading-time contents)) (word-analysis (--filter (> ... 2) (me-word-stats contents))) (word-analysis-stats (-concat (-take 3 word-analysis) (reverse ...))) (funs (when self (length ...))) (methods (when self (length ...))) (ifs (when self (length ...))) (classes (when self (length ...))) (comments (when self (length ...)))) (with-current-buffer buffername (erase-buffer) (org-mode) (insert "* Generic Stats\n\n") (insert (format "- Reading time: %s minutes \n" reading-time)) (insert (format "- %s\n" lines)) (insert (format "- %s\n" words)) (insert (format "- Average book pages for this text: %s\n\n" book-pages)) (insert (format "- Buffer size in KiloBytes: %s\n\n" buffersize)) (insert "- Up to three most and least used words:\n\n") (--each word-analysis-stats (insert (format " %s | %s\n" ... ...))) (insert "\n") (when funs (insert "* Programming Stats\n\n") (insert "\n") (insert "-- Code Stats --\n\n") (insert (format "#Functions: %s \n" funs)) (insert (format "#Methods: %s \n" methods)) (insert (format "#If-else: %s \n" ifs)) (insert (format "#Classes: %s \n" classes)) (insert (format "#Comments: %s \n" comments))) (insert "\n") (when self (insert "* Duplication Stats\n\n") (insert "-- Code Duplication By Token Type --\n\n") (let* (... ...) (me-require ...) (me-insert-treesitter-follow-overlay nodes-with-duplication ...)))))) :docs "You can extract information from the original buff..." :examples ((:name "Basic stats" :given (:type file :name "/tmp/test.txt" :mode text-mode :contents "This is a little test file. Test!\n") :then (:type buffer :name "Statistics" :mode org-mode :contents "* Generic Stats\n\n- Reading time: 0 minutes \n- Page..."))) :origin "/home/librarianmage/.config/emacs/straight/build/m..."))
me-mold()
funcall-interactively(me-mold)
call-interactively(me-mold nil nil)
command-execute(me-mold)
from moldable-emacs.
Figured it out! It was unrelated to straight.el. In
moldable-emacs/moldable-emacs.el
Lines 1089 to 1099 in 98365b8
incf
but cl-lib
uses cl-incf
. The cl
package aliases incf
to that as well.from moldable-emacs.
from moldable-emacs.
Yup! All's good now ^_^
from moldable-emacs.
Related Issues (19)
- Would love to have playground in Python or Javascript. HOT 1
- Would love to have playground in Python or Javascript.
- experimental.el is missing in the repo HOT 1
- Build Warnings & Errors HOT 10
- Namespace prefixes & Style: Opinion? Standard? HOT 1
- Excited but lost HOT 6
- Issues with the "ElispListToOrgTable" mold & `me-alist-to-plist` HOT 7
- Consider wrapping buffer names with `*moldable-emacs-%s*` HOT 1
- Consider giving molds a `:type-vector` property to support auto composability HOT 9
- Issues with tutorial ListCurrentEmacsBuffersAndSizesInBarChart.org HOT 6
- Issue with running CodeAsTree mold on process buffer
- I wanted to comment about an article, Moldable Emacs: let's make English easy to query! HOT 1
- Show and tell: Xref to Org todo list HOT 4
- WhatMoldsCanIUse? gives backtrace HOT 2
- WhatMoldsCanIUse? does not report molds with failed dependencies HOT 4
- CodeAsTree does not test minor mode properly
- Readme improvements HOT 5
- Some links about moldable development HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moldable-emacs.