Emacs Lisp Function Frequency

By Xah Lee. Date: . Last updated: .

This page shows a table of emacs lisp functions in order of their usage frequency.

  1. setq 12299
  2. if 11284
  3. defun 9664
  4. let 7414
  5. and 6499
  6. or 5257
  7. autoload 4967
  8. when 4478
  9. not 4345
  10. car 4160
  11. eq 4101
  12. define-key 3442
  13. cdr 3265
  14. defvar 3227
  15. interactive 3033
  16. point 2957
  17. list 2754
  18. goto-char 2212
  19. cons 2144
  20. register-definition-prefixes 2115
  21. while 2073
  22. unless 2007
  23. defcustom 2005
  24. put 1990
  25. lambda 1990
  26. cond 1946
  27. let* 1850
  28. concat 1783
  29. nth 1735
  30. t 1694
  31. - 1558
  32. progn 1460
  33. error 1415
  34. length 1414
  35. format 1376
  36. insert 1370
  37. + 1281
  38. funcall 1276
  39. message 1271
  40. save-excursion 1266
  41. > 1216
  42. < 1161
  43. memq 1152
  44. point-min 1143
  45. push 1115
  46. = 1045
  47. dolist 974
  48. 1+ 954
  49. null 950
  50. string-match 942
  51. 1- 840
  52. equal 811
  53. point-max 805
  54. aref 795
  55. with-current-buffer 780
  56. current-buffer 774
  57. stringp 719
  58. substring 692
  59. assq 661
  60. mapcar 649
  61. match-string 639
  62. match-beginning 587
  63. * 586
  64. widget-get 585
  65. string 572
  66. match-end 571
  67. expand-file-name 537
  68. forward-line 530
  69. consp 530
  70. apply 523
  71. purecopy 521
  72. get 517
  73. re-search-forward 505
  74. <= 485
  75. setq-local 481
  76. looking-at 480
  77. add-hook 461
  78. / 460
  79. require 447
  80. custom-autoload 437
  81. append 406
  82. repeat 401
  83. condition-case 401
  84. defconst 398
  85. assoc 386
  86. defalias 382
  87. zerop 380
  88. >= 377
  89. bindings--define-key 372
  90. nreverse 365
  91. cadr 365
  92. custom-put-if-not 352
  93. listp 351
  94. member 345
  95. defface 342
  96. aset 335
  97. defvar-local 332
  98. symbol-name 330
  99. declare-function 328
  100. make-sparse-keymap 326
  101. symbolp 316
  102. string= 313
  103. max 305
  104. declare 302
  105. delete-region 300
  106. defsubst 298
  107. map 296
  108. forward-char 294
  109. buffer-name 293
  110. file-name-nondirectory 292
  111. symbol-value 289
  112. kbd 289
  113. provide 278
  114. beginning-of-line 276
  115. defgroup 273
  116. buffer-substring 272
  117. numberp 265
  118. princ 265
  119. min 263
  120. pop 257
  121. global-set-key 257
  122. eobp 253
  123. delq 251
  124. file-exists-p 251
  125. boundp 250
  126. propertize 249
  127. string-to-number 248
  128. fboundp 244
  129. put-text-property 242
  130. plist-get 239
  131. car-safe 238
  132. file-name-directory 234
  133. get-text-property 233
  134. search-forward 232
  135. inhibit-read-only 232
  136. selected-window 232
  137. setf 226
  138. setcdr 224
  139. window-buffer 223
  140. widget-put 221
  141. current-column 219
  142. the 217
  143. overlay-put 215
  144. throw 214
  145. regexp-quote 214
  146. defmacro 213
  147. vector 213
  148. integerp 210
  149. functionp 209
  150. mapconcat 207
  151. run-hooks 206
  152. intern 202
  153. remove-hook 202
  154. nil 199
  155. load 197
  156. set-buffer 193
  157. line-end-position 192
  158. case-fold-search 191
  159. set-marker 191
  160. elt 189
  161. signal 189
  162. line-beginning-position 186
  163. user-error 186
  164. unwind-protect 185
  165. prog1 183
  166. /= 183
  167. string-equal 180
  168. select-window 180
  169. define-obsolete-function-alias 178
  170. nconc 176
  171. selected-frame 175
  172. with-temp-buffer 174
  173. get-buffer-create 173
  174. file-directory-p 172
  175. oref 172
  176. replace-match 171
  177. set 170
  178. make-local-variable 170
  179. frame-parameter 166
  180. function 163
  181. delete-char 160
  182. eval 158
  183. widget-apply 157
  184. default-value 155
  185. erase-buffer 153
  186. buffer-substring-no-properties 153
  187. prefix-numeric-value 151
  188. buffer-live-p 151
  189. downcase 150
  190. string-match-p 150
  191. save-match-data 149
  192. kill-buffer 148
  193. featurep 147
  194. catch 146
  195. substitute-command-keys 145
  196. get-buffer 144
  197. function-put 144
  198. define-minor-mode 141
  199. end-of-line 141
  200. save-restriction 140
  201. sort 140
  202. copy-sequence 138
  203. dotimes 138
  204. add-to-list 138
  205. logand 138
  206. y-or-n-p 136
  207. sit-for 135
  208. completing-read 131
  209. mapc 130
  210. make-string 130
  211. buffer-file-name 130
  212. posn-window 130
  213. bolp 128
  214. pcase 128
  215. buffer-modified-p 127
  216. switch-to-buffer 126
  217. nthcdr 126
  218. event-start 126
  219. widget-value 126
  220. skip-chars-forward 125
  221. setcar 123
  222. alist-get 123
  223. format-message 118
  224. ignore-errors 118
  225. widen 116
  226. bobp 116
  227. re-search-backward 116
  228. window-frame 115
  229. mark 114
  230. lookup-key 113
  231. cl-loop 113
  232. make-obsolete-variable 112
  233. eval-when-compile 111
  234. debug 111
  235. set-buffer-modified-p 110
  236. following-char 110
  237. file-readable-p 109

