Fork me on GitHub
#emacs
<
2024-05-28
>
andrea.crotti12:05:46

working with stupidly big json files & co means that every time I accidentally try to paste something too big it will still pretty much crash my Emacs. I was wondering, should not there be a setting that just not allow me to paste something too big? I never really want to paste in 1MB of JSON in a buffer anyway, could Emacs just refuse?

djm12:05:53

There might be better solutions, but I think you could do something with advice. E.g. This code indents yanked code, if it’s not too large: https://github.com/bbatsov/prelude/blob/master/core/prelude-editor.el#L285-L308 So you could delete it instead (or something similar that stops it from being inserted in the first place, if possible)

oyakushev12:05:41

Do you use CIDER from melpa or from melpa-stable?

oyakushev12:05:14

Ah, sorry, misread the question. It is about yanking, not about evaluation results.

andrea.crotti13:05:49

yeah just yanking of massive amount of texts

tomd14:05:04

I expect what's making emacs crash is the major mode trying to process all that text. https://elpa.gnu.org/packages/so-long.html can avoid that. I have it globally enabled. It may make it so you can undo the paste.

daveliepmann15:05:33

it's a long shot, but what version of emacs are you on? thinking of https://lars.ingebrigtsen.no/2022/08/19/19x10/ which made it into core a while back

andrea.crotti16:05:32

yeah it's not that, it's just that they are really massive

andrea.crotti16:05:43

but ok I've tried to enable so-long as well

Pablo15:05:09

Originally asked in #C053AK3F9, but there was not response in a day, so trying here in #C099W16KZ Hi, I just installed https://github-com.translate.goog/copilot-emacs/copilot.el but I’m constantly spammed with this error:

⛔ Warning (copilot): copilot--infer-indentation-offset found no mode-specific indentation offset.
That’s because I need to define indentation for Clojure. There are some defaults:
(defcustom copilot-indentation-alist
  (append '((latex-mode tex-indent-basic)
            (nxml-mode nxml-child-indent)
            (python-mode python-indent py-indent-offset python-indent-offset)
            (python-ts-mode python-indent py-indent-offset python-indent-offset)
            (web-mode web-mode-markup-indent-offset web-mode-html-offset))
          editorconfig-indentation-alist)
  "Alist of `major-mode' to indentation map with optional fallbacks."
  :type '(alist :key-type symbol :value-type (choice integer symbol))
  :group 'copilot)
Is clojure-align equivalent to what is defined on other languages? Is there an editorconfig-indentation-alist somewhere that includes Clojure, Elisp, ...?

Akiz05:05:21

If you come up with a solution, please post it here.

cddr18:05:19

I'd try lisp-indent.

Onur Yazgan10:07:09

hey @UNUH8H85U, I'm having the same problem. Were you able to figure this out?

cddr12:07:19

Did you try lisp-indent?

Onur Yazgan13:07:02

yeah, no luck unfortunately.

Pablo20:05:09

Is clojure-mode child of lisp-mode?

vemv20:05:42

provided-mode-derived-p can answer that 🙂

Pablo20:05:02

How can I call it?

vemv20:05:16

M-: (provided-mode-derived-p 'clojurescript-mode 'clojure-mode)

vemv20:05:28

Or M-x ielm to fireup an Elisp repl

Pablo20:05:02

Thanks 😄

🍻 1
nivekuil22:05:02

C-h m calls describe-mode , that's how I would find the answer

💯 1
1