geza42

joined 1 year ago
[–] geza42@alien.top 1 points 11 months ago

I simply use:

(defun my-recompile-init-eln ()
  (interactive)
  (byte-compile-file "~/.emacs.d/early-init.el")
  (native-compile "~/.emacs.d/early-init.el")
  (byte-compile-file "~/.emacs.d/init.el")
  (native-compile "~/.emacs.d/init.el"))

I use it manually, but I don't care too much because I don't edit my init files too often anymore. But it shouldn't be too hard to run this function automatically at boot if the .elc is outdated compared to the .el.

[–] geza42@alien.top 1 points 11 months ago

That is not true. There are some features which makes only the GUI version slower, but it's definitely not "almost always" that the GUI is the reason. There are a lot of features/packages which makes Emacs slower in general, no matter GUI/TUI.

So profiling, or bisecting the init file can be used find out the problem.

[–] geza42@alien.top 2 points 11 months ago (3 children)

I also had this, git-gutter caused it. I switched to hl-diff, it doesn't have this problem.

[–] geza42@alien.top 1 points 11 months ago (4 children)

"In my experience Emacs simply isn't a very good terminal to run a shell in anyway"

Do you know about vterm and eat? If yes, what is the problem with these?

[–] geza42@alien.top 1 points 11 months ago (1 children)

This has nothing to do with the diff program. Ediff is not able to highlight whitespace differences like it highlights non-whitespace differences. Maybe it is possible to do somehow, but by default, whitespace differences generate a diff region with no highlights (or as ediff calls it, refinements).

It is because highlights are done on word level, and whitespaces are not words.

[–] geza42@alien.top 1 points 11 months ago

Emacs has electric-indent-chars. Whenever a character in this set is pressed, Emacs re-indents the current line. And as the indentation calculation is not perfect, it can happen that when you create a new line, its indentation calculated incorrectly, and during editing you press some electric-indent-char, which then re-indents the line.

[–] geza42@alien.top 1 points 1 year ago

For minibuffer completion, I created this, kind of works, but if there is an already developed, fully working solution, I'd rather use that. And I'm still interested in for a solution to use in a normal buffer that corfu could use.

(defun my-consult-fd-string (&optional dir initial)
  (interactive "P")
  (setq this-command 'consult-fd)
  (pcase-let* ((`(,prompt ,paths ,dir) (consult--directory-prompt "Fd" dir))
	   (default-directory dir)
	   (builder (consult--fd-make-builder paths)))
(concat dir (consult--find prompt builder initial))))

(defun my-consult-insert-fd-string ()
  (interactive)
  (insert
   (abbreviate-file-name
(let ((f (bounds-of-thing-at-point 'filename)))
  (if f
      (let ((r (my-consult-fd-string (buffer-substring-no-properties (car f) (cdr f)) nil)))
	(delete-region (car f) (cdr f))
	r)
    (my-consult-fd-string t nil))))))
(define-key minibuffer-local-map (kbd "M-f") 'my-consult-insert-fd-string)
 

Is there a solution for inserting a filename to a buffer (either to a normal buffer, or to the minibuffer) using a recursive fuzzy search, using the vertico + consult + corfu + cape ecosystem? Something like what consult-file does, but instead of opening the selected file, insert the path of it to a buffer.

We have cape-file, but it doesn't fuzzy search in a recursive way.

[–] geza42@alien.top 1 points 1 year ago

I think one has to be pragmatic, and only put effort to features that are actually useful. Don't put hours writing an elisp function which only saves you 10 seconds in a month. I'm saying this, because I had to stop myself from spending time on Emacs. I realized that my config is OK for me. I still have a lot of ideas how to make it better, but I simply don't do them, because it doesn't matter too much. Of course, I still do smaller tweaks, but otherwise I spend my time on more useful things. If someone had told me this before I started using emacs, they would have saved several days of not-too-useful emacs configuration for me. Of course, it was fun, I did it as a hobby, but still, it wasn't the smartest way to spend my free time.

[–] geza42@alien.top 1 points 1 year ago

There is evil-textobj-anyblock which does a similar thing (you can configure evil-textobj-anyblock-blocks to only use quotes, if you don't like that by default it uses all kinds of blocks)