Closed e665107 closed 3 months ago
I don't know about desktop-save-mode. How can I experiment it in vanilla Emacs?
The section Saving Emacs Sessions
in the info pages of Emacs explains it.
https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html
Following is my configuration about the desktop-save-mode.
(desktop-save-mode 1) (savehist-mode 1) (setq savehist-additional-variables '()) (add-to-list 'desktop-globals-to-save '(search-ring)) (add-to-list 'desktop-globals-to-save '(kill-ring))
I can't reproduce. I used your config, saved the desktop session with several buffers running citre-mode
, and I can restore it without any problem. I'm on Emacs 28.2.
The content of citre-config.el
has not been changed for a long time, but the definition of citre-auto-enable-citre-mode
has changed. That's the only place I suspect to have any problems.
Please set debug-on-quit
to non-nil in your init.el
, and when Emacs stucks, press C-g
, you should see a backtrace. Please paste the backtrace here so we can inspect it more.
Hi, I catch it Debugger entered--Lisp error: (quit) accept-process-output() citre-get-output-lines(("global" "--print-dbpath")) citre-global--get-output-lines(("--print-dbpath"))
citre-global-dbpath()
citre-backend-usable-p(global)
citre-auto-enable-citre-mode()
run-hooks(find-file-hook)
after-find-file(nil nil)
find-file-noselect-1(#
run-hooks(after-init-hook delayed-warnings-hook) command-line() normal-top-level()
It seems your global program is running forever, which shouldn't happen.
When running in a directory without gtags database, global should throw an error immediately:
$ global --print-dbpath
global: GTAGS not found.
citre-global-dbpath
, which runs this command internally, should return nil immediately:
(citre-global-dbpath)
;; => nil
When running in a directory with a gtags database, global should print its path immediately:
$ global --print-dbpath
/home/kino/.cache/gtags//home/kino/ctags
citre-global-dbpath
should return the path immediately
(citre-global-dbpath)
;; => /home/kino/.cache/gtags//home/kino/ctags
I suspect it's a problem of your global program. Could you try run $ global --print-dbpath
in different locations and see if stucks?
I have choose another directory and run the $ global --print-dbpath, it shows as follow:
h:\test_projects\stm32f103_freertos_test_iar>global --print-dbpath global --print-dbpath h:/test_projects/stm32f103_freertos_test_iar
h:\test_projects\stm32f103_freertos_test_iar>
That's expected. I mean does it stuck in directories without a gtags database?
Close due to no further response.
Hi
When i cloned the new verison(citre-0.3.1) of citre, emacs(28.2) will be get stuck in restore the desktop-files. Yeah, I have used the desktop-save-mode, i find the memory the emacs used is increasing little by little, But when i comment the citre-config, i becomes ok. Follow is my configuration related to the citre:
(use-package citre :ensure t ;; :defer t :init ;; (require 'citre-config) :config (defun prog-mode-citre-bindings() (local-set-key (kbd "C-c j") 'citre-jump) (local-set-key (kbd "C-c l") 'citre-jump-back) (local-set-key (kbd "C-u v") 'citre-peek) (local-set-key (kbd "C-u g") 'citre-peek-through) (local-set-key (kbd "C-u f") 'citre-peek-chain-forward) (local-set-key (kbd "C-u a") 'citre-peek-chain-backward) (local-set-key (kbd "C-u d") 'citre-peek-next-definition) (local-set-key (kbd "C-u s") 'citre-peek-prev-definition) (local-set-key (kbd "C-u r") 'citre-peek-restore) (local-set-key (kbd "C-u w") 'citre-peek-save-session) (local-set-key (kbd "C-u e") 'citre-peek-load-session) (local-set-key (kbd "C-c i") 'custom-citre-completion-at-point) ) (defun prog-mode-citre-c-bindings() (local-set-key (kbd "C-u v") 'citre-peek) (local-set-key (kbd "C-u g") 'citre-peek-through) (local-set-key (kbd "C-u f") 'citre-peek-chain-forward) (local-set-key (kbd "C-u a") 'citre-peek-chain-backward) (local-set-key (kbd "C-u d") 'citre-peek-next-definition) (local-set-key (kbd "C-u s") 'citre-peek-prev-definition) (local-set-key (kbd "C-u r") 'citre-peek-restore) (local-set-key (kbd "C-u w") 'citre-peek-save-session) (local-set-key (kbd "C-u e") 'citre-peek-load-session) (local-set-key (kbd "C-c i") 'custom-citre-completion-at-point) ) (setq ;; citre-readtags-program "~/.emacs.d/user_bins/ctags/readtags" ;; citre-ctags-program "~/.emacs.d/user_bins/ctags/ctags" ;; citre-gtags-program "~/.emacs.d/user_bins/Gnu_global/bin/gtags" ;; citre-global-program "~/.emacs.d/user_bins/Gnuglobal/bin/global" ;; used for things like displaying paths relatively, see its docstring. ;; citre-project-root-function #'projectile-project-root ;; Set this if you want to always use one location to create a tags file. ;; citre-default-create-tags-file-location 'global-cache ;; See the "Create tags file" section above to know these options ;; citre-use-project-root-when-creating-tags t citre-prompt-language-for-ctags-command t ;; By default, when you open any file, and a tags file can be found for it, ;;
citre-mode' is automatically enabled. If you only want this to work for ;; certain modes (like
prog-mode'), set it like this. ;; citre-auto-enable-citre-mode-modes '(prog-mode) ) ;; (setq citre-edit-cmd-buf-default-cmd ;; "ctags ;; -o ;; %TAGSFILE% ;; --kinds-all= ;; --fields= ;; --extras=* ;; --extras=-{qualified} ;; -R ;; ./rtl ;; ") ;; (custom-set-variables ;; '(citre-register-completion-backend '(tags global)) ;; '(citre-register-find-definition-backends '(tags global)) ;; '(citre-register-find-reference-backends '(tags)) ;; '(citre-register-tags-in-buffer-backends '(tags global)) ;; '(citre-auto-enable-citre-mode-backends '(tags global)) ;; ) (defun citre-jump+ () (interactive) (condition-case (citre-jump) (error (call-interactively #'xref-find-definitions)))) (add-hook 'verilog-mode-hook 'prog-mode-citre-bindings) (add-hook 'c-mode-hook 'prog-mode-citre-c-bindings) (add-hook 'c++-mode-hook 'prog-mode-citre-c-bindings) )