Commits

Anonymous committed 23af4a9

lisputils: using fboundp test for read-directory-name

  • Participants
  • Parent commits 4771d6e

Comments (0)

Files changed (1)

File ropemacs/lisputils.py

         values = [[value, value] for value in values]
     if exact and default is not None:
         prompt = prompt + ('[%s] ' % default)
-    result = lisp["ropemacs-completing-read-function"].value()(prompt, values,
-                                                               None, exact, starting)
+    reader = lisp['ropemacs-completing-read-function'].value()
+    result = reader(prompt, values, None, exact, starting)
     if result == '' and exact:
         return default
     return result
 def ask_directory(prompt, default=None, starting=None):
     if default is not None:
         prompt = prompt + ('[%s] ' % default)
-    if _emacs_version() < 22:
+    if lisp.fboundp(lisp['read-directory-name']):
+        result = lisp.read_directory_name(prompt, starting, default)
+    else:
         result = lisp.read_file_name(prompt, starting, default)
-    else:
-        result = lisp.read_directory_name(prompt, starting, default)
     if result == '' and default is not None:
         return default
     return result