0

When my emacs start, previously visited buffers/files are restored with desktop.el. So far so good.

But my settings related to org-mode files are somehow not applied.

If I open a new org file or if I manually load org-mode on a restored org file then my settings are applied.

Here is a minimal reproducible config :

.emacs :

(setq company-backends '(company-ac-php-backend
                         company-lsp
                         company-bbdb
                         company-semantic
                         company-clang
                         company-cmake
                         company-capf
                         company-files
                         (company-dabbrev-code company-gtags company-etags company-keywords)
                         company-oddmuse
                         company-dabbrev))

(add-to-list 'load-path "~/.emacs.d/auto-install/")
(add-to-list 'load-path "~/.emacs.d/lisp_files/")

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)

(package-initialize)

(gcmh-mode 1)

(require 'org)
(org-babel-load-file "~/.emacs.d/config.org")

The config.el compiled with org-babel :

;; Persistence stuff
(setq desktop-save 'ask)
(push '(name . nil) frameset-filter-alist)

(setq desktop-globals-to-save
      (append '((extended-command-history . 100)
                (command-history          . 100)
                (file-name-history        . 100)
                (grep-history             . 50)
                (compile-history          . 40)
                (minibuffer-history       . 100)
                (query-replace-history    . 100)
                (read-expression-history  . 100)
                (regexp-history           . 100)
                (regexp-search-ring       . 100)
                (search-ring              . 100)
                (shell-command-history    . 100)
                tags-file-name
                register-alist)))

(desktop-save-mode 1)
(desktop-read)

(setq desktop-load-locked-desktop 'ask)


;; org-mode stuff
(require 'org-bullets)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
(setq org-bullets-face-name (quote org-bullet-face))
(setq org-bullets-bullet-list '("➊" "➋" "❸" "4" "5" "⑥" "⑦" "8" "9" "◯" "⚪" "⚫" "⚬" "❍" "○" "⊙" "⊚" "⊛" "∙" "∘"))

(setq org-ellipsis " ⤵")

On desktop restored org files, org-bullets-mode is not active and org-ellipsis is still '...' (but weirdly describe-variable says the value is " ⤵").

This situation is very troublesome, because I have to manually load org-mode on every restored org buffers to have my settings applied to them !

What is going on ?

GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0) of 2021-11-27, modified by Debian

Org mode version 9.5.3 (9.5.3-g69c588 @ /home/user/.emacs.d/elpa/org-9.5.3/)

1
  • Maybe you can move config.el to .emacs and remove org-babel-load-file to check if it takes effect. Commented May 4, 2022 at 9:34

1 Answer 1

0

OK, things are working now, don't bother.

I'm not sure I remember exactly what I did (sorry, I should have posted right away), but I, at least :

  • Removed my desktop file (Yes, sad)
  • Removed the (desktop-read) instruction (redundant with (desktop-save-mode 1))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.