idris-mode – Buffer *idris-repl* has no process - emacs

I'm trying to get idris-mode to work. I am using HEAD from both idris-dev and idris-mode. Whenever I execute C-l (idris-load-file) I get this error
Debugger entered--Lisp error: (file-error "make client process failed" "connection refused" :name "Idris Ideslave" :buffer "*idris-connection*" :host "127.0.0.1" :service 0 :nowait nil)
make-network-process(:name "Idris Ideslave" :buffer "*idris-connection*" :host "127.0.0.1" :service 0 :nowait nil)
open-network-stream("Idris Ideslave" "*idris-connection*" "127.0.0.1" 0)
(setq idris-connection (open-network-stream "Idris Ideslave" (idris-buffer-name :connection) "127.0.0.1" port))
.............snipped
Whenever I try M-x idris-repl it states Buffer *idris-repl* has no process.
The result from this thread was to update the projects from git. However I'm using the most up-to-date versions from each project.
edit: running make also fails, but that's probably a different issue. If I manually checkout 0.9.16, make will pass but the same issue above persists.
edit: I do not have this installed locally, I am running it out of a cabal sandbox. In idris-settings.el I changed idris-interpreter-path to the full path of idris. Also, when I run idris outside of emacs I get errors about not finding prelude or builtins. If I add -i path/to/idris/libs/prelude then everything works. But adding "-i path/to/idris/libs/prelude" to idris-interpreter-flags in idris-settings.el does not help

I've sort of solved this. For idris-interpreter-flags you must give each actual argument as a separate string (which is common, I should have known). So, if I set idris-interpreter-flags to '("-i" "/path/to/idris/libs/prelude") then all is good. So I have to add the path for each of the libraries' directories that idris comes with.
How does this work? Is this normal to require? Is it because I'm not running this as a true cabal installed package that it doesn't pick up on the libraries?

Related

emacs listing packages error in process sentinel

