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
29 t6029
30unless5944
31let*5811
32point-min5755
33format5386
34lambda5038
35=4896
36string-match4861
37length4683
38-4682
39message4616
40 “1+”4509
41looking-at4316
42 const4215
43 “>”4200
44put4199
45memq4160
46 “<”4087
47 “+”4074
48point-max3940
49equal3758
50 “1-”3716
51aref3631
52match-string3407
53require3381
54re-search-forward3236
55match-end3207
56match-beginning3080
57null2761
58push2751
59with-current-buffer2691
60funcall2681
61current-buffer2645
62substring2609
63make-local-variable2415
64forward-line2383
65stringp2357
66defconst2296
67mapcar2207
68assoc2111
69set2008
70dolist1992
71beginning-of-line1933
72assq1908
73string=1860
74append1858
75 “*”1853
76string1762
77car-safe1712
78forward-char1677
79cadr1609
80 “>=”1603
81set-buffer1597
82condition-case1584
83apply1557
84expand-file-name1550
85consp1515
86fboundp1511
87aset1504
88princ1500
89delete-region1493
90 “<=”1493
91purecopy1489
92defsubst1407
93pop1402
94featurep1323
95member1301
96nreverse1290
97buffer-substring1255
98throw1253
99 “/”1244
100defmacro1243
101provide1242
102repeat1241
103replace-match1239
104function1221
105declare-function1204
106symbol-name1190
107boundp1171
108defalias1166
109zerop1132
110intern1105
111get1089
112add-hook1086
113listp1084
114file-exists-p1067
115end-of-line1059
116modify-syntax-entry1037
117string-to-number1029
118setcdr1023
119search-forward977
120current-column961
121skip-chars-forward958
122get-text-property948
123setcar948
124symbol-value932
125save-restriction922
126eobp915
127char-after912
128oref911
129erase-buffer908
130regexp-quote888
131mapconcat873
132defgroup871
133delq864
134symbolp854
135max852
136math-mul822
137make-variable-buffer-local807
138numberp802
139 case-fold-search801
140mapc792
141buffer-name772
142make-sparse-keymap761
143eval748
144integerp746
145file-name-nondirectory737
146re-search-backward737
147string-equal732
148run-hooks723
149eval-when-compile722
150prog1715
151defmethod714
152downcase712
153kill-buffer711
154get-buffer-create701
155plist-get689
156elt689
157narrow-to-region683
158file-name-directory675
159nthcdr674
160 “end”666
161 “/=”664
162put-text-property659
163nconc655
164catch655
165defface644
166min636
167caar632
168unwind-protect620
169widen619
170 nil617
171add-to-list613
172selected-window612
173skip-chars-backward607
174widget-get606
175math-div602
176bolp598
177save-match-data583
178call-interactively574
179prefix-numeric-value565
180vector560
181buffer-file-name555
182buffer-substring-no-properties553
183delete-char543
184select-window543
185 inhibit-read-only532
186backward-char526
187with-temp-buffer514
188following-char513
189setf510
190signal508
191math-add504
192map495
193make-string492
194mark492
195y-or-n-p491
196set-marker490
197get-buffer488
198file-directory-p487
199c-lang-const486
200switch-to-buffer485
201sort483
202read-string482
203custom-autoload465
204read457
205remove-hook453
206float441
207copy-sequence431
208sit-for431
209bobp425
210point-marker423
211math-reject-arg412
212cddr410
213completing-read408
214forward-sexp396
215char-to-string395
216quote391
217gnus-message390
218get-buffer-window386
219preceding-char385
220overlay-put385
221math-sub378
222org-defkey378
223indent-to366
224number-to-string357
225logand352
226split-string350
227loop341
228char-before339
229gethash337
230reverse337
231file-name-as-directory332
232buffer-string323
233count321
234delete-file319
235incf319
236marker-position318
237functionp314
238set-buffer-modified-p314
239symbol-function312
240buffer-modified-p310
241math-neg309
242cdar306
243add-text-properties304
244delete303
245current-time302
246ignore-errors301
247make-vector300
248last298
249insert-buffer-substring291
250pop-to-buffer288
251lsh286
252propertize286
253save-window-excursion285
254match-string-no-properties284
255marker-buffer283
256selected-frame283
257count-lines282
258insert-file-contents282
259load281
260back-to-indentation279
261eolp279
262line-beginning-position278
263make-symbol274
264file-attributes274
265kbd272
266use-local-map270
267find-file-noselect267
268move-marker264
269math-normalize261
270dotimes260
271abs260
272called-interactively-p259
273int-to-string258
274point-at-bol258
275calc-wrapper253
276line-end-position253
277window-height249
278window-buffer246
279upcase245
280make-marker243
281file-readable-p243
282vectorp241
283point-at-eol240
284move-to-column239
285fset238
286search-backward237
287current-indentation237
288define-obsolete-function-alias234
289widget-put229
290gnus228
291global-set-key228
292 buffer-read-only228
293format-time-string226
294logior226
295buffer-size224
296info224
297ding223
298mod223
299def-edebug-spec222
300newline221
301getenv221
302buffer-live-p220
303process-status219
304regexp-opt218
305prin1-to-string216
306with-output-to-temp-buffer213
307directory-file-name211
308oset210
309directory-files209
310process-buffer209
311read-from-minibuffer208
312recenter208
313region-beginning207
314push-mark206
315save-buffer205
316eval-and-compile205
317read-file-name204
318intern-soft202
319case202

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.
blog comments powered by Disqus