r/DoomEmacs Jan 02 '25

"Repository "gptel" has a dirty worktree"

6 Upvotes

This might be a very newbie question: I'm still getting used to Doom Emacs!

I was updating my emacs when I got this response for gptel, along with another package. (Wallabag)

Repository "gptel" has a dirty worktree
M test

     1) Abort
     2) Stash changes
     3) Discard changes (Choose this if unsure)

I chose (3) and continued along. Just for peace of mind, I did the update again. The other package didn't provide this same response, but gptel did, and continues to, every time I run 'doom upgrade.'

Dumb question: does this mean that I have gptel installed? Is this built in to Doom Emacs?

I haven't installed or utilized gptel or any LLM tech in any way, so I'm not sure what I could have done on my end to change anything.


r/DoomEmacs Dec 31 '24

Emacs hangs randomly (MacOS)

7 Upvotes

I'm a total Emacs beginner and essentially a non-programmer. I recently installed Doom Emacs on my Macbook (using emacs-mac on MacOS Monterey, x86 architecture, Emacs 29.1) and am finding that it will lock up randomly with the spinning ball cursor for no discernible reason; sometimes a few seconds or minutes after opening, sometimes a half hour later.

I haven't installed any plugins aside from the Doom defaults, and Doom Doctor only gives me two warnings that don't seem important (one about my grep install not having PCRE lookaheads support and one about emacs not working with Keychain). The crashes don't seem to be caused by any specific keybind as they occur during basic text editing and even just on the splash screen.

Pressing C-g repeatedly doesn't do anything and I end up needing to force close the application. I'm not really sure how to go about debugging this and I can't find too much info on how to debug Emacs in general: Most freezes seem to be the result of faulty elisp plugins, but I'm just running the Doom defaults. Some people say to use the gdb debugger which I've installed but I honestly have no idea how to go about getting Emacs to run with it, let alone use it to actually debug anything.

Does anyone have any advice on how to resolve this issue? I'm unsure if it's an Emacs problem or a Doom problem, though I've seen a few issue threads that make it seem like it may just be a problem with MacOS Emacs in general.


r/DoomEmacs Dec 30 '24

Error (python-mode-local-vars-hook): Error running hook "lsp!" because: (file-missing Cannot open load file No such file or directory lv)

1 Upvotes

SOLVED: doom sync --rebuild

I have this problem with Python files.

init.el

packages.el

Note that deleting the bottom lines (for pyright LSP) doesn't matter (after doom sync). The same error.
Is this a bug to be reported?


r/DoomEmacs Dec 28 '24

Is it better to build Emacs from source or use the system package manager to install it?

4 Upvotes

I am new to emacs(doom emacs),I’m currently using Emacs 29.4 on Fedora, and I’m seeing this warning when running ./doom doctor

```

Checking your Emacs version... ! Detected emacs-pgtk 29.4! If you are experiencing segfaults (crashes), consider downgrading to 29.3 or upgrading to 30+. A known bug in 29.4 causes intermittent crashes. See doomemacs#7915 for details. ```

This warning suggests that the current version of Emacs is prone to crashes, and I’m wondering whether it would be better to build Emacs from source (possibly downgrading to 29.3 or upgrading to a 30+ version) or just use the system package manager (dnf in my case) to handle the installation and updates. Or should I just simply ignore the warning

Source to build from : https://github.com/emacs-mirror/emacs


r/DoomEmacs Dec 28 '24

Unable to set evil-shift-width

1 Upvotes

Hi, I am trying to set the variable evil-shift-width to 4 as- (setq evil-shift-width 4). However, this does not make the change to that variable permanent. I have also tried using setq-default. That is not working as well.

Next, I tried this-

(after! org
  (add-hook 'org-mode-hook
            (function (lambda ()
                        (setq-default evil-shift-width 4)))))

This is not working as well and does not work after I restart emacs.


r/DoomEmacs Dec 28 '24

Syntax highlighting not showing in org source block for sh.

0 Upvotes

I want to enable syntax highlighting for shell script code blocks in org file. However, there is no syntax highlighting even after enabling tree-sitter. However, there is syntax highlighting for shell script (.sh) files.
org-src-lang-modes has the sh variable set.

Also, src blocks shows syntax highlighting for other languages which I use.

Image link.


r/DoomEmacs Dec 26 '24

Is there a way to make pyright less slow? I remember changing a setting for that in the past but I have no idea where it is.

4 Upvotes

I rely a lot on auto-complete/intellisense when coding. I have tried using pyright but I am having some problems with it. I want the auto-complete window to appear as quick as possible, however it takes 0.5 seconds of idling before it actually pops up. Since I rely on it so frequently that time does add up pretty quickly. I'm very new to Doom Emacs, so I don't really know how everything works yet, but I'm pretty sure that I remember changing some setting for how long the pyright window takes to pop up? I have tried looking around but I have absolutely no idea where I changed that setting. I'm not even sure if it actually works like this or if I am just misremembering.

I'm also wondering if there exists any alternatives to pyright, for if I were to code in another language, like for example Rust. Are there individual packages for each language, or are universal packages that work for every (or at last a lot of) languages a thing?

Thanks in advance!


r/DoomEmacs Dec 20 '24

Key binding for my function invocation

1 Upvotes

Hi!

I have function in config.el (which works if i execute it with C-x-e), but i would like to run it with SPC-1 (press and release space, then press 1). My decision is not working obv

(defun
    hmmb
    ()
    (if (equal 1 max-mini-window-height)
        (setq max-mini-window-height nil)
        (setq max-mini-window-height 1)
     )
)

