This page shows a table of emacs lisp functions in order of their usage frequency.
Ever wonder what are the top 30 most frequently used emacs lisp functions? If you are just beginner elisp programer, you probably want to know these well.
Also, this list provides raw data for many uses. For example, when
you are designing a abbreviation list
for Yasnippet Templates for
coding emacs lisp.
Suppose you want “ff” to be the abbrev for find-file. But some other two-words function might be “ff” as well, such as find-if, fill-flowed, focus-frame, face-font, face-foreground. But if you looked at the frequency list and realized that all the other are not used much, then it'd be a good decision to make ff as the abbrev for find-file only.
Also, for emacs lisp language developers, when adding a new function or deprecating a function; the frequency table will provide useful info.
Just for fun, you might walk down the list and see which is the first one you don't recognize. That might be a fun way to judge your lisp expertise and challenge friends.
1 setq 54152 2 if 46340 3 defun 34491 4 let 25186 5 and 22555 6 car 19730 7 or 17592 8 not 15833 9 eq 15524 10 when 14187 11 point 14087 12 cdr 14034 13 list 12909 14 nth 12770 15 defvar 11574 16 goto-char 10905 17 while 10767 18 interactive 10514 19 define-key 9828 20 concat 8805 21 cons 8685 22 progn 7633 23 cond 7175 24 insert 7085 25 save-excursion 6891 26 defcustom 6838 27 error 6520 28 autoload 6128 29 t 6029 30 unless 5944 31 let* 5811 32 point-min 5755 33 fn 5441 34 format 5386 35 lambda 5038 36 = 4896 37 string-match 4861 38 length 4683 39 - 4682 40 message 4616 41 1+ 4509 42 looking-at 4316 43 const 4215 44 > 4200 45 put 4199 46 memq 4160 47 < 4087 48 + 4074 49 point-max 3940 51 equal 3758 52 1- 3716 53 aref 3631 54 match-string 3407 55 require 3381 56 re-search-forward 3236 57 match-end 3207 58 match-beginning 3080 59 null 2761 60 push 2751 61 with-current-buffer 2691 62 funcall 2681 63 current-buffer 2645 64 substring 2609 65 make-local-variable 2415 66 forward-line 2383 67 stringp 2357 68 defconst 2296 69 mapcar 2207 70 assoc 2111 71 set 2008 72 dolist 1992 73 beginning-of-line 1933 74 assq 1908 75 string= 1860 76 append 1858 77 * 1853 78 choice 1795 79 string 1762 80 x 1724 81 car-safe 1712 82 forward-char 1677 83 cadr 1609 84 >= 1603 85 set-buffer 1597 86 condition-case 1584 87 apply 1557 88 expand-file-name 1550 89 consp 1515 90 fboundp 1511 91 aset 1504 92 princ 1500 93 delete-region 1493 94 <= 1493 95 purecopy 1489 96 file 1408 97 defsubst 1407 98 pop 1402 99 arg 1370 100 featurep 1323 101 member 1301 102 nreverse 1290 103 a 1256 104 buffer-substring 1255 105 throw 1253 106 / 1244 107 defmacro 1243 108 provide 1242 109 repeat 1241 110 replace-match 1239 111 function 1221 112 name 1210 113 declare-function 1204 114 symbol-name 1190 115 boundp 1171 116 defalias 1166 117 zerop 1132 118 intern 1105 119 class 1091 120 get 1089 121 start 1086 122 add-hook 1086 123 listp 1084 124 file-exists-p 1067 125 end-of-line 1059 126 modify-syntax-entry 1037 127 string-to-number 1029 128 setcdr 1023 129 search-forward 977 130 current-column 961 131 skip-chars-forward 958 132 get-text-property 948 133 setcar 948 134 menu-item 935 135 symbol-value 932 136 save-restriction 922 137 eobp 915 138 char-after 912 139 oref 911 140 erase-buffer 908 141 regexp-quote 888 142 mapconcat 873 143 defgroup 871 144 delq 864 145 symbolp 854 146 max 852 147 math-mul 822 148 group 817 149 n 816 150 background 811 151 make-variable-buffer-local 807 152 numberp 802 153 case-fold-search 801 154 mapc 792 155 buffer-name 772 156 &rest 770 157 i 762 158 make-sparse-keymap 761 159 1 758 160 eval 748 161 integerp 746 162 :foreground 744 163 s 743 164 file-name-nondirectory 737 165 re-search-backward 737 166 string-equal 732 167 var 727 168 beg 724 169 run-hooks 723 170 eval-when-compile 722 171 [0-9]+\\ 716 172 prog1 715 173 defmethod 714 174 downcase 712 175 kill-buffer 711 176 default 708 177 get-buffer-create 701 178 regexp 699 179 plist-get 689 180 elt 689 181 narrow-to-region 683 182 pos 680 183 buffer 676 184 file-name-directory 675 185 nthcdr 674 186 end 666 187 /= 664 188 put-text-property 659 189 nconc 655 190 catch 655 191 type 647 192 defface 644 193 min 636 194 symbol 634 195 caar 632 196 unwind-protect 620 197 widen 619 198 nil 617 199 add-to-list 613 200 selected-window 612 201 skip-chars-backward 607 202 widget-get 606 203 math-div 602 204 \\ 599 205 bolp 598 206 save-match-data 583 207 call-interactively 574 208 prefix-numeric-value 565 209 .*\\ 564 210 buf 561 211 vector 560 212 buffer-file-name 555 213 buffer-substring-no-properties 553 214 delete-char 543 215 select-window 543 216 p 535 217 inhibit-read-only 532 218 backward-char 526 219 with-temp-buffer 514 220 following-char 513 221 setf 510 222 signal 508 223 math-add 504 224 tag 504 225 dir 503 226 map 495 227 make-string 492 228 mark 492 229 y-or-n-p 491 230 set-marker 490 231 get-buffer 488 232 file-directory-p 487 233 see 487 234 c-lang-const 486 235 switch-to-buffer 485 236 sort 483 237 read-string 482 238 filename 475 239 custom-autoload 465 240 str 460 241 % 458 242 read 457 243 remove-hook 453 244 widget 443 245 key 443 246 float 441 247 entry 439 248 copy-sequence 431 249 sit-for 431 250 bobp 425 251 point-marker 423 252 math-reject-arg 412 253 cddr 410 254 completing-read 408 255 0 407 256 forward-sexp 396 257 char-to-string 395 258 [ 392 259 from 391 260 quote 391 261 gnus-message 390 262 get-buffer-window 386 263 preceding-char 385 264 overlay-put 385 265 [^ 384 266 math-sub 378 267 org-defkey 378 268 c 371 269 b 366 270 defvoo 366 271 indent-to 366 272 form 363 273 2 359 274 number-to-string 357 275 logand 352 276 result 352 277 split-string 350 278 loop 341 279 deffoo 340 280 char-before 339 281 gethash 337 282 reverse 337 283 val 337 284 min-colors 332 285 file-name-as-directory 332 286 buffer-string 323 287 table 322 288 count 321 289 delete-file 319 290 incf 319 291 marker-position 318 292 this 318 293 files 316 294 functionp 314 295 set-buffer-modified-p 314 296 proc 313 297 symbol-function 312 298 buffer-modified-p 310 299 math-neg 309 300 args 309 301 event 309 302 control 309 303 cdar 306 304 value 304 305 add-text-properties 304 306 delete 303 307 current-time 302 308 ignore-errors 301 309 make-vector 300 310 last 298 311 f 296 312 which 296 313 insert-buffer-substring 291 314 face 290 315 pop-to-buffer 288 316 lsh 286 317 propertize 286 318 save-window-excursion 285 319 match-string-no-properties 284 320 marker-buffer 283 321 selected-frame 283 322 count-lines 282 323 insert-file-contents 282 324 item 282 325 load 281 326 back-to-indentation 279 327 eolp 279 328 line-beginning-position 278 329 len 275 330 num 275 331 make-symbol 274 332 file-attributes 274 333 expr 272 334 integer 272 335 kbd 272 336 custom-put-if-not 271 337 date 271 338 sym 271 339 article 270 340 prefix 270 341 use-local-map 270 342 doctor-put-meaning 269 343 char 268 344 process 267 345 find-file-noselect 267 346 alist 266 347 move-marker 264 348 obj 262 349 math-normalize 261 350 dotimes 260 351 custom-manual 260 352 abs 260 353 func 259 354 called-interactively-p 259 355 int-to-string 258 356 point-at-bol 258 357 calc-wrapper 253 358 line-end-position 253 359 window-height 249 360 context 249 361 semantic-lambda 247 362 number 246 363 window-buffer 246 364 url 245 365 upcase 245 366 l 243 367 make-marker 243 368 file-readable-p 243 369 vectorp 241 370 point-at-eol 240 371 move-to-column 239 372 res 238 373 fset 238 374 search-backward 237 375 current-indentation 237 376 prompt 236 377 define-obsolete-function-alias 234 378 4 230 379 dun-mprincl 230 380 widget-put 229 381 gnus 228 382 global-set-key 228 383 buffer-read-only 228 384 format-time-string 226 385 logior 226 386 in 225 387 buffer-size 224 388 info 224 389 ding 223 390 mod 223 391 def-edebug-spec 222 392 ediff-with-current-buffer 222 393 data 221 394 newline 221 395 getenv 221 396 buffer-live-p 220 397 process-status 219 398 vhdl-insert-keyword 219 399 regexp-opt 218 400 prin1-to-string 216 401 semantic-tag-name 215 402 with-output-to-temp-buffer 213 403 directory-file-name 211 404 oset 210 405 directory-files 209 406 process-buffer 209 407 read-from-minibuffer 208 408 recenter 208 409 region-beginning 207 410 vec 207 411 push-mark 206 412 save-buffer 205 413 eval-and-compile 205 414 read-file-name 204 415 intern-soft 202 416 case 202 417 sexp 201 …
The right side is number of times they are called.
This list is generated by reading all lisp files bundled with emacs 23.2, then count the occurrences of the first word after the left parenthesis. There are about 1327 “.el” files.
(this list is generated by a Python script in a text processing fashion. It is not done by a lisp reader, so is not absolutely accurate. Some entry above may not actually be a valid lisp function. (i've already manually removed some that are not functions, but didn't do a thorough job.))
The Python script is here: function-frequency.py.
For me, the first function i'm not familiar is #81 car-safe. Then, #86 condition-case, #89 consp, #95 purecopy, #102 nreverse, … Been coding elisp leisurely for 5 years, perhaps 2 hours per day as statistical average. So, i'd say around 80 is the number of functions you really need to know.
PS: Tell me how far down the list you got first function that's not familiar to you.
blog comments powered by Disqus