Emacs Lisp Script to Count Emacs Lisp Function Frequency

This list is generated by reading all top level lisp files bundled with GNU Emacs 28.1 of 2022-04-04. at ~/bin/emacs-28.1/share/emacs/28.1/lisp/ Total of 302 files. Then count the occurrences of the first word after the left parenthesis.

;; 2022-05-28
;; file name: count_elisp_func_frequency.el
;; run it by
;; emacs --script count_elisp_func_frequency.el

(setq xOutputFileName "xfuncfreq.txt")

(set-default-coding-systems 'utf-8-unix)

(defun xah-hash-to-list (HashTable)
  "Return a list that represent the HASHTABLE
Each element is a list: '(key value).

URL `http://xahlee.info/emacs/emacs/elisp_hash_table.html'
Version 2019-06-11 2022-05-28"
  (let (($result nil))
    (maphash
     (lambda (k v)
       (push (list k v) $result))
     HashTable)
    $result))

(defun xah-report-func-freq ()
  "go thru emacs lisp source code dir, computer function usage frequency.
version 2022-05-28"
  (interactive)
  (let ((xDir (expand-file-name (concat invocation-directory "../" "share/emacs/28.1/lisp/")))
        xFuncName
        (xHash (make-hash-table :test 'equal))
        xKeyExistVal xFnSortedList
        )
    ;; walk the directory. for each file, open it. find text like 「(some-thing」 put it in a hashtable
    (mapc
     (lambda (fPath)
       (with-temp-buffer
         (insert-file-contents fPath)
         (goto-char (point-min))
         (while (re-search-forward "(+\\([^ )\n]+\\)" nil t)
           (setq xFuncName (match-string 1))
           (setq xKeyExistVal (gethash xFuncName xHash))
           (if xKeyExistVal
               (puthash xFuncName (1+ xKeyExistVal) xHash)
             (puthash xFuncName 1 xHash)))))
     (directory-files xDir t "\\.el$"))
    (setq xFnSortedList
          (sort (xah-hash-to-list xHash)
                (lambda (a b)
                  (< (cadr a)
                     (cadr b)))))
    (setq xFnSortedList (nreverse xFnSortedList))

    (with-temp-file xOutputFileName
      (mapc
       (lambda (x)
         (insert
          (format "「%s」 %s\n" (car x) (cadr x))))
       xFnSortedList))))

(xah-report-func-freq)

old versions

emacs misc list

ErgoEmacs mascot-s276x226
Buy Xah Emacs Tutorial