Emacs Lisp Function Frequency

Buy Xah Emacs Tutorial. Master emacs benefits for life.
, , …,

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.

ranknamecount
1setq54152
2if46340
3defun34491
4let25186
5and22555
6car19730
7or17592
8not15833
9eq15524
10when14187
11point14087
12cdr14034
13list12909
14nth12770
15defvar11574
16goto-char10905
17while10767
18interactive10514
19define-key9828
20concat8805
21cons8685
22progn7633
23cond7175
24insert7085
25save-excursion6891
26defcustom6838
27error6520
28autoload6128
29t6029
30unless5944
31let*5811
32point-min5755
34format5386
35lambda5038
36=4896
37string-match4861
38length4683
39-4682
40message4616
41“1+”4509
42looking-at4316
43const4215
44“>”4200
45put4199
46memq4160
47“<”4087
48“+”4074
49point-max3940
51equal3758
52“1-”3716
53aref3631
54match-string3407
55require3381
56re-search-forward3236
57match-end3207
58match-beginning3080
59null2761
60push2751
61with-current-buffer2691
62funcall2681
63current-buffer2645
64substring2609
65make-local-variable2415
66forward-line2383
67stringp2357
68defconst2296
69mapcar2207
70assoc2111
71set2008
72dolist1992
73beginning-of-line1933
74assq1908
75string=1860
76append1858
77“*”1853
79string1762
81car-safe1712
82forward-char1677
83cadr1609
84“>=”1603
85set-buffer1597
86condition-case1584
87apply1557
88expand-file-name1550
89consp1515
90fboundp1511
91aset1504
92princ1500
93delete-region1493
94“<=”1493
95purecopy1489
97defsubst1407
98pop1402
100featurep1323
101member1301
102nreverse1290
104buffer-substring1255
105throw1253
106“/”1244
107defmacro1243
108provide1242
109repeat1241
110replace-match1239
111function1221
113declare-function1204
114symbol-name1190
115boundp1171
116defalias1166
117zerop1132
118intern1105
120get1089
122add-hook1086
123listp1084
124file-exists-p1067
125end-of-line1059
126modify-syntax-entry1037
127string-to-number1029
128setcdr1023
129search-forward977
130current-column961
131skip-chars-forward958
132get-text-property948
133setcar948
135symbol-value932
136save-restriction922
137eobp915
138char-after912
139oref911
140erase-buffer908
141regexp-quote888
142mapconcat873
143defgroup871
144delq864
145symbolp854
146max852
147math-mul822
151make-variable-buffer-local807
152numberp802
153case-fold-search801
154mapc792
155buffer-name772
158make-sparse-keymap761
160eval748
161integerp746
164file-name-nondirectory737
165re-search-backward737
166string-equal732
169run-hooks723
170eval-when-compile722
172prog1715
173defmethod714
174downcase712
175kill-buffer711
177get-buffer-create701
179plist-get689
180elt689
181narrow-to-region683
184file-name-directory675
185nthcdr674
186“end”666
187“/=”664
188put-text-property659
189nconc655
190catch655
192defface644
193min636
195caar632
196unwind-protect620
197widen619
198nil617
199add-to-list613
200selected-window612
201skip-chars-backward607
202widget-get606
203math-div602
205bolp598
206save-match-data583
207call-interactively574
208prefix-numeric-value565
211vector560
212buffer-file-name555
213buffer-substring-no-properties553
214delete-char543
215select-window543
217inhibit-read-only532
218backward-char526
219with-temp-buffer514
220following-char513
221setf510
222signal508
223math-add504
226map495
227make-string492
228mark492
229y-or-n-p491
230set-marker490
231get-buffer488
232file-directory-p487
234c-lang-const486
235switch-to-buffer485
236sort483
237read-string482
239custom-autoload465
242read457
243remove-hook453
246float441
248copy-sequence431
249sit-for431
250bobp425
251point-marker423
252math-reject-arg412
253cddr410
254completing-read408
256forward-sexp396
257char-to-string395
260quote391
261gnus-message390
262get-buffer-window386
263preceding-char385
264overlay-put385
266math-sub378
267org-defkey378
271indent-to366
274number-to-string357
275logand352
277split-string350
278loop341
280char-before339
281gethash337
282reverse337
285file-name-as-directory332
286buffer-string323
288count321
289delete-file319
290incf319
291marker-position318
294functionp314
295set-buffer-modified-p314
297symbol-function312
298buffer-modified-p310
299math-neg309
303cdar306
305add-text-properties304
306delete303
307current-time302
308ignore-errors301
309make-vector300
310last298
313insert-buffer-substring291
315pop-to-buffer288
316lsh286
317propertize286
318save-window-excursion285
319match-string-no-properties284
320marker-buffer283
321selected-frame283
322count-lines282
323insert-file-contents282
325load281
326back-to-indentation279
327eolp279
328line-beginning-position278
331make-symbol274
332file-attributes274
335kbd272
341use-local-map270
345find-file-noselect267
347move-marker264
349math-normalize261
350dotimes260
352abs260
354called-interactively-p259
355int-to-string258
356point-at-bol258
357calc-wrapper253
358line-end-position253
359window-height249
363window-buffer246
365upcase245
367make-marker243
368file-readable-p243
369vectorp241
370point-at-eol240
371move-to-column239
373fset238
374search-backward237
375current-indentation237
377define-obsolete-function-alias234
380widget-put229
381gnus228
382global-set-key228
383buffer-read-only228
384format-time-string226
385logior226
387buffer-size224
388info224
389ding223
390mod223
391def-edebug-spec222
394newline221
395getenv221
396buffer-live-p220
397process-status219
399regexp-opt218
400prin1-to-string216
402with-output-to-temp-buffer213
403directory-file-name211
404oset210
405directory-files209
406process-buffer209
407read-from-minibuffer208
408recenter208
409region-beginning207
411push-mark206
412save-buffer205
413eval-and-compile205
414read-file-name204
415intern-soft202
416case202

