From daca7f41ff3f6548babb047b10074bf08de5bac9 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sat, 11 Mar 2023 18:37:38 +0100 Subject: [PATCH] [Emacs] Fix org-file export for CI On older org-mode versions, org lists are lists of lists of only one element, so that - a - b - c translates as (("a") ("b") ("c")) But in more recent versions, the same list translates as ("a" "b" "c") This commit handles both situations, as my local Emacs version follows the latter behaviour but the Emacs version available in my CI workflow follows the former behaviour. --- org/config/emacs.org | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/org/config/emacs.org b/org/config/emacs.org index 3b37259..4d650ff 100644 --- a/org/config/emacs.org +++ b/org/config/emacs.org @@ -1901,7 +1901,9 @@ Paris 8 (my university). #+header: :tangle no :exports none #+begin_src emacs-lisp :var lists=mu4e-emacs-mailing-lists (mapconcat (lambda (list) - (let ((address (string-replace (regexp-quote "~") "" list))) + (let ((address (string-replace (regexp-quote "~") + "" + (if (stringp list) list (car list))))) (mapconcat (lambda (flag) (concat flag ":" address)) '("list" "t" "f" "contact") @@ -3848,21 +3850,22 @@ these will be renamed this way: #+begin_src emacs-lisp :var buffers=exwm-renamed-buffers-list :cache yes (format "%s\n%S" (mapconcat (lambda (buffer) - (let ((buffer-name buffer)) + (let ((buffer-name (if (stringp buffer) + buffer + (car buffer)))) (format "(\"%s\" %S)" (downcase buffer-name) - `(exwm-workspace-rename-buffer (concat "EXWM: " - ,buffer-name - " - " - exwm-title))))) + `(exwm-workspace-rename-buffer + (concat ,(concat "EXWM: " buffer-name " - ") + exwm-title))))) buffers "\n") '(_otherwise (exwm-workspace-rename-buffer exwm-title))) #+end_src -#+RESULTS[6811bb0d3e54e891d39c3814f239e4c5ce497214]: exwm-gen-buffers-rename -: ("kitty" (exwm-workspace-rename-buffer (concat "EXWM: " "Kitty" " - " exwm-title))) -: ("qutebrowser" (exwm-workspace-rename-buffer (concat "EXWM: " "Qutebrowser" " - " exwm-title))) +#+RESULTS[64fdbf1e8957b82aad801ec57f2155a0a8f5be54]: exwm-gen-buffers-rename +: ("kitty" (exwm-workspace-rename-buffer (concat "EXWM: Kitty - " exwm-title))) +: ("qutebrowser" (exwm-workspace-rename-buffer (concat "EXWM: Qutebrowser - " exwm-title))) : (_otherwise (exwm-workspace-rename-buffer exwm-title)) #+name: exwm-buffers-name