Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboad breaks emacsclient when used in conjuction --with-native-compilation #334

Open
Kingpatzer opened this issue Oct 22, 2021 · 4 comments

Comments

@Kingpatzer
Copy link

Kingpatzer commented Oct 22, 2021

When started with the below rather minimal init.el, the following will start an emacs server, but no window is created:

emacsclient -c -a ''

Proper behavior should be that a server is started and a window is created.

If I recompile emacs without the --with-native-compilation flag, Emacsclient starts. So it appears to have something to do with native-compilation.

(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
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(straight-use-package 'use-package)
(setq-default straight-use-package-by-default t)
(setq-default straight-check-for-modifications '(watch-files find-when-checking))

(use-package page-break-lines
    :straight t)

 (use-package dashboard
    :straight t
    :config (dashboard-setup-startup-hook)
    (setq initial-buffer-choice (lambda () get-buffer-create "*dashboard*")
          dashboad-banner-logo-title "Welcome to David's Emacs Dashboard"
          dashboard-startup-banner 'logo
          dashboard-center-content nil
          dashboard-show-shortcuts t
          dashboard-set-init-info t
          dashboard-items '((recents . 5)
                            (bookmarks . 5)
                            (agenda . 5)
                            (registers . 5)))) 
@Kingpatzer
Copy link
Author

Kingpatzer commented Oct 25, 2021

If started from the command line via emacsclient -c -a '' the error provided is:

Waiting for Emacs...
ERROR: Symbol’s value as variable is void: get-buffer-create

Not loading Dashboard produces no error and Emacsclient starts the server and opens a window as expected.

@Nexion
Copy link

Nexion commented Jan 21, 2022

The body of your lambda expression lacks parentheses. It should look like this:

(setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*")))

Omit the last closing parenthesis if you're going to just copy and paste this line of code in place of yours.

@drishal
Copy link

drishal commented Apr 24, 2022

exactly same issue here as well
latest git builds of pgtk seems to be broken with dashboard for some reason
and on top of that it does not send to the background


~ ❯ emacs --daemon
Due to a limitation in GTK 3, Emacs built with PGTK will simply exit when a
display connection is closed.  The problem is especially difficult to fix,
such that Emacs on Wayland with multiple displays is unlikely ever to be able
to survive disconnects.
Loading /home/drishal/.emacs.d/custom.el (source)...
Loading /home/drishal/.emacs.d/custom.el (source)...done
Loading /home/drishal/.emacs.d/recentf...
Loading /home/drishal/.emacs.d/recentf...done
Cleaning up the recentf list...
Cleaning up the recentf list...done (0 removed)
[yas] Prepared just-in-time loading of snippets successfully.
.emacs.d/init.el: Warning: (lambda nil \...) quoted with ' rather than with #'
Wrote /home/drishal/.emacs-temp/.!home!drishal!.emacs.d!bookmarks.~undo-tree~
tsc-dyn-get: Using source :github (:loaded nil :recorded 0.18.0 :requested 0.18.0)
tsc-dyn-get: Recorded version already satifies requested -> loading
tree-sitter-langs: Grammar bundle v0.11.6 was already installed; skipped
Starting new Ispell process /home/drishal/.nix-profile/bin/ispell with default dictionary... \
Starting new Ispell process /home/drishal/.nix-profile/bin/ispell with default dictionary...done
Starting Emacs daemon.
Emacs loaded in 2.89 seconds with 15 garbage collections.
Package rfc2368 is deprecated
Package cl is deprecated

relevant part of the config

(use-package dashboard :ensure t)
(require 'dashboard)
(dashboard-setup-startup-hook)
;; Or if you use use-package
(use-package dashboard
  :ensure t
  :config
  (dashboard-setup-startup-hook))
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))

@willbush
Copy link

I got the same issue. Dashboard causing the emacs daemon to freeze.

Changing this:

  (setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))

To: get-buffer-create

  (setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*")))

Fixed the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants