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.

If you are a emacs lisp beginner, you want to master the these functions by order. Go down the list and see which is the first one you don't recognize. A fun way to judge your lisp expertise and challenge friends.

  1. setq 55211
  2. if 51253
  3. defun 40229
  4. let 31698
  5. and 27604
  6. or 21195
  7. car 21092
  8. when 20185
  9. not 18504
  10. eq 18458
  11. point 16003
  12. cdr 15510
  13. list 13548
  14. nth 13472
  15. defvar 12640
  16. goto-char 12370
  17. while 11145
  18. interactive 11034
  19. concat 10123
  20. define-key 9906
  21. cons 9388
  22. cond 8918
  23. defcustom 7990
  24. progn 7987
  25. let* 7965
  26. unless 7881
  27. insert 7683
  28. t 7422
  29. save-excursion 7302
  30. lambda 7279
  31. format 7279
  32. autoload 6694
  33. error 6591
  34. point-min 6178
  35. const 5667
  36. length 5480
  37. - 5378
  38. = 5344
  39. memq 5091
  40. message 4964
  41. 1+ 4840
  42. fn 4833
  43. string-match 4821
  44. > 4792
  45. &optional 4752
  46. < 4708
  47. looking-at 4594
  48. + 4568
  49. point-max 4360
  50. equal 4282
  51. put 4267
  52. funcall 4128
  53. require 4076
  54. push 4072
  55. 1- 4025
  56. aref 3813
  57. fboundp 3710
  58. with-current-buffer 3576
  59. match-string 3553
  60. match-end 3465
  61. re-search-forward 3400
  62. dolist 3393
  63. null 3369
  64. match-beginning 3260
  65. current-buffer 3010
  66. mapcar 2933
  67. stringp 2865
  68. substring 2816
  69. defconst 2747
  70. assq 2740
  71. forward-line 2665
  72. declare-function 2489
  73. register-definition-prefixes 2485
  74. choice 2422
  75. assoc 2324
  76. append 2277
  77. string= 2246
  78. string 2223
  79. cadr 2126
  80. * 2113
  81. apply 2035
  82. set 1926
  83. make-local-variable 1894
  84. forward-char 1861
  85. expand-file-name 1853
  86. plist-get 1820
  87. member 1799
  88. >= 1798
  89. beginning-of-line 1796
  90. car-safe 1778
  91. x 1775
  92. consp 1769
  93. <= 1756
  94. file 1629
  95. name 1607
  96. throw 1600
  97. princ 1598
  98. nreverse 1587
  99. delete-region 1586
  100. condition-case 1580
  101. defsubst 1527
  102. pop 1502
  103. zerop 1481
  104. repeat 1462
  105. arg 1444
  106. a 1440
  107. provide 1439
  108. aset 1421
  109. symbol-name 1390
  110. org-element-property 1342
  111. start 1332
  112. add-hook 1325
  113. / 1306
  114. setf 1294
  115. listp 1279
  116. buffer-substring 1270
  117. defmacro 1247
  118. string-to-number 1242
  119. intern 1229
  120. type 1208
  121. function 1206
  122. set-buffer 1205
  123. get 1193
  124. get-text-property 1182
  125. class 1178
  126. mapconcat 1175
  127. file-exists-p 1148
  128. skip-chars-forward 1137
  129. replace-match 1134
  130. setcdr 1119
  131. regexp-quote 1103
  132. symbolp 1085
  133. eobp 1085
  134. modify-syntax-entry 1085
  135. menu-item 1080
  136. char-after 1073
  137. max 1064
  138. boundp 1061
  139. oref 1056
  140. defalias 1053
  141. delq 1019
  142. current-column 1016
  143. save-restriction 1015
  144. case-fold-search 1014
  145. search-forward 992
  146. 1 969
  147. defgroup 967
  148. cl-defmethod 958
  149. numberp 953
  150. end-of-line 949
  151. s 948
  152. setcar 931
  153. setq-local 923
  154. end 916
  155. n 915
  156. erase-buffer 906
  157. default 897
  158. beg 890
  159. buffer 884
  160. catch 881
  161. purecopy 875
  162. var 867
  163. defface 865
  164. min 858
  165. math-mul 853
  166. prog1 851
  167. i 850
  168. make-sparse-keymap 850
  169. &rest 849
  170. background 846
  171. regexp 842
  172. put-text-property 839
  173. symbol-value 835
  174. pos 831
  175. buffer-name 827
  176. with-temp-buffer 817
  177. mapc 805
  178. integerp 804
  179. string-equal 802
  180. group 789
  181. re-search-backward 787
  182. skip-chars-backward 785
  183. line-beginning-position 776
  184. nil 774
  185. downcase 772
  186. elt 760
  187. file-name-directory 759
  188. file-name-nondirectory 758
  189. map 753
  190. nconc 752
  191. /= 746
  192. symbol 746
  193. declare 740
  194. narrow-to-region 739
  195. make-variable-buffer-local 736
  196. eval 735
  197. get-buffer-create 727
  198. [0-9]+\\ 725
  199. bolp 721
  200. kill-buffer 712
  201. user-error 711
  202. run-hooks 704
  203. buffer-substring-no-properties 701
  204. inhibit-read-only 686
  205. unwind-protect 684
  206. nthcdr 681
  207. pcase 678
  208. eval-when-compile 676
  209. c-lang-const 671
  210. widget-get 664
  211. vector 661
  212. delete-char 659
  213. caar 657
  214. \\ 653
  215. buf 651
  216. widen 651
  217. replace-regexp-in-string 644
  218. make-string 642
  219. save-match-data 639
  220. line-end-position 637
  221. dir 634
  222. math-div 623
  223. see 622
  224. tag 622
  225. overlay-put 619
  226. call-interactively 617
  227. .*\\ 614
  228. set-marker 611
  229. ignore-errors 609
  230. p 609
  231. backward-char 596
  232. buffer-file-name 593
  233. key 587
  234. split-string 586
  235. following-char 581
  236. signal 576
  237. char-before 574
  238. filename 572
  239. remove-hook 562
  240. get-buffer 558
  241. select-window 556
  242. kbd 555
  243. selected-window 554
  244. sort 554
  245. entry 554
  246. file-directory-p 549
  247. gethash 545
  248. add-to-list 542
  249. string-match-p 542
  250. value 536
  251. str 534
  252. define-obsolete-function-alias 532
  253. ` 530
  254. _ 528
  255. prefix-numeric-value 528
  256. math-add 526
  257. result 525
  258. y-or-n-p 523
  259. featurep 522
  260. point-marker 515
  261. bindings--define-key 513
  262. mark 512
  263. read-string 509
  264. , 502
  265. read 502
  266. 0 497
  267. cl-incf 496
  268. bobp 488
  269. propertize 487
  270. functionp 484
  271. cddr 483
  272. float 478
  273. table 478
  274. sit-for 474
  275. match-string-no-properties 473
  276. buffer-string 468
  277. dotimes 468
  278. copy-sequence 467
  279. completing-read 465
  280. c 462
  281. f 459
  282. custom-autoload 459
  283. val 456
  284. cl-loop 451
  285. org-defkey 448
  286. get-buffer-window 438
  287. switch-to-buffer 438
  288. :foreground 434
  289. 2 432
  290. number-to-string 431
  291. b 429
  292. math-reject-arg 422
  293. from 420
  294. forward-sexp 418
  295. char-to-string 418
  296. form 411
  297. item 411
  298. reverse 409
  299. indent 405
  300. [^ 402
  301. range 400
  302. % 399
  303. min-colors 397
  304. math-sub 397
  305. derived-mode-p 394
  306. preceding-char 393
  307. widget 393
  308. buffer-live-p 389
  309. delete-file 388
  310. last 388
  311. logand 384
  312. which 377
  313. gnus-message 377
  314. debug 376
  315. cl-assert 375
  316. count 368
  317. integer 362
  318. insert-file-contents 361
  319. event 360
  320. alist 358
  321. indent-to 355
  322. marker-position 353
  323. args 353
  324. the 352
  325. regexp-opt 351
  326. [ 349
  327. delete 348
  328. custom-put-if-not 346
  329. window 345
  330. eolp 344
  331. cdar 343
  332. called-interactively-p 341
  333. this 341
  334. format-message 339
  335. files 339
  336. set-buffer-modified-p 338
  337. file-name-as-directory 337
  338. data 334
  339. substitute-command-keys 334
  340. puthash 334
  341. face 334
  342. count-lines 332
  343. %s 332
  344. sym 330
  345. save-window-excursion 330
  346. prefix 328
  347. window-buffer 327
  348. find-file-noselect 325
  349. marker-buffer 325
  350. url 324
  351. copy-marker 323
  352. make-symbol 322
  353. point-at-eol 320
  354. add-text-properties 319
  355. proc 316
  356. buffer-modified-p 314
  357. prompt 314
  358. math-neg 312
  359. define-derived-mode 311
  360. file-attributes 311
  361. current-indentation 310
  362. load 306
  363. char 305
  364. e 305
  365. date 304
  366. len 303
  367. process 302
  368. abs 301
  369. expr 300
  370. deffoo 299
  371. 4 297
  372. org-element-type 297
  373. upcase 296
  374. c-lang-defconst 295
  375. res 294
  376. insert-buffer-substring 292
  377. control 291
  378. make-vector 290
  379. num 287
  380. info 287
  381. file-readable-p 286
  382. mod 285
  383. pop-to-buffer 284
  384. article 283
  385. body 281
  386. l 280
  387. obj 280
  388. format-time-string 279
  389. global-set-key 277
  390. selected-frame 275
  391. gnus 274
  392. vec 271
  393. context 270
  394. defvar-local 269
  395. custom-manual 269
  396. defvoo 269
  397. doctor-put-meaning 269
  398. func 267
  399. buffer-size 266
  400. point-at-bol 266
  401. number 265
  402. search-backward 264
  403. process-buffer 263
  404. line 262
  405. move-to-column 261
  406. region-beginning 261
  407. node 261
  408. frame 260
  409. define-minor-mode 258
  410. semantic-tag-name 258
  411. in 257
  412. calc-wrapper 256
  413. directory-file-name 255
  414. limit 255
  415. text 253
  416. ash 253
  417. get-buffer-process 252
  418. sexp 252
  419. move-marker 251
  420. m 250
  421. widget-put 249
  422. command 247
  423. Org 246
  424. semantic-lambda 246
  425. math-normalize 244
  426. dun-mprincl 243
  427. pred 242
  428. v 240
  429. mode 239
  430. region-end 239
  431. cmd 238
  432. make-hash-table 236
  433. make-overlay 233
  434. write-region 232
  435. next-single-property-change 231
  436. window-height 231
  437. push-mark 231
  438. oset 230
  439. directory-files 229
  440. element 229
  441. overlay-get 229
  442. int-to-string 229
  443. make-marker 226
  444. back-to-indentation 226
  445. cdr-safe 225
  446. read-from-minibuffer 224
  447. make-obsolete-variable 224
  448. vhdl-insert-keyword 224
  449. plist-put 223
  450. to 223
  451. overlay-start 222
  452. process-status 221
  453. for 221
  454. ding 220
  455. getenv 220
  456. header 220
  457. vectorp 219
  458. symbol-function 219
  459. obsolete 219
  460. org-string-nw-p 219
  461. state 218
  462. delete-overlay 217
  463. e.g. 216
  464. prin1-to-string 215
  465. msg 214
  466. function-item 214
  467. define-obsolete-variable-alias 213
  468. id 212
  469. file-truename 211
  470. status 211
  471. "" 211
  472. buffer-read-only 209
  473. buffer-list 209
  474. with-output-to-temp-buffer 209
  475. default-directory 208
  476. executable-find 207
  477. register-input-method 207
  478. newline 206
  479. intern-soft 206
  480. recenter 206
  481. month 205
  482. 3 204
  483. save-buffer 203
  484. path 202
  485. quail-define-package 202
  486. read-file-name 200
  487. begin 200
  488. defclass 200
  489. category 200
  490. message-fetch-field 199
  491. handle 198
  492. select 197
  493. lookup-key 196
  494. ediff-with-current-buffer 196
  495. .+\\ 195
  496. fset 195
  497. host 195
  498. event-start 194
  499. posn-window 194
  500. window-frame 194

Python Script to Count Emacs Lisp Function Frequency

This list is generated by reading all lisp files bundled with GNU Emacs 27.1 of 2020-08-11. Total of 1583 emacs lisp files. Then count the occurrences of the first word after the left parenthesis.

This list is generated by the following Python script.

# -*- coding: utf-8 -*-
# python 3

# purpose: count emacs lisp function frequency list of emacs lisp programs
# see
# http://ergoemacs.org/emacs/function-frequency.html
# 2006-10-27, 2020-12-17

# algorithm sketch:
# for each file in a given dir,
# read in the file
# delete comment lines
# break it into a list of temp lines, seperated by (
# for each such line, grab the first word
# put this into a wordlist
# for each in wordlist, add it into a hash key, and if already exist, increase by 1

import os, sys, shutil, re, operator

# /Applications/Emacs27.1.app/Contents/Resources/lisp/
# copy it to a temp directory, ungzip the files
inputDir = "/Users/xah/xx/lisp"

# keys are words, vals are count of occurrences
wordFreq = {}

def countMe(filePath):
    "add words frequency into wordFreq"
    print("reading:", filePath)
    inF = open(filePath, "rb")
    s = str(inF.read(), "iso-8859-1")
    inF.close()

    # ; rid of some comments (on a line by themselves)
    s = s.splitlines()
    s = [x for x in s if not re.search(r"\s*;", x)]
    s = " ".join(s)

    s = s.split("(")

    wordlist = []
    for li in s:
        if li:
            s2 = re.split(r"\s+|\)", li)
            if s2:
                if s2[0]:
                    wordlist.append(s2[0])

    # add to dict
    for wd in wordlist:
        if wd in wordFreq:
            wordFreq[wd] = wordFreq[wd] + 1
        else:
            wordFreq[wd] = 1

for dir_path, subdir_list, file_list in os.walk(inputDir):
    for fname in file_list:
        if re.search(r"\.el$", fname, re.U):
            countMe(os.path.join(dir_path, fname))

print()

# print(wordFreq)

for k, v in sorted(iter(wordFreq.items()), key=operator.itemgetter(1), reverse=True):
    print(k, v)

Old version: Emacs 23.2 Lisp Function Frequency 2006-10-30

See also Emacs Command Frequency Statistics

Put $5 at https://www.patreon.com/xahlee , or goto paypal.com and pay to Xah@XahLee.org . Message me on XahLee discord, say so, ask me questions.
Or Buy Xah Emacs Tutorial