I'm new to emacs, have installed emacs26, and I use a proxy server. When I tried to add packages it is showing this error:
error in process sentinel:
Error retrieving: https://elpa.gnu.org/packages/archive-contents (error connection-failed "failed with code 110" :host "elpa.gnu.org" :service 443)
I added the following code:
(setq url-proxy-services
'(("no_proxy" . "^\\(localhost\\|172.16.2.30\\)")
("http" . "localhost:8080")
("https" . "localhost:8080")))
But I still get the same error.
It appears that
(custom-set-variables
'(gnutls-algorithm-priority "normal:-vers-tls1.3"))
fixes the problem.
Cf. https://emacs.stackexchange.com/a/56067/795

Emacs autocomplete error : running timer

I tryed to install autocomplete mode for emacs, downloaded it from the elpa repository, with
M-x list-packages
And when I try it, the mode gives me an error
Error running timer ‘ac-update-greedy’: (error "Keyword argument :max-width not one of (:min-height :around :face :mouse-face :selection-face :scroll-bar :margin-left :margin-right :symbol :parent :parent-offset :keymap)")
Error running timer ‘ac-show-menu’: (error "Keyword argument :max-width not one of (:min-height :around :face :mouse-face :selection-face :scroll-bar :margin-left :margin-right :symbol :parent :parent-offset :keymap)")
And it fails even if I don't load each other mod. Even If I manually run
M-x auto-complete-mode
Where can this error come from ?
Ok, I found the answer. So I'll just post it there in case somebody is in the same situation,
The problem came from popup.el, a required package for auto-complete.
I downloaded the sources, recompiled them, and added the new popup.el in my mod folder
And it worked !

How should I configure Vulkan for cider-jack-in?

I'm working through the newly released Vulkan Tutorial in Clojure with CIDER, and I've hit a bit of a snag. The example makefile project works perfectly, but I'm having trouble translating it into Clojure.
My build.boot file just specifies the :source-paths and adds LWJGL as a dependency:
(set-env!
:source-paths #{"src"}
:dependencies
(let [lwjgl-version "3.0.0"]
[['org.lwjgl/lwjgl lwjgl-version]
['org.lwjgl/lwjgl-platform lwjgl-version :classifier "natives-linux"]]))
Then, in src/example/core.clj, I have an extension-count function that uses vkEnumerateInstanceExtensionProperties as demonstrated in the original example:
(ns example.core
(:import (org.lwjgl.vulkan VK10)))
(defn extension-count []
(let [^String layer-name nil
property-count (int-array 1)]
(VK10/vkEnumerateInstanceExtensionProperties layer-name property-count nil)
(first property-count)))
Now, from Bash, I can set the relevant environment variables LD_LIBRARY_PATH and VK_LAYER_PATH as I start up a REPL:
$ VULKAN_SDK_PATH=~/VulkanSDK/1.0.21.1/x86_64 LD_LIBRARY_PATH=$VULKAN_SDK_PATH/lib VK_LAYER_PATH=$VULKAN_SDK_PATH/etc/explicit_layer.d boot repl
boot.user=> (require '[example.core :refer [extension-count]])
nil
boot.user=> (extension-count)
4
As you can see, everything works correctly. But of course, when I use cider-jack-in by C-c M-j instead, I get an UnsatisfiedLinkError because CIDER isn't setting those variables:
boot.user> (import (java.util.function Consumer)
(org.lwjgl.system Configuration))
org.lwjgl.system.Configuration
boot.user> (Configuration/setDebugStreamConsumer
(reify Consumer
(accept [_ message]
(println message))))
nil
boot.user> (require '[example.core :refer [extension-count]])
nil
boot.user> (extension-count)
[LWJGL] Failed to load a library. Possible solutions:
a) Set -Djava.library.path or -Dorg.lwjgl.librarypath to the directory that contains the shared libraries.
b) Add the JAR(s) containing the shared libraries to the classpath.
[LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics.
java.lang.UnsatisfiedLinkError: Failed to locate library: libvulkan.so.1
Am I supposed to be setting java.library.path or org.lwjgl.librarypath, as suggested in the above error message, instead of LD_LIBRARY_PATH? I can set either of those variables from profile.boot:
(System/setProperty
"java.library.path"
(str (System/getProperty "user.home") "/VulkanSDK/1.0.21.1/x86_64/lib"))
Now when I try C-c M-j again, it works:
boot.user> (require '[example.core :refer [extension-count]])
nil
boot.user> (extension-count)
4
However, this still doesn't let me set VK_LAYER_PATH, which will be fairly important in the future:
We will start using validation layers in Vulkan and you need to tell the Vulkan library where to load these from using the VK_LAYER_PATH variable:
test: VulkanTest
LD_LIBRARY_PATH=$(VULKAN_SDK_PATH)/lib VK_LAYER_PATH=$(VULKAN_SDK_PATH)/etc/explicit_layer.d ./VulkanTest
How can I set these environment variables for cider-jack-in? I'd prefer not to have to manually configure CIDER's dependencies for a standalone repl in a separate terminal and then connect to it using cider-connect, but if there's no other option here, I guess that's what I'll have to do.

Flycheck-Google-Cpplint is not Configured Correctly

I am trying to install flycheck-google-cpplint in my emacs. But I get this error:
(flycheck-mode 1)
(eval-after-load 'flycheck
'(progn
(require 'flycheck-google-cpplint)
(flycheck-add-next-checker 'c/c++-cppcheck
'c/c++-googlelint 'append)))
(custom-set-variables
'(flycheck-googlelint-verbose "3")
'(flycheck-googlelint-filter "-whitespace,+whitespace/braces"))
But this does not work. I get the following error:
Error: (user-error "Configured syntax checker c/c++-googlelint cannot be used")
I don't know why. I installed cpplint and it works fine if I used it from the command line. Any suggestion?
flycheck-google-lint uses cpplint. You have to tell emacs where to find the cpplint.py executable in order to run the syntax check.
You can find the cpplint file here.
Then, you need to add this to your init emacs file:
(custom-set-variables
'(flycheck-c/c++-googlelint-executable "/path/to/cpplint.py"))

Emacs tramp errors

When I try to open a file on another machine using tramp 2.1.9, it logs me into the machine and shows the file, but then this appears in the minibuffer:
File mode specification error: (wrong-number-of-arguments #[(filename) "\306^H!\205!^#\307^H!^Y\310 !^Z\311 !^[\312 !^\\313 !^]\314
^K^L\315$-\207" [filename v method user host localname tramp-tramp-file-p tramp-dissect-file-name tramp-file-name-method tramp-file-name-user tramp-file-name-host tramp-file-name-localname tramp-make-tramp-file-name ""] 5 ("/usr/local/share/emacs/s\
ite-lisp/tramp.elc" . 133124)] 3)
Directory-local variables error: (wrong-number-of-arguments #[(filename) "\306^H!\205!^#\307^H!^Y\310 !^Z\311 !^[\312 !^\\313 !^]\314
^K^L\315$-\207" [filename v method user host localname tramp-tramp-file-p tramp-dissect-file-name tramp-file-name-method tramp-file-name-user tramp-file-name-host tramp-file-name-localname tramp-make-tramp-file-name ""] 5 ("/usr/local/share/emacs/s\
ite-lisp/tramp.elc" . 133124)] 3)
Error: (wrong-number-of-arguments #[(filename) \306^H!\205!^#\307^H!^Y\310 !^Z\311 !^[\312 !^\\313 !^]\314
^K^L\315$-\207 [filename v method user host localname tramp-tramp-file-p tramp-dissect-file-name tramp-file-name-method tramp-file-name-user tramp-file-name-host tramp-file-name-localname tramp-make-tramp-file-name ] 5 (/usr/local/share/emacs/site-\
lisp/tramp.elc . 133124)] 3)
And I can't move around the file. Anyone experienced this? The only tramp-related lines in my .emacs file are:
(require 'tramp)
(setq tramp-default-method "ssh")
It looks like your shell prompt is appearing in that error string. If the remote shell prompt is an issue, I'm a little surprised that tramp gets as far as loading the file. But, one easy way to diagnose whether the remote shell prompt is an issue is to temporarily move aside your .bashrc (or whatever shell customizations you have that /bin/sh would load).
Here's the tramp manual on remote shell setup.
As for a solution (if the prompt is an issue), I have accumulated a set of conditions for falling back to a simple prompt (but I no longer recall which tests are used to avoid particular issues).
if [ "$TERM" == "vt100" -o "$TERM" == "dumb" -o "$EMACS" == "t" ]; then
export PS1="\h [\W]> "
else
...set fancy prompt here...
fi
(I also test for ! -z "$PS1" before doing any shell customizations, but I'm pretty sure the tramp shell is interactive.)