Skip to content

Commit

Permalink
Try 'auto-dark-emacs' + now 'ess-rmd-render-book' removes '_main.Rmd'.
Browse files Browse the repository at this point in the history
  • Loading branch information
basille committed Mar 13, 2023
1 parent 64d9c6b commit adcf8d9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
3 changes: 2 additions & 1 deletion functions/ess-rmd-library.el
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
;; Function rmd-bookdown to use bookdown::render_book on index.Rmd
;; Inspiration borrowed from ess-swv-run-in-R (ess-swv.el)
(defun ess-rmd-render-book ()
"Run Bookdown on index.Rmd."
"Run Bookdown on index.Rmd (remove '_main.Rmd' if needed)."
(interactive)
(let* ((rmd-buf (current-buffer)))
(update-ess-process-name-list)
Expand Down Expand Up @@ -103,6 +103,7 @@
(bkdwn-cmd
(format "bookdown::render_book(\"index.Rmd\", encoding = \"UTF-8\", output_format = %s)" output-format)))
(message "Running Bookdown on index.Rmd")
(delete-file "_main.Rmd")
(ess-execute bkdwn-cmd 'buffer nil nil)
(switch-to-buffer rmd-buf)
(ess-show-buffer (buffer-name sbuffer) nil))))))
Expand Down
35 changes: 23 additions & 12 deletions init.org
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ repositories. We first list these packages:
apropospriate-theme
auctex
auctex-latexmk
auto-dark
bonjourmadame
buffer-move
centered-window
Expand All @@ -95,6 +96,7 @@ repositories. We first list these packages:
dired-narrow
dired-quick-sort
dired-single
doom-themes
eshell-git-prompt
ess
ess-smart-equals
Expand Down Expand Up @@ -199,12 +201,12 @@ Define a =my-cache-dir= (=~/.emacs.d/cache/=) folder for later use

** Color theme

With the help of the package [[https://github.com/guidoschmidt/circadian.el][circadian]], Emacs can switch themes based
on sunrise and sunset. I will use [[https://github.com/tmalsburg/tango-plus-theme][Tango Plus]] during the day, and [[https://github.com/arcticicestudio/nord-emacs][Nord
Emacs]] at night (with brightness of comments at 20%). Coordinates are
for South Florida:
With the help of the package [[https://github.com/guidoschmidt/circadian.el][circadian]], Emacs can switch themes based on sunrise
and sunset. I will use [[https://github.com/tmalsburg/tango-plus-theme][Tango Plus]] during the day, and [[https://github.com/arcticicestudio/nord-emacs][Nord Emacs]] at night (with
brightness of comments at 20%). Coordinates are for Southern France. **Note:**
There is currently [[https://github.com/guidoschmidt/circadian.el/issues/9][a bug]] with the switch to Nord theme at night…

#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp :tangle no
(setq nord-comment-brightness 20)
;; (load-theme 'nord t)
;; Montpellier
Expand All @@ -213,19 +215,28 @@ for South Florida:
(setq calendar-longitude 3.8767)
(setq circadian-themes '((:sunrise . tango-plus)
(:sunset . nord)))
;; (setq circadian-themes '(
;; (:sunrise . doom-one-light)
;; (:sunset . doom-one)
;; ;; ("11:37" . doom-one-light)
;; ;; ("11:38" . doom-one)
;; ))
(add-hook 'circadian-before-load-theme-hook
#'(lambda (theme)
(setq custom-face-attributes '())))
(circadian-setup)
#+END_SRC

Alternatively with [[https://github.com/hadronzoo/theme-changer][Theme Changer]]:
With [[https://github.com/LionyxML/auto-dark-emacs][auto-dark]], Emacs can switch to dark mode when the system itself switches to
dark mode (consequently, dark mode needs to be enabled in the system; works for
GNOME). I will use [[https://github.com/tmalsburg/tango-plus-theme][Tango Plus]] during the day, and [[https://github.com/arcticicestudio/nord-emacs][Nord Emacs]] at night (with
brightness of comments at 20%).

#+BEGIN_SRC emacs-lisp :tangle no
(require 'theme-changer)
;; Use color-theme package instead Emacs 24 color theme facility
;; (setq theme-changer-mode "color-theme")
(change-theme 'tango-plus 'nord)
#+BEGIN_SRC emacs-lisp
(setq nord-comment-brightness 20)
(setq auto-dark-light-theme 'tango-plus)
(setq auto-dark-dark-theme 'nord)
(auto-dark-mode t)
#+END_SRC


Expand Down Expand Up @@ -1784,7 +1795,7 @@ new pipe =|>= instead of magrittr's pipe =%>%=):

(with-eval-after-load 'ess-r-mode
(require 'ess-smart-equals)
(setq ess-smart-equals-extra-ops '(brace paren percent))
(setq ess-smart-equals-extra-ops '(brace percent)) ; no 'paren'
(ess-smart-equals-activate))

#+END_SRC
Expand Down

0 comments on commit adcf8d9

Please sign in to comment.