8000 fsharp-mode-project-root breaks when the file doesn't exist · Issue #340 · fsharp/emacs-fsharp-mode · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
fsharp-mode-project-root breaks when the file doesn't exist #340
Open
@catern

Description

@catern

Description

fsharp-mode adds fsharp-mode-project-root to project-find-functions, which is run by project-current. Such functions should return nil if they can't find a project; otherwise, they make cause project-current as a whole to error.

This causes Emacs to break if e.g. there's a buffer visiting a file which hasn't yet been created.

Repro steps

Please provide the steps required to reproduce the problem

  1. M-: (fsharp-mode-project-root "/non/existent")

Expected behavior

It should return nil as is the project-find-functions spec

Actual behavior

It errors:

Debugger entered--Lisp error: (file-missing "Opening directory" "No such file or directory" "/non")
  directory-files("/non/" full ".*\\.sln$")
  fsharp-mode-search-upwards(".*\\.sln$" "/non/")
  fsharp-mode/find-sln("/non/existent")
  fsharp-mode/find-sln-or-fsproj("/non/existent")
  fsharp-mode-project-root("/non/existent")
  eval((fsharp-mode-project-root "/non/existent") t)
  eval-expression((fsharp-mode-project-root "/non/existent") nil nil 127)
  funcall-interactively(eval-expression (fsharp-mode-project-root "/non/existent") nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0