This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-16
Channels
- # announcements (7)
- # babashka (8)
- # beginners (48)
- # calva (4)
- # cider (6)
- # circleci (2)
- # clj-commons (14)
- # clj-kondo (3)
- # clj-on-windows (7)
- # cljs-dev (34)
- # clojure (49)
- # clojure-dev (25)
- # clojure-europe (48)
- # clojure-losangeles (1)
- # clojure-nl (4)
- # clojure-norway (33)
- # clojure-uk (2)
- # clojurescript (37)
- # community-development (5)
- # conjure (17)
- # cursive (2)
- # data-science (1)
- # editors (10)
- # emacs (50)
- # events (22)
- # honeysql (11)
- # introduce-yourself (1)
- # jobs-discuss (13)
- # lsp (42)
- # malli (9)
- # off-topic (7)
- # pathom (11)
- # portal (5)
- # re-frame (3)
- # reagent (22)
- # reitit (8)
- # reveal (1)
- # rewrite-clj (4)
- # shadow-cljs (38)
- # xtdb (21)
namely, I cannot complete (System/g|) for example in the buffer, but it will complete in the cider REPL buffer
Are you using clojure-lsp? I’m not sure if it supports Java method completions yet, and with (clojure +lsp) in init.el, it now disables cider completion in Clojure buffers in favor of just lsp. It’s kinda frustrating when doing interop work so I wrote a function to toggle between cider and lsp completion. Can’t guarantee it works 100%.
(defun jk/toggle-cider-completion ()
"Toggle between lsp-mode and cider-mode completion in the current buffer."
(interactive)
(if (-contains-p completion-at-point-functions #'cider-complete-at-point)
(progn
(remove-hook 'completion-at-point-functions #'cider-complete-at-point t)
(add-hook 'completion-at-point-functions #'lsp-completion-at-point nil t))
(progn
(add-hook 'completion-at-point-functions #'cider-complete-at-point nil t)
(remove-hook 'completion-at-point-functions #'lsp-completion-at-point t))))
If you’re configuring clojure-lsp manually then I would imagine that you’d get both completions by default. Doom explicitly disables cider completions but only with +lsp afaik. It may be that they’re clobbering each other somehow, yeah.
hmmm, thanks for your help. will try to explicitly turn off lsp’s completions, though i guess i was hoping for both to work magically together 🙂
No problem. If you find a good solution please share :) I’ve been doing a lot of interop lately and this workaround was my quick solution. You could try to describe-variable on completion-at-point-functions to see if cider is there or if it’s being removed somehow
So I guess lsp-mode is disabling cider completion. I wish there was an easy way to get the best of both worlds…
it may also just be the order that the modes are loaded in or how i have my hooks executing
so perhaps lsp doesn’t actively disable cider completion, it just sets itself up to handle completion
calva tries to use both, fwiw, but doesn't surprise me that the clojure module leans hard on lsp when it's enabled. I don't actually use company mode myself
also, fwiw @U06DQC6MA there's a #doom-emacs channel
I think you can get the best of both worlds with https://github.com/minad/cape. Something like
(setq-local completion-at-point-functions (list (cape-super-capf #'cider-complete-at-point
#'lsp-completion-at-point)))
to set it up temporarily in the current buffer. (May or maybe not do anything useful in Doom)I am getting really weird behavior from moving my mouse in the terminal. I think this is emacs misinterpreting escape sequences it is getting? Here is a gif of me just moving my mouse, no keypresses or anything. It just starts inserting "M" and ";" and random numbers.
I think this started when I updated emacs. I have (xterm-mouse-mode 1)
. My term is set to xterm-256color
.
Anyone run into this issue? Any idea how to fix it?
which terminal? And can you try in another terminal? (i have no idea but what a fascinating bug)
MacOS terminal. Will try iterm2
@U5K8NTHEZ I have had the same problem since some recent upgrade of something (emacs? iterm? not sure). So has @U0GTWEP96. Neither of us has found a solution yet (except to disable xterm-mouse-mode
which is not really a solution). If you figure it out please let me know!
Must be emacs since I don't use iterm
Yep. I can recreate in iterm
So happy to hear others are having the problem!
Yes, I get it in all terminal emulators so must not be iterm.
It happened at the same time that the values reported by M-x list-colors-display
changed (I know because it broke my color theme). I used to have 256 colors with names like color102
. Now I have 556 colors with names like lightsalmon3
. I suspect a relationship but I don’t know enough about Emacs and ANSI color stuff to say for sure.
Yes, my color scheme broke as well
What would be the steps to reproduce? Run emacs in terminal, M-x xterm-mouse-mode and start moving the mouse? I'd like to try and reproduce.
It is hard for me to make a minimal reproducible case. Because the gif is the exception it usually doesn't happen that frequently. I can get it to happen in different modes, different files etc. One thing that seems to make it happen more often is doing a cider jack-in on a clojure repl. This is emacs init.el btw https://github.com/jimmyhmiller/dotfiles/blob/master/.emacs.d/init.el
@U02DNF3TW3E it only happens in Clojure buffers (including CIDER repls) for me.
Doing some testing, I can get it to work in other modes, but only after a cider jack-in has been run in my emacs session.
It might have something with cider or emacs-mode and not necessarily with emacs. I can't reproduce starting emacs with -Q
but I haven't tried loading cider with an emacs instance started with -Q
. I'll try later.
Yes it does seem to be cider. At the very least, as soon as I cider-jack-in I can reliably recreate it.
If you do c-h k
and move the mouse around, you can see how the coordinates are sent for the mouse. Those seem to somehow be making their way into the buffer and misunderstood.
Wow this is a fascinating bug. I haven't experienced this issue but I'll be watching to see what the cause is. 🍿
I'm running emacs -Q -nw
in a terminal (alacritty) in Ubuntu and eval'ed the following code:
(let ((frame-background-mode 'dark))
(frame-set-background-mode nil))
(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
""
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)
(use-package clojure-mode)
(use-package cider)
Feel free to ignore the straight.el
parts. I then M-x xterm-mouse-mode
and M-x cider-jack-in
move my mouse like crazy and can't reproduce 😞 I was kinda hoping that I could see it in my computer.I see 256 colors. Is there other information you need from that command?
@U02DNF3TW3E I ran your commands and evaled that and was able to recreate it. So maybe its a mac thing?
Maybe. I have a mac M1 available I'll try to replicate there as well.
Unfortunately I was unable to replicate on Mac either. MacOS Monterey w/ Emacs 29 (self compiled) running in Alacritty as terminal. Sorry I’m not of much help.
Jimmy: thanks. I had this hypothesis that this problem was related to a change in color space, because I thought I was seeing ANSI color codes, but if you still have 256 colors it sounds like probably not. I think your explanation of mouse movement cursor control codes making it into the buffer makes more sense.
I did some debugging here, and I think it is caused by something that changed in emacs 28. Using cider 1.5.0 & clojure-mode 5.15.1, I can recreate this in emacs 28.1 (only after running cider-jack-in
) , but can't in emacs 27.1. I'm on linux.
Though using @U02DNF3TW3E’s code above and starting emacs with -Q (with the addition of (xterm-mouse-mode 1)
), I can't recreate it. So it may be from an interaction with some other package I have installed.
@U06SGCEHJ that sounds right to me. I have another Mac that is still on 27 that had no problems.