Closed lolcklol2 closed 1 year ago
This doesn't seem to be the org-fragtog
's fault:
org-fragtog
M-x org-latex-preview
Seems like the bug isn't reproducible on a clean installation with just org-moge
so something else may be at play here. I commented out my entire config.el
but it didn't help. I use Doom however so maybe that's what it is (in my case at least).
Please refer to this thread for details.
I gat this error wan ever a auto preview gets generatet the preview still gets product put i dont anderstand the problem shod i just
disable errors and ignor it her is the error:
(defun efs/org-babel-tangle-config () (when (string-equal (buffer-file-name) (expand-file-name "/home/ck/org/Nots/20230823070942-init.org")) ;; Dynamic scoping to the rescue (let ((org-confirm-babel-evaluate nil)) (org-babel-tangle))))
(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'efs/org-babel-tangle-config)))
(use-package dashboard :ensure t :config (dashboard-setup-startup-hook))
(setq initial-buffer-choice (lambda () (get-buffer "dashboard")))
;;test23 (setq custom-file (locate-user-emacs-file "evars.el")) (load custom-file 'noerror 'nomessage)
;; Minimize garbage collection during startup (setq gc-cons-threshold most-positive-fixnum)
;; Lower threshold back to 8 MiB (default is 800kB) (add-hook 'emacs-startup-hook (lambda () (setq gc-cons-threshold (expt 2 23)))) (defun loadup-gen () "Generate the lines to include in the lisp/loadup.el file to place all of the libraries that are loaded by your InitFile into the main dumped emacs" (interactive) (defun get-loads-from-Messages () (save-excursion (let ((retval ())) (set-buffer "Messages") (beginning-of-buffer) (while (search-forward-regexp "^Loading " nil t) (let ((start (point))) (search-forward "…") (backward-char 3) (setq retval (cons (buffer-substring-no-properties start (point)) retval)))) retval))) (map 'list (lambda (file) (princ (format "(load \"%s\")\n" file))) (get-loads-from-Messages))) ;; time the loading of the .emacs ;; keep this on top of your .emacs (defvar emacs-load-start (current-time)) (defun anarcat/time-to-ms (time) (+ ( (+ ( (car time) (expt 2 16)) (car (cdr time))) 1000000) (car (cdr (cdr time))))) (defun anarcat/display-timing () (message ".emacs loaded in %fms" (/ (- (anarcat/time-to-ms (current-time)) (anarcat/time-to-ms emacs-load-start)) 1000000.0))) (add-hook 'after-init-hook 'anarcat/display-timing t)
(require 'package)
(setq package-archives '(("melpa" . "https://melpa.org/packages/") ("elpa" . "https://elpa.gnu.org/packages/")))
(unless package-archive-contents (package-refresh-contents))
;; Initialize use-package on non-Linux platforms (unless (package-installed-p 'use-package) (package-install 'use-package))
(require 'use-package) (setq use-package-always-ensure t)
(org-babel-do-load-languages 'org-babel-load-languages '( (emacs-lisp . t) (python . t) ))
(use-package org-auto-tangle :hook (org-mode . org-auto-tangle-mode))
(define-key org-mode-map (kbd "C-c C-r") 'org-mode-restart)
(setq org-agenda-include-diary t)
(use-package sudo-edit) (define-key org-mode-map (kbd "C-c e") 'sudo-edit)
(setq org-agenda-start-with-log-mode t) (setq org-log-done 'time) (setq org-log-into-drawer t) (setq org-agenda-files '("~/org/Nots"))
(setq calendar-week-start-day 1
(defun holiday-add-Block (start-date end-date list mark) "Add fixed holidays with MARK for all dates between START-DATE and END-DATE." (let* ((start-time (encode-time 0 0 0 (nth 1 start-date) (nth 0 start-date) 2023)) (end-time (encode-time 0 0 0 (nth 1 end-date) (nth 0 end-date) 2023)) (current-time start-time)) (while (> (float-time (time-subtract end-time current-time)) 1) ;; Print the values of current-time and end-time (message "current-time: %s" current-time) (message "end-time: %s" end-time)
(holiday-add-Block '(1 1) '(1 5) 'holiday-general-holidays "Weihnachtsferien") (holiday-add-Block '(7 13) '(8 25) 'holiday-general-holidays "Sommerferien") (holiday-add-Block '(2 5) '(2 10) 'holiday-general-holidays "Winterferien") (holiday-add-Block '(3 25) '(4 5) 'holiday-general-holidays "Osterferien") (holiday-add-Block '(12 23) '(12 31) 'holiday-general-holidays "Weihnachtsferien")
(global-set-key (kbd "C-c a") 'org-agenda)
(use-package org-super-agenda) (setq org-habit-following-days 7) (setq org-habit-graph-column 51) (setq habit-preceding-days 20) (setq org-habit-show-habits t) (setq org-habit-show-habits-only-for-today t)
(require 'org-tempo) (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) (add-to-list 'org-structure-template-alist '("py" . "src python")) (add-to-list 'org-structure-template-alist '("ja" . "src java"))
(use-package ya-org-capture :after yankpad :load-path "~/.emacs.d/lisp" :config (ya-org-capture/setup))
(use-package org-roam :ensure t :init (setq org-roam-v2-ack t) :custom (org-roam-directory "~/org/Nots") (org-roam-completion-everywhere t) (org-roam-capture-templates '(("d" "default" plain "%?" :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") :unnarrowed t)
:bind (("C-c n l" . org-roam-buffer-toggle) ("C-c n f" . org-roam-node-find) ("C-c n i" . org-roam-node-insert) :map org-mode-map ("C-M-i" . completion-at-point) :map org-roam-dailies-map ("Y" . org-roam-dailies-capture-yesterday) ("T" . org-roam-dailies-capture-tomorrow)) :bind-keymap ("C-c n d" . org-roam-dailies-map) :config (require 'org-roam-dailies) ;; Ensure the keymap is available (org-roam-db-autosync-mode))
(use-package org-roam-ui :bind ( ("C-c n u" . org-roam-ui-mode)) :config (setq org-roam-ui-sync-theme t org-roam-ui-follow t org-roam-ui-update-on-save t org-roam-ui-open-on-start t))
(defvar centered-visual-fill--original-org-faces nil "List of original org face attributes")
(define-minor-mode centered-visual-fill-mode "Center text, enable visual-fill-column-mode, and change org header font" :init-value nil :lighter " Centered" (if centered-visual-fill-mode (progn (setq-local visual-fill-column-center-text t) (visual-fill-column-mode 1) (set-face-attribute (car face) nil :font "Menlo" :weight 'regular :height (cdr face)))) (kill-local-variable 'visual-fill-column-center-text) (visual-fill-column-mode -1) (dolist (face centered-visual-fill--original-org-faces) (apply #'set-face-attribute `(,(car face) nil ,@(cdr face)))) (setq centered-visual-fill--original-org-faces nil))
(use-package org-fragtog) (use-package xenops) (setq org-latex-inputenc-alist '(("utf8" . "utf8x" ))) (setq org-format-latex-options (plist-put org-format-latex-options :scale 2)) (global-auto-revert-mode -1) (require 'ox-latex) (setq org-startup-with-latex-preview t) (add-hook 'org-mode-hook 'org-fragtog-mode)
(use-package forge) (setq org-startup-numerated t)
(defun efs/org-mode-setup () (org-indent-mode) (variable-pitch-mode 1) (visual-line-mode 1)) ;; Org Mode Configuration ------------------------------------------------------ (customize-set-variable 'org-blank-before-new-entry'((heading . auto)(plain-list-item . auto))) (setq org-cycle-separator-lines 3) (defun efs/org-font-setup () ;; Replace list hyphen with dot (font-lock-add-keywords 'org-mode '(("^ *\([-]\) " (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•"))))))
;; Set faces for heading levels (dolist (face '((org-level-1 . 1.4) (org-level-2 . 1.3) (org-level-3 . 1.05) (org-level-4 . 1.0) (org-level-5 . 1.1) (org-level-6 . 1.1) (org-level-7 . 1.1) (org-level-8 . 1.1))) (set-face-attribute (car face) nil :font "CMU Serif" :weight 'Bold :height (cdr face)))
;; Ensure that anything that should be fixed-pitch in Org files appears that way (set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch) (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) (set-face-attribute 'org-table nil :inherit '(shadow fixed-pitch)) (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch)) (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch)) (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch)) (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch))
(use-package org ;; :hook (org-mode . efs/org-mode-setup) :config (setq org-ellipsis "▾" org-hide-emphasis-markers t)
(setq org-agenda-start-with-log-mode 1) (setq org-log-done 'time) (setq org-log-into-drawer t)
(efs/org-font-setup))
(use-package org-bullets :after org :hook (org-mode . org-bullets-mode) :custom (org-bullets-bullet-list '(" " " " " " " " " " " " " "))) (require 'org-tempo) (set-face-attribute 'org-level-1 nil :height 250 ) (set-face-attribute 'org-level-2 nil :height 200 ) (set-face-attribute 'org-level-3 nil :height 150 ) (set-face-attribute 'org-level-4 nil :height 150 )
(defun my-org-depth () (org-content 1)) (add-hook 'org-mode-hook 'my-org-depth)
(define-key global-map "\C-cc"'org-capture) (setq org-capture-templates '( ("t" "TODO" entry (file+headline "~/org/agenda/Calendar.org" "Tasks") " TODO %?\n %i\n") ("p" "profile" entry (file+headline "~/org/agenda/Calendar.org" "Profile") " %^{Name}\n** Geburtstag%?") ))
(require 'org-habit)
(setq org-startup-with-inline-images t) (use-package org-inline-pdf)
(setq org-image-actual-width 400) (add-hook 'org-mode-hook #'org-inline-pdf-mode)
(setq bookmark-save-flag 0)
(setq org-agenda-custom-commands '(("w" "Agenda for next 2 weeks" ((agenda "" ((org-agenda-span 14)))) ((org-agenda-write-buffer-name "Agenda for next 2 weeks") (org-agenda-write-to-absolute-file "~/agenda.txt")))))
(use-package mu4e :ensure nil ;; :load-path "/usr/share/emacs/site-lisp/mu4e/" ;; :defer 20 ; Wait until 20 seconds after startup :config
(setq mu4e-change-filenames-when-moving t)
;; Refresh mail using isync every 10 minutes (setq mu4e-update-interval (* 10 60)) (setq mu4e-get-mail-command "mbsync -a") (setq mu4e-maildir "~/Mail")
(setq mu4e-drafts-folder "/[Gmail]/Drafts") (setq mu4e-sent-folder "/[Gmail]/Sent Mail") (setq mu4e-refile-folder "/[Gmail]/All Mail") (setq mu4e-trash-folder "/[Gmail]/Trash")
(setq mu4e-maildir-shortcuts '(("/Inbox" . ?i) ("/[Gmail]/Sent Mail" . ?s) ("/[Gmail]/Trash" . ?t) ("/[Gmail]/Drafts" . ?d) ("/[Gmail]/All Mail" . ?a)))) (global-set-key (kbd "C-c k") 'mu4e)
(setq evil-want-keybinding nil) (use-package evil :config (evil-mode 1))
(use-package evil-collection :after evil :ensure t :config (evil-collection-init))
(global-set-key (kbd "") 'keyboard-escape-quit)
(define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state)
(use-package evil-org :ensure t :after org :hook (org-mode . (lambda () evil-org-mode)) :config (require 'evil-org-agenda) (evil-org-agenda-set-keys))
(defun efs/org-babel-tangle-config () (when (string-equal (buffer-file-name) (expand-file-name "/home/ck/org/Nots/20230823070942-init.org")) ;; Dynamic scoping to the rescue (let ((org-confirm-babel-evaluate nil)) (org-babel-tangle))))
(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'efs/org-babel-tangle-config)))
(org-babel-do-load-languages 'org-babel-load-languages '( (emacs-lisp . t) (python . t) )) ;;tes
;;test (use-package no-littering) (setq no-littering-etc-directory (expand-file-name "~/.emacs.d/etclit" user-emacs-directory)) (setq no-littering-var-directory (expand-file-name "~/.emacs.d/datalit" user-emacs-directory)) (setq auto-save-file-name-transforms `((".*" ,(no-littering-expand-var-file-name "auto-save/") t)))
(require 'no-littering)
(use-package ivy :demand :diminish :bind (("C-s" . swiper) :map ivy-minibuffer-map ("TAB" . ivy-alt-done) ("C-l" . ivy-alt-done) ("C-j" . ivy-next-line) ("C-k" . ivy-previous-line) :map ivy-switch-buffer-map ("C-k" . ivy-previous-line) ("C-l" . ivy-done) ("C-d" . ivy-switch-buffer-kill) :map ivy-reverse-i-search-map ("C-k" . ivy-previous-line) ("C-d" . ivy-reverse-i-search-kill)) :config (ivy-mode 1))
(set-face-attribute 'default nil :height 150)
(global-display-line-numbers-mode)
(setq inhibit-startup-message t use-dialog-box nil) (setq display-line-numbers-type 'visual) (set-fringe-mode 10) (menu-bar-mode -1) (scroll-bar-mode -1) (tool-bar-mode -1) (global-auto-revert-mode 1)
(use-package all-the-icons :ensure t)
(use-package doom-themes :ensure t :config (load-theme 'doom-one)) (use-package doom-modeline :ensure t :hook (after-init . doom-modeline-mode))
(use-package rainbow-delimiters :hook (prog-mode . rainbow-delimiters-mode)) (use-package highlight-indentation :ensure t) (use-package sage-shell-mode :ensure t :init (progn (use-package auto-complete :init (progn (setq ac-delay 0.3 ac-auto-start 2)))
(eval-after-load "auto-complete" '(setq ac-modes (append '(sage-shell-mode sage-shell:sage-mode) ac-modes))) (add-hook 'sage-shell:sage-mode-hook 'ac-sage-setup) (add-hook 'sage-shell:sage-mode-hook 'auto-complete-mode) (add-hook 'sage-shell-mode-hook 'ac-sage-setup) (add-hook 'sage-shell-mode-hook 'auto-complete-mode) (setq ac-sage-show-quick-help t)))
(setq display-time-interval 60) (setq display-time-format "%H:%M | %m.%d.%y") (display-time-mode) (display-battery-mode)
(use-package company-tabnine :ensure t) (require 'company-tabnine) (nconc company-backends '(company-tabnine))
(use-package quickrun ) (require 'quickrun) (with-eval-after-load 'lsp-mode (define-key lsp-mode-map (kbd "C-c C-c") 'quickrun))
;;test (use-package undo-tree :defer t :diminish undo-tree-mode :init (global-undo-tree-mode) :custom (undo-tree-visualizer-diff t) (undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo"))) (undo-tree-visualizer-timestamps t)) (require 'undo-tree) (global-undo-tree-mode) (setq undo-tree-show-help-in-visualize-buffer t) (setq undo-tree-show-minibuffer-help t) (setq undo-tree-minibuffer-help-dynamic t) (setq undo-tree-auto-save-history t)
(use-package quickrun) (require 'quickrun)
(use-package flex-autopair) (require 'flex-autopair) (flex-autopair-mode 1)
(use-package projectile) (use-package flycheck) (use-package lsp-mode :hook ((lsp-mode . lsp-enable-which-key-integration))) (use-package hydra) (use-package company) (use-package lsp-ui) (use-package which-key :config (which-key-mode)) (use-package lsp-java :config (add-hook 'java-mode-hook 'lsp)) (use-package dap-mode :after lsp-mode :config (dap-auto-configure-mode)) (use-package dap-java :ensure nil) (use-package helm-lsp) (use-package helm :config (helm-mode)) (use-package lsp-treemacs)
(use-package python-mode :ensure t :hook (python-mode . lsp-deferred) :custom ;; NOTE: Set these if Python 3 is called "python3" on your system! ;; (python-shell-interpreter "python3") ;; (dap-python-executable "python3") (dap-python-debugger 'debugpy) :config (require 'dap-python))
(use-package pyvenv :config (pyvenv-mode 1))
(use-package typescript-mode :mode "\.ts\'" :hook (typescript-mode . lsp-deferred) :config (setq typescript-indent-level 2))
(use-package lsp-mode :init ;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l") (setq lsp-keymap-prefix "C-c l") :hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode) (XXX-mode . lsp) ;; if you want which-key integration (lsp-mode . lsp-enable-which-key-integration)) :commands lsp)
(use-package lsp-ui :hook (lsp-mode . lsp-ui-mode) :custom (lsp-ui-doc-position 'bottom))
(use-package dap-mode :after lsp-mode :config (dap-auto-configure-mode))
(defun efs/lsp-mode-setup () (setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) (lsp-headerline-breadcrumb-mode))
(use-package helm-lsp) (use-package helm :config (helm-mode))
(use-package projectile :diminish projectile-mode :config (projectile-mode) :custom ((projectile-completion-system 'ivy)) :bind-keymap ("C-c p" . projectile-command-map) :init ;; NOTE: Set this to the folder where you keep your Git repos! (when (file-directory-p "~/Projects/Code") (setq projectile-project-search-path '("~/Projects/Code"))) (setq projectile-switch-project-action #'projectile-dired))
(use-package company :ensure t :init (add-hook 'after-init-hook 'global-company-mode)) (setq company-idle-delay 0)
(use-package company-anaconda :ensure t)
(use-package company-math :ensure t)
(use-package company-auctex :ensure t)
(use-package company-box :hook (company-mode . company-box-mode))
(use-package mmm-mode :ensure t :init (progn (setq mmm-global-mode 'maybe)) :config (progn (mmm-add-classes '((python-rst :submode rst-mode :front "^ [ru]?\"\"\"[^\"]$" :back "^ *\"\"\"" :include-front t :include-back t :end-not-begin t))) (mmm-add-mode-ext-class 'python-mode nil 'python-rst) (mmm-add-mode-ext-class 'sage-shell:sage-mode nil 'python-rst) ))
(use-package cython-mode :ensure t :mode (("\.pyx\'" . cython-mode) ("\.spyx\'" . cython-mode) ("\.pxd\'" . cython-mode) ("\.pxi\'" . cython-mode)))
(use-package python-mode :init (progn (add-hook 'python-mode-hook 'highlight-indentation-mode) (add-hook 'python-mode-hook 'anaconda-mode) (add-hook 'python-mode-hook 'eldoc-mode) (add-hook 'python-mode-hook 'sphinx-doc-mode))
:config (progn (setq-default python-indent 4) (setq python-fill-docstring-style 'onetwo)
(use-package which-key :init (which-key-mode) :diminish which-key-mode :config (setq which-key-idle-delay 0))
(use-package counsel :bind (("M-x" . counsel-M-x) ("C-x b" . counsel-ibuffer)) :config)
(use-package helpful :custom (counsel-describe-function-function #'helpful-callable) (counsel-describe-variable-function #'helpful-variable) :bind ([remap describe-function] . counsel-describe-function) ([remap describe-command] . helpful-command) ([remap describe-variable] . counsel-describe-variable) ([remap describe-key] . helpful-key)) (with-eval-after-load 'counsel (recentf-mode))
(use-package eglot-java)
(use-package pdf-tools :ensure t :config (add-hook 'pdf-view-mode-hook 'pdf-view-midnight-minor-mode) ) (pdf-tools-install) (use-package saveplace-pdf-view)
(require 'saveplace-pdf-view) (save-place-mode 1)
(defun my-render-org-table-at-point () (interactive) (save-excursion (beginning-of-line) (if (overlays-at (point)) ;; this is a rough solution, because there can ;; be other overlays at point (delete-overlay (car (overlays-at (point))))
(use-package systemd)
(setq initial-scratch-message "") (setq initial-major-mode 'org-mode)
(use-package speed-type)
(recentf-mode 1) (setq recentf-max-menu-items 25) (setq recentf-max-saved-items 25) (global-set-key (kbd "C-x e") 'recentf-open-files)
(setq split-width-threshold 0) (setq split-height-threshold 100)
(use-package yasnippet :config (setq yas-snippet-dirs '("~/.emacs.d/snippets")) (yas-global-mode 1))
(use-package flycheck :ensure t :hook (org-mode . flyspell-mode) :hook (org-mode . flyspell-buffer) );;:init (global-flycheck-mode))
(with-eval-after-load "ispell" ;; Configure
LANG
, otherwise ispell.el cannot find a 'default ;; dictionary' even though multiple dictionaries will be configured ;; in next line. (setenv "LANG" "en_US.UTF-8") (setq ispell-program-name "hunspell") ;; Configure German, Swiss German, and two variants of English. (setq ispell-dictionary "de_DE,de_CH,en_GB,en_US") ;; ispell-set-spellchecker-params has to be called ;; before ispell-hunspell-add-multi-dic will work (ispell-set-spellchecker-params) (ispell-hunspell-add-multi-dic "de_DE,de_CH,en_GB,en_US") ;; For saving words to the personal dictionary, don't infer it from ;; the locale, otherwise it would save to ~/.hunspell_de_DE. (setq ispell-personal-dictionary "~/.hunspell_personal"));; The personal dictionary file has to exist, otherwise hunspell will ;; silently not use it. (unless (file-exists-p ispell-personal-dictionary) (write-region "" nil ispell-personal-dictionary nil 0))