Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selectrum-read-directory-name with no optional arguments errors #91

Closed
andyleejordan opened this issue May 16, 2020 · 4 comments
Closed

Comments

@andyleejordan
Copy link
Contributor

Hello,

I happened upon a bug with a package that was trying to ask for a directory, and it turns out I can repro it with this:

;; Run with `emacs -Q -l test.el'.

;;; Code:
(message (emacs-version))
(toggle-debug-on-error)

;; Typical `package.el' setup with Melpa:

;; (require 'package)
;; (add-to-list 'package-archives
;;              '("melpa" . "https://melpa.org/packages/") t)
;; (package-initialize)
;; (package-refresh-contents)

;; Or typical `straight.el' setup:
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

;; Insert repro code here:
(straight-use-package 'selectrum)
(selectrum-read-directory-name "Dir: ")

(provide 'test)
;;; test.el ends here
GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.2.0, NS appkit-1671.20 Version 10.14.3 (Build 18D109)) of 2019-09-02

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  directory-file-name(nil)
  (let ((dir (expand-file-name (or dir default-directory))) (default (directory-file-name (or default-dirname initial dir)))) (setq dir (or (file-name-directory (directory-file-name default)) dir)) (selectrum-read-file-name prompt dir (file-name-as-directory (file-name-nondirectory default)) mustmatch nil (function file-directory-p)))
  selectrum-read-directory-name("Dir: ")
  eval-buffer(#<buffer  *load*> nil "/Users/andschwa/.emacs.d/etc/test.el" nil t)  ; Reading at buffer position 1803
  load-with-code-conversion("/Users/andschwa/.emacs.d/etc/test.el" "/Users/andschwa/.emacs.d/etc/test.el" nil t)
  load("/Users/andschwa/.emacs.d/etc/test.el" nil t)
  command-line-1(("-l" ".emacs.d/etc/test.el"))
  command-line()
  normal-top-level()

I'm not quite sure what's going on yet.

This is at commit 392fb1b.

@clemera
Copy link
Collaborator

clemera commented May 16, 2020

Thanks! I looked at this and the let in selectrum-read-directory-name needs to be converted to let*

@andyleejordan
Copy link
Contributor Author

Cool, thanks for investigating @clemera!

@raxod502
Copy link
Member

Fixed. Thanks for looking at it!

@raxod502 raxod502 added the waiting on response Needs more info or follow-up, will be closed after 90 days if no response label May 17, 2020
@andyleejordan
Copy link
Contributor Author

Confirmed fixed. Thank you!

@raxod502 raxod502 removed the waiting on response Needs more info or follow-up, will be closed after 90 days if no response label May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants