summaryrefslogtreecommitdiff
path: root/lisp/ls-lisp.el
diff options
context:
space:
mode:
authorTino Calancha <tino.calancha@gmail.com>2017-07-25 14:53:44 +0900
committerTino Calancha <tino.calancha@gmail.com>2017-07-25 14:53:44 +0900
commit565cfd9f6c19e4d2aa318efdf19bdc56175bd153 (patch)
treeff6634e072243860a154841d04cb4f86942b081e /lisp/ls-lisp.el
parent35954cb92b8cd4ad093756d171688343bab02c2e (diff)
downloademacs-565cfd9f6c19e4d2aa318efdf19bdc56175bd153.tar.gz
emacs-565cfd9f6c19e4d2aa318efdf19bdc56175bd153.tar.bz2
emacs-565cfd9f6c19e4d2aa318efdf19bdc56175bd153.zip
ls-lisp: Add an unload function and enable lexical binding
Enable lexical binding. * lisp/ls-lisp.el (ls-lisp-unload-function): New defun. * test/lisp/ls-lisp.el (ls-lisp-unload): Add test.
Diffstat (limited to 'lisp/ls-lisp.el')
-rw-r--r--lisp/ls-lisp.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index b368efbbc95..730ba26c6c8 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -1,4 +1,4 @@
-;;; ls-lisp.el --- emulate insert-directory completely in Emacs Lisp
+;;; ls-lisp.el --- emulate insert-directory completely in Emacs Lisp -*- lexical-binding: t -*-
;; Copyright (C) 1992, 1994, 2000-2017 Free Software Foundation, Inc.
@@ -866,6 +866,12 @@ All ls time options, namely c, t and u, are handled."
file-size)
(format " %6s" (file-size-human-readable file-size))))
+(defun ls-lisp-unload-function ()
+ "Unload ls-lisp library."
+ (advice-remove 'insert-directory #'ls-lisp--insert-directory)
+ ;; Continue standard unloading.
+ nil)
+
(provide 'ls-lisp)
;;; ls-lisp.el ends here