From ba8f0ae1089e42c1865aff56c81a258aab93c4c2 Mon Sep 17 00:00:00 2001 From: Simon Parri Date: Thu, 25 Sep 2025 11:34:44 -0500 Subject: Emacs: Add ESS for statistics --- common/.emacs.d/init.el | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) (limited to 'common') diff --git a/common/.emacs.d/init.el b/common/.emacs.d/init.el index 04bb259..57c79f7 100644 --- a/common/.emacs.d/init.el +++ b/common/.emacs.d/init.el @@ -3614,26 +3614,35 @@ exactly like localhost." (with-eval-after-load 'ol ;; ol-tabfs (defvar org-tabfs-browser-regexp "Mozilla Firefox$") + (defun org-tabfs-store-link () (when (and (tabfs-exists-p) (string-match-p org-tabfs-browser-regexp (buffer-name))) - (let* ((cur (tabfs--directory - (tabfs--representation->filename - (tabfs-current-tab)))) - (rx (rx bol (or "http" "https" "file"))) + (let* ((cur (expand-file-name + "tabs/last-focused" + tabfs-directory)) (url (string-chop-newline (file-string - (expand-file-name "url.txt" cur)))) - (type (car (string-match-substrings rx url))) + (expand-file-name "capture-url.txt" cur)))) (title (string-chop-newline (file-string (expand-file-name "title.txt" cur))))) - (when type - (org-link-store-props - :type type - :description title - :link (replace-regexp-in-string "^file://" "" url)))))) - (org-link-set-parameters "tabfs" :store #'org-tabfs-store-link)) + (org-link-store-props + :type "tabfs" + :description (unless (string= title "") title) + :link (concat "tabfs:" url))))) + + (defun org-tabfs-open-link (link &optional arg) + (ignore arg) + (let ((create (expand-file-name + "tabs/create-reuse" + tabfs-directory))) + (write-string link create))) + + (org-link-set-parameters + "tabfs" + :store #'org-tabfs-store-link + :follow #'org-tabfs-open-link)) (use-package flymake-diagnostic-at-point :ensure t) @@ -3869,6 +3878,13 @@ instead." (add-hook 'sly-mrepl-mode-hook #'puni-mode)) +(use-package ess + :if (or (group-enabled-p 'stats) + (group-enabled-p 'programming)) + :ensure t + :config + (setq ess-use-flymake nil)) + (progn ;; wesnoth-mode (when-let ((wesnoth-dir (seq-find -- cgit v1.2.3