diff options
author | Mark Oteiza <mvoteiza@udel.edu> | 2017-09-15 22:59:57 -0400 |
---|---|---|
committer | Mark Oteiza <mvoteiza@udel.edu> | 2017-09-15 23:18:54 -0400 |
commit | 30c955b1725258546c6152a6dda8f634867a6319 (patch) | |
tree | 0c8d80822d4a1eee1dee55a4b24decc58e1dbe0e /lisp/emacs-lisp | |
parent | 767b3a7429d94d1565256565fda2060c95ca4f73 (diff) | |
download | emacs-30c955b1725258546c6152a6dda8f634867a6319.tar.gz emacs-30c955b1725258546c6152a6dda8f634867a6319.tar.bz2 emacs-30c955b1725258546c6152a6dda8f634867a6319.zip |
Use cl-print in timer list
* lisp/emacs-lisp/timer-list.el (timer-list): Use cl-print
for handling functions.
(timer-list-mode): Capitalize major mode name. Set bidi direction
as in tabulated-list-mode.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/timer-list.el | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/lisp/emacs-lisp/timer-list.el b/lisp/emacs-lisp/timer-list.el index 5d00fb290f9..44a315f9806 100644 --- a/lisp/emacs-lisp/timer-list.el +++ b/lisp/emacs-lisp/timer-list.el @@ -35,9 +35,7 @@ (dolist (timer (append timer-list timer-idle-list)) (insert (format "%4s %10s %8s %s" ;; Idle. - (if (aref timer 7) - "*" - " ") + (if (aref timer 7) "*" " ") ;; Next time. (let ((time (float-time (list (aref timer 1) (aref timer 2) @@ -59,16 +57,9 @@ (t (format "%s" repeat)))) ;; Function. - (let ((function (aref timer 5))) - (replace-regexp-in-string - "\n" " " - (cond - ((byte-code-function-p function) - (replace-regexp-in-string - "[^-A-Za-z0-9 ]" "" - (format "%s" function))) - (t - (format "%s" function))))))) + (let ((cl-print-compiled 'static) + (cl-print-compiled-button nil)) + (cl-prin1-to-string (aref timer 5))))) (put-text-property (line-beginning-position) (1+ (line-beginning-position)) 'timer timer) @@ -88,8 +79,9 @@ ["Cancel" timer-list-cancel t])) map)) -(define-derived-mode timer-list-mode special-mode "timer-list" +(define-derived-mode timer-list-mode special-mode "Timer-List" "Mode for listing and controlling timers." + (setq bidi-paragraph-direction 'left-to-right) (setq truncate-lines t) (buffer-disable-undo) (setq-local revert-buffer-function 'timer-list) |