Python Script to Count Emacs Lisp Function Frequency

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.

# -*- coding: utf-8 -*-
# Python

# purpose: count emacs lisp function frequency list of emacs lisp programs
# see
# http://ergoemacs.org/emacs/function-frequency.html

# 2006-10-27 Xah Lee ∑ http://xahlee.org/

# 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

mydir = '/Applications/Emacs.app/Contents/Resources/share/emacs/22.0.50/lisp'
mydir = "C:/Users/xah/web/xahlee_org/emacs/"
mydir = "c:/Program Files (x86)/ErgoEmacs/lisp"

minLevel=1; # files and dirs of mydir are level 1.
maxLevel=7; # inclusive

# keys are words, vals are num of occurances
wordFreq={}

def countMe(filePath):
   "add words frequency into wordFreq"

   print 'reading:', filePath
   inF = open(filePath,'rb')
   s=unicode(inF.read(),'iso-8859-1')
   inF.close()

   # ; rid of (some) comments (on a line by themselves)
   s=s.splitlines()
   s=filter(lambda x: not re.search(r"\s*;", x), s)
   s=' '.join(s)

   s = s.split('(')
#   s = filter(lambda x: x != '' and (not re.search(r'^\s+$',x)), s)

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

#    compute frequency
   for wd in wordlist:
        if wordFreq.has_key(wd):
            wordFreq[wd]=wordFreq[wd]+1
        else:
           wordFreq[wd]=1

def getInto(dummy, curdir, filess):
   curdirLevel=len(re.split('/',curdir))-len(re.split('/',mydir))
   filessLevel=curdirLevel+1
   if minLevel <= filessLevel <= maxLevel:
      for child in filess:
         if re.search(r'\.el$',child,re.U) and os.path.isfile(curdir+'/'+child):
             countMe(curdir+'/'+child)

os.path.walk(mydir, getInto, 'dummy')

for k,v in sorted(wordFreq.iteritems(), key=operator.itemgetter(1) ,reverse=True):
    print k.encode('utf-8'),v
Like it?
Buy Xah Emacs Tutorial
or share
blog comments powered by Disqus