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

windows 10 nimsuggest failing, a simple fix #238

Open
cark opened this issue Aug 27, 2021 · 0 comments
Open

windows 10 nimsuggest failing, a simple fix #238

cark opened this issue Aug 27, 2021 · 0 comments

Comments

@cark
Copy link

cark commented Aug 27, 2021

  • OS: windows 10
  • emacs : 27.1
  • nim : 1.4.4
  • nimsuggest : hum no idea ... it says 1.4.4 but it looks like coming from nim.exe ? The one coming with nim.
  • nim-mode : the latest from elpa
  • messages : none
  • read the readme : yes
  • related to nim-suggest : yes
  • nim-mode works without nimsuggest-mode

Problem statement:
I couldn't make nim-mode work with nimsuggest. Nimsuggest was timing out.
It was unable to find the temporary copy of my source code in the temp directory.
In my case this path looks something like this :
C:\Users\carkh\AppData\Local\Temp\emacs-nim-mode\00000000056b84a0\f:/home/cara/Nim/capture/src

Looking at nim-suggest.el, in the nimsuggest--get-temp-file-name function,
in response to bug 119, we're replacing the colon in this path with U+A789 (a colon looking unicode character).

I changed this replaced character to a simple asscii 's' character, and now it works.

  • Why does it not work with the unicode character ? I don't know.
  • Why change it specifically to an 's' character ? It doesn't matter which character we're using, there is only one colon in the string, always at the same position. As long as it always is the same character, it doesn't matter which one we're using. There cannot be any collision as we're always replacing a colon

So here is the change :

(defun nimsuggest--get-temp-file-name ()
  "Get temp file name."
  (mapconcat 'directory-file-name
             `(,(nimsuggest--get-dirty-dir)
               ,(cl-case system-type
                  ((ms-dos windows-nt cygwin)
                   ;; For bug #119, convert ":" to "꞉" (U+A789)
                   (concat "/"
                           (replace-regexp-in-string
                            ":" "s";;(char-to-string #xA789) <---- change is on this line
                            buffer-file-name)))
                  (t ; for *nix system
                   buffer-file-name)))
             ""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant