* lisp/emacs-lisp/cl-macs.el (cl--transform-lambda): Add back `declare' in
[bpt/emacs.git] / lisp / emacs-lisp / tabulated-list.el
CommitLineData
48da7392 1;;; tabulated-list.el --- generic major mode for tabulated lists -*- lexical-binding: t -*-
a83ec3c9 2
acaf905b 3;; Copyright (C) 2011-2012 Free Software Foundation, Inc.
a83ec3c9
CY
4
5;; Author: Chong Yidong <cyd@stupidchicken.com>
6;; Keywords: extensions, lisp
7
8;; This file is part of GNU Emacs.
9
267b82ff 10;; GNU Emacs is free software: you can redistribute it and/or modify
a83ec3c9 11;; it under the terms of the GNU General Public License as published by
267b82ff
GM
12;; the Free Software Foundation, either version 3 of the License, or
13;; (at your option) any later version.
a83ec3c9
CY
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22
23;;; Commentary:
24
6632d361
CY
25;; This file defines Tabulated List mode, a generic major mode for
26;; displaying lists of tabulated data, intended for other major modes
27;; to inherit from. It provides several utility routines, e.g. for
28;; pretty-printing lines of tabulated data to fit into the appropriate
29;; columns.
a83ec3c9
CY
30
31;; For usage information, see the documentation of `tabulated-list-mode'.
32
6632d361
CY
33;; This package originated from Tom Tromey's Package Menu mode,
34;; extended and generalized to be used by other modes.
a83ec3c9
CY
35
36;;; Code:
37
0ae03b6a
CY
38;; The reason `tabulated-list-format' and other variables are
39;; permanent-local is to make it convenient to switch to a different
40;; major mode, switch back, and have the original Tabulated List data
41;; still valid. See, for example, ebuff-menu.el.
42
a83ec3c9
CY
43(defvar tabulated-list-format nil
44 "The format of the current Tabulated List mode buffer.
6632d361
CY
45This should be a vector of elements (NAME WIDTH SORT . PROPS),
46where:
a83ec3c9 47 - NAME is a string describing the column.
6632d361
CY
48 This is the label for the column in the header line.
49 Different columns must have non-`equal' names.
a83ec3c9
CY
50 - WIDTH is the width to reserve for the column.
51 For the final element, its numerical value is ignored.
52 - SORT specifies how to sort entries by this column.
53 If nil, this column cannot be used for sorting.
54 If t, sort by comparing the string value printed in the column.
55 Otherwise, it should be a predicate function suitable for
56 `sort', accepting arguments with the same form as the elements
6632d361
CY
57 of `tabulated-list-entries'.
58 - PROPS is a plist of additional column properties.
59 Currently supported properties are:
f0809a9d 60 - `:right-align': if non-nil, the column should be right-aligned.
6632d361
CY
61 - `:pad-right': Number of additional padding spaces to the
62 right of the column (defaults to 1 if omitted).")
a83ec3c9 63(make-variable-buffer-local 'tabulated-list-format)
0ae03b6a 64(put 'tabulated-list-format 'permanent-local t)
a83ec3c9 65
1241b724
CY
66(defvar tabulated-list-use-header-line t
67 "Whether the Tabulated List buffer should use a header line.")
68(make-variable-buffer-local 'tabulated-list-use-header-line)
69
a83ec3c9
CY
70(defvar tabulated-list-entries nil
71 "Entries displayed in the current Tabulated List buffer.
72This should be either a function, or a list.
73If a list, each element has the form (ID [DESC1 ... DESCN]),
74where:
75 - ID is nil, or a Lisp object uniquely identifying this entry,
76 which is used to keep the cursor on the \"same\" entry when
77 rearranging the list. Comparison is done with `equal'.
78
79 - Each DESC is a column descriptor, one for each column
80 specified in `tabulated-list-format'. A descriptor is either
81 a string, which is printed as-is, or a list (LABEL . PROPS),
82 which means to use `insert-text-button' to insert a text
83 button with label LABEL and button properties PROPS.
84 The string, or button label, must not contain any newline.
85
86If `tabulated-list-entries' is a function, it is called with no
87arguments and must return a list of the above form.")
88(make-variable-buffer-local 'tabulated-list-entries)
0ae03b6a 89(put 'tabulated-list-entries 'permanent-local t)
a83ec3c9
CY
90
91(defvar tabulated-list-padding 0
92 "Number of characters preceding each Tabulated List mode entry.
93By default, lines are padded with spaces, but you can use the
94function `tabulated-list-put-tag' to change this.")
95(make-variable-buffer-local 'tabulated-list-padding)
0ae03b6a 96(put 'tabulated-list-padding 'permanent-local t)
a83ec3c9
CY
97
98(defvar tabulated-list-revert-hook nil
99 "Hook run before reverting a Tabulated List buffer.
100This is commonly used to recompute `tabulated-list-entries'.")
101
102(defvar tabulated-list-printer 'tabulated-list-print-entry
103 "Function for inserting a Tabulated List entry at point.
104It is called with two arguments, ID and COLS. ID is a Lisp
105object identifying the entry, and COLS is a vector of column
106descriptors, as documented in `tabulated-list-entries'.")
107(make-variable-buffer-local 'tabulated-list-printer)
108
109(defvar tabulated-list-sort-key nil
110 "Sort key for the current Tabulated List mode buffer.
111If nil, no additional sorting is performed.
112Otherwise, this should be a cons cell (NAME . FLIP).
113NAME is a string matching one of the column names in
114`tabulated-list-format' (the corresponding SORT entry in
115`tabulated-list-format' then specifies how to sort). FLIP, if
116non-nil, means to invert the resulting sort.")
117(make-variable-buffer-local 'tabulated-list-sort-key)
0ae03b6a 118(put 'tabulated-list-sort-key 'permanent-local t)
a83ec3c9 119
6632d361
CY
120(defsubst tabulated-list-get-id (&optional pos)
121 "Return the entry ID of the Tabulated List entry at POS.
122The value is an ID object from `tabulated-list-entries', or nil.
a83ec3c9
CY
123POS, if omitted or nil, defaults to point."
124 (get-text-property (or pos (point)) 'tabulated-list-id))
125
6632d361
CY
126(defsubst tabulated-list-get-entry (&optional pos)
127 "Return the Tabulated List entry at POS.
128The value is a vector of column descriptors, or nil if there is
129no entry at POS. POS, if omitted or nil, defaults to point."
130 (get-text-property (or pos (point)) 'tabulated-list-entry))
131
a83ec3c9
CY
132(defun tabulated-list-put-tag (tag &optional advance)
133 "Put TAG in the padding area of the current line.
134TAG should be a string, with length <= `tabulated-list-padding'.
135If ADVANCE is non-nil, move forward by one line afterwards."
136 (unless (stringp tag)
137 (error "Invalid argument to `tabulated-list-put-tag'"))
138 (unless (> tabulated-list-padding 0)
139 (error "Unable to tag the current line"))
140 (save-excursion
141 (beginning-of-line)
6632d361 142 (when (tabulated-list-get-entry)
a83ec3c9
CY
143 (let ((beg (point))
144 (inhibit-read-only t))
145 (forward-char tabulated-list-padding)
146 (insert-and-inherit
6632d361
CY
147 (let ((width (string-width tag)))
148 (if (<= width tabulated-list-padding)
149 (concat tag
150 (make-string (- tabulated-list-padding width) ?\s))
151 (truncate-string-to-width tag tabulated-list-padding))))
a83ec3c9
CY
152 (delete-region beg (+ beg tabulated-list-padding)))))
153 (if advance
154 (forward-line)))
155
156(defvar tabulated-list-mode-map
157 (let ((map (copy-keymap special-mode-map)))
158 (set-keymap-parent map button-buffer-map)
159 (define-key map "n" 'next-line)
160 (define-key map "p" 'previous-line)
e5f9458f 161 (define-key map "S" 'tabulated-list-sort)
a83ec3c9
CY
162 (define-key map [follow-link] 'mouse-face)
163 (define-key map [mouse-2] 'mouse-select-window)
164 map)
165 "Local keymap for `tabulated-list-mode' buffers.")
166
167(defvar tabulated-list-sort-button-map
168 (let ((map (make-sparse-keymap)))
169 (define-key map [header-line mouse-1] 'tabulated-list-col-sort)
170 (define-key map [header-line mouse-2] 'tabulated-list-col-sort)
1241b724
CY
171 (define-key map [mouse-1] 'tabulated-list-col-sort)
172 (define-key map [mouse-2] 'tabulated-list-col-sort)
173 (define-key map "\C-m" 'tabulated-list-sort)
a83ec3c9
CY
174 (define-key map [follow-link] 'mouse-face)
175 map)
176 "Local keymap for `tabulated-list-mode' sort buttons.")
177
16a43933
CY
178(defvar tabulated-list-glyphless-char-display
179 (let ((table (make-char-table 'glyphless-char-display nil)))
180 (set-char-table-parent table glyphless-char-display)
fe7a3057 181 ;; Some text terminals can't display the Unicode arrows; be safe.
16a43933
CY
182 (aset table 9650 (cons nil "^"))
183 (aset table 9660 (cons nil "v"))
184 table)
185 "The `glyphless-char-display' table in Tabulated List buffers.")
186
1241b724
CY
187(defvar tabulated-list--header-string nil)
188(defvar tabulated-list--header-overlay nil)
189
a83ec3c9
CY
190(defun tabulated-list-init-header ()
191 "Set up header line for the Tabulated List buffer."
f0809a9d 192 ;; FIXME: Should share code with tabulated-list-print-col!
6632d361 193 (let ((x (max tabulated-list-padding 0))
a83ec3c9
CY
194 (button-props `(help-echo "Click to sort by column"
195 mouse-face highlight
196 keymap ,tabulated-list-sort-button-map))
197 (cols nil))
e5f9458f 198 (push (propertize " " 'display `(space :align-to ,x)) cols)
a83ec3c9
CY
199 (dotimes (n (length tabulated-list-format))
200 (let* ((col (aref tabulated-list-format n))
6632d361 201 (label (nth 0 col))
a83ec3c9 202 (width (nth 1 col))
6632d361 203 (props (nthcdr 3 col))
f0809a9d
SM
204 (pad-right (or (plist-get props :pad-right) 1))
205 (right-align (plist-get props :right-align))
206 (next-x (+ x pad-right width)))
a83ec3c9
CY
207 (push
208 (cond
209 ;; An unsortable column
1241b724
CY
210 ((not (nth 2 col))
211 (propertize label 'tabulated-list-column-name label))
a83ec3c9
CY
212 ;; The selected sort column
213 ((equal (car col) (car tabulated-list-sort-key))
214 (apply 'propertize
215 (concat label
216 (cond
f0809a9d
SM
217 ((> (+ 2 (length label)) width) "")
218 ((cdr tabulated-list-sort-key) " â–²")
a83ec3c9
CY
219 (t " â–¼")))
220 'face 'bold
1241b724 221 'tabulated-list-column-name label
a83ec3c9
CY
222 button-props))
223 ;; Unselected sortable column.
224 (t (apply 'propertize label
1241b724 225 'tabulated-list-column-name label
a83ec3c9 226 button-props)))
6632d361 227 cols)
f0809a9d
SM
228 (when right-align
229 (let ((shift (- width (string-width (car cols)))))
230 (when (> shift 0)
231 (setq cols
232 (cons (car cols)
233 (cons (propertize (make-string shift ?\s)
234 'display
235 `(space :align-to ,(+ x shift)))
236 (cdr cols))))
237 (setq x (+ x shift)))))
6632d361
CY
238 (if (> pad-right 0)
239 (push (propertize " "
f0809a9d 240 'display `(space :align-to ,next-x)
6632d361 241 'face 'fixed-pitch)
f0809a9d
SM
242 cols))
243 (setq x next-x)))
1241b724
CY
244 (setq cols (apply 'concat (nreverse cols)))
245 (if tabulated-list-use-header-line
246 (setq header-line-format cols)
247 (setq header-line-format nil)
248 (set (make-local-variable 'tabulated-list--header-string) cols))))
249
250(defun tabulated-list-print-fake-header ()
251 "Insert a fake Tabulated List \"header line\" at the start of the buffer."
252 (goto-char (point-min))
253 (let ((inhibit-read-only t))
254 (insert tabulated-list--header-string "\n")
255 (if tabulated-list--header-overlay
256 (move-overlay tabulated-list--header-overlay (point-min) (point))
257 (set (make-local-variable 'tabulated-list--header-overlay)
258 (make-overlay (point-min) (point))))
259 (overlay-put tabulated-list--header-overlay 'face 'underline)))
a83ec3c9
CY
260
261(defun tabulated-list-revert (&rest ignored)
262 "The `revert-buffer-function' for `tabulated-list-mode'.
263It runs `tabulated-list-revert-hook', then calls `tabulated-list-print'."
264 (interactive)
265 (unless (derived-mode-p 'tabulated-list-mode)
266 (error "The current buffer is not in Tabulated List mode"))
267 (run-hooks 'tabulated-list-revert-hook)
268 (tabulated-list-print t))
269
6632d361
CY
270(defun tabulated-list--column-number (name)
271 (let ((len (length tabulated-list-format))
272 (n 0)
273 found)
274 (while (and (< n len) (null found))
275 (if (equal (car (aref tabulated-list-format n)) name)
276 (setq found n))
277 (setq n (1+ n)))
278 (or found
279 (error "No column named %s" name))))
280
a83ec3c9
CY
281(defun tabulated-list-print (&optional remember-pos)
282 "Populate the current Tabulated List mode buffer.
283This sorts the `tabulated-list-entries' list if sorting is
284specified by `tabulated-list-sort-key'. It then erases the
285buffer and inserts the entries with `tabulated-list-printer'.
286
287Optional argument REMEMBER-POS, if non-nil, means to move point
288to the entry with the same ID element as the current line."
289 (let ((inhibit-read-only t)
2c070447 290 (entries (if (functionp tabulated-list-entries)
a83ec3c9
CY
291 (funcall tabulated-list-entries)
292 tabulated-list-entries))
293 entry-id saved-pt saved-col)
294 (and remember-pos
295 (setq entry-id (tabulated-list-get-id))
296 (setq saved-col (current-column)))
297 (erase-buffer)
1241b724
CY
298 (unless tabulated-list-use-header-line
299 (tabulated-list-print-fake-header))
f0809a9d 300 ;; Sort the entries, if necessary.
6632d361
CY
301 (when (and tabulated-list-sort-key
302 (car tabulated-list-sort-key))
303 (let* ((sort-column (car tabulated-list-sort-key))
304 (n (tabulated-list--column-number sort-column))
305 (sorter (nth 2 (aref tabulated-list-format n))))
306 ;; Is the specified column sortable?
307 (when sorter
a83ec3c9
CY
308 (when (eq sorter t)
309 (setq sorter ; Default sorter checks column N:
e67a13ab
CY
310 (lambda (A B)
311 (setq A (aref (cadr A) n))
312 (setq B (aref (cadr B) n))
313 (string< (if (stringp A) A (car A))
314 (if (stringp B) B (car B))))))
a83ec3c9
CY
315 (setq entries (sort entries sorter))
316 (if (cdr tabulated-list-sort-key)
317 (setq entries (nreverse entries)))
2c070447 318 (unless (functionp tabulated-list-entries)
a83ec3c9
CY
319 (setq tabulated-list-entries entries)))))
320 ;; Print the resulting list.
321 (dolist (elt entries)
322 (and entry-id
323 (equal entry-id (car elt))
324 (setq saved-pt (point)))
325 (apply tabulated-list-printer elt))
326 (set-buffer-modified-p nil)
327 ;; If REMEMBER-POS was specified, move to the "old" location.
328 (if saved-pt
329 (progn (goto-char saved-pt)
3e26a4a2
CY
330 (move-to-column saved-col)
331 (recenter))
a83ec3c9
CY
332 (goto-char (point-min)))))
333
334(defun tabulated-list-print-entry (id cols)
335 "Insert a Tabulated List entry at point.
336This is the default `tabulated-list-printer' function. ID is a
337Lisp object identifying the entry to print, and COLS is a vector
338of column descriptors."
6632d361
CY
339 (let ((beg (point))
340 (x (max tabulated-list-padding 0))
341 (ncols (length tabulated-list-format))
342 (inhibit-read-only t))
a83ec3c9
CY
343 (if (> tabulated-list-padding 0)
344 (insert (make-string x ?\s)))
6632d361
CY
345 (dotimes (n ncols)
346 (setq x (tabulated-list-print-col n (aref cols n) x)))
a83ec3c9 347 (insert ?\n)
6632d361
CY
348 (put-text-property beg (point) 'tabulated-list-id id)
349 (put-text-property beg (point) 'tabulated-list-entry cols)))
350
351(defun tabulated-list-print-col (n col-desc x)
352 "Insert a specified Tabulated List entry at point.
353N is the column number, COL-DESC is a column descriptor \(see
354`tabulated-list-entries'), and X is the column number at point.
355Return the column number after insertion."
f0809a9d
SM
356 ;; TODO: don't truncate to `width' if the next column is align-right
357 ;; and has some space left.
6632d361
CY
358 (let* ((format (aref tabulated-list-format n))
359 (name (nth 0 format))
360 (width (nth 1 format))
361 (props (nthcdr 3 format))
362 (pad-right (or (plist-get props :pad-right) 1))
f0809a9d 363 (right-align (plist-get props :right-align))
6632d361 364 (label (if (stringp col-desc) col-desc (car col-desc)))
f0809a9d 365 (label-width (string-width label))
6632d361
CY
366 (help-echo (concat (car format) ": " label))
367 (opoint (point))
368 (not-last-col (< (1+ n) (length tabulated-list-format))))
369 ;; Truncate labels if necessary (except last column).
370 (and not-last-col
f0809a9d
SM
371 (> label-width width)
372 (setq label (truncate-string-to-width label width nil nil t)
373 label-width width))
6632d361 374 (setq label (bidi-string-mark-left-to-right label))
f0809a9d
SM
375 (when (and right-align (> width label-width))
376 (let ((shift (- width label-width)))
377 (insert (propertize (make-string shift ?\s)
378 'display `(space :align-to ,(+ x shift))))
379 (setq width (- width shift))
380 (setq x (+ x shift))))
6632d361
CY
381 (if (stringp col-desc)
382 (insert (propertize label 'help-echo help-echo))
383 (apply 'insert-text-button label (cdr col-desc)))
f0809a9d
SM
384 (let ((next-x (+ x pad-right width)))
385 ;; No need to append any spaces if this is the last column.
386 (when not-last-col
387 (when (> pad-right 0) (insert (make-string pad-right ?\s)))
388 (insert (propertize
389 (make-string (- next-x x label-width pad-right) ?\s)
390 'display `(space :align-to ,next-x))))
391 (put-text-property opoint (point) 'tabulated-list-column-name name)
392 next-x)))
6632d361
CY
393
394(defun tabulated-list-delete-entry ()
395 "Delete the Tabulated List entry at point.
396Return a list (ID COLS), where ID is the ID of the deleted entry
397and COLS is a vector of its column descriptors. Move point to
398the beginning of the deleted entry. Return nil if there is no
399entry at point.
400
401This function only changes the buffer contents; it does not alter
402`tabulated-list-entries'."
403 ;; Assume that each entry occupies one line.
404 (let* ((id (tabulated-list-get-id))
405 (cols (tabulated-list-get-entry))
406 (inhibit-read-only t))
407 (when cols
408 (delete-region (line-beginning-position) (1+ (line-end-position)))
409 (list id cols))))
410
411(defun tabulated-list-set-col (col desc &optional change-entry-data)
412 "Change the Tabulated List entry at point, setting COL to DESC.
413COL is the column number to change, or the name of the column to change.
414DESC is the new column descriptor, which is inserted via
415`tabulated-list-print-col'.
416
417If CHANGE-ENTRY-DATA is non-nil, modify the underlying entry data
418by setting the appropriate slot of the vector originally used to
419print this entry. If `tabulated-list-entries' has a list value,
420this is the vector stored within it."
421 (let* ((opoint (point))
422 (eol (line-end-position))
423 (pos (line-beginning-position))
424 (id (tabulated-list-get-id pos))
425 (entry (tabulated-list-get-entry pos))
426 (prop 'tabulated-list-column-name)
427 (inhibit-read-only t)
428 name)
429 (cond ((numberp col)
430 (setq name (car (aref tabulated-list-format col))))
431 ((stringp col)
432 (setq name col
433 col (tabulated-list--column-number col)))
434 (t
435 (error "Invalid column %s" col)))
436 (unless entry
437 (error "No Tabulated List entry at position %s" opoint))
438 (unless (equal (get-text-property pos prop) name)
439 (while (and (setq pos
440 (next-single-property-change pos prop nil eol))
441 (< pos eol)
442 (not (equal (get-text-property pos prop) name)))))
443 (when (< pos eol)
444 (delete-region pos (next-single-property-change pos prop nil eol))
445 (goto-char pos)
446 (tabulated-list-print-col col desc (current-column))
447 (if change-entry-data
448 (aset entry col desc))
449 (put-text-property pos (point) 'tabulated-list-id id)
450 (put-text-property pos (point) 'tabulated-list-entry entry)
451 (goto-char opoint))))
a83ec3c9
CY
452
453(defun tabulated-list-col-sort (&optional e)
454 "Sort Tabulated List entries by the column of the mouse click E."
455 (interactive "e")
456 (let* ((pos (event-start e))
1241b724 457 (obj (posn-object pos)))
a83ec3c9 458 (with-current-buffer (window-buffer (posn-window pos))
1241b724
CY
459 (tabulated-list--sort-by-column-name
460 (get-text-property (if obj (cdr obj) (posn-point pos))
461 'tabulated-list-column-name
462 (car obj))))))
6632d361 463
e5f9458f 464(defun tabulated-list-sort (&optional n)
6632d361
CY
465 "Sort Tabulated List entries by the column at point.
466With a numeric prefix argument N, sort the Nth column."
467 (interactive "P")
468 (let ((name (if n
469 (car (aref tabulated-list-format n))
470 (get-text-property (point)
471 'tabulated-list-column-name))))
472 (tabulated-list--sort-by-column-name name)))
473
474(defun tabulated-list--sort-by-column-name (name)
1241b724 475 (when (and name (derived-mode-p 'tabulated-list-mode))
6632d361
CY
476 ;; Flip the sort order on a second click.
477 (if (equal name (car tabulated-list-sort-key))
478 (setcdr tabulated-list-sort-key
479 (not (cdr tabulated-list-sort-key)))
480 (setq tabulated-list-sort-key (cons name nil)))
481 (tabulated-list-init-header)
482 (tabulated-list-print t)))
a83ec3c9
CY
483
484;;; The mode definition:
485
a83ec3c9
CY
486(define-derived-mode tabulated-list-mode special-mode "Tabulated"
487 "Generic major mode for browsing a list of items.
488This mode is usually not used directly; instead, other major
489modes are derived from it, using `define-derived-mode'.
490
491In this major mode, the buffer is divided into multiple columns,
09e80d9f 492which are labeled using the header line. Each non-empty line
a83ec3c9
CY
493belongs to one \"entry\", and the entries can be sorted according
494to their column values.
495
496An inheriting mode should usually do the following in their body:
497
498 - Set `tabulated-list-format', specifying the column format.
499 - Set `tabulated-list-revert-hook', if the buffer contents need
500 to be specially recomputed prior to `revert-buffer'.
501 - Maybe set a `tabulated-list-entries' function (see below).
502 - Maybe set `tabulated-list-printer' (see below).
503 - Maybe set `tabulated-list-padding'.
504 - Call `tabulated-list-init-header' to initialize `header-line-format'
505 according to `tabulated-list-format'.
506
507An inheriting mode is usually accompanied by a \"list-FOO\"
508command (e.g. `list-packages', `list-processes'). This command
509creates or switches to a buffer and enables the major mode in
510that buffer. If `tabulated-list-entries' is not a function, the
511command should initialize it to a list of entries for displaying.
512Finally, it should call `tabulated-list-print'.
513
514`tabulated-list-print' calls the printer function specified by
515`tabulated-list-printer', once for each entry. The default
516printer is `tabulated-list-print-entry', but a mode that keeps
517data in an ewoc may instead specify a printer function (e.g., one
518that calls `ewoc-enter-last'), with `tabulated-list-print-entry'
519as the ewoc pretty-printer."
520 (setq truncate-lines t)
521 (setq buffer-read-only t)
522 (set (make-local-variable 'revert-buffer-function)
16a43933
CY
523 'tabulated-list-revert)
524 (set (make-local-variable 'glyphless-char-display)
525 tabulated-list-glyphless-char-display))
a83ec3c9
CY
526
527(put 'tabulated-list-mode 'mode-class 'special)
528
529(provide 'tabulated-list)
530
531;; Local Variables:
532;; coding: utf-8
a83ec3c9
CY
533;; End:
534
535;;; tabulated-list.el ends here