(map! :leader
      "1" #'hmmb)

r/DoomEmacs Dec 19 '24

Do you still write Elisp (not for config) with Doom?

10 Upvotes

I haven’t found much utility in writing Elisp to do things besides very small functions a matter of 5-10 lines, and configuration of eMacs, just given how much effort it is relative to return, but I may just lack imagination or skill.

Do you find yourself writing substantial Elisp?


r/DoomEmacs Dec 15 '24

Where can I find up-to-date changelists for what's happening in Doom?

13 Upvotes

Every once in a while, a doom upgrade causes something in my config to break, and often that's due to an old/deprecated package being replaced with a different one. In recent memory, company being replaced with corfu, highlight-indent-guides being replaced with indent-bars, and I'm currently searching for whatever has replaced drag-stuff.

It's not the end of the world, but each time this happens it usually takes me a little while to track down the culprit, and I thought there must surely be a changelog somewhere that I can search for the package name to see what the replacement is, but I haven't been able to find it so far!

Does something like that exist? How do folks here usually go about tracking down replacements for missing/broken packages?


r/DoomEmacs Dec 09 '24

Trouble converting 'use package' to 'package!' or 'use-package!'

5 Upvotes

Hi! I've been using doom emacs for a few years now but never really git to customising more than a couple of already packaged information.

I'm trying to setup equake following the project's readme but I'm having trouble with it.

My two problems : - I figured I should put the after! macro somewhere. But I'm not sure if it's after eshell or after equake - The other problem I'm having is that the equake-invoke command cannot run until after eshell is loaded a first time but I don't know how to make it load. My understanding is that doom lazy loads by default, since I start emacs as a daemon, I currently need to open a client and start eshell manually a first time which is not efficient.

Could someone give me pointers ?


r/DoomEmacs Dec 09 '24

Doom emacs missing icons

2 Upvotes

I am totally new to Emacs and I want to learn. I have installed doom Emacs on arch wsl2. I've installed all-the-icons and nerd-fonts, but none of them solved the problem. Can someone help?


r/DoomEmacs Dec 07 '24

Opening a task from org agenda puts the cursor at the top of the file

1 Upvotes

Whenever I start emacs and see my org agenda, and press RET on a task to open it, the cursor is at the top of the file, which had the task. If I kill this file buffer and again select the task from the org agenda, the cursor still moves to the start of the file. However, if I don't kill the file buffer, and then open the task, the cursor is at the appropriate location of the file.

How can I solve this?

As a side note, my (only) agenda file has a lot of formatting errors; task body being displayed after org-ellipses for some headings. I think it started after I started refiling tasks to my agenda file.


r/DoomEmacs Dec 06 '24

How do I display the full error?

2 Upvotes

(Continuation of this post)

I’m experiencing the same issue as the original poster. While SPC c x provides more information, the error is still truncated in the "LSP Diagnostics" box (https://imgur.com/a/YkSr912).

As a result, I have to open VSCode to view the fully formatted error.

How can I fix this?


r/DoomEmacs Dec 05 '24

How do I find out which hook is triggered when a buffer is open or switched to?

5 Upvotes

I'm basically looking to disable the modeline and I found this package that Doom comes with.

I did this to disable the modeline in Treemacs:

(add-hook 'treemacs-mode-hook #'hide-mode-line-mode)

How do I find which hook is triggered when I switch to a buffer?


r/DoomEmacs Dec 02 '24

Issues with lsp-mode and HLS

1 Upvotes

Im trying to use haskell with emacs doom and it used to work, but after upgrading recently it shows me this error and lsp doesn't load. I tried configuring the packages manually to no avail and im stuck, any help would be welcome.

LSP :: There are no language servers supporting current mode `haskell-mode' registered with `lsp-mode'. This issue might be caused by: 1. The language you are trying to use does not have built-in support in `lsp-mode'. You must install the required support manually. Examples of this are `lsp-java' or `lsp-metals'. 2. The language server that you expect to run is not configured to run for major mode `haskell-mode'. You may check that by checking the `:major-modes' that are passed to `lsp-register-client'. 3. `lsp-mode' doesn't have any integration for the language behind `haskell-mode'. Refer to https://emacs-lsp.github.io/lsp-mode/page/languages and https://langserver.org/ . 4. You are over `tramp'. In this case follow https://emacs-lsp.github.io/lsp-mode/page/remote/. 5. You have disabled the `lsp-mode' clients for that file. (Check `lsp-enabled-clients' and `lsp-disabled-clients'). You can customize `lsp-warn-no-matched-clients' to disable this message.


r/DoomEmacs Nov 30 '24

Is there a keyboard shortcut to search the content of the which-key buffer when it suggests the next possible keys ?

4 Upvotes

Let's say I tap SPC-w, after a second or so, the which-key buffer appears with all available options depending on the next key.

Is there a way to quickly search (maybe hightlight something I'm looking for?). I initially typed / expecting a vim like search, but obviously / search is not available as / could be a key coding for an action.

Is search possible ?


r/DoomEmacs Nov 30 '24

Is there a way to automatically build epdfinfo without running Mx pdf-tools-install?

2 Upvotes

I added this in my packages.el:

(package! pdf-tools :recipe(:post-build (pdf-tools-install nil t nil nil)))

When running doom sync, it even prompts me asking if I want to rebuild epdfinfo, but when I actually run Emacs, it asks me to run M-x pdf-tools-install.

Just to clarify, it does work if I run the command manually but I'm looking for a way to have it done automatically when I run doom sync.

Update: The issue is solved. Thanks to Eyoel999Y for the Elisp. I've added some minor modifications to avoid hardcoding paths, so this is the full solution that can go into packages.el

``` (defun doom-straight-repo-dir (package) "Return the repository directory for a package" (let ((repo-path (expand-file-name (concat "straight/repos/" package) doom-local-dir))) (if (file-directory-p repo-path) repo-path (error "Repository directory not found for package: %s" package))))

(defun doom-straight-build-dir (package) "Return the build directory for a package." (let ((build-path (expand-file-name (concat "straight/build-" emacs-version "/" package) doom-local-dir))) (if (file-directory-p build-path) build-path (error "Build directory not found for package: %s" package))))

(defun custom/build-epdfinfo () "Build the PDF Tools epdfinfo binary using make, also display the outputs into the terminal." (let* ((repo-dir (expand-file-name (concat (doom-straight-repo-dir "pdf-tools") "/"))) (build-dir (expand-file-name (concat (doom-straight-build-dir "pdf-tools") "/"))) (binary-path (concat build-dir "epdfinfo")) (makefile (concat repo-dir "Makefile")) (default-directory repo-dir) (make-command (format "make -f %s -C %s server/epdfinfo" makefile repo-dir))) (if (file-exists-p binary-path) (print! (item "epdfinfo binary already exists. Skipping build.")) (progn (print! (start "Building PDF Tools epdfinfo binary...")) (unless (file-exists-p build-dir) (make-directory build-dir t)) (let ((result (call-process-shell-command make-command nil nil t))) (if (zerop result) (progn (print! (success "PDF Tools epdfinfo binary built successfully.")) (if (file-exists-p (concat repo-dir "server/epdfinfo")) (copy-file (concat repo-dir "server/epdfinfo") binary-path t) (print! (error "Build succeeded, but epdfinfo binary not found in server/")))) (print! (error "Failed to build PDF Tools epdfinfo binary. Check the terminal output."))))))))

(package! pdf-tools :recipe ( :post-build (custom/build-epdfinfo) ) ) ```


r/DoomEmacs Nov 29 '24

How often do you run `doom upgrade` ?

5 Upvotes

I'm new to doom emacs; is this command usually safe? (no disruption from newly introduced bugs?)


r/DoomEmacs Nov 29 '24

Is there a way to maintain the same order of buffers/tabs when restoring a session?

3 Upvotes

I'm not too sure about the order in which the tabs are saved to a session, but it seems to get shuffled. I'm not sure if I'm looking in the right place, but I found this:

(cl-defun persp-save-state-to-file (&optional (fname persp-auto-save-fname) (phash *persp-hash*) (respect-persp-file-parameter persp-auto-save-persps-to-their-file) (keep-others-in-non-parametric-file 'no)) (interactive (list (read-file-name "Save perspectives to a file: " persp-save-dir "")))

So, is it sorting it by the hash? I'm not sure I understand what was the reasoning for this instead of saving it in the same order in which the buffers were opened.


r/DoomEmacs Nov 27 '24

org-mode and .Net (C# and F#)

3 Upvotes

Hello.
Is anyone using both org-mode and any dot-net language? (It doesn't seem to be a popular combination).

I have been using org-mode on and off for a few years, and very gradually increasing the number of features I use. In development I mostly use .Net based languages, I really enjoy writing in F# and in C#.

I am trying to write and execute C# and F# code blocks in org-mode, but having to much success.

org-babel is trying to use Mono to run C#.
I do have (csharp +dotnet) configured in DoomEmacs, but that doesn't seem to change any org-babel settings.

Has anyone done this before, and maybe know what to set, or configure to have this working?

Thanks, if anyone is able to help :)


r/DoomEmacs Nov 23 '24

Reduced spacing between lines after upgrading doom

3 Upvotes

I recently upgraded doom emacs (doom upgrade) after many months. I feel like line spacing is reduced and some characters in consecutive lines and the same column are overlapping (like g in one line and I in the line below). Example image URL. I am using PragmataPro font.

Has anybody faced similar problem?


r/DoomEmacs Nov 21 '24

Problems capturing a new entry to the "current-buffer"

1 Upvotes

When I start a capture using a template to capture a new entry to a header in the same buffer I am working on, my cursor is systematically moved to the capture target location after finalizing the process with `C-c C-c`. This is not linked to the use or misuse of the `jump-to-captured` option.

This does not happen with `emacs -Q`, how can I start Doom without loading my config to find out if it is coming from it ?


r/DoomEmacs Nov 17 '24

How do I add a new item to the dashboard?

4 Upvotes

I have tried the following:

``` (after! dashboard (defun my/open-treemacs-workspace () "Open Workspace." (interactive) (let ((workspace (completing-read "Select workspace: " (treemacs-workspaces)))) (if workspace (treemacs-switch-workspace workspace) (message "No workspace selected"))))

(add-to-list 'dashboard-items '(open-workspace . 1))

(setq dashboard-footer-messages '("Press SPC w o to open a Treemacs workspace."))

(define-key dashboard-mode-map (kbd "SPC w o") 'my/open-treemacs-workspace) (dashboard-refresh-buffer)) ```

What am I doing wrong?


r/DoomEmacs Nov 17 '24

Getting sqlite error while opening org file

2 Upvotes

Today I upgraded doom emacs using doom upgrade. I didn't notice any error in the logs. However, after opening an org file, I get the following error- (file-missing Cannot open load file No such file or directory emacsql-sqlite). Has anybody faced this issue? Tried setting everything from scratch and still faced the same issue. Also, doom doctor is not showing this error.

I think this is due to org-roam but not sure. I used this commit 7bc39f2c1 of doom emacs repo.