Emacs Lisp: Should Directory Name Ends in a Slash?

Master emacs+lisp, benefit for life. Testimonials. Thank you for support.

In emacs lisp, dir path should end in a slash.

when your command query user for dir path, user may not add the ending slash. Your program can add it, like this:

(setq inputDir (file-name-as-directory inputDir) ) ; normalize dir path

calling file-name-as-directory is better than writing code to check and append slash yourself.

(info "(elisp) Directory Names")

Like what you read?
Buy Xah Emacs Tutorial
or share some
blog comments powered by Disqus