Commit 343b3aad authored by Neil Mather's avatar Neil Mather
Browse files

Literate programming

parent db8e8da2
......@@ -18,3 +18,7 @@
- I'd like to the issue on [[file:../flock.org][Flock]] where reloading a page with stacked notes sometimes gives a 'page not redirecting correctly' error.
- Also some links from subfolders don't work.
- Definitely enjoyed the [[file:../literate-config.org][Literate config]] approach for my spacemacs config. It probably makes sense for config - stuff that is cobbled together over time from various sources. Was thinking about if it would be worth trying it with other code - i.e. [[file:../literate-programming.org][Literate programming]]. It could be problematic on shared projects though, presumably - you'd be forcing everyone in to doing it that way, otherwise your literate file and the code would get out of sync.
- [[file:../adding-timestamps-to-org-roam-notes.org][Adding timestamps to org-roam notes]].
#+title: Literate config
[[file:literate-programming.org][Literate programming]].
#+title: Literate programming
#+CREATED: [2020-11-26 Thu 16:50]
#+LAST_MODIFIED: [2020-11-26 Thu 16:53]
Tried the paradigm a little bit on config files, with [[file:my-spacemacs-user-config.org][My Spacemacs User Config]].
It could be problematic on shared projects though, presumably - you'd be forcing everyone in to doing it that way, otherwise your literate file and the code would get out of sync.
- [[https://gist.github.com/jpf/d71453f535065a0d9281672152541386][Thoughts after 6 months of literate programming · GitHub]]
- [[https://news.ycombinator.com/item?id=10069748][Ask HN: Why did literate programming not catch on? | Hacker News]]
#+TITLE: My Spacemacs User Config
#+property: header-args:elisp :tangle ~/.spacemacs.d/user-config.el :comments org
#+LAST_MODIFIED: [2020-11-26 Thu 16:29]
#+LAST_MODIFIED: [2020-11-26 Thu 16:56]
* Preamble
......@@ -335,36 +335,42 @@ See https://github.com/hlissner/emacs-solaire-mode
** Helm
#+begin_src elisp
(defun open-local-file-projectile (directory)
"Helm action function, open projectile file within DIRECTORY
specify by the keyword projectile-default-file define in
`dir-locals-file'"
(let ((default-file (f-join directory (nth 1
(car (-tree-map (lambda (node)
(when (eq (car node) 'projectile-default-file)
(format "%s" (cdr node))))
(dir-locals-get-class-variables (dir-locals-read-from-dir directory))))))))
(if (f-exists? default-file)
(find-file default-file)
(message "The file %s doesn't exist in the select project" default-file)
(defun open-local-file-projectile (directory)
"Helm action function, open projectile file within DIRECTORY
specify by the keyword projectile-default-file define in
`dir-locals-file'"
(let ((default-file (f-join directory (nth 1
(car (-tree-map (lambda (node)
(when (eq (car node) 'projectile-default-file)
(format "%s" (cdr node))))
(dir-locals-get-class-variables (dir-locals-read-from-dir directory))))))))
(if (f-exists? default-file)
(find-file default-file)
(message "The file %s doesn't exist in the select project" default-file)
)
)
)
)
;; helm-related
;; remove helm duplicates: https://github.com/syl20bnr/spacemacs/issues/13564
(setq history-delete-duplicates t)
(with-eval-after-load "helm-projectile"
(helm-add-action-to-source "Open default file"
'open-local-file-projectile
helm-source-projectile-projects)
)
(with-eval-after-load "helm-projectile"
(helm-add-action-to-source "Open default file"
'open-local-file-projectile
helm-source-projectile-projects)
)
;; (add-to-list 'helm-source-projectile-projects-actions '("Open default file" . open-local-file-projectile) t)
;; (add-to-list 'helm-source-projectile-projects-actions '("Open default file" . open-local-file-projectile) t)
;; https://github.com/syl20bnr/spacemacs/issues/13100
;(setq completion-styles '(helm-flex))
;; https://github.com/syl20bnr/spacemacs/issues/13100
;(setq completion-styles '(helm-flex))
#+end_src
*** Remove duplicates in helm command history
See: https://github.com/syl20bnr/spacemacs/issues/13564
#+begin_src elisp
(setq history-delete-duplicates t)
#+end_src
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment