Skip to content

Instantly share code, notes, and snippets.

@shrysr
Created September 5, 2020 06:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shrysr/61ab10568a545b510594f3a1f053ccb6 to your computer and use it in GitHub Desktop.
Save shrysr/61ab10568a545b510594f3a1f053ccb6 to your computer and use it in GitHub Desktop.
Head: master Adds notes on modus-themes
Merge: origin/master Adds alerts and sauron
Push: gh/master Updated readme and init.el
Untracked files (16)
.agignore
.org-id-locations
base-emacs-config.org
base-emacs-config.org.org
baseline-config.org
emacs-config.html
eww-bookmarks
load-log.txt
network-security.data
oddmuse/
persp-confs/
private-snippets/
savefile/
snippets/mu4e-compose-mode/craigslist-job-response-1
sr-secrets.org.gpg
straight/
Unstaged changes (3)
modified README.org
@@ -1,3 +1,5 @@
+\* shryr's Dotemacs
+
This is my Emacs configuration. As with every Emacs configuration, it
works very well for my needs, and there is always something to learn
from each configuration. In general, I use Emacs for task management,
@@ -8,4 +10,6 @@ life.
Package management via straight.el. I use an org-mode based literate
configuration, and my configuration is fluid as you can see from the
number of commits. I would recommend browsing through the configuration
-and picking up the snippets that interest you.
+and picking up the snippets that interest you. The file
+[[file:emacs-config.org][emacs-config.org]] is the source of truth from
+which every file is tangled.
modified emacs-config.org
@@ -1,5 +1,5 @@
#+STARTUP: overview
-#+PROPERTY: header-args :results silent :tangle ./dotemacs.el
+#+PROPERTY: header-args :results silent :tangle ./dotemacs.el
#+toc: t
#+hugo_base_dir: ~/my_org/hugo-sr/
#+hugo_section: docs
@@ -13,24 +13,41 @@
#+TITLE: shrysr's Dotemacs.
* Readme
+:PROPERTIES:
+:CUSTOM_ID: h:1C29D934-00F9-4612-B819-62BF53E5DC97
+:END:
#+BEGIN_SRC org :tangle ./README.org
+\* shryr's Dotemacs
-
-#+BEGIN_SRC org
This is my Emacs configuration. As with every Emacs configuration, it
works very well for my needs, and there is always something to learn
from each configuration. In general, I use Emacs for task management,
coding, email, web browsing, blogging, as well as a journal system to
say the least. Using and learning Emacs and Org mode has changed my
life.
-I've been using my own configuration on top of the excellent
-[[https://github.com/jkitchin/scimax][Scimax starter-kit]] for the past
-many years. This is a reboot to reverse or study the bias, and create My
-Very Own Emacs configuration. It obviously includes massive snippets of
-code from Scimax, as well as other configurations I come across, not to
-mention the excellent advice often received from #emacs and other
-geniuses lurking in irc channels, and of course the vast internet.
+
+Package management via straight.el. I use an org-mode based literate
+configuration, and my configuration is fluid as you can see from the
+number of commits. I would recommend browsing through the configuration
+and picking up the snippets that interest you. The file
+[[file:emacs-config.org][emacs-config.org]] is the source of truth from
+which every file is tangled.
+
+#+END_SRC
+
+* Introduction
+:PROPERTIES:
+:CUSTOM_ID: h:8E548BE0-62F2-4FDA-8E81-1B00533808F7
+:END:
+
+I've been using my own configuration on top of the excellent [[https://github.com/jkitchin/scimax][Scimax
+starter-kit]] for the past many years. This is a reboot to reverse or
+study the bias, and create My Very Own Emacs configuration. It obviously
+includes massive snippets of code from Scimax, as well as other
+configurations I come across, not to mention the excellent advice often
+received from #emacs and other geniuses lurking in irc channels, and of
+course the vast internet.
#+BEGIN_QUOTE
- Note that this config is still under a great deal of flux at the
@@ -45,14 +62,12 @@ geniuses lurking in irc channels, and of course the vast internet.
whole for anybody interested.
#+END_QUOTE
-#+END_SRC
-
** Overall setup
:PROPERTIES:
:ID: F59AFE11-0E90-4784-8F85-25C19E704E70
+:CUSTOM_ID: h:D454EE91-93AC-41EE-8937-A00657B16E08
:END:
-#+BEGIN_SRC org
The file ~emacs-config.org~ is the source of truth for the entire
config. This file is tangled into this README, and into init.el and
dotemacs.el. Other settings like gitignore are also tangled from the Org
@@ -102,14 +117,12 @@ General notes:
- I would prefer not using git hooks for the tangling because my commit
workflow is still erratic. Sometimes, there is no change in code, but
just some additional notes to the configuration.
-#+END_SRC
-
** TODO Inspirations (and other literate configurations)
:PROPERTIES:
:ID: 9C707625-50A5-49D4-B222-7709568CEFD2
+:CUSTOM_ID: h:94A0C497-999E-4127-BACB-895CD7EE98C4
:END:
-#+BEGIN_SRC org
This is a growing and non-comprehensive list of configurations that I
admire and have liberally copied from in constructing my own.
@@ -122,18 +135,20 @@ admire and have liberally copied from in constructing my own.
- [[https://github.com/wasamasa/dotemacs][GitHub - wasamasa/dotemacs: Literate Emacs configuration]]
- [[https://github.com/IvanMalison/dotfiles][GitHub - IvanMalison/dotfiles: Configuration files for XMonad, Emacs, NixOS, Taffybar and more.]]
- [[https://protesilaos.com/dotemacs/][GNU Emacs integrated computing environment | Protesilaos Stavrou]].
-
+- [[https://git.sr.ht/~technomancy/dotfiles][Technomancy's Dotfiles]] - this configuration is not based on org-mode,
+ but I think it is a good example to learn from, and definitely good
+ enough to begin with.
+
In general - code and snippet source references are added as and when
possible though this is a tedius task for those with configurations
under a great rate of flux.
-#+END_SRC
** TODO Packages I've found very useful
:PROPERTIES:
:ID: 86AAE7DE-B6F3-41BC-88C3-4C530F80BD5C
+:CUSTOM_ID: h:730E6D2F-0B66-431A-8F1F-485BCA80E21A
:END:
-#+BEGIN_SRC org
Though I'm using a huge number of packages - this list reflects the
absolute core that I consider to be essential to my current /daily/
workflow. This list is being formulated so that I can develop a minimal
@@ -156,16 +171,19 @@ Emacs config that can be used for a rapid setup on a headless server.
* Init setup
:PROPERTIES:
:header-args: :tangle ./init.el
+:CUSTOM_ID: h:83310F21-750B-4535-93E9-EE603B7CC367
:END:
This part of the config has to be tangled to init.el so that straight
and use-package can be setup. This is a separate init file as it is
expected to remain stable and will be the only .el file that is in git
-commit.
+commit. The idea is also to include some fundamental settings to make it
+easier to use Emacs. This unfortunately includes the counsel package.
** Lexical Scope and binding
:PROPERTIES:
:ID: 3CBA7F73-C58D-4B9F-9B9E-3E02B52F6890
+:CUSTOM_ID: h:4B5165ED-B00E-456E-B487-CEE9D896D3AC
:END:
A reasonable explanation of the importance of lexical binding is available [[info:elisp#Lexical%20Binding][in the elisp manual]]. This is essentially similar to the quoted or unquoted variables in R.
@@ -175,18 +193,19 @@ A lexically-bound variable has lexical scope, meaning that any reference to the
construct.
#+END_QUOTE
-
- #+BEGIN_SRC emacs-lisp
+#+name: base/lexical-scope
+#+BEGIN_SRC emacs-lisp
;;; -*- lexical-binding: t -*-
(setq-default lexical-binding t)
- #+END_SRC
+#+END_SRC
- #+RESULTS:
- : t
+#+RESULTS:
+: t
** Garbage collection
:PROPERTIES:
:ID: B38F4BDA-37C8-412E-B892-851A2176CFD0
+:CUSTOM_ID: h:61FBC769-18FC-4BB2-B44C-F692D85FF25C
:END:
- Note taken on [2020-04-09 Thu 18:09] \\
As the doom emacs FAQ states - the GC collection has to be set back to
@@ -205,14 +224,15 @@ References:
subject. Like garbage collection when focus is lost from
Emacs. The doom docs claim this is done via the gcmh package.
+#+name: base/garbage-collection
#+BEGIN_SRC emacs-lisp
(setq gc-cons-threshold most-positive-fixnum ; 2^61 bytes
gc-cons-percentage 0.6)
(add-hook 'emacs-startup-hook
- (lambda ()
- (setq gc-cons-threshold 16777216 ; 16mb
- gc-cons-percentage 0.1)))
+ (lambda ()
+ (setq gc-cons-threshold 16777216 ; 16mb
+ gc-cons-percentage 0.1)))
;; Raising gc-cons threshold when the minibuffer is active
@@ -224,28 +244,32 @@ References:
;; benefits.
(run-at-time
1 nil (lambda () (setq gc-cons-threshold 16777216 ; 16mb
- gc-cons-percentage 0.1) )))
+ gc-cons-percentage 0.1) )))
(add-hook 'minibuffer-setup-hook #'doom-defer-garbage-collection-h)
(add-hook 'minibuffer-exit-hook #'doom-restore-garbage-collection-h)
#+END_SRC
#+RESULTS:
-| pl/minibuffer-exit | doom-restore-garbage-collection-h |
+| doom-restore-garbage-collection-h |
** Package management
+:PROPERTIES:
+:CUSTOM_ID: h:D7799517-CBBC-466F-87F6-010A51D289AC
+:END:
*** Straight
:PROPERTIES:
:ID: A1B35506-B602-4344-9F49-2BD76C932C78
+:CUSTOM_ID: h:E9FD31AE-008E-40DD-A7D7-AF7E131D006F
:END:
This snippet essentially bootstraps straight.el, which has several advantages over use-package, along with the ability to seamlessly work with use-package as well.
- By bootsrapping, this means that the straight package is downloaded to the user's emacs directory and compiled and installed. Unless set otherwise, the user's emacs directory is =~/.emacs.d=
+By bootsrapping, this means that the straight package is downloaded to the user's emacs directory and compiled and installed. Unless set otherwise, the user's emacs directory is =~/.emacs.d=
-#+name: straight-setup
- #+BEGIN_SRC emacs-lisp
+#+name: base/straight-setup
+#+BEGIN_SRC emacs-lisp
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
@@ -258,17 +282,18 @@ This snippet essentially bootstraps straight.el, which has several advantages ov
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
- #+END_SRC
+#+END_SRC
- #+RESULTS: straight-setup
- : t
+#+RESULTS: straight-setup
+: t
*** Use-package integration with straight
:PROPERTIES:
:ID: A970A1D7-083C-4982-A7A0-E026B9BFFE57
+:CUSTOM_ID: h:7195E994-A43C-4638-9AC4-EC9878605AC0
:END:
-#+name: use-package-with-straight
+#+name: base/use-package-with-straight
#+BEGIN_SRC emacs-lisp
(setq straight-use-package-by-default t)
(straight-use-package 'use-package)
@@ -278,23 +303,49 @@ This snippet essentially bootstraps straight.el, which has several advantages ov
#+RESULTS: use-package-with-straight
- #+RESULTS:
+#+RESULTS:
+
+*** Enabling use-package statistics
+:PROPERTIES:
+:CUSTOM_ID: h:AB2C52AD-9263-4898-97FF-F683E4C1CA91
+:END:
+Refer [[https://github.com/jwiegley/use-package#gathering-statistics][Use-package documentation]]. Thanks to cyflea on #emacs for this
+reference. As mentioned above, this has to be set right after
+use-package is enabled, and before any other packages are loaded.
+
+#+BEGIN_SRC emacs-lisp
+(setq use-package-compute-statistics t)
+#+END_SRC
+
+*** Use-package ensure system package
+:PROPERTIES:
+:CUSTOM_ID: h:AA8CC5ED-61C8-40C4-92AC-EF8C46BD4094
+:END:
+
+#+name: base/ensure-system-package
+#+BEGIN_SRC emacs-lisp
+(straight-use-package 'use-package-ensure-system-package)
+#+END_SRC
+
+#+RESULTS:
+: t
** Some basic directory definitions
:PROPERTIES:
:ID: 52D8055A-D99B-463C-8F97-056C068EDACD
+:CUSTOM_ID: h:EB9CF3B5-288C-4C1F-B9C7-F59A1EF4AE3F
:END:
-#+name: directory-definitions
+#+name: base/directory-definitions
#+BEGIN_SRC emacs-lisp
;; Base function to create the home directory
(defun sr/fun/homedir (foldername)
-"Function to extract the home directory path"
+ "Function to extract the home directory path"
(expand-file-name foldername (getenv "HOME")))
;; Emacs directory defauling to .emacs.d
(defun sr/fun/emacs-dir (foldername)
-"Function to prepend the project directory path to any folder. Starts from the home directory."
+ "Function to prepend the project directory path to any folder. Starts from the home directory."
(expand-file-name foldername (sr/fun/homedir ".emacs.d" )))
#+END_SRC
@@ -304,11 +355,12 @@ This snippet essentially bootstraps straight.el, which has several advantages ov
** Shorten yes or no
:PROPERTIES:
:ID: 4A052D85-5CA0-4703-94BD-693A88D89926
+:CUSTOM_ID: h:80A9D784-4DFD-419E-BD16-77F20AD57D69
:END:
It is infuriating that this is not a default in emacs. Therefore this minor snippet is included in the init.
-#+name: em-shorten-yn
+#+name: base/em-shorten-yn
#+BEGIN_SRC emacs-lisp
(fset 'yes-or-no-p 'y-or-n-p)
#+END_SRC
@@ -319,11 +371,36 @@ It is infuriating that this is not a default in emacs. Therefore this minor snip
#+RESULTS:
: y-or-n-p
+** Follow vc sym links
+:PROPERTIES:
+:CUSTOM_ID: h:261CAB48-C75A-445E-81C3-1B9A2D80F3D2
+:END:
+
+#+name: base/follow-symlinks
+#+BEGIN_SRC emacs-lisp
+(setq vc-follow-symlinks 't)
+;; The default value seems to be 'ask
+#+END_SRC
+
+** Load prefer newer
+:PROPERTIES:
+:CUSTOM_ID: h:DFD196A3-34A1-4AD0-8F81-B9359225DCDA
+:END:
+#+name: base/load-prefer-newer
+#+BEGIN_SRC emacs-lisp
+(setq load-prefer-newer t)
+#+END_SRC
+
+#+RESULTS:
+: t
+
** Load main config
:PROPERTIES:
:ID: CEBFC8FA-011A-4836-A815-9B00746EF8AE
+:CUSTOM_ID: h:A2215326-601A-4740-BD0D-0FCD4BE1DE61
:END:
+#+name: name
#+BEGIN_SRC emacs-lisp
(load (sr/fun/emacs-dir "dotemacs.el"))
#+END_SRC
@@ -334,6 +411,7 @@ It is infuriating that this is not a default in emacs. Therefore this minor snip
* .gitignore
:PROPERTIES:
:ID: 3BBFF3C0-D494-4988-A450-22662D15E5FE
+:CUSTOM_ID: h:A3D4788A-E686-4F84-A32E-3F83EA013601
:END:
- Note taken on [2020-03-26 Thu 11:38] \\
In this process, I realised that as long as there is a .gitignore file present (and not in a commit) and the specified files have never been in a commit - git automatically ignores these files. i.e there is no need to commit a .gitignore file.
@@ -381,20 +459,24 @@ emacs configuration.
* Tangle Emacs config on save
:PROPERTIES:
:ID: EE52585C-C1D6-4759-94AE-CCECA01E5D41
+:CUSTOM_ID: h:87B636BF-CDA0-4E4E-95E6-0C69FE6D68D1
:END:
** TODO Tangle on save without async
:PROPERTIES:
:ID: 47CCBB72-667B-4710-AF6F-32B9DEA32E89
+:CUSTOM_ID: h:40A16A11-0E8F-4512-814E-2630E728F68B
:END:
As such the tangling hardly takes any time. [[https://thewanderingcoder.com/2015/02/literate-emacs-configuration/][Literate Emacs Configuration | Sean Miller: The Wandering Coder]] provides an example of setting up a function. This uses the buffer file name to tangle for the emacs config file. A hook is added to the save function to check.
- [ ] Add a force tangle option if files do not exist. This is because, if for troubleshooting purposes, the el files are deleted, and there is no change in the org file, then the tangling does not take place at all. In general, it may be better to ensure the el files are deleted and tangled again.
+#+name: base/tangle-on-save-1
#+BEGIN_SRC emacs-lisp
(defun sr/fun/tangle-on-save-init ()
-(when (string= buffer-file-name (file-truename "~/.emacs.d/emacs-config.org"))
-(org-babel-tangle)))
+ (when (string= buffer-file-name (file-truename "~/.emacs.d/emacs-config.org"))
+ (org-babel-tangle)))
+
(add-hook 'after-save-hook 'sr/fun/tangle-on-save-init)
@@ -404,6 +486,9 @@ As such the tangling hardly takes any time. [[https://thewanderingcoder.com/2015
| rmail-after-save-hook | backup-each-save | sr/fun/tangle-on-save-init |
** Local file variables
+:PROPERTIES:
+:CUSTOM_ID: h:C29EC1A1-D58E-4A3C-A5FE-0ADFDF789785
+:END:
One way to do this is via local file variables, adding the following to the init file (or any file). However, it seems that this is not 'activated' by default.
@@ -414,6 +499,9 @@ One way to do this is via local file variables, adding the following to the init
#+END_EXAMPLE
** TODO COMMENT Async function to tangle org file on save.
+:PROPERTIES:
+:CUSTOM_ID: h:3A1C8E08-1E14-4B21-8FAE-6BBE48475E8E
+:END:
This is inspired from [[https://www.reddit.com/r/emacs/comments/5ej8by/asynchronous_tangle_and_compile_of_configorg/][Asynchronous tangle and compile of config.org(question/issue) : emacs]] on reddit and a work in progress. Since I am using straight.el, the byte compilation of packages is not necessary (or already taken care of). It is probably worth noting that the tangling process is almost instant and maybe this effort is not warranted.
@@ -424,7 +512,7 @@ This is inspired from [[https://www.reddit.com/r/emacs/comments/5ej8by/asynchron
(async-start
(lambda ()
(org-babel-tangle))
-(message "Tangle async done")))
+ (message "Tangle async done")))
#+END_SRC
@@ -434,6 +522,7 @@ This is inspired from [[https://www.reddit.com/r/emacs/comments/5ej8by/asynchron
* Various directories
:PROPERTIES:
:ID: 252B8837-EE16-41C1-96C1-3F6C05D156BF
+:CUSTOM_ID: h:16F95DBF-7532-4590-81A6-1FD8EABC19CC
:END:
I am not sure if the best way to define these locations is by using a
@@ -456,28 +545,29 @@ distinguish between variables and functions quickly. I would like a way
to differentiate functions and variables, and therefore the
=sr/fun/function-name=. Most people limit this to my/function-name.
+#+name: base/setting-directories
#+BEGIN_SRC emacs-lisp
(defun sr/fun/project-dir (foldername)
-"Function to prepend the project directory path to any folder. Starts from the home directory."
+ "Function to prepend the project directory path to any folder. Starts from the home directory."
(expand-file-name foldername (sr/fun/homedir "my_projects" )))
(defun sr/fun/org-dir (foldername)
-"Function to prepend the org directory path to any folder. Starts from the home directory."
+ "Function to prepend the org directory path to any folder. Starts from the home directory."
(expand-file-name foldername (sr/fun/homedir "my_org" )))
(defun sr/fun/roam-private-dir (foldername)
-"Function to prepend the org directory path to any folder. Starts from the home directory."
- (expand-file-name foldername (sr/fun/org-dir "roam/00_private/" )))
+ "Function to prepend the org directory path to any folder. Starts from the home directory."
+ (expand-file-name foldername (sr/fun/org-dir "roam/private/" )))
(defun sr/fun/roam-public-dir (foldername)
-"Function to prepend the org directory path to any folder. Starts from the home directory."
+ "Function to prepend the org directory path to any folder. Starts from the home directory."
(expand-file-name foldername (sr/fun/org-dir "roam/" )))
(defun sr/fun/emacs-meta-dir (foldername)
-"Function to prepend the org directory path to any folder. Starts from the home directory."
- (expand-file-name foldername (sr/fun/roam-private-dir "emacs_meta" )))
+ "Function to prepend the org directory path to any folder. Starts from the home directory."
+ (expand-file-name foldername (sr/fun/org-dir "emacs_meta" )))
(setq sr/project-dir (sr/fun/project-dir ""))
(setq sr/emacs-meta-dir (sr/fun/emacs-meta-dir ""))
@@ -492,6 +582,7 @@ to differentiate functions and variables, and therefore the
* Auto-save
:PROPERTIES:
:ID: 6BBBB542-2501-4516-A138-692EC000CBC3
+:CUSTOM_ID: h:2B68F7DB-C669-44D7-99A2-636D08786CB5
:END:
Copied from ldleworth's config. I think this makes sense for me at the moment. Here is a summary:
@@ -510,45 +601,46 @@ Copied from ldleworth's config. I think this makes sense for me at the moment. H
- [ ] check whether this causes any lag with operating emacs.
- keep 10 versions of old backups and delete old backups.
-#+name: emacs-autosave-settings
+#+name: base/emacs-autosave-settings
#+BEGIN_SRC emacs-lisp
(setq auto-save-default t)
(setq auto-save-timeout 20
- auto-save-interval 60)
+ auto-save-interval 240)
(defvar emacs-autosave-directory
-(concat user-emacs-directory "autosaves/"))
+ (concat user-emacs-directory "autosaves/"))
(unless (file-exists-p emacs-autosave-directory)
-(make-directory emacs-autosave-directory))
+ (make-directory emacs-autosave-directory))
(setq auto-save-file-name-transforms
-`((".*" ,emacs-autosave-directory t)))
+ `((".*" ,emacs-autosave-directory t)))
(setq backup-directory-alist `((".*" . ,emacs-autosave-directory)))
(use-package backup-each-save
-:straight t
-:config (add-hook 'after-save-hook 'backup-each-save))
+ :straight t
+ :config (add-hook 'after-save-hook 'backup-each-save))
(setq vc-make-backup-files t)
(setq backup-by-copying t)
(setq kept-new-versions 10
-kept-old-verisons 0
-delete-old-versions t)
+ kept-old-verisons 0
+ delete-old-versions t)
#+END_SRC
* OS Level variables
:PROPERTIES:
:ID: BE6ABB97-4B9A-4E2F-9D74-83F6AECF8A4D
+:CUSTOM_ID: h:727B49EA-4A90-4BCA-9F70-23BB0F2C72D1
:END:
Since I switch between a Linux machine and a Mac frequently, it is better to define variables that can be used to set other variables depending on the OS.
-#+name: os-level-variables
+#+name: base/os-level-variables
#+BEGIN_SRC emacs-lisp
;; Get current system's name
(defun insert-system-name()
@@ -578,11 +670,31 @@ Since I switch between a Linux machine and a Mac frequently, it is better to def
(string-equal system-type "gnu/linux")
)
+#+END_SRC
+
+* Fill column and auto-fill and refill for text modes
+:PROPERTIES:
+:ID: 3A60EF9B-1308-44B9-B7D4-009370687D38
+:CUSTOM_ID: h:7F152A0D-F0BC-40F8-92D5-739182298BB6
+:END:
+
+#+name: base/auto-fill
+#+BEGIN_SRC emacs-lisp
+(setq-default fill-column 72)
+(global-visual-line-mode 1)
+(add-hook 'text-mode-hook 'auto-fill-mode)
+(add-hook 'org-mode-hook 'auto-fill-mode)
+;; I am not sure I want to enable this for markdown mode. Enabled on a
+;; trial basis
+(add-hook 'markdown-mode-hook 'auto-fill-mode)
+
+
#+END_SRC
* Org-mode related
:PROPERTIES:
:ID: 57711EE4-7077-4084-9513-1FEBBC016D81
+:CUSTOM_ID: h:C97FEF0E-F208-4777-8947-106147F57625
:END:
These have packages and settings that are mostly related to org-mode
@@ -592,236 +704,305 @@ given it's own section though it is org-mode related.
** Installing org and org plus contrib via straight
:PROPERTIES:
:ID: 1D103003-0690-4DD0-964C-2E5DCDEC1937
+:CUSTOM_ID: h:F7939FA9-4BFF-4BA3-8262-044C4C18BB45
:END:
-*** Old
+*** COMMENT Old
:PROPERTIES:
:ID: 807D3F5C-D02C-4020-8222-F473B2FA8876
+:CUSTOM_ID: h:51CEE0E3-1625-4AFA-89A6-938C2F3EDFFC
:END:
Reference: [[https://github.crookster.org/switching-to-straight.el-from-emacs-26-builtin-package.el/][Crookster's blog post]]
#+name: org-installation-with-straight-1
#+BEGIN_SRC emacs-lisp
;;______________________________________________________________________
-;;;; Installing Org with straight.el
-;;; https://github.com/raxod502/straight.el/blob/develop/README.md#installing-org-with-straightel
+ ;;;; Installing Org with straight.el
+ ;;; https://github.com/raxod502/straight.el/blob/develop/README.md#installing-org-with-straightel
(require 'subr-x)
(straight-use-package 'git)
(defun org-git-version ()
"The Git version of 'org-mode'.
-Inserted by installing 'org-mode' or when a release is made."
+ Inserted by installing 'org-mode' or when a release is made."
(require 'git)
(let ((git-repo (expand-file-name
- "straight/repos/org/" user-emacs-directory)))
+ "straight/repos/org/" user-emacs-directory)))
(string-trim
(git-run "describe"
- "--match=release\*"
- "--abbrev=6"
- "HEAD"))))
+ "--match=release\*"
+ "--abbrev=6"
+ "HEAD"))))
(defun org-release ()
"The release version of 'org-mode'.
-Inserted by installing 'org-mode' or when a release is made."
+ Inserted by installing 'org-mode' or when a release is made."
(require 'git)
(let ((git-repo (expand-file-name
- "straight/repos/org/" user-emacs-directory)))
+ "straight/repos/org/" user-emacs-directory)))
(string-trim
(string-remove-prefix
"release_"
(git-run "describe"
- "--match=release\*"
- "--abbrev=0"
- "HEAD")))))
+ "--match=release\*"
+ "--abbrev=0"
+ "HEAD")))))
(provide 'org-version)
;; (straight-use-package 'org) ; or org-plus-contrib if desired
(use-package org-plus-contrib
- :mode (("\\.org$" . org-mode))
- :bind
- ("C-c l" . org-store-link)
- ("C-c a" . org-agenda))
+ :mode ;; (("\\.org$" . org-mode))
+ :bind
+ ("C-c l" . org-store-link)
+ ("C-c a" . org-agenda))
#+END_SRC
-*** COMMENT ldlework's alternative
+*** ldlework's alternative
+:PROPERTIES:
+:CUSTOM_ID: h:A8BBA4E2-99AA-462C-B1C3-43359E62C822
+:END:
- Note taken on [2020-03-30 Mon 20:24] \\
The only addition is the installation of org-plus-contrib and setting the shortcuts for the agenda and link.
**** Fix org-git version
:PROPERTIES:
:ID: 9E872705-E3CD-4A1F-98B2-63406665656B
+:CUSTOM_ID: h:3F6E5781-C04E-4593-988F-46D11E8FBD0F
:END:
#+BEGIN_SRC emacs-lisp
(defun fix-org-git-version ()
-"The Git version of org-mode.
+ "The Git version of org-mode.
Inserted by installing org-mode or when a release is made."
-(require 'git)
-(let ((git-repo (expand-file-name
-"straight/repos/org/" user-emacs-directory)))
-(string-trim
-(git-run "describe"
-"--match=release\*"
-"--abbrev=6"
-"HEAD"))))
+ (require 'git)
+ (let ((git-repo (expand-file-name
+ "straight/repos/org/" user-emacs-directory)))
+ (string-trim
+ (git-run "describe"
+ "--match=release\*"
+ "--abbrev=6"
+ "HEAD"))))
#+END_SRC
**** Fix org release
:PROPERTIES:
:ID: 88C7834B-F216-43C5-A88A-0CA1A82D3365
+:CUSTOM_ID: h:41D19492-F488-4023-96B9-3612C919573D
:END:
-
+
#+BEGIN_SRC emacs-lisp
(defun fix-org-release ()
-"The release version of org-mode.
+ "The release version of org-mode.
Inserted by installing org-mode or when a release is made."
-(require 'git)
-(let ((git-repo (expand-file-name
-"straight/repos/org/" user-emacs-directory)))
-(string-trim
-(string-remove-prefix
-"release_"
-(git-run "describe"
-"--match=release\*"
-"--abbrev=0"
-"HEAD")))))
+ (require 'git)
+ (let ((git-repo (expand-file-name
+ "straight/repos/org/" user-emacs-directory)))
+ (string-trim
+ (string-remove-prefix
+ "release_"
+ (git-run "describe"
+ "--match=release\*"
+ "--abbrev=0"
+ "HEAD")))))
#+END_SRC
**** Install org
:PROPERTIES:
:ID: 44D0A1FB-C1F2-4522-B493-9411297195D5
+:CUSTOM_ID: h:33AD7073-6116-465A-AB68-E50BB9D45FB0
:END:
#+BEGIN_SRC emacs-lisp
(use-package org
-:demand t
-:mode ("\\.org\\'" . org-mode)
-:config
-;; these depend on the 'straight.el fixes' above
-(defalias #'org-git-version #'fix-org-git-version)
-(defalias #'org-release #'fix-org-release)
-(require 'org-habit)
-(require 'org-capture)
-(require 'org-tempo))
+ :demand t
+ :mode ("\\.org\\'" . org-mode)
+ :config
+ ;; these depend on the 'straight.el fixes' above
+ (defalias #'org-git-version #'fix-org-git-version)
+ (defalias #'org-release #'fix-org-release)
+ (require 'org-habit)
+ (require 'org-capture)
+ (require 'org-tempo))
(use-package org-plus-contrib
- :mode (("\\.org$" . org-mode))
- :bind
- ("C-c l" . org-store-link)
- ("C-c a" . org-agenda))
+ :mode (("\\.org$" . org-mode))
+ :bind
+ ("C-c l" . org-store-link)
+ ("C-c a" . org-agenda))
+#+END_SRC
+
+#+RESULTS:
+: org-agenda
+
+*** COMMENT straight install
+:PROPERTIES:
+:CUSTOM_ID: h:CDDBB6FC-7519-4E0B-9D57-541DD96FF43A
+:END:
+
+The readme indicates the hack has now been built in as a default.
+
+#+BEGIN_SRC emacs-lisp
+(straight-use-package 'org)
#+END_SRC
-** Collection of hooks for org mode
+** Default org directory and agenda file directory
:PROPERTIES:
-:ID: AA8706FA-0B26-4F0A-B6F8-2E2EDA551375
+:ID: be1c3eed-5e7d-4f62-a5f4-127c0ee30a73
+:CUSTOM_ID: h:F6F31451-CE93-4673-953C-1CE2113AEAA8
:END:
-This is intended to be a collection of hooks loaded after org mode. It may be more convenient to add such hooks in the package configurations since the hooks will not work if the package is not available.
-However, hooks have the potential to slow down search, opening multiple files like in org-agenda, tramp files and so on. Therefore, the idea is to try collect the hooks here and include logic to discard hooks if the mode or package is not installed.
+- [ ] use the roam private location function to define the org agenda
+ files.
+- [ ] it may be worth using the roam directory or the private directory
+ as the org-directory. The benefits should be evaluated.
-- [ ] Maybe work on a method to switch off all the hooks after org mode since this mode is being used extensively.
+ #+BEGIN_SRC emacs-lisp
+(setq org-agenda-files nil)
+ #+END_SRC
-List of hooks
-- [ ] Org indent mode
-- [ ] Flyspell mode
-- [ ]
+
+#+begin_src emacs-lisp
+(setq org-directory "~/my_org")
+(setq org-agenda-files '("~/my_org"))
+;; (setq org-agenda-files '("~/my_org/roam/private/todo-global.org"))
-#+BEGIN_SRC emacs-lisp
-;; Indent by header level
-(with-eval-after-load 'org
- (add-hook 'org-mode-hook #'org-indent-mode))
+;; (custom-set-variables
+;; '(org-directory "~/my_org/roam/private")
+;; '(org-agenda-files (list org-directory)))
-;; Enable flyspell mode
+;; One issue with this is that the the list of files is re-added every time the configuration is run.
+;; (add-to-list 'org-agenda-files sr/roam-private-dir)
-(add-hook 'org-mode-hook 'flyspell-mode)
+#+end_src
+
+#+RESULTS:
+| ~/my_org/ |
+** Hide emphasis markers
+:PROPERTIES:
+:ID: 71F342FB-E30C-4C91-93CF-AA855716C109
+:CUSTOM_ID: h:2EF177CD-7C3C-4A54-8D36-E21A6F6F8ACF
+:END:
+#+BEGIN_SRC emacs-lisp
+(setq org-hide-emphasis-markers t)
#+END_SRC
+** Org-superstar
+:PROPERTIES:
+:ID: 21205D80-F99D-465C-B0F2-58CA62BD765D
+:CUSTOM_ID: h:55E36B85-FBF7-4574-85E8-6E554D6CC593
+:END:
-** Exports
-*** Markdown export
+#+BEGIN_SRC emacs-lisp
+(use-package org-superstar
+ :straight t
+ :config
+ (add-hook 'org-mode-hook (lambda () (org-superstar-mode 1)))
+ (setq org-superstar-configure-like-org-bullets t))
+#+END_SRC
+** Startup with org indented
:PROPERTIES:
-:ID: A7FBD8B1-5C55-407A-8409-65EB85C8FDD4
+:ID: 61A0F5AB-C9F9-4783-B32C-6806A10D3116
+:CUSTOM_ID: h:F7B81D1E-1621-46F9-B5EF-B8EF4FCC51BC
:END:
#+BEGIN_SRC emacs-lisp
-(require 'ox-md)
+(setq org-startup-indented 't)
#+END_SRC
-*** ox-pandoc
+** Org Speed commands
:PROPERTIES:
-:ID: 1B23050A-3ABD-48C9-A0B1-6294414748E0
+:ID: 064C080D-4C7E-4EA5-A173-2EA058A7B19A
+:CUSTOM_ID: h:C1EFBC56-6FFD-40D8-BEF2-8D85E6797B11
:END:
+I think the speed commands should be enabled first to enable easy
+navigation of org mode documents.
+
+#+name: org-basics
#+BEGIN_SRC emacs-lisp
-(use-package ox-pandoc
- :ensure t
- :straight t
- :defer 5)
+(require 'org-inlinetask)
+(require 'org-mouse)
+
+;; Make editing invisible regions smart
+(setq org-catch-invisible-edits 'smart)
+
+;; allow lists with letters in them.
+(setq org-list-allow-alphabetical t)
+
+(setq org-src-tab-acts-natively t)
+
+(setq org-use-speed-commands t)
+
+(add-to-list 'org-speed-commands-user (cons "P" 'org-set-property))
+(add-to-list 'org-speed-commands-user (cons "d" 'org-deadline))
+
+;; Mark a subtree
+(add-to-list 'org-speed-commands-user (cons "m" 'org-mark-subtree))
+
+;; Widen
+(add-to-list 'org-speed-commands-user (cons "S" 'widen))
+
+;; kill a subtree
+(add-to-list 'org-speed-commands-user (cons "k" (lambda ()
+ (org-mark-subtree)
+ (kill-region
+ (region-beginning)
+ (region-end)))))
+
+;; Jump to headline
+(add-to-list 'org-speed-commands-user
+ (cons "q" (lambda ()
+ (avy-with avy-goto-line
+ (avy--generic-jump "^\\*+" nil avy-style)))))
+
#+END_SRC
#+RESULTS:
+: ((q lambda nil (avy-with avy-goto-line (avy--generic-jump ^\*+ nil avy-style))) (q lambda nil (let ((avy-keys (or (cdr (assq (quote avy-goto-line) avy-keys-alist)) avy-keys)) (avy-style (or (cdr (assq (quote avy-goto-line) avy-styles-alist)) avy-style)) (avy-command (quote avy-goto-line))) (setq avy-action nil) (fset (quote avy-resume) (function (lambda nil (interactive) (avy--generic-jump ^\*+ nil avy-style)))) (avy--generic-jump ^\*+ nil avy-style))) (k lambda nil (org-mark-subtree) (kill-region (region-beginning) (region-end))) (S . widen) (m . org-mark-subtree) (d . org-deadline) (P . org-set-property))
** TODO Agenda mechanics
-*** Set org agenda window to be the only window
+:PROPERTIES:
+:CUSTOM_ID: h:E7CE67A0-3467-43E4-8D26-FF2CE02A7208
+:END:
+*** Set org agenda window to be the only window
:PROPERTIES:
:ID: 48DCE365-CB7B-4AC0-B03E-3C504CC8DC72
+:CUSTOM_ID: h:BAAE6D5F-A3FC-4694-A3DE-03129EADE397
:END:
Thanks to jamzattack on #Emacs for this one. This is very convenient, as
-I always want the agenda launched with a full window.
+I always want the agenda launched with a full window.
#+BEGIN_SRC emacs-lisp
(setq org-agenda-window-setup 'only-window)
#+END_SRC
*** Weekday starts on Monday
- :PROPERTIES:
- :ID: d9f341b0-ad88-40ca-a19a-9ca710b2d681
- :END:
+:PROPERTIES:
+:ID: d9f341b0-ad88-40ca-a19a-9ca710b2d681
+:CUSTOM_ID: h:D4B14B1E-C484-4F5A-A468-54ACECE90074
+:END:
#+BEGIN_SRC emacs-lisp
(setq org-agenda-start-on-weekday 1)
#+end_src
*** Display heading tags farther to the right
- :PROPERTIES:
- :ID: 4d9c3678-f06d-49c5-9f80-184c0e2fac4e
- :END:
+:PROPERTIES:
+:ID: 4d9c3678-f06d-49c5-9f80-184c0e2fac4e
+:CUSTOM_ID: h:891CF8FE-8BF4-4169-ABFE-702CBBE20BE1
+:END:
#+BEGIN_SRC emacs-lisp
(setq org-agenda-tags-column -130)
#+end_src
-*** Default org directory and agenda file directory
+*** TODO Agenda customisation
:PROPERTIES:
-:ID: be1c3eed-5e7d-4f62-a5f4-127c0ee30a73
+:ID: 0b93631b-5a2d-4764-92b0-f5cdf42fffe7
+:CUSTOM_ID: h:F2B3B85C-ACB7-4C6E-AD09-04C4E0EFC3CA
:END:
-- [ ] use the roam private location function to define the org agenda
- files.
-- [ ] it may be worth using the roam directory or the private directory
- as the org-directory. The benefits should be evaluated.
-
-#+begin_src emacs-lisp
-(setq org-directory (sr/fun/org-dir ""))
-
-(add-to-list 'org-agenda-files (expand-file-name (sr/fun/roam-private-dir "")))
- #+end_src
-
- #+RESULTS:
- | ~/my_org/ |
-
-*** COMMENT Enable a sticky agenda
-
-#+BEGIN_SRC emacs-lisp
-(setq org-agenda-sticky nil)
-#+END_SRC
-
-*** TODO COMMENT Agenda customisation
- :PROPERTIES:
- :ID: 0b93631b-5a2d-4764-92b0-f5cdf42fffe7
- :END:
-
- Note taken on [2019-02-07 Thu 08:26] \\
Need to clear up the search functions, enabling complete search in journal files. Archive and some external directories are included, since they are explictly in org mode.
@@ -829,12 +1010,12 @@ I always want the agenda launched with a full window.
(setq org-agenda-custom-commands
'(("c" "Simple agenda view"
- ((tags "recurr"
+ ((tags "recurr"
((org-agenda-overriding-header "Recurring Tasks")))
- (agenda "")
- (todo "")))
- ("o" agenda "Office mode" ((org-agenda-tag-filter-preset '("-course" "-habit" "-someday" "-book" "-emacs"))))
- ("qc" tags "+commandment")
+ (agenda "")
+ (todo "")))
+ ("o" agenda "Office mode" ((org-agenda-tag-filter-preset '("-course" "-habit" "-someday" "-book" "-emacs"))))
+ ("qc" tags "+commandment")
("e" tags "+org")
("w" agenda "Today" ((org-agenda-tag-filter-preset '("+work"))))
("W" todo-tree "WAITING")
@@ -842,21 +1023,47 @@ I always want the agenda launched with a full window.
("d" . "ds related") ;; gives label to "d"
("ds" agenda "Datascience" ((org-agenda-tag-filter-preset '("+datascience"))))
("qw" agenda "MRPS" ((org-agenda-tag-filter-preset '("+canjs"))))
- ("qa" "Archive tags search" org-tags-view ""
- ((org-agenda-files (file-expand-wildcards "~/my_org/*.org*"))))
- ("j" "Journal Search" search ""
- ''((org-agenda-text-search-extra-files (file-expand-wildcards "~/my_org/journal/"))))
- ("S" search ""
+ ;; ("qa" "Archive tags search" org-tags-view ""
+ ;; ((org-agenda-files (file-expand-wildcards "~/my_org/*.org*"))))
+ ("j" "Journal Search" search ""
+ ''((org-agenda-text-search-extra-files (file-expand-wildcards "~/my_org/journal/"))))
+ ("S" search ""
((org-agenda-files '("~/my_org/"))
(org-agenda-text-search-extra-files )))
)
)
#+end_src
-*** Include gpg files in agenda generation
+*** DONE org-habit
+CLOSED: [2019-02-12 Tue 13:21]
:PROPERTIES:
- :ID: 4c1a0a00-d123-4b6a-a209-219872d43ca1
- :END:
+:ID: 951e7ed9-783d-44b9-869d-fe048e41e93f
+:CUSTOM_ID: h:B9131B16-C52E-401B-A816-DEF74D9916A2
+:END:
+- Note taken on [2019-02-12 Tue 13:20] \\
+ Adding a require has brought org-habit back on track.
+- Note taken on [2019-02-07 Thu 09:50] \\
+ Appears the use-package config for org-habit is not correct and there is some issue in downloading it as a package.
+
+I want to shift the org habit graph in the agenda further out right so as to leave enough room for the headings to be visible.
+
+#+BEGIN_SRC emacs-lisp
+(require 'org-habit)
+(setq org-habit-graph-column 90)
+;; Setting this startup with nil so that it can be toggled off.
+;; This seems to speed up agenda slightly.
+;; toggle habits using the 'K' in org agenda
+(setq org-habit-toggle-habits nil)
+#+end_src
+
+#+RESULTS:
+: 90
+
+*** COMMENT Include gpg files in agenda generation
+:PROPERTIES:
+:ID: 4c1a0a00-d123-4b6a-a209-219872d43ca1
+:CUSTOM_ID: h:3D3E87AB-5A98-4B5E-8028-5E66C9B0253D
+:END:
- Note taken on [2020-05-14 Thu 23:12] \\
This is tested to work as expected. Active date entries from the gpg
files are being included.
@@ -864,7 +1071,7 @@ I always want the agenda launched with a full window.
Source: https://emacs.stackexchange.com/questions/36542/include-org-gpg-files-in-org-agenda
Note that this must be set first and then the agenda files specified.
-#+BEGIN_SRC emacs-lisp :tangle no
+#+BEGIN_SRC emacs-lisp
(unless (string-match-p "\\.gpg" org-agenda-file-regexp)
(setq org-agenda-file-regexp
(replace-regexp-in-string "\\\\\\.org" "\\\\.org\\\\(\\\\.gpg\\\\)?"
@@ -875,47 +1082,12 @@ Note that this must be set first and then the agenda files specified.
#+RESULTS:
-*** COMMENT Expanding search locations
- :PROPERTIES:
- :ID: 63a20a98-6090-4087-889d-7398df5b6bb9
- :END:
- - Note taken on [2020-04-15 Wed 07:58] \\
- I do not really use this as I am able to use ag/grep for these
- locations, which is much faster than using the agenda search.
-
-I initially included my journal location to the agenda search. However it is very slow compared to using grep/rgrep/ag. Therefore, the agenda full text search is now limited to the project directory and the org-brain directory. The snippet below enables searching recursively within folders.
-
-#+BEGIN_SRC emacs-lisp :tangle no
-(setq org-agenda-text-search-extra-files '(agenda-archives))
-
-(setq org-agenda-text-search-extra-files (apply 'append
- (mapcar
- (lambda (directory)
- (directory-files-recursively
- directory org-agenda-file-regexp))
- '("~/my_projects/" "~/my_org/brain/"))))
-#+end_src
-
-*** TODO COMMENT Adding org archive for text search. Optimise this
+*** Enable default fuzzy search like in google
:PROPERTIES:
-:CREATED: <2019-02-07 Thu 08:29>
-:ID: D8743646-BD5B-463C-AB4B-CAB8AF8AA535
+:ID: a8012ca5-8f07-419f-8aed-11d43651bcca
+:CUSTOM_ID: h:14054F8E-F242-4B90-A122-7701C718F799
:END:
-- Note taken on [2020-02-22 Sat 13:25] \\
- I don't really use this anymore. I prefer grep or ag for searching through all my text files. The caveat is that the files have to under a single root directory.
-#+BEGIN_SRC emacs-lisp
-(setq org-agenda-text-search-extra-files '(agenda-archives))
-#+end_src
-
-#+RESULTS:
-| agenda-archives |
-
-*** Enable default fuzzy search like in google
- :PROPERTIES:
- :ID: a8012ca5-8f07-419f-8aed-11d43651bcca
- :END:
-
#+BEGIN_SRC emacs-lisp
(setq org-agenda-search-view-always-boolean t)
#+end_src
@@ -923,49 +1095,19 @@ I initially included my journal location to the agenda search. However it is ver
*** Hooks for org-agenda
:PROPERTIES:
:ID: 821CDF30-9FBA-40AB-99F4-B01A8CCBDE1F
+:CUSTOM_ID: h:FA741247-4DCA-4836-8ED6-9A938E1F0517
:END:
#+BEGIN_SRC emacs-lisp
(add-hook 'org-agenda-mode-hook
'(lambda ()
- (hl-line-mode 1)))
+ (hl-line-mode 1)))
#+END_SRC
-*** DONE org-habit
-CLOSED: [2019-02-12 Tue 13:21]
-:PROPERTIES:
-:ID: 951e7ed9-783d-44b9-869d-fe048e41e93f
-:END:
-- Note taken on [2019-02-12 Tue 13:20] \\
- Adding a require has brought org-habit back on track.
-- Note taken on [2019-02-07 Thu 09:50] \\
- Appears the use-package config for org-habit is not correct and there is some issue in downloading it as a package.
-
-I want to shift the org habit graph in the agenda further out right so as to leave enough room for the headings to be visible.
-
-#+BEGIN_SRC emacs-lisp
-(require 'org-habit)
-(setq org-habit-graph-column 90)
-;; Setting this startup with nil so that it can be toggled off.
-;; This seems to speed up agenda slightly.
-;; toggle habits using the 'K' in org agenda
-(setq org-habit-toggle-habits nil)
-#+end_src
-
-#+RESULTS:
-: 90
-
-*** COMMENT Hide done scheduled and deadline tasks
+*** TODO COMMENT Org super agenda
:PROPERTIES:
-:ID: 2F89C9CA-E75D-4EF3-BD0B-F28CDEBD10D8
+:CUSTOM_ID: h:8AB4B46B-6B28-42E9-BC89-1460A6B7E24D
:END:
-
-#+BEGIN_SRC emacs-lisp
-(setq org-agenda-skip-deadline-if-done t)
-(setq org-agenda-skip-scheduled-if-done t)
-#+END_SRC
-
-*** TODO COMMENT Org super agenda
I need to find a way to make org agenda more useful to my purposes
since my agenda is getting cluttered as I add more items. Org super
agenda helps with this and there are other nifty customisations like the
@@ -976,14 +1118,20 @@ work, it seems that it would make sense if the necessary views are
consolidated into a hydra that can be called whenever required.
**** Installation
+:PROPERTIES:
+:CUSTOM_ID: h:8410E2AE-63FB-4973-B2EE-DEAE7DE7D221
+:END:
#+BEGIN_SRC emacs-lisp
(use-package org-super-agenda
-:straight t
-:config
-(require 'org-super-agenda))
+ :straight t
+ :config
+ (require 'org-super-agenda))
#+END_SRC
**** Auto grouping
+:PROPERTIES:
+:CUSTOM_ID: h:C5D4A4FC-1F01-4BF4-ACA3-8E8C7931E0CD
+:END:
Executing this provides an org agenda for the week or the day and tasks
on each day are grouped according to the headline property set for
@@ -994,8 +1142,69 @@ on each day are grouped according to the headline property set for
'((:auto-group t))))
(org-agenda-list))
#+END_SRC
+*** COMMENT Enable a sticky agenda
+:PROPERTIES:
+:CUSTOM_ID: h:5556DBB7-BAFC-4E11-B0BE-C6E507A7096F
+:END:
-*** COMMENT Inhibit startup status of org files
+#+BEGIN_SRC emacs-lisp
+(setq org-agenda-sticky nil)
+#+END_SRC
+
+*** COMMENT Expanding search locations
+:PROPERTIES:
+:ID: 63a20a98-6090-4087-889d-7398df5b6bb9
+:CUSTOM_ID: h:7391ECBA-A6AC-4FF6-ADA4-11870983FD30
+:END:
+- Note taken on [2020-04-15 Wed 07:58] \\
+ I do not really use this as I am able to use ag/grep for these
+ locations, which is much faster than using the agenda search.
+
+I initially included my journal location to the agenda search. However it is very slow compared to using grep/rgrep/ag. Therefore, the agenda full text search is now limited to the project directory and the org-brain directory. The snippet below enables searching recursively within folders.
+
+#+BEGIN_SRC emacs-lisp :tangle no
+(setq org-agenda-text-search-extra-files '(agenda-archives))
+
+(setq org-agenda-text-search-extra-files (apply 'append
+ (mapcar
+ (lambda (directory)
+ (directory-files-recursively
+ directory org-agenda-file-regexp))
+ '("~/my_projects/" "~/my_org/brain/"))))
+#+end_src
+
+*** COMMENT Adding org archive for text search. Optimise this
+:PROPERTIES:
+:CREATED: <2019-02-07 Thu 08:29>
+:ID: D8743646-BD5B-463C-AB4B-CAB8AF8AA535
+:CUSTOM_ID: h:F36E187E-4280-4917-A353-560126C51024
+:END:
+
+- Note taken on [2020-02-22 Sat 13:25] \\
+ I don't really use this anymore. I prefer grep or ag for searching through all my text files. The caveat is that the files have to under a single root directory.
+#+BEGIN_SRC emacs-lisp
+(setq org-agenda-text-search-extra-files '(agenda-archives))
+#+end_src
+
+#+RESULTS:
+| agenda-archives |
+
+*** COMMENT Hide done scheduled and deadline tasks
+:PROPERTIES:
+:ID: 2F89C9CA-E75D-4EF3-BD0B-F28CDEBD10D8
+:CUSTOM_ID: h:52CDFD36-6E3C-4AD4-A6FB-0BA850F844A8
+:END:
+
+#+BEGIN_SRC emacs-lisp
+(setq org-agenda-skip-deadline-if-done t)
+(setq org-agenda-skip-scheduled-if-done t)
+#+END_SRC
+
+*** Inhibit startup status of org files
+:PROPERTIES:
+:ID: BBE6E9CF-CCDC-457E-B10A-895DEF28CCEA
+:CUSTOM_ID: h:6A4912C4-E256-4141-9C93-3A5729EE0DF0
+:END:
This should help with the generation of the org-agenda.
#+BEGIN_SRC emacs-lisp
@@ -1005,6 +1214,7 @@ This should help with the generation of the org-agenda.
** Archiving mechanics
:PROPERTIES:
:ID: BC8CD91A-8BD2-44A0-8715-7564881D89FF
+:CUSTOM_ID: h:B436959F-FE7F-408F-B641-524AF3BCCABD
:END:
- Note taken on [2020-04-06 Mon 23:27] \\
@@ -1023,10 +1233,53 @@ This should help with the generation of the org-agenda.
#+BEGIN_SRC emacs-lisp
(setq org-archive-mark-done nil)
-(setq org-archive-location (sr/fun/org-dir "archive/%s_archive::* Archive"))
+(setq org-archive-location (sr/fun/roam-private-dir "archive/%s_archive::* Archive"))
+#+END_SRC
+
+** Task state sequences
+:PROPERTIES:
+:ID: ECFD3C43-FA17-414C-A6F4-8676F99936A3
+:CUSTOM_ID: h:D4B95283-E4F2-4DFE-8C71-0277F0D35901
+:END:
+
+The difference between cancelled and failed would be that -
+
+failed: things I could have planned and done, and it would have been a
+good thing to do - but I did not. These kind of tasks are worth tracking
+in a general sense, and that is why a failed tag would be useful. The
+agenda can then be used to filter failed tasks to see whether there have
+been repeated failures in the past.
+
+Cancelled tasks - these are tasks that do not require to be done. The
+reason could be that they were pre-emptive tasks that were superceded by
+events, or simply deemed unnecessary at all levels. Such tasks would not
+warrant a detailed review in general.
+
+Looking at Bernt Hansen's documentation - it also makes sense to have
+some more key words for filtering. Summary of sequences that make sense
+at this point:
+
+- TODO
+- Next
+- Done
+
+This sequence will include a note as to why the state is being set.
+
+- Waiting
+- Hold
+- Cancelled
+- Failed
+
+#+BEGIN_SRC emacs-lisp
+(setq org-todo-keywords
+ (quote ((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)")
+ (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" "FAILED(f@/!)"))))
#+END_SRC
** TODO Capture mechanics
+:PROPERTIES:
+:CUSTOM_ID: h:AE3110C1-52C0-476D-A046-69AFE58FCE20
+:END:
Over time I've found an efficient capture mechanism to be important to
nurture productivity while accounting for interruptions. I think the
@@ -1043,12 +1296,16 @@ above. Some other good starting points are:
- [[https://pages.sachachua.com/.emacs.d/Sacha.html][Sacha Chua's Emacs configuration]]
*** TODO Doct for org capture templates
+:PROPERTIES:
+:CUSTOM_ID: h:3CB13872-2481-4322-85D7-AB1B2B21997C
+:END:
[[https://github.com/progfolio/doct][DOCT]] makes it a lot easier to define capture templates in a clean manner. At the moment, I am interested in adding hooks to specific functions and improving the entire capture process.
**** Install doct
:PROPERTIES:
:ID: 687BA330-0F53-4335-9609-50925ECA58D0
+:CUSTOM_ID: h:9793D7FB-4EC1-4ED5-A831-F69BEC5D6628
:END:
#+BEGIN_SRC emacs-lisp
@@ -1061,6 +1318,7 @@ above. Some other good starting points are:
**** doct functions
:PROPERTIES:
:ID: CC7C84DE-AFEF-4E44-9B5B-056DFA58AF5B
+:CUSTOM_ID: h:351902E8-4B4B-4FC1-9A99-B30B50ED6CEF
:END:
- Note taken on [2020-04-12 Sun 11:42] \\
@@ -1074,69 +1332,71 @@ above. Some other good starting points are:
#+BEGIN_SRC emacs-lisp
(defun sr/fun/todo-act-today ()
-'("* %{todo-state} %?"
-":PROPERTIES:"
-":CREATED: %<%Y-%m-%d %a %H:%M>"
-":PLANNED: %t"
-":END:"))
+ '("* %{todo-state} %?"
+ ":PROPERTIES:"
+ ":CREATED: %<%Y-%m-%d %a %H:%M>"
+ ":PLANNED: %t"
+ ":END:"))
(defun sr/fun/todo-act-date ()
-'("* %{todo-state} %?"
-":PROPERTIES:"
-":CREATED: %<%Y-%m-%d %a %H:%M>"
-":PLANNED: %^t"
-":END:"))
+ '("* %{todo-state} %?"
+ ":PROPERTIES:"
+ ":CREATED: %<%Y-%m-%d %a %H:%M>"
+ ":PLANNED: %^t"
+ ":END:"))
(defun sr/fun/todo-passive ()
-'("* %{todo-state} %?"
-":PROPERTIES:"
-":CREATED: %U"
-":END:"))
+ '("* %{todo-state} %?"
+ ":PROPERTIES:"
+ ":CREATED: %U"
+ ":END:"))
(defun sr/fun/todo-link-act-today ()
-'("* %{todo-state} %a"
-":PROPERTIES:"
-":CREATED: %<%Y-%m-%d %a %H:%M>"
-":PLANNED: %t"
-":END:"
-"%?"))
+ '("* %{todo-state} %a"
+ ":PROPERTIES:"
+ ":CREATED: %<%Y-%m-%d %a %H:%M>"
+ ":PLANNED: %t"
+ ":END:"
+ "%?"))
(defun sr/fun/todo-link-act-date ()
-'("* %{todo-state} %a"
-":PROPERTIES:"
-":CREATED: %<%Y-%m-%d %a %H:%M>"
-":PLANNED: %^t"
-":END:"
-"%?"))
+ '("* %{todo-state} %a"
+ ":PROPERTIES:"
+ ":CREATED: %<%Y-%m-%d %a %H:%M>"
+ ":PLANNED: %^t"
+ ":END:"
+ "%?"))
(defun sr/fun/todo-file-link-act-date ()
-'("* %{todo-state} [[file:%F][%f]]"
-":PROPERTIES:"
-":CREATED: %<%Y-%m-%d %a %H:%M>"
-":PLANNED: %^t"
-":END:"
-"%?"))
+ '("* %{todo-state} [[file:%F][%f]]"
+ ":PROPERTIES:"
+ ":CREATED: %<%Y-%m-%d %a %H:%M>"
+ ":PLANNED: %^t"
+ ":END:"
+ "%?"))
(defun sr/fun/todo-file-ext-link-act-date ()
-'("* %{todo-state} %(org-web-tools--get-url %x)"
-":PROPERTIES:"
-":CREATED: %<%Y-%m-%d %a %H:%M>"
-":PLANNED: %^t"
-":END:"
-"%?"))
+ '("* %{todo-state} %(org-web-tools--get-url %x)"
+ ":PROPERTIES:"
+ ":CREATED: %<%Y-%m-%d %a %H:%M>"
+ ":PLANNED: %^t"
+ ":END:"
+ "%?"))
(defun sr/fun/note-link-passive ()
-'("* %a"
-":PROPERTIES:"
-":CREATED: %U"
-":END:"
-"%?"))
+ '("* %a"
+ ":PROPERTIES:"
+ ":CREATED: %U"
+ ":END:"
+ "%?"))
(defun sr/fun/note-passive ()
-'("* %?"
-":PROPERTIES:"
-":CREATED: %U"
-":END:"))
+ '("* %?"
+ ":PROPERTIES:"
+ ":CREATED: %U"
+ ":END:"))
+
+
#+END_SRC
@@ -1146,6 +1406,7 @@ above. Some other good starting points are:
**** doct templates
:PROPERTIES:
:ID: A4795CBE-F6A0-42F9-86F2-FEC78870CF32
+:CUSTOM_ID: h:EF3CE44A-FEAA-41CB-8556-229B644527C1
:END:
- [X] Created inactive date for all entries
@@ -1159,122 +1420,140 @@ above. Some other good starting points are:
- [ ] Capture to today's journal
- [ ] Capture to tomorrow's journal
- [ ] Capture to current clocked task
+- [ ] file links should use the sr/fun/roam-private-dir type variables
+ for an easy update.
+
+
#+BEGIN_SRC emacs-lisp
(setq org-capture-templates
(doct '(("capture" :keys "c"
- :file "~/my_org/todo-global.org"
+ :file "~/my_org/roam/private/todo-global.org"
:prepend t
- :children (("inbox"
- :keys "t"
- :type entry
- :file "~/my_org/refile.org"
- :headline "inbox"
- :todo-state "TODO"
- :template sr/fun/todo-passive)
- ("mail"
- :keys "m"
- :type entry
- :file "~/my_org/refile.org"
- :todo-state "TODO"
- :headline "mail"
- :template sr/fun/todo-link-passive)
+ :children (("inbox"
+ :keys "t"
+ :type entry
+ :file "~/my_org/refile.org"
+ :headline "inbox"
+ :todo-state ""
+ :template sr/fun/note-link-passive)
+ ;; ("test"
+ ;; :keys "o"
+ ;; :type plain
+ ;; ;; :file "~/my_org/refile.org"
+ ;; ;; :headline "inbox"
+ ;; ;; :todo-state "TODO"
+ ;; :template (function org-roam--capture-get-point)
+ ;; "%?"
+ ;; :file-name "%(format-time-string \"%Y-%m-%d--%H-%M-%SZ--${slug}\" (current-time) t)"
+ ;; :head "#+TITLE: ${title}\n"
+ ;; :unnarrowed t)
+ ("mail"
+ :keys "m"
+ :type entry
+ :file "~/my_org/refile.org"
+ :todo-state "TODO"
+ :headline "mail"
+ :template sr/fun/note-link-passive)
("reading" :keys "r"
:headline "reading"
:todo-state "TODO"
- :template sr/fun/todo-link-passive)
- ("emacs" :keys "e"
+ :template sr/fun/note-link-passive)
+ ("emacs" :keys "e"
:headline "emacs"
:todo-state "TODO"
- :template sr/fun/todo-link-passive)))
- ("Todo" :keys "t"
+ :template sr/fun/note-link-passive)))
+ ("Todo" :keys "t"
:file "~/my_org/todo-global.org"
:prepend t
- :children (("inbox"
- :keys "t"
- :type entry
- :headline "@inbox"
- :todo-state "TODO"
- :template sr/fun/todo-act-date)
- ("mail"
- :keys "m"
- :type entry
- :headline "@mail"
- :todo-state "TODO"
- :template sr/fun/todo-link-act-date)
- ("article"
- :keys "r"
- :type entry
- :headline "@reading"
- :todo-state "TODO"
- :template sr/fun/todo-link-act-date)
- ("File link"
- :keys "f"
- :type entry
- :headline "@inbox"
- :todo-state "TODO"
- :clock-in t
- :template sr/fun/todo-file-link-act-date)
- ("External link"
- :keys "e"
- :type entry
- :headline "@reading"
- :todo-state "TODO"
- :template sr/fun/todo-file-ext-link-act-date)))
- ("Notes" :keys "n"
+ :children (("inbox"
+ :keys "t"
+ :type entry
+ :headline "@inbox"
+ :todo-state "TODO"
+ :template sr/fun/todo-act-date)
+ ("mail"
+ :keys "m"
+ :type entry
+ :headline "@mail"
+ :todo-state "TODO"
+ :template sr/fun/todo-link-act-date)
+ ("article"
+ :keys "r"
+ :type entry
+ :headline "@reading"
+ :todo-state "TODO"
+ :template sr/fun/todo-link-act-date)
+ ("File link"
+ :keys "f"
+ :type entry
+ :headline "@inbox"
+ :todo-state "TODO"
+ :clock-in t
+ :template sr/fun/todo-file-link-act-date)
+ ("External link"
+ :keys "e"
+ :type entry
+ :headline "@reading"
+ :todo-state "TODO"
+ :template sr/fun/todo-file-ext-link-act-date)))
+ ("Notes" :keys "n"
:file "~/my_org/notes.org"
:prepend t
- :template sr/fun/note-passive
:children (("Fast note"
- :keys "n"
- :type entry
- :headline "@Notes")
- ("Emacs note"
- :keys "e"
- :file "~/my_org/emacs.org"
- :type entry)
- ("Mail Archive"
- :template sr/fun/note-link-passive
- :keys "m"
- :type entry
- :headline "@mail archive")
- ("Read Archive"
- :template sr/fun/note-link-passive
- :keys "r"
- :type entry
- :headline "@read archive")
- ("DS Link note" :keys "d"
- :file "~/my_org/datascience.org"
+ :keys "n"
+ :type entry
+ :template sr/fun/note-passive
+ :headline "@Notes")
+ ("Emacs note"
+ :keys "e"
+ :file "~/my_org/roam/private/emacs.org"
+ :type entry)
+ ("Mail Archive"
+ :template sr/fun/note-link-passive
+ :keys "m"
+ :type entry
+ :headline "@mail archive")
+ ("Read Archive"
+ :template sr/fun/note-link-passive
+ :keys "r"
+ :type entry
+ :headline "@read archive")
+ ("DS Link note" :keys "d"
+ :file "~/my_org/datascience.org"
:headline "@Datascience @Notes"
:todo-state "TODO"
- :template sr/fun/todo-link-passive)))
- ;; ("Project" :keys "p"
+ :template sr/fun/note-link-passive)))
+ ;; ("Project" :keys "p"
;; :file "~/my_org/project-tasks.org"
;; :template sr/fun/todo-link-active)
- )))
+ )
+
+ ))
#+END_SRC
*** COMMENT Old Capture templates
- :PROPERTIES:
- :ID: 50f2b318-d9e6-4403-af24-875c662d888d
- :END:
- - Note taken on [2020-04-02 Thu 01:38] \\
- This section will be retired soon in favor of using the doct package.
+:PROPERTIES:
+:ID: 50f2b318-d9e6-4403-af24-875c662d888d
+:CUSTOM_ID: h:DB6636DD-321C-4502-A77F-8699D71F0889
+:END:
+- Note taken on [2020-04-02 Thu 01:38] \\
+ This section will be retired soon in favor of using the doct package.
#+BEGIN_SRC emacs-lisp
(setq org-capture-templates
'(("t" "Task entry")
("tt" "Todo - Fast Now" entry (file+headline "~/my_org/todo-global.org" "@Inbox")
- "** TODO %?")
+ "** TODO %?")
("tj" "Todo -Job journal" entry (file+olp+datetree "~/my_org/ds-jobs.org" "Job Search Journal")
- "** TODO %?")
+ "** TODO %?")
("te" "Todo - Emacs" entry (file+headline "~/my_org/todo-global.org" "@Emacs notes and tasks")
"** TODO %?")
("td" "Datascience inbox" entry (file+headline "~/my_org/datascience.org" "@Datascience @Inbox")
"** TODO %?")
- ("tm" "Mail Link Todo" entry (file+headline "~/my_org/todo-global.org" "@Inbox")
- "** TODO Mail: %a ")
+ ("tm" "Mail Link Todo" entry (file+headline "~/my_org/todo-global.org" "@Inbox")
+ "** TODO Mail: %a ")
("l" "Link/Snippet" entry (file+headline "~/my_org/link_database.org" ".UL Unfiled Links")
"** %? %a ")
("e" "Protocol info" entry ;; 'w' for 'org-protocol'
@@ -1307,7 +1586,7 @@ above. Some other good starting points are:
("cn" "Clock Note" entry (clock) "** %?\n:PROPERTIES:\n:CREATED: [%<%Y-%m-%d %a %H:%M>]\n:END:")
("r" "Review note" entry (file+weektree "~/my_org/lifebook.org" "#Personal #Reviews")
"** %?\n:PROPERTIES:\n:CREATED: [%<%Y-%m-%d %a %H:%M>]\n:END:")
- ))
+ ))
#+end_src
#+RESULTS:
@@ -1320,15 +1599,18 @@ above. Some other good starting points are:
| l | Link/Snippet | entry | (file+headline ~/my_org/link_database.org .UL Unfiled Links) | ** %? %a |
| e | Protocol info | entry | (file+headline ~/my_org/link_database.org .UL Unfiled Links) | *** %a, |
-*** Closing org-capture frame on abort
- :PROPERTIES:
- :ID: 1f79f2ff-2185-451d-8485-8f11c7b1de41
- :END:
-- Note taken on [2019-03-13 Wed 07:35] \\
- This basically ensures a clean exit in case of aborting a capture, and
- also maintains buffer configuration on going ahead with the capture.
-- Note taken on [2019-02-07 Thu 08:53] \\
- Needs further review.
+*** COMMENT Closing org-capture frame on abort
+:PROPERTIES:
+:ID: 1f79f2ff-2185-451d-8485-8f11c7b1de41
+:CUSTOM_ID: h:92099F7C-F720-41CD-912F-99AB6A9DCBD5
+:END:
+ - Note taken on [2020-07-26 Sun 22:16] \\
+ This seems to be creating some errors and has to be investigated.
+ - Note taken on [2019-03-13 Wed 07:35] \\
+ This basically ensures a clean exit in case of aborting a capture, and
+ also maintains buffer configuration on going ahead with the capture.
+ - Note taken on [2019-02-07 Thu 08:53] \\
+ Needs further review.
Source: [[http://stackoverflow.com/questions/23517372/hook-or-advice-when-aborting-org-capture-before-template-selection][emacs - hook or advice when aborting org-capture before template selection? - Stack Overflow]]
@@ -1349,9 +1631,10 @@ Source: [[http://stackoverflow.com/questions/23517372/hook-or-advice-when-aborti
#+RESULTS:
: org-capture-finalize
-*** TODO Controlling org-capture buffers
+*** TODO COMMENT Controlling org-capture buffers
:PROPERTIES:
:ID: FB3E4494-6AAA-4CA3-8A43-726E9E7143A7
+:CUSTOM_ID: h:42301032-8CC2-4FBD-899C-530B83D87BA1
:END:
- Note taken on [2019-03-13 Wed 08:01] \\
This interferes with org-journal's capture format.
@@ -1366,7 +1649,7 @@ https://stackoverflow.com/questions/54192239/open-org-capture-buffer-in-specific
,which partially resolves the issue by enabling just a single capture
buffer.
-#+BEGIN_SRC emacs-lisp :tangle no
+#+BEGIN_SRC emacs-lisp
(defun my-org-capture-place-template-dont-delete-windows (oldfun args)
(cl-letf (((symbol-function 'delete-other-windows) 'ignore))
@@ -1378,11 +1661,10 @@ buffer.
#+RESULTS:
-** TODO Refile mechanics
-
-*** Refile target level
+** Refile target level
:PROPERTIES:
:ID: CA519BE8-36B0-42E4-AAA2-9FB6E0550C0E
+:CUSTOM_ID: h:49B5BB99-4120-4B96-B2FE-29E34145C762
:END:
#+BEGIN_SRC emacs-lisp
@@ -1391,9 +1673,10 @@ buffer.
(org-agenda-files :maxlevel . 2)))
#+END_SRC
-*** General refiling settings
+** General refiling settings
:PROPERTIES:
:ID: FFCC1781-C5C5-4A3C-9ED1-7E6424E958C2
+:CUSTOM_ID: h:C9112EEC-6F50-4773-8B5D-33B593C05AF1
:END:
#+BEGIN_SRC emacs-lisp
@@ -1404,7 +1687,13 @@ buffer.
#+END_SRC
** Clocking mechanics
+:PROPERTIES:
+:CUSTOM_ID: h:48E4AA61-F079-4E26-9D88-5460EEBE23DD
+:END:
*** Continuous clocking + punch in/out approach
+:PROPERTIES:
+:CUSTOM_ID: h:9D1C60B4-56C3-459B-B4DD-3C7644FBE140
+:END:
This approach and code snippets are adapted (and shamelessly borrowed)
from [[http://doc.norang.ca/org-mode.html][Bernt Hansen's approach]]. While Bernt follows a complex approach of
clocking into parent tasks - my current workflow favors clocking in
@@ -1423,6 +1712,7 @@ specific project.
**** Defining default Task
:PROPERTIES:
:ID: 391EC3C2-323A-4E39-8281-B5C4CD6C093E
+:CUSTOM_ID: h:3A47D502-A78F-4D6D-BE3E-2F5544D3DE16
:END:
#+BEGIN_SRC emacs-lisp
@@ -1440,13 +1730,14 @@ specific project.
**** Punch in
:PROPERTIES:
:ID: 05072AC4-8A12-44B6-8BC4-53A012AA05EE
+:CUSTOM_ID: h:227324CB-4F03-452B-BF4E-5C2716E1A40E
:END:
Bernt Hansen shares that he has a default punch in and punch out task that keeps the clock on all day. I think this will work for me as well. Other than work and projects, most of the time I am tinkering with Emacs, or writing a journal note or trying to re-organise my stuff. By using a punch in and out, I can track how much time I am engaged with a computer, other than specific projects.
#+BEGIN_SRC emacs-lisp
(defun sr/punch-in (arg)
- (interactive "p")
+ (interactive "p")
(setq sr/keep-clock-running t)
(sr/clock-in-organization-task-as-default))
#+END_SRC
@@ -1457,6 +1748,7 @@ Bernt Hansen shares that he has a default punch in and punch out task that keeps
**** Punch Out
:PROPERTIES:
:ID: 4FCAA0D2-152B-4B3B-A460-8778D419BB2B
+:CUSTOM_ID: h:51913949-0FAB-4790-AAE0-13C9CA2DEFE5
:END:
#+BEGIN_SRC emacs-lisp
@@ -1472,6 +1764,7 @@ Bernt Hansen shares that he has a default punch in and punch out task that keeps
**** Advising clock Out
:PROPERTIES:
:ID: 5A0C48D0-72C6-4D5A-8216-0F3D4D2B98A0
+:CUSTOM_ID: h:91F5D994-552B-4699-93C7-4A32F375318D
:END:
#+BEGIN_SRC emacs-lisp
@@ -1490,6 +1783,7 @@ Bernt Hansen shares that he has a default punch in and punch out task that keeps
**** Shortcuts for punch in and punch out
:PROPERTIES:
:ID: 26357B49-2E4F-461C-857C-A72C75C9EE8E
+:CUSTOM_ID: h:AC1EB31D-646A-46B9-9708-48F40FBF571A
:END:
#+BEGIN_SRC emacs-lisp
@@ -1500,6 +1794,7 @@ Bernt Hansen shares that he has a default punch in and punch out task that keeps
*** set idle timer for clocked task
:PROPERTIES:
:ID: E7AFDD59-B791-4B41-81B6-740158ADF8AF
+:CUSTOM_ID: h:47756D6E-BD18-491C-BC03-293743C9222D
:END:
#+BEGIN_SRC emacs-lisp
@@ -1509,6 +1804,7 @@ Bernt Hansen shares that he has a default punch in and punch out task that keeps
*** No zero clocks
:PROPERTIES:
:ID: F42F6474-78E2-430F-B9A1-A47D23FA68DF
+:CUSTOM_ID: h:77E7DED3-9D5F-4B1F-8B57-18242312AF94
:END:
#+BEGIN_SRC emacs-lisp
@@ -1517,6 +1813,7 @@ Bernt Hansen shares that he has a default punch in and punch out task that keeps
*** Clocking accuracy
:PROPERTIES:
:ID: 5D990989-3F82-41F9-B28F-577AF99D1C84
+:CUSTOM_ID: h:1EA0C290-B326-4448-A65E-E6C02173D28C
:END:
This is borrowed off Bernt Hansen's method.
@@ -1524,14 +1821,15 @@ This is borrowed off Bernt Hansen's method.
#+BEGIN_SRC emacs-lisp
(setq org-agenda-clock-consistency-checks
(quote (:max-duration "4:00"
- :min-duration 0
- :max-gap 0
- :gap-ok-around ("4:00"))))
+ :min-duration 0
+ :max-gap 0
+ :gap-ok-around ("4:00"))))
#+END_SRC
*** org-mru-clock
:PROPERTIES:
:ID: 956D3AC9-7E24-4D9B-BA88-C8180558430C
+:CUSTOM_ID: h:BC09FBBF-8939-4A9E-B64E-051EF6E0EC4E
:END:
- [ ] use the functions included to capture to the current clocked tasks.
- [ ] method to jump to recent clocked task instead of starting the clock
@@ -1541,7 +1839,7 @@ This is a handy package to quickly select past tasks which have been clocked in.
(use-package org-mru-clock
:ensure t
:bind (("M-s 1" . org-mru-clock-in)
- ("C-c C-x C-j" . org-mru-clock-select-recent-task))
+ ("C-c C-x C-j" . org-mru-clock-select-recent-task))
:init
(setq org-mru-clock-how-many 100
org-mru-clock-completing-read #'ivy-completing-read))
@@ -1550,6 +1848,7 @@ This is a handy package to quickly select past tasks which have been clocked in.
*** counsel-org-clock
:PROPERTIES:
:ID: AFCC3254-EBCB-4C63-971B-371687470AEB
+:CUSTOM_ID: h:4C1D6B80-5135-48FC-97E3-A64C4C2E5975
:END:
Here is a comparison of counsel-org-clock and org-mru-clock: [[http://mbork.pl/2018-04-28_org-mru-clock][Marcin
@@ -1565,66 +1864,755 @@ clocked tasks from the agenda.
#+END_SRC
-** Task state sequences
+** org-source-window split setup
:PROPERTIES:
-:ID: ECFD3C43-FA17-414C-A6F4-8676F99936A3
+:ID: 34171B48-C042-4CB4-959A-75DECE5F4DC2
+:CUSTOM_ID: h:B8A72206-2060-4B9E-BE56-28C99D6CEDB4
:END:
-The difference between cancelled and failed would be that -
+#+BEGIN_SRC emacs-lisp
+(setq org-src-window-setup 'split-window-right)
+#+END_SRC
-failed: things I could have planned and done, and it would have been a
-good thing to do - but I did not. These kind of tasks are worth tracking
-in a general sense, and that is why a failed tag would be useful. The
-agenda can then be used to filter failed tasks to see whether there have
-been repeated failures in the past.
+** Log done
+:PROPERTIES:
+:ID: 420C6490-8982-4D5C-90E8-001EF6025C1E
+:CUSTOM_ID: h:D7571354-29D7-4054-A20B-2297CEED3ED9
+:END:
-Cancelled tasks - these are tasks that do not require to be done. The
-reason could be that they were pre-emptive tasks that were superceded by
-events, or simply deemed unnecessary at all levels. Such tasks would not
-warrant a detailed review in general.
+#+BEGIN_SRC emacs-lisp
+(setq org-log-done 'time)
+#+END_SRC
-Looking at Bernt Hansen's documentation - it also makes sense to have
-some more key words for filtering. Summary of sequences that make sense
-at this point:
+** TODO Exports
+:PROPERTIES:
+:CUSTOM_ID: h:3798C1C4-4A1C-44F6-998D-A83379E10171
+:END:
-- TODO
-- Next
-- Done
+#+BEGIN_QUOTE
+A lot / most of these are /stolen/ from https://tecosaur.github.io/emacs-config/
+#+END_QUOTE
-This sequence will include a note as to why the state is being set.
+- [ ] understand the correct translation of the defadvice functions frp,
+ tecosaur's configuration.
-- Waiting
-- Hold
-- Cancelled
-- Failed
+*** Markdown export
+:PROPERTIES:
+:ID: A7FBD8B1-5C55-407A-8409-65EB85C8FDD4
+:CUSTOM_ID: h:15D4341B-9CF1-4CBA-8203-245C4D04A05E
+:END:
#+BEGIN_SRC emacs-lisp
-(setq org-todo-keywords
- (quote ((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d)")
- (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" "FAILED(f@/!)"))))
+(require 'ox-md)
#+END_SRC
-** org-source-window split setup
+*** ox-pandoc
:PROPERTIES:
-:ID: 34171B48-C042-4CB4-959A-75DECE5F4DC2
+:ID: 1B23050A-3ABD-48C9-A0B1-6294414748E0
+:CUSTOM_ID: h:B3391C5F-4F15-4B1D-9299-2C691DE1AA94
:END:
#+BEGIN_SRC emacs-lisp
-(setq org-src-window-setup 'split-window-right)
+(use-package ox-pandoc
+ :ensure t
+ :straight t
+ :defer 5)
#+END_SRC
-** Log done
+#+RESULTS:
+
+*** TODO COMMENT General
:PROPERTIES:
-:ID: 420C6490-8982-4D5C-90E8-001EF6025C1E
+:CUSTOM_ID: h:68068ACD-BE2B-4ADE-9C2F-2DF9B2EFF1C5
:END:
+Add an :ignore: tag which can be used to ignore headings and only export
+the content. This is useful for internal organisation that need not
+make sense externally.
#+BEGIN_SRC emacs-lisp
-(setq org-log-done 'time)
+(use-package ox-extra
+ :straight t
+ :after org
+ :config
+ ;; (require 'ox-extra)
+ (ox-extras-activate '(ignore-headlines)))
+#+END_SRC
+
+*** TODO COMMENT HTML Export
+:PROPERTIES:
+:CUSTOM_ID: h:BBE7CC47-8ADC-4882-A8FD-64E07C333823
+:END:
+**** org-html-style-fancy
+:PROPERTIES:
+:ID: 838C6AAC-91A7-450C-BCA9-1FD7369773BE
+:CUSTOM_ID: h:6322591E-797A-4091-BDF0-9014FF3988ED
+:END:
+
+- [X] Copy the pile-css-theme folder and files into the specified
+ path. This will take care of the path to the css and js files
+ necessary for the theme.
+
+- [X] Copy the export header html into the specified path
+
+#+BEGIN_SRC emacs-lisp
+(setq org-html-style-fancy
+ (concat (f-read-text (sr/fun/project-dir "static-site/static/org-export-header.html"))
+ "<script>\n"
+ (f-read-text (sr/fun/project-dir "static-site/static/pile-css-theme/main.js"))
+ "</script>\n<style>\n"
+ (f-read-text (sr/fun/project-dir "static-site/static/pile-css-theme/main.css"))
+ "</style>")
+ org-html-style-plain org-html-style-default
+ org-html-style-default org-html-style-fancy
+ org-html-htmlize-output-type 'css
+ org-html-doctype "html5"
+ org-html-html5-fancy t)
+#+END_SRC
+
+**** org-fancy-html-export-mode
+:PROPERTIES:
+:ID: 6AAE9CF5-4453-4746-A403-9AF440FE1593
+:CUSTOM_ID: h:FC82F0F8-1FC4-4149-A3EB-8D08F5935F67
+:END:
+
+To enable this mode, some functions have to be defined and available.
+
+- [X] [[id:838C6AAC-91A7-450C-BCA9-1FD7369773BE][org-html-style-fancy]] which also defines org-html-style-plain
+ - [ ]
+
+#+BEGIN_SRC emacs-lisp
+(define-minor-mode org-fancy-html-export-mode
+ "Toggle my fabulous org export tweaks. While this mode itself does a little bit,
+the vast majority of the change in behaviour comes from switch statements in:
+ - `org-html-template-fancier'
+ - `org-html--build-meta-info-extended'
+ - `org-html-src-block-collapsable'
+ - `org-html-block-collapsable'
+ - `org-html-table-wrapped'
+ - `org-html--format-toc-headline-colapseable'
+ - `org-html--toc-text-stripped-leaves'
+ - `org-export-html-headline-anchor'"
+ :global t
+ :init-value t
+ (if org-fancy-html-export-mode
+ (setq org-html-style-default org-html-style-fancy
+ org-html-checkbox-type 'html-span)
+ (setq org-html-style-default org-html-style-plain
+ org-html-checkbox-type 'html)))
+
+
+#+END_SRC
+
+**** COMMENT extra header content
+:PROPERTIES:
+:CUSTOM_ID: h:DA0B40BD-D52A-4E89-85E8-B3AB2F18CC76
+:END:
+
+- [ ] orig-fn will not work if [[6AAE9CF5-4453-4746-A403-9AF440FE1593][org-fancy-html-export-mode]] is not
+ defined and working.
+- [ ] invalid advice class orig-fn
+
+#+BEGIN_SRC emacs-lisp
+(defun org-html-template-fancier (orig-fn contents info)
+ "Return complete document string after HTML conversion.
+CONTENTS is the transcoded contents string. INFO is a plist
+holding export options. Adds a few extra things to the body
+compared to the default implementation."
+ :around #'org-html-template
+ (if (not org-fancy-html-export-mode)
+ (funcall orig-fn contents info)
+ (concat
+ (when (and (not (org-html-html5-p info)) (org-html-xhtml-p info))
+ (let* ((xml-declaration (plist-get info :html-xml-declaration))
+ (decl (or (and (stringp xml-declaration) xml-declaration)
+ (cdr (assoc (plist-get info :html-extension)
+ xml-declaration))
+ (cdr (assoc "html" xml-declaration))
+ "")))
+ (when (not (or (not decl) (string= "" decl)))
+ (format "%s\n"
+ (format decl
+ (or (and org-html-coding-system
+ (fboundp 'coding-system-get)
+ (coding-system-get org-html-coding-system 'mime-charset))
+ "iso-8859-1"))))))
+ (org-html-doctype info)
+ "\n"
+ (concat "<html"
+ (cond ((org-html-xhtml-p info)
+ (format
+ " xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"%s\" xml:lang=\"%s\""
+ (plist-get info :language) (plist-get info :language)))
+ ((org-html-html5-p info)
+ (format " lang=\"%s\"" (plist-get info :language))))
+ ">\n")
+ "<head>\n"
+ (org-html--build-meta-info info)
+ (org-html--build-head info)
+ (org-html--build-mathjax-config info)
+ "</head>\n"
+ "<body>\n<input type='checkbox' id='theme-switch'><div id='page'><label id='switch-label' for='theme-switch'></label>"
+ (let ((link-up (org-trim (plist-get info :html-link-up)))
+ (link-home (org-trim (plist-get info :html-link-home))))
+ (unless (and (string= link-up "") (string= link-home ""))
+ (format (plist-get info :html-home/up-format)
+ (or link-up link-home)
+ (or link-home link-up))))
+ ;; Preamble.
+ (org-html--build-pre/postamble 'preamble info)
+ ;; Document contents.
+ (let ((div (assq 'content (plist-get info :html-divs))))
+ (format "<%s id=\"%s\">\n" (nth 1 div) (nth 2 div)))
+ ;; Document title.
+ (when (plist-get info :with-title)
+ (let ((title (and (plist-get info :with-title)
+ (plist-get info :title)))
+ (subtitle (plist-get info :subtitle))
+ (html5-fancy (org-html--html5-fancy-p info)))
+ (when title
+ (format
+ "<div class='page-header'><div class='page-meta'>%s, %s</div><h1 class=\"title\">%s%s</h1></div>\n"
+ (format-time-string "%Y-%m-%d %A %-I:%M%p")
+ (org-export-data (plist-get info :author) info)
+ (org-export-data title info)
+ (if subtitle
+ (format
+ (if html5-fancy
+ "<p class=\"subtitle\">%s</p>\n"
+ (concat "\n" (org-html-close-tag "br" nil info) "\n"
+ "<span class=\"subtitle\">%s</span>\n"))
+ (org-export-data subtitle info))
+ "")))))
+ contents
+ (format "</%s>\n" (nth 1 (assq 'content (plist-get info :html-divs))))
+ ;; Postamble.
+ (org-html--build-pre/postamble 'postamble info)
+ ;; Possibly use the Klipse library live code blocks.
+ (when (plist-get info :html-klipsify-src)
+ (concat "<script>" (plist-get info :html-klipse-selection-script)
+ "</script><script src=\""
+ org-html-klipse-js
+ "\"></script><link rel=\"stylesheet\" type=\"text/css\" href=\""
+ org-html-klipse-css "\"/>"))
+ ;; Closing document.
+ "</div>\n</body>\n</html>")))
+#+END_SRC
+
+**** TODO COMMENT custom css/jss
+:PROPERTIES:
+:CUSTOM_ID: h:7954C0C3-B105-47BB-94CA-EBC114BFBFF3
+:END:
+
+#+BEGIN_SRC html :tangle misc/org-export-header.html :comments no
+<link rel="icon" href="https://tecosaur.com/resources/org/nib.ico" type="image/ico" />
+
+<link rel="preload" as="font" crossorigin="crossorigin" type="font/woff2" href="https://tecosaur.com/resources/org/etbookot-roman-webfont.woff2">
+<link rel="preload" as="font" crossorigin="crossorigin" type="font/woff2" href="https://tecosaur.com/resources/org/etbookot-italic-webfont.woff2">
+#+END_SRC
+
+#+BEGIN_SRC emacs-lisp
+(after! org
+ (setq org-html-style-fancy
+ (concat (f-read-text (expand-file-name "misc/org-export-header.html" doom-private-dir))
+ "<script>\n"
+ (f-read-text (expand-file-name "misc/pile-css-theme/main.js" doom-private-dir))
+ "</script>\n<style>\n"
+ (f-read-text (expand-file-name "misc/pile-css-theme/main.css" doom-private-dir))
+ "</style>")
+ org-html-style-plain org-html-style-default
+ org-html-style-default org-html-style-fancy
+ org-html-htmlize-output-type 'css
+ org-html-doctype "html5"
+ org-html-html5-fancy t))
+#+END_SRC
+
+**** TODO collapsible src and example blocks
+:PROPERTIES:
+:CUSTOM_ID: h:9369EAE3-CD97-4333-B2A6-BE29633AFCCF
+:END:
+
+#+BEGIN_SRC emacs-lisp
+(defun org-html-src-block-collapsable (orig-fn src-block contents info)
+ "Wrap the usual <pre> block in a <details>"
+ :around #'org-html-src-block
+ (if (not org-fancy-html-export-mode)
+ (funcall orig-fn src-block contents info)
+ (let* ((properties (cadr src-block))
+ (lang (mode-name-to-lang-name
+ (plist-get properties :language)))
+ (name (plist-get properties :name))
+ (ref (org-export-get-reference src-block info)))
+ (format
+ "<details id='%s' class='code'%s><summary%s>%s</summary>
+<div class='gutter'>
+<a href='#%s'>#</a>
+<button title='Copy to clipboard' onclick='copyPreToClipdord(this)'>⎘</button>\
+</div>
+%s
+</details>"
+ ref
+ (if (member (org-export-read-attribute :attr_html src-block :collapsed)
+ '("y" "yes" "t" "true"))
+ "" " open")
+ (if name " class='named'" "")
+ (if (not name) (concat "<span class='lang'>" lang "</span>")
+ (format "<span class='name'>%s</span><span class='lang'>%s</span>" name lang))
+ ref
+ (if name
+ (replace-regexp-in-string (format "<pre\\( class=\"[^\"]+\"\\)? id=\"%s\">" ref) "<pre\\1>"
+ (funcall orig-fn src-block contents info))
+ (funcall orig-fn src-block contents info))))))
+
+(defun mode-name-to-lang-name (mode)
+ (or (cadr (assoc mode
+ '(("asymptote" "Asymptote")
+ ("awk" "Awk")
+ ("C" "C")
+ ("clojure" "Clojure")
+ ("css" "CSS")
+ ("D" "D")
+ ("ditaa" "ditaa")
+ ("dot" "Graphviz")
+ ("calc" "Emacs Calc")
+ ("emacs-lisp" "Emacs Lisp")
+ ("fortran" "Fortran")
+ ("gnuplot" "gnuplot")
+ ("haskell" "Haskell")
+ ("hledger" "hledger")
+ ("java" "Java")
+ ("js" "Javascript")
+ ("latex" "LaTeX")
+ ("ledger" "Ledger")
+ ("lisp" "Lisp")
+ ("lilypond" "Lilypond")
+ ("lua" "Lua")
+ ("matlab" "MATLAB")
+ ("mscgen" "Mscgen")
+ ("ocaml" "Objective Caml")
+ ("octave" "Octave")
+ ("org" "Org mode")
+ ("oz" "OZ")
+ ("plantuml" "Plantuml")
+ ("processing" "Processing.js")
+ ("python" "Python")
+ ("R" "R")
+ ("ruby" "Ruby")
+ ("sass" "Sass")
+ ("scheme" "Scheme")
+ ("screen" "Gnu Screen")
+ ("sed" "Sed")
+ ("sh" "shell")
+ ("sql" "SQL")
+ ("sqlite" "SQLite")
+ ("forth" "Forth")
+ ("io" "IO")
+ ("J" "J")
+ ("makefile" "Makefile")
+ ("maxima" "Maxima")
+ ("perl" "Perl")
+ ("picolisp" "Pico Lisp")
+ ("scala" "Scala")
+ ("shell" "Shell Script")
+ ("ebnf2ps" "ebfn2ps")
+ ("cpp" "C++")
+ ("abc" "ABC")
+ ("coq" "Coq")
+ ("groovy" "Groovy")
+ ("bash" "bash")
+ ("csh" "csh")
+ ("ash" "ash")
+ ("dash" "dash")
+ ("ksh" "ksh")
+ ("mksh" "mksh")
+ ("posh" "posh")
+ ("ada" "Ada")
+ ("asm" "Assembler")
+ ("caml" "Caml")
+ ("delphi" "Delphi")
+ ("html" "HTML")
+ ("idl" "IDL")
+ ("mercury" "Mercury")
+ ("metapost" "MetaPost")
+ ("modula-2" "Modula-2")
+ ("pascal" "Pascal")
+ ("ps" "PostScript")
+ ("prolog" "Prolog")
+ ("simula" "Simula")
+ ("tcl" "tcl")
+ ("tex" "LaTeX")
+ ("plain-tex" "TeX")
+ ("verilog" "Verilog")
+ ("vhdl" "VHDL")
+ ("xml" "XML")
+ ("nxml" "XML")
+ ("conf" "Configuration File"))))
+ mode))
+#+END_SRC
+
+**** Header anchors
+:PROPERTIES:
+:CUSTOM_ID: h:3242148F-629E-4F9B-BD39-5FFC037BB7E1
+:END:
+
+#+BEGIN_SRC emacs-lisp
+(defun org-export-html-headline-anchor (text backend info)
+ (when (and (org-export-derived-backend-p backend 'html)
+ org-fancy-html-export-mode)
+ (unless org-msg-currently-exporting
+ (replace-regexp-in-string
+ "<h\\([0-9]\\) id=\"\\([a-z0-9-]+\\)\">\\(.*[^ ]\\)<\\/h[0-9]>" ; this is quite restrictive, but due to `org-heading-contraction' I can do this
+ "<h\\1 id=\"\\2\">\\3<a aria-hidden=\"true\" href=\"#\\2\">#</a> </h\\1>"
+ text))))
+
+(add-to-list 'org-export-filter-headline-functions
+ 'org-export-html-headline-anchor)
+#+END_SRC
+
+**** TODO Handle table overflow
+:PROPERTIES:
+:CUSTOM_ID: h:019A8A59-41BF-4BBB-B1BF-50EEA1F798CC
+:END:
+
+#+BEGIN_SRC emacs-lisp
+(defun org-html-table-wrapped (orig-fn table contents info)
+ "Wrap the usual <table> in a <div>"
+ :around #'org-html-table
+ (if (not org-fancy-html-export-mode)
+ (funcall orig-fn table contents info)
+ (let* ((name (plist-get (cadr table) :name))
+ (ref (org-export-get-reference table info)))
+ (format "<div id='%s' class='table'>
+<div class='gutter'><a href='#%s'>#</a></div>
+<div class='tabular'>
+%s
+</div>\
+</div>"
+ ref ref
+ (if name
+ (replace-regexp-in-string (format "<table id=\"%s\"" ref) "<table"
+ (funcall orig-fn table contents info))
+ (funcall orig-fn table contents info))))))
+#+END_SRC
+
+**** Verbatim different from code
+:PROPERTIES:
+:CUSTOM_ID: h:DF38FDAF-C835-4B5B-ABCC-4B599A14F38C
+:END:
+
+#+BEGIN_SRC emacs-lisp
+(setq org-html-text-markup-alist
+ '((bold . "<b>%s</b>")
+ (code . "<code>%s</code>")
+ (italic . "<i>%s</i>")
+ (strike-through . "<del>%s</del>")
+ (underline . "<span class=\"underline\">%s</span>")
+ (verbatim . "<kbd>%s</kbd>")))
+#+END_SRC
+
+*** LaTeX
+:PROPERTIES:
+:ID: F6530BD3-415D-41B0-9CCF-FF03EFC3C536
+:CUSTOM_ID: h:3C634198-C969-46F2-B8C4-74CC3C8DAABB
+:END:
+
+These are adapted from https://tecosaur.github.io/emacs-config/config.html#latex
+
+#+BEGIN_SRC emacs-lisp
+ (defun tec/org-export-latex-filter-acronym (text backend info)
+ (when (org-export-derived-backend-p backend 'latex)
+ (let ((case-fold-search nil))
+ (replace-regexp-in-string
+ "[;\\\\]?\\b[A-Z][A-Z]+s?"
+ (lambda (all-caps-str)
+ ; only \acr if str doesn't start with ";" or "\" (for LaTeX commands)
+ (cond ((equal (aref all-caps-str 0) ?\;) (substring all-caps-str 1))
+ ((equal (aref all-caps-str 0) ?\\) all-caps-str)
+ ((equal (aref all-caps-str (- (length all-caps-str) 1)) ?s)
+ (concat "\\textls*[70]{\\textsc{"
+ (s-downcase (substring all-caps-str 0 -1))
+ "}\\protect\\scalebox{.91}[.84]{s}}"))
+ (t (concat "\\textls*[70]{\\textsc{"
+ (s-downcase all-caps-str) "}}"))))
+ text t t))))
+
+ ;; (add-to-list 'org-export-filter-plain-text-functions
+ ;; 'tec/org-export-latex-filter-acronym)
+
+ ;; FIXME I want to process headings, but this causes issues ATM
+ ;; (add-to-list 'org-export-filter-headline-functions
+ ;; 'tec/org-export-latex-filter-acronym)
+ ;; )
#+END_SRC
+#+BEGIN_SRC emacs-lisp
+(defun tec/org-export-latex-fancy-item-checkboxes (text backend info)
+ (when (org-export-derived-backend-p backend 'latex)
+ (replace-regexp-in-string
+ "\\\\item\\[{$\\\\\\(\\w+\\)$}\\]"
+ (lambda (fullmatch)
+ (concat "\\\\item[" (pcase (substring fullmatch 9 -3) ; content of capture group
+ ("square" "\\\\ifdefined\\\\checkboxUnchecked\\\\checkboxUnchecked\\\\else$\\\\square$\\\\fi" )
+ ("boxminus" "\\\\ifdefined\\\\checkboxTransitive\\\\checkboxTransitive\\\\else$\\\\boxminus$\\\\fi")
+ ("boxtimes" "\\\\ifdefined\\\\checkboxChecked\\\\checkboxChecked\\\\else$\\\\boxtimes$\\\\fi" )
+ (_ (substring fullmatch 9 -3))) "]"))
+ text)))
+
+(add-to-list 'org-export-filter-item-functions
+ 'tec/org-export-latex-fancy-item-checkboxes)
+#+END_SRC
+
+**** Additional adjustments
+:PROPERTIES:
+:ID: F5E2CF65-F432-4FE9-A846-DF7793E9B242
+:CUSTOM_ID: h:4725293E-0902-4250-96FA-E9523C825B40
+:END:
+
+#+BEGIN_SRC emacs-lisp :noweb yes
+(add-to-list 'org-latex-classes
+ '("fancy-article"
+ "\\documentclass{scrartcl}\n\
+\\usepackage[T1]{fontenc}\n\
+\\usepackage[osf,largesc,helvratio=0.9]{newpxtext}\n\
+\\usepackage[scale=0.92]{sourcecodepro}\n\
+\\usepackage[varbb]{newpxmath}\n\
+
+\\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=2000]{microtype}\n\
+\\usepackage{xcolor}\n\
+\\usepackage{booktabs}
+
+\\usepackage{subcaption}
+\\usepackage[hypcap=true]{caption}
+\\setkomafont{caption}{\\sffamily\\small}
+\\setkomafont{captionlabel}{\\upshape\\bfseries}
+\\captionsetup{justification=raggedright,singlelinecheck=true}
+\\setcapindent{0pt}
+
+\\setlength{\\parskip}{\\baselineskip}\n\
+\\setlength{\\parindent}{0pt}\n\
+
+\\usepackage{pifont}
+\\newcommand{\\checkboxUnchecked}{$\\square$}
+\\newcommand{\\checkboxTransitive}{\\rlap{\\raisebox{0.0ex}{\\hspace{0.35ex}\\Large\\textbf -}}$\\square$}
+\\newcommand{\\checkboxChecked}{\\rlap{\\raisebox{0.2ex}{\\hspace{0.35ex}\\scriptsize \\ding{56}}}$\\square$}
+
+\\newenvironment{warning}
+ {\\begin{center}
+ \\begin{tabular}{rp{0.9\\textwidth}}
+ \\ding{82} & \\textbf{Warning} \\\\ &
+ }
+ {
+ \\end{tabular}
+ \\end{center}
+ }
+"
+ ("\\section{%s}" . "\\section*{%s}")
+ ("\\subsection{%s}" . "\\subsection*{%s}")
+ ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
+ ("\\paragraph{%s}" . "\\paragraph*{%s}")
+ ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
+(add-to-list 'org-latex-classes
+ '("blank"
+ "[NO-DEFAULT-PACKAGES]
+ [NO-PACKAGES]
+ [EXTRA]"
+ ("\\section{%s}" . "\\section*{%s}")
+ ("\\subsection{%s}" . "\\subsection*{%s}")
+ ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
+ ("\\paragraph{%s}" . "\\paragraph*{%s}")
+ ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
+(add-to-list 'org-latex-classes
+ '("bmc-article"
+ "\\documentclass[article,code,maths]{bmc}
+ [NO-DEFAULT-PACKAGES]
+ [NO-PACKAGES]
+ [EXTRA]"
+ ("\\section{%s}" . "\\section*{%s}")
+ ("\\subsection{%s}" . "\\subsection*{%s}")
+ ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
+ ("\\paragraph{%s}" . "\\paragraph*{%s}")
+ ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
+(add-to-list 'org-latex-classes
+ '("bmc"
+ "\\documentclass[code,maths]{bmc}
+ [NO-DEFAULT-PACKAGES]
+ [NO-PACKAGES]
+ [EXTRA]"
+ ("\\chapter{%s}" . "\\chapter*{%s}")
+ ("\\section{%s}" . "\\section*{%s}")
+ ("\\subsection{%s}" . "\\subsection*{%s}")
+ ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
+ ("\\paragraph{%s}" . "\\paragraph*{%s}")
+ ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
+
+(setq org-latex-default-class "fancy-article")
+
+<<org-latex-smart-minted>>
+
+(setq org-latex-listings 'minted
+ org-latex-minted-options
+ '())
+
+(setq org-latex-tables-booktabs t)
+
+(setq org-latex-hyperref-template "
+\\colorlet{greenyblue}{blue!70!green}
+\\colorlet{blueygreen}{blue!40!green}
+\\providecolor{link}{named}{greenyblue}
+\\providecolor{cite}{named}{blueygreen}
+\\hypersetup{
+ pdfauthor={%a},
+ pdftitle={%t},
+ pdfkeywords={%k},
+ pdfsubject={%d},
+ pdfcreator={%c},
+ pdflang={%L},
+ breaklinks=true,
+ colorlinks=true,
+ linkcolor=link,
+ urlcolor=link,
+ citecolor=cite\n}
+\\urlstyle{same}\n")
+(setq org-latex-pdf-process
+ '("latexmk -shell-escape -interaction=nonstopmode -f -pdf -output-directory=%o %f"))
+#+END_SRC
+
+**** Remaining blocks for org latex adjustments
+:PROPERTIES:
+:header-args: :tangle no
+:END:
+
+#+NAME: org-minted-preamble
+#+BEGIN_SRC latex :tangle no
+\\usepackage{minted}
+\\usepackage[many]{tcolorbox}
+\\setminted{
+ frame=none,
+ % framesep=2mm,
+ baselinestretch=1.2,
+ fontsize=\\footnotesize,
+ highlightcolor=white!95!black!80!blue,
+ linenos,
+ breakanywhere=true,
+ breakautoindent=true,
+ breaklines=true,
+ tabsize=4,
+ xleftmargin=3.5em,
+ autogobble=true,
+ obeytabs=true,
+ python3=true,
+ % texcomments=true,
+ framesep=2mm,
+ breakbefore=\\\\\.+,
+ breakafter=\\,
+ style=autumn,
+ breaksymbol=\\color{white!60!black}\\tiny\\ensuremath{\\hookrightarrow},
+ breakanywheresymbolpre=\\,\\footnotesize\\ensuremath{_{\\color{white!60!black}\\rfloor}},
+ breakbeforesymbolpre=\\,\\footnotesize\\ensuremath{_{\\color{white!60!black}\\rfloor}},
+ breakaftersymbolpre=\\,\\footnotesize\\ensuremath{_{\\color{white!60!black}\\rfloor}},
+}
+
+\\BeforeBeginEnvironment{minted}{
+ \\begin{tcolorbox}[
+ enhanced,
+ overlay={\\fill[white!90!black] (frame.south west) rectangle ([xshift=2.8em]frame.north west);},
+ colback=white!95!black,
+ colframe=white!95!black, % make frame colour same as background
+ breakable,% Allow white breaks
+ arc=0pt,outer arc=0pt,sharp corners, % sharp corners
+ boxsep=0pt,left=0pt,right=0pt,top=0pt,bottom=0pt % no margin/paddding
+ ]
+}
+\\AfterEndEnvironment{minted}{\\end{tcolorbox}}
+\\renewcommand\\theFancyVerbLine{\\color{black!60!white}\\arabic{FancyVerbLine}} % minted line numbering
+#+END_SRC
+
+#+RESULTS: org-minted-preamble
+#+begin_export latex
+\\usepackage{minted}
+\\usepackage[many]{tcolorbox}
+\\setminted{
+ frame=none,
+ % framesep=2mm,
+ baselinestretch=1.2,
+ fontsize=\\footnotesize,
+ highlightcolor=white!95!black!80!blue,
+ linenos,
+ breakanywhere=true,
+ breakautoindent=true,
+ breaklines=true,
+ tabsize=4,
+ xleftmargin=3.5em,
+ autogobble=true,
+ obeytabs=true,
+ python3=true,
+ % texcomments=true,
+ framesep=2mm,
+ breakbefore=\\\\\.+,
+ breakafter=\\,
+ style=autumn,
+ breaksymbol=\\color{white!60!black}\\tiny\\ensuremath{\\hookrightarrow},
+ breakanywheresymbolpre=\\,\\footnotesize\\ensuremath{_{\\color{white!60!black}\\rfloor}},
+ breakbeforesymbolpre=\\,\\footnotesize\\ensuremath{_{\\color{white!60!black}\\rfloor}},
+ breakaftersymbolpre=\\,\\footnotesize\\ensuremath{_{\\color{white!60!black}\\rfloor}},
+}
+
+\\BeforeBeginEnvironment{minted}{
+ \\begin{tcolorbox}[
+ enhanced,
+ overlay={\\fill[white!90!black] (frame.south west) rectangle ([xshift=2.8em]frame.north west);},
+ colback=white!95!black,
+ colframe=white!95!black, % make frame colour same as background
+ breakable,% Allow white breaks
+ arc=0pt,outer arc=0pt,sharp corners, % sharp corners
+ boxsep=0pt,left=0pt,right=0pt,top=0pt,bottom=0pt % no margin/paddding
+ ]
+}
+\\AfterEndEnvironment{minted}{\\end{tcolorbox}}
+\\renewcommand\\theFancyVerbLine{\\color{black!60!white}\\arabic{FancyVerbLine}} % minted line numbering
+#+end_export
+
+We also always want some particular elements in the preamble, let's call this
+the "universal preamble"
+
+#+NAME: org-universal-preamble
+#+BEGIN_SRC latex
+\\usepackage[main,include]{embedall}
+\\IfFileExists{./\\jobname.org}{\\embedfile[desc=The original file]{\\jobname.org}}{}
+#+END_SRC
+
+**** Org latex smart minted
+Instead of just loading doing the 'minted stuff' all the time, we can try to be
+a bit cleverer, and handle the "universal preamble" while we're at it.
+
+#+NAME: org-latex-smart-minted
+#+BEGIN_SRC emacs-lisp :tangle no :noweb yes
+(defun org-latex-header-smart-minted (orig-fn tpl def-pkg pkg snippets-p &optional extra)
+ "Include minted config if src blocks are detected."
+ :around #'org-splice-latex-header
+ (let ((header (funcall orig-fn tpl def-pkg pkg snippets-p extra))
+ (src-p (when (save-excursion
+ (goto-char (point-min))
+ (search-forward-regexp "#\\+BEGIN_SRC\\|#\\+begin_src" nil t))
+ t)))
+ (if snippets-p header
+ (concat header
+ org-latex-universal-preamble
+ (when src-p org-latex-minted-preamble)))))
+
+(defvar org-latex-minted-preamble "
+<<org-minted-preamble>>
+"
+ "Preamble to be inserted when minted is used.")
+
+(defvar org-latex-universal-preamble "
+<<org-universal-preamble>>
+"
+ "Preamble to be included in every export.")
+#+END_SRC
** TODO Shortcuts (to be replaced via hydra)
:PROPERTIES:
:ID: DCF53C2E-3C3B-4FC1-BDD9-ED8D6017A771
+:CUSTOM_ID: h:D7E5F3C2-5038-4F42-9E01-1ABEFC73C6DB
:END:
#+BEGIN_SRC emacs-lisp
@@ -1635,6 +2623,7 @@ This sequence will include a note as to why the state is being set.
** TODO org-ql
:PROPERTIES:
:ID: 36253952-2078-4DC2-B284-D9992E453DAF
+:CUSTOM_ID: h:6C38A7EF-F605-46E3-BAF1-FC8ECA0F8D13
:END:
- Note taken on [2020-04-24 Fri 09:59] \\
This is an interesting package that I want to master using
@@ -1642,14 +2631,48 @@ This sequence will include a note as to why the state is being set.
#+BEGIN_SRC emacs-lisp
(use-package org-ql
-:straight t)
+ :straight t)
+
+#+END_SRC
+
+** TODO COMMENT Collection of hooks for org mode
+:PROPERTIES:
+:ID: AA8706FA-0B26-4F0A-B6F8-2E2EDA551375
+:CUSTOM_ID: h:BE53685E-2406-463C-898D-4E64819A77F4
+:END:
+This is intended to be a collection of hooks loaded after org mode. It may be more convenient to add such hooks in the package configurations since the hooks will not work if the package is not available.
+
+However, hooks have the potential to slow down search, opening multiple files like in org-agenda, tramp files and so on. Therefore, the idea is to try collect the hooks here and include logic to discard hooks if the mode or package is not installed.
+
+- [ ] Maybe work on a method to switch off all the hooks after org mode since this mode is being used extensively.
+
+List of hooks
+- [ ] Org indent mode
+- [ ] Flyspell mode - the problem here is that flyspell is referred else where. The hooks ha
+ - [ ]
+
+#+BEGIN_SRC emacs-lisp
+;; Indent by header level
+
+(with-eval-after-load 'org
+ (add-hook 'org-mode-hook #'org-indent-mode))
+
+;; Enable flyspell mode
+
+(add-hook 'org-mode-hook 'flyspell-mode)
#+END_SRC
** COMMENT Org git link
+:PROPERTIES:
+:CUSTOM_ID: h:E50D65C4-458A-40C6-8144-614307811397
+:END:
- Note taken on [2020-07-12 Sun 20:27] \\
The orgit package enables creating links to commits.
*** Note
+:PROPERTIES:
+:CUSTOM_ID: h:1879E1DC-7371-47D4-B1BE-1DA5D8C1DC5A
+:END:
This is very handy to save as a capture and ready reference to a
particular commit. This also works well while referring to links in
@@ -1664,6 +2687,7 @@ commit link will be saved.
*** script
:PROPERTIES:
:ID: 216D9A94-024D-4FFC-9C30-0B5D9C280731
+:CUSTOM_ID: h:E639B032-EA96-4922-A1C3-0831E540332E
:END:
#+BEGIN_SRC emacs-lisp
@@ -1850,9 +2874,9 @@ commit link will be saved.
(when (buffer-file-name)
(let ((file (abbreviate-file-name (buffer-file-name))))
(when (org-git-gitrepos-p file)
- (org-store-link-props
- :type "git"
- :link (org-git-create-git-link file))))))
+ (org-store-link-props
+ :type "git"
+ :link (org-git-create-git-link file))))))
(add-hook 'org-store-link-functions 'org-git-store-link)
@@ -1870,11 +2894,11 @@ commit link will be saved.
(defun org-git-blob-sha (gitdir object)
"Return sha of the referenced object"
- (with-temp-buffer
- (if (zerop (call-process org-git-program nil t nil
- "--no-pager" (concat "--git-dir=" gitdir) "rev-parse" object))
- (buffer-substring (point-min) (1- (point-max))) ; to strip off final newline
- (error "git error: %s " (buffer-string)))))
+ (with-temp-buffer
+ (if (zerop (call-process org-git-program nil t nil
+ "--no-pager" (concat "--git-dir=" gitdir) "rev-parse" object))
+ (buffer-substring (point-min) (1- (point-max))) ; to strip off final newline
+ (error "git error: %s " (buffer-string)))))
(defun org-git-get-current-branch (gitdir)
"Return the name of the current branch."
@@ -1895,6 +2919,7 @@ commit link will be saved.
** org-sidebar
:PROPERTIES:
:ID: FD166AE3-7B57-4057-938B-F44531FAF0B0
+:CUSTOM_ID: h:759583F7-33FC-4400-81D1-D0A488AD8AC5
:END:
#+BEGIN_SRC emacs-lisp
@@ -1902,48 +2927,54 @@ commit link will be saved.
:straight (org-sidebar :host github :repo "alphapapa/org-sidebar"))
#+END_SRC
-* Temporary package list
+** TODO Log
+:PROPERTIES:
+:CUSTOM_ID: h:DE12FA74-EBF5-408B-85BF-66ECE8634C24
+:END:
+* COMMENT Temporary package list
:PROPERTIES:
:ID: 75AABB86-BB3D-417F-8043-4ACA11AE8759
+:CUSTOM_ID: h:072816E6-A8D5-4319-BC89-74E9474A13FE
:END:
- Note taken on [2020-03-30 Mon 07:58] \\
A lot of these are borrowed from scimax and will be slowly whittled down to the essentials.
#+BEGIN_SRC emacs-lisp
- ;; (use-package helm-bibtex)
+;; (use-package helm-bibtex)
- ;; Functions for working with hash tables
- (use-package ht)
+;; Functions for working with hash tables
+(use-package ht)
- (use-package hy-mode)
+(use-package hy-mode)
- (use-package hydra
- :init
- (setq hydra-is-helpful t)
- :config
- (require 'hydra-ox))
-
- (use-package jedi)
+(use-package hydra
+ :init
+ (setq hydra-is-helpful t)
+ :config
+ (require 'hydra-ox))
- (use-package diminish)
+(use-package jedi)
- (use-package rainbow-mode)
+(use-package rainbow-mode)
- ;; Provides functions for working with files
- (use-package f)
+;; Provides functions for working with files
+(use-package f)
- (use-package auto-complete
- :diminish auto-complete-mode
- :config (ac-config-default))
+(use-package auto-complete
+ :diminish auto-complete-mode
+ :config (ac-config-default))
- (straight-use-package 'ggtags)
- (straight-use-package 'ibuffer-projectile)
+(straight-use-package 'ggtags)
+(straight-use-package 'ibuffer-projectile)
#+END_SRC
: t
- * Org journal
+* Org journal
+:PROPERTIES:
+:CUSTOM_ID: h:4D155EB8-6710-461A-8556-DF6ECCD66C10
+:END:
- Note taken on [2020-04-10 Fri 17:29] \\
Scimax journal has the benefit of being well integrated with Scimax. The
other benefit is being able to have journal files within a
@@ -1961,6 +2992,7 @@ commit link will be saved.
** Base config
:PROPERTIES:
:ID: 3A6F91EB-3C33-410F-948A-88CFF1E8E6B8
+:CUSTOM_ID: h:F75106E9-7F49-4FB0-AA82-D25DC0DF619F
:END:
#+BEGIN_SRC emacs-lisp
@@ -1972,12 +3004,13 @@ commit link will be saved.
"Custom function to create journal header."
(concat
(pcase org-journal-file-type
- (`daily "#+TITLE: Daily Journal\n#+STARTUP: showeverything")
- (`weekly "#+TITLE: Weekly Journal\n#+STARTUP: folded")
- (`monthly "#+TITLE: Monthly Journal\n#+STARTUP: folded")
- (`yearly "#+TITLE: Yearly Journal\n#+STARTUP: folded"))))
+ (`daily "#+TITLE: Daily Journal\n#+STARTUP: showeverything\n#+TAGS: review(r) @midday(m) @evening(e) @morning(o)")
+ ;; (`weekly "#+TITLE: Weekly Journal\n#+STARTUP: folded")
+ ;; (`monthly "#+TITLE: Monthly Journal\n#+STARTUP: folded")
+ ;; (`yearly "#+TITLE: Yearly Journal\n#+STARTUP: folded")
+ )))
:custom
- (org-journal-dir "~/my_org/journal/")
+ (org-journal-dir "~/my_org/roam/private/journal/")
(org-journal-file-format "%Y/%m/%Y-%m-%d.org")
(org-journal-enable-agenda-integration t)
(org-journal-date-format "%A, %d %B %Y")
@@ -1995,6 +3028,9 @@ commit link will be saved.
: t
** TODO org-capture template for Journal
+:PROPERTIES:
+:CUSTOM_ID: h:AC322230-6E4A-44FF-866C-3B2235973BA7
+:END:
#+BEGIN_SRC emacs-lisp :tangle no
(defun org-journal-find-location ()
@@ -2012,14 +3048,19 @@ commit link will be saved.
** TODO Figure out easy encryption approach for org journal
:PROPERTIES:
:CREATED: <2019-02-07 Thu 13:51>
+:CUSTOM_ID: h:2C23A59A-4223-472C-88AB-F4BBD402C7AA
:END:
* Crypto
+:PROPERTIES:
+:CUSTOM_ID: h:250D4460-9195-41D4-A521-C05F5B0DBBB2
+:END:
** Basic crypto
:PROPERTIES:
- :ID: B4CA6F66-7CD6-4905-A3B0-B4FCB763ADE9
- :END:
+:ID: B4CA6F66-7CD6-4905-A3B0-B4FCB763ADE9
+:CUSTOM_ID: h:5B568232-F74A-482B-B59B-FD48D05ED6DA
+:END:
#+BEGIN_SRC emacs-lisp
(setq epa-file-encrypt-to "shreyas@fastmail.com")
@@ -2029,6 +3070,9 @@ commit link will be saved.
: Loaded crypto setup
** TEST org-crypt
+:PROPERTIES:
+:CUSTOM_ID: h:E6F616A0-3FDE-4389-AB65-4187692006F7
+:END:
#+BEGIN_SRC emacs-lisp :tangle no
(require 'org-crypt)
@@ -2044,9 +3088,10 @@ commit link will be saved.
#+END_SRC
** Setting auth sources
- :PROPERTIES:
- :ID: 4c87f5e8-70ca-4719-a550-cfcd32076ee0
- :END:
+:PROPERTIES:
+:ID: 4c87f5e8-70ca-4719-a550-cfcd32076ee0
+:CUSTOM_ID: h:DC7A0D43-AD1C-4CE8-90A3-46A11F097111
+:END:
This was prompted by this discussion https://emacs.stackexchange.com/questions/10207/how-to-get-org2blog-to-use-authinfo-gpg
@@ -2056,7 +3101,7 @@ I have modified it to my own file names.
(require 'auth-source)
(setq auth-sources
'((:source "~/.authinfo.gpg"
- "~/.bitly-access.token.gpg")))
+ "~/.bitly-access.token.gpg")))
(setq epa-file-cache-passphrase-for-symmetric-encryption t)
@@ -2084,32 +3129,37 @@ I have modified it to my own file names.
#+END_SRC
* git related
+:PROPERTIES:
+:CUSTOM_ID: h:63D131F2-0B94-40D7-B414-A57ED2BA9648
+:END:
** TODO Git gutter
:PROPERTIES:
- :ID: a30f51f4-8c96-4e89-a692-9df36e5278a7
- :END:
+:ID: a30f51f4-8c96-4e89-a692-9df36e5278a7
+:CUSTOM_ID: h:D5F489D9-D46E-48F6-B1F8-63400E29C991
+:END:
- Note taken on [2019-02-07 Thu 09:30] \\
Started using this today. It is actually very convenient to quickly view the changes made in the document. There is a function to pop up the changes at that location. I need to learn more about using this tool effectively.
#+begin_src emacs-lisp
- (use-package git-gutter
- :ensure t
- :config
- (global-git-gutter-mode 't)
- :diminish git-gutter-mode)
+(use-package git-gutter
+ :ensure t
+ :config
+ (global-git-gutter-mode 't)
+ :diminish git-gutter-mode)
#+end_src
#+RESULTS:
: t
** magit settings
- :PROPERTIES:
- :ID: 55d1b554-f224-41fa-a4ae-5c2e2c1024be
- :END:
+:PROPERTIES:
+:ID: 55d1b554-f224-41fa-a4ae-5c2e2c1024be
+:CUSTOM_ID: h:19F2E4DE-F0C8-4C98-855C-0F25EEA3777D
+:END:
#+BEGIN_SRC emacs-lisp
- (use-package magit
- :init (setq magit-completing-read-function 'ivy-completing-read)
+(use-package magit
+ :init (setq magit-completing-read-function 'ivy-completing-read)
:config
(global-set-key (kbd "C-x g") 'magit-status)
(setq magit-revert-buffers 'silent)
@@ -2122,6 +3172,7 @@ I have modified it to my own file names.
** TODO Time machine for git
:PROPERTIES:
:ID: eeb65d68-8c6d-4896-b9e4-cdf06bd3f81d
+:CUSTOM_ID: h:69B02AC5-E2EC-4F54-A95A-529107FDBC90
:END:
- Note taken on [2019-02-08 Fri 13:21] \\
Launched by =M-x git-timemachine=, this lets you navigate through the commit history with a single key press! This is especially awesome for tracking changes to a particular snippet of code.
@@ -2159,7 +3210,7 @@ Testing alert
#+BEGIN_SRC emacs-lisp :tangle no
(alert "this is an alert")
#+END_SRC
-** Sauron
+** TODO Sauron
:PROPERTIES:
:ID: C550528A-15FB-4993-A54A-D125302B4513
:CUSTOM_ID: h:B660DC34-825F-4F71-BDF1-081B778C97B8
@@ -2181,7 +3232,7 @@ up.
(use-package sauron
:ensure t
:config
- (setq sauron-modules '(sauron-org sauron-notifications sauron-dbus sauron-appt))
+ (setq sauron-modules '(sauron-org sauron-notifications sauron-appt sauron-mu4e))
(add-hook 'sauron-event-added-functions 'sauron-alert-el-adapter)
;; I want to have sauron alerts stay on top
(setq sauron-sticky-frame t)
@@ -2189,31 +3240,49 @@ up.
;; (require 'sauron)
;; Since I use Emacs mostly in the deamon mode, I do not want an extra buffer poppin up
(setq sauron-separate-frame nil)
-(require 'sauron-mu4e)
+ ;; This does not seem to work and there is not much documentation about
+ ;; it. It looks like only select modules are getting loaded.
+ (require 'sauron-mu4e)
(sauron-start))
#+END_SRC
* PDF related
+:PROPERTIES:
+:CUSTOM_ID: h:448562C8-E7B3-42AD-8AFF-813EE5DC1137
+:END:
** STABLE PDF Tools
CLOSED: [2019-10-23 Wed 09:26]
:PROPERTIES:
:ID: 50da84f6-3fb3-4e30-b4b0-e293f3bb1b72
+:CUSTOM_ID: h:5DBA4E81-4367-4EDC-93DB-A993F967271E
:END:
- - Note taken on [2019-10-23 Wed 09:26] \\
- This appears to be setup via scimax already. Disabling for now.
- - Note taken on [2019-02-18 Mon 14:30] \\
- [[https://emacs.stackexchange.com/questions/13314/install-pdf-tools-on-emacs-macosx][osx - Install Pdf-Tools on Emacs MacOSX - Emacs Stack Exchange]]
+- Note taken on [2019-10-23 Wed 09:26] \\
+ This appears to be setup via scimax already. Disabling for now.
+- Note taken on [2019-02-18 Mon 14:30] \\
+ [[https://emacs.stackexchange.com/questions/13314/install-pdf-tools-on-emacs-macosx][osx - Install Pdf-Tools on Emacs MacOSX - Emacs Stack Exchange]]
#+BEGIN_SRC emacs-lisp
(use-package pdf-tools
:ensure t
+ :init
+ (setq-default pdf-view-display-size 'fit-page)
+ ;; more fine-grained zooming
+ (setq pdf-view-resize-factor 1.1)
+ ;; automatically annotate highlights
+ (setq pdf-annot-activate-created-annotations t)
:config
+ (pdf-tools-install)
(custom-set-variables
'(pdf-tools-handle-upgrades nil)) ; Use brew upgrade pdf-tools instead in the mac
(setq pdf-info-epdfinfo-program "/usr/local/bin/epdfinfo")
- (pdf-tools-install)
-)
+ ;; keyboard shortcuts
+ ;; TODO consider using these
+ ;; (define-key pdf-view-mode-map (kbd "h") 'pdf-annot-add-highlight-markup-annotation)
+ ;; (define-key pdf-view-mode-map (kbd "t") 'pdf-annot-add-text-annotation)
+ ;; (define-key pdf-view-mode-map (kbd "D") 'pdf-annot-delete))
+
+ )
#+END_SRC
@@ -2221,9 +3290,10 @@ CLOSED: [2019-10-23 Wed 09:26]
: t
** org-noter
- :PROPERTIES:
- :ID: adfce132-a15d-4b1e-bda5-7d1248a9c4d5
- :END:
+:PROPERTIES:
+:ID: adfce132-a15d-4b1e-bda5-7d1248a9c4d5
+:CUSTOM_ID: h:2C2E8D3F-27A9-4933-8B89-A8100FA9E26C
+:END:
#+BEGIN_QUOTE
Org-noter's purpose is to let you create notes that are kept in sync when you scroll through the document, but that are external to it - the notes themselves live in an Org-mode file. As such, this leverages the power of Org-mode (the notes may have outlines, latex fragments, babel, etc) acting like notes that are made inside the document. Also, taking notes is very simple: just press i and annotate away!
@@ -2243,9 +3313,13 @@ Org-noter's purpose is to let you create notes that are kept in sync when you sc
#+RESULTS:
* Window, frame and buffer management
+:PROPERTIES:
+:CUSTOM_ID: h:90F5CD9F-D5A0-436A-B450-FCD6D0DEE984
+:END:
** winum
:PROPERTIES:
:ID: 80A2FA09-6120-44C4-A1B4-3FB3645C269A
+:CUSTOM_ID: h:ACFF28D8-66E5-45E2-AA75-6EADB97CF245
:END:
This package makes it easy to switch between frames, and is particularly useful in a multi screen setup of emacs.
@@ -2289,11 +3363,14 @@ This package makes it easy to switch between frames, and is particularly useful
** Winner mode
:PROPERTIES:
:ID: E7F63E2C-F5F7-4BF6-A5E3-C3E3AD82F4B7
+:CUSTOM_ID: h:508D6548-FA70-429C-B5D2-48E0C2A9A55A
:END:
Enabling winner mode. This is convenient to switch between temporary window configurations in conjunction with somewhat more permanent configurations in eyebrowse.
#+BEGIN_SRC emacs-lisp
-(winner-mode)
+(use-package winner
+ :config
+ (winner-mode))
#+END_SRC
#+RESULTS:
@@ -2302,6 +3379,7 @@ Enabling winner mode. This is convenient to switch between temporary window conf
** TEST eyebrowse
:PROPERTIES:
:ID: 2a73c1c9-9438-478a-881a-e2f61c803929
+:CUSTOM_ID: h:0D087C58-AC84-4283-999C-305EFE07758E
:END:
This has to be combined with desktop.el or some other method to enable persistence across sessions. However, this does work well for a single session.
@@ -2319,6 +3397,7 @@ This has to be combined with desktop.el or some other method to enable persisten
** TODO Bufler
:PROPERTIES:
:ID: 33032A84-CCB0-481A-A622-E30B1B823ED5
+:CUSTOM_ID: h:48FB73D0-02CD-40D2-8336-73212C91B4A7
:END:
For the few occassions that I use the buffer-list command, I think the bufler
@@ -2330,12 +3409,13 @@ package provides a more functional interface.
#+BEGIN_SRC emacs-lisp
(use-package bufler
:straight (bufler :host github :repo "alphapapa/bufler.el")
-:bind ("C-x C-b" . bufler-list))
+ :bind ("C-x C-b" . bufler-list))
#+END_SRC
** Frame settings
:PROPERTIES:
:ID: 5ACDA41D-D680-46ED-A1AD-28C614E9BBCB
+:CUSTOM_ID: h:6AC97DEC-7902-4517-ACF0-6B6EFEF42BCA
:END:
I'm often running emacsclient with a daemon and have found that specific settings need to be set for each frame that is created, like the window size, and the visual fill column and line settings.
@@ -2353,14 +3433,15 @@ I'm often running emacsclient with a daemon and have found that specific setting
** crux
:PROPERTIES:
:ID: BF85E4B9-231B-4FC6-BBB1-5C1A686F0E27
+:CUSTOM_ID: h:097D5570-E4C3-4A6F-9053-6E376B322690
:END:
-Crux has a handle re-open and root function that will open a file as root if the permissions are set so.
+Crux has a handle re-open and root function that will open a file as root if the permissions are set so. It also has some other handy functions like transposing windows, duplicating lines and so on.
#+BEGIN_SRC emacs-lisp
(use-package crux
:straight t
- :defer 10
+ :defer 4
:bind (("C-c C-s" . crux-sudo-edit)
("C-c C-r" . crux-eval-and-replace)
("C-c o" . crux-open-with))
@@ -2374,6 +3455,9 @@ Crux has a handle re-open and root function that will open a file as root if the
: crux-open-with
** transpose-frame
+:PROPERTIES:
+:CUSTOM_ID: h:993C89E6-346B-4629-8ECC-5AD246357678
+:END:
Thanks to a tip from dale in #Emacs, I found the transpose-frame
package. THis contains a bunch of nifty functions to quickly rotate and
@@ -2382,14 +3466,18 @@ mirror frame configurations.
#+BEGIN_SRC emacs-lisp
(use-package transpose-frame
:straight (transpose-frame :host github :repo "emacsorphanage/transpose-frame")
-:config
-(require 'transpose-frame))
+ :config
+ (require 'transpose-frame))
#+END_SRC
* Project management
+:PROPERTIES:
+:CUSTOM_ID: h:1D080691-E81C-4336-A917-01779231D8B1
+:END:
** TODO org-projectile
:PROPERTIES:
:ID: 7A27A0F7-8998-437B-97DF-4821702AE10D
+:CUSTOM_ID: h:F0A1A3AA-1A11-41EE-BAAE-B75AA956F6B5
:END:
- Note taken on [2019-02-07 Thu 08:42] \\
@@ -2417,6 +3505,7 @@ Starting off with the basic configuration posted in org-projectile github repo.
** projectile
:PROPERTIES:
:ID: DD02A085-D48E-4085-B39A-41AD64D8CB16
+:CUSTOM_ID: h:52B84D34-975B-4FA5-ACE0-25B5E8B03CA2
:END:
- [ ] Add a variable for the emacs_meta directory.
@@ -2443,10 +3532,17 @@ Starting off with the basic configuration posted in org-projectile github repo.
#+END_SRC
* Knowledge management
+:PROPERTIES:
+:CUSTOM_ID: h:B18F9F48-959A-4510-A52C-64A07958A212
+:END:
** org-brain
+:PROPERTIES:
+:CUSTOM_ID: h:102818D4-E9AE-461D-92E0-AFB0DE9787F3
+:END:
*** Main configuration
:PROPERTIES:
:ID: 33249427-B582-4094-8E59-4CAF966EA934
+:CUSTOM_ID: h:F8EE20B7-1749-4BDB-B99F-4B00C0E33E69
:END:
#+begin_src emacs-lisp
@@ -2461,6 +3557,7 @@ Starting off with the basic configuration posted in org-projectile github repo.
;; (setcdr org-brain-visualize-mode-map nil)
(setq
;; org-brain-path (f-join path-of-this-repo "brain")
+ org-brain-path (sr/fun/roam-public-dir "")
org-brain-visualize-default-choices 'all
org-brain-include-file-entries t
org-brain-scan-for-header-entries t
@@ -2470,27 +3567,19 @@ Starting off with the basic configuration posted in org-projectile github repo.
org-id-track-globally t
org-brain-vis-current-title-append-functions '(org-brain-entry-tags-string)
org-brain-title-max-length 24)
- ;; (push '("b" "Brain" plain (function org-brain-goto-end)
- ;; "* %i%?\n:PROPERTIES:\n:CREATED: [%<%Y-%m-%d %a %H:%M>]\n:ID: [%(org-id-get-create)]\n:END:" :empty-lines 1
- ;; org-capture-templates))
-
- (defun org-brain-cliplink-resource ()
- "Add a URL from the clipboard as an org-brain resource.
-Suggest the URL title as a description for resource."
- (interactive)
- (let ((url (org-cliplink-clipboard-content)))
- (org-brain-add-resource
- url
- (org-cliplink-retrieve-title-synchronously url)
- t)))
-
- (define-key org-brain-visualize-mode-map (kbd "L") #'org-brain-cliplink-resource))
+ (push '("b" "Brain" plain (function org-brain-goto-end)
+ "* %i%?\n:PROPERTIES:\n:CREATED: [%<%Y-%m-%d %a %H:%M>]\n:ID: [%(org-id-get-create)]\n:END:" :empty-lines 1)
+ org-capture-templates)
;; (add-hook 'org-brain-refile 'org-id-get-create)))
+)
#+end_src
#+RESULTS:
: org-brain-visualize
*** org-cliplink function
+:PROPERTIES:
+:CUSTOM_ID: h:30E004FC-21D6-4CD6-BAFD-7C055D509386
+:END:
#+BEGIN_SRC emacs-lisp
(defun org-brain-cliplink-resource ()
@@ -2509,6 +3598,7 @@ Suggest the URL title as a description for resource."
*** Chronological entries
:PROPERTIES:
:ID: 94C0FCDB-1CAE-49FF-A694-91A7814AA7BD
+:CUSTOM_ID: h:A3A8E075-8E93-4DAE-8B7C-7228B4D80E09
:END:
#+BEGIN_SRC emacs-lisp
@@ -2544,80 +3634,84 @@ Suggest the URL title as a description for resource."
*** Navigation Helpers
:PROPERTIES:
:ID: DD789690-67CF-467A-8F58-5A7AB287D7DE
+:CUSTOM_ID: h:4FCE4F64-3173-40FE-BCA1-92C074D27CFF
:END:
#+begin_src emacs-lisp
- (defun my/org-brain-visualize-parent ()
- (interactive)
- (when (org-brain-parents (org-brain-entry-at-pt)) (org-brain-visualize-parent (org-brain-entry-at-pt))))
+(defun my/org-brain-visualize-parent ()
+ (interactive)
+ (when (org-brain-parents (org-brain-entry-at-pt)) (org-brain-visualize-parent (org-brain-entry-at-pt))))
- (defun my/org-brain-visualize-child (entry &optional all)
- (interactive (list (org-brain-entry-at-pt)))
- (when (org-brain-children entry)
- (let* ((entries (if all (org-brain-children entry)
+(defun my/org-brain-visualize-child (entry &optional all)
+ (interactive (list (org-brain-entry-at-pt)))
+ (when (org-brain-children entry)
+ (let* ((entries (if all (org-brain-children entry)
(org-brain--linked-property-entries
entry org-brain-children-property-name)))
(child (cond
((equal 1 (length entries)) (car-safe entries))
((not entries) (error (concat entry " has no children")))
(t (org-brain-choose-entry "Goto child: " entries nil t)))))
- (org-brain-visualize child))))
-
- (defun my/next-button-with-category (category)
- (let ((original-point (point))
- (first-result (text-property-search-forward 'brain-category category t t)))
- (when first-result
- (goto-char (prop-match-beginning first-result)))
- (when (eq original-point (point))
- (beginning-of-buffer)
- (let ((second-result (text-property-search-forward 'brain-category category t t)))
- (when second-result
- (goto-char (prop-match-beginning second-result))))
- (when (eq 0 (point))
- (goto-char original-point))
- )
- ))
+ (org-brain-visualize child))))
+
+(defun my/next-button-with-category (category)
+ (let ((original-point (point))
+ (first-result (text-property-search-forward 'brain-category category t t)))
+ (when first-result
+ (goto-char (prop-match-beginning first-result)))
+ (when (eq original-point (point))
+ (beginning-of-buffer)
+ (let ((second-result (text-property-search-forward 'brain-category category t t)))
+ (when second-result
+ (goto-char (prop-match-beginning second-result))))
+ (when (eq 0 (point))
+ (goto-char original-point))
+ )
+ ))
- (defun my/previous-button-with-category (category)
- (let ((result (text-property-search-backwards 'brain-category category nil t)))))
+(defun my/previous-button-with-category (category)
+ (let ((result (text-property-search-backwards 'brain-category category nil t)))))
- (defun my/next-brain-child ()
- (interactive)
- (my/next-button-with-category 'child))
+(defun my/next-brain-child ()
+ (interactive)
+ (my/next-button-with-category 'child))
- (defun my/next-brain-history ()
- (interactive)
- (my/next-button-with-category 'history))
+(defun my/next-brain-history ()
+ (interactive)
+ (my/next-button-with-category 'history))
- (defun my/avy-brain-jump (category)
- (avy-jump "\\<." :pred (lambda () (and (eq category (get-text-property (point) 'brain-category))
- (eq (- (point) 1) (button-start (button-at (point))))))
- :action (lambda (p) (goto-char (+ 1 p)) (push-button))))
+(defun my/avy-brain-jump (category)
+ (avy-jump "\\<." :pred (lambda () (and (eq category (get-text-property (point) 'brain-category))
+ (eq (- (point) 1) (button-start (button-at (point))))))
+ :action (lambda (p) (goto-char (+ 1 p)) (push-button))))
- (defun my/avy-brain-jump-history ()
- (interactive)
- (my/avy-brain-jump 'history))
+(defun my/avy-brain-jump-history ()
+ (interactive)
+ (my/avy-brain-jump 'history))
- (defun my/avy-brain-jump-child ()
- (interactive)
- (my/avy-brain-jump 'child))
+(defun my/avy-brain-jump-child ()
+ (interactive)
+ (my/avy-brain-jump 'child))
- (defun my/avy-brain-jump-parent ()
- (interactive)
- (my/avy-brain-jump 'parent))
+(defun my/avy-brain-jump-parent ()
+ (interactive)
+ (my/avy-brain-jump 'parent))
- (defun my/avy-brain-jump-friend ()
- (interactive)
- (my/avy-brain-jump 'friend))
+(defun my/avy-brain-jump-friend ()
+ (interactive)
+ (my/avy-brain-jump 'friend))
- (defun my/avy-brain-jump-sibling ()
- (interactive)
- (my/avy-brain-jump 'sibling))
+(defun my/avy-brain-jump-sibling ()
+ (interactive)
+ (my/avy-brain-jump 'sibling))
#+end_src
#+RESULTS:
: my/avy-brain-jump-sibling
** TODO org-roam stuff
+:PROPERTIES:
+:CUSTOM_ID: h:A1C2078B-385F-4B49-B7FF-F11584B3D48C
+:END:
I have decided to use org-roam for my knowledge base and even try to
connect it with my existing org-brain database. They are after all only
@@ -2628,46 +3722,56 @@ database.
*** Basic setup - org-roam
:PROPERTIES:
:ID: 61E64346-EE07-4268-88F0-FDBFAA02C43A
+:CUSTOM_ID: h:56A47EF2-A94C-45E7-BF41-1EA3E1456E04
:END:
#+BEGIN_SRC emacs-lisp
- (use-package org-roam
- :straight t
- :after org
- :hook
- (after-init . org-roam-mode)
- :custom
- ;; (org-roam-directory "~/my_org/roam")
- (org-roam-directory "~/my_org/roam")
- ;; This does not seem to work or is meant for existing databases
- ;; (org-roam-db-location "~/Databases/org-roam/")
- :bind (:map org-roam-mode-map
- (("C-c n l" . org-roam)
- ("C-c n f" . org-roam-find-file)
- ("C-c n g" . org-roam-graph-show))
- :map org-mode-map
- (("C-c n i" . org-roam-insert))
- (("C-c n I" . org-roam-insert-immediate)))
- :config
- (setq org-roam-completion-system 'helm))
+(use-package org-roam
+ :straight t
+ :defer 8
+ :after org
+ :hook
+ (after-init . org-roam-mode)
+ :custom
+ ;; (org-roam-directory "~/my_org/roam")
+ (org-roam-directory "~/my_org/roam")
+ ;; This does not seem to work or is meant for existing databases
+ ;; (org-roam-db-location "~/Databases/org-roam/")
+ :bind (:map org-roam-mode-map
+ (("C-c n l" . org-roam)
+ ("C-c n f" . org-roam-find-file)
+ ("C-c n g" . org-roam-graph-show))
+ :map org-mode-map
+ (("C-c n i" . org-roam-insert))
+ (("C-c n I" . org-roam-insert-immediate)))
+ :config
+ (setq org-roam-completion-system 'helm))
#+END_SRC
+*** TODO [#A] Roam capture templates
+
+Journal capture : this should capture into today's journal a quick
+note. Each capture should have a time stamp.
+
*** company-org-roam
:PROPERTIES:
:ID: AF5D949C-F3AD-4F24-9415-D47EA0C46E2B
+:CUSTOM_ID: h:B222F088-CA9D-414D-8F04-DC803FF5CC61
:END:
#+BEGIN_SRC emacs-lisp
(use-package company-org-roam
:straight (:host github :repo "org-roam/company-org-roam")
+ :defer 10
:config
(push 'company-org-roam company-backends))
#+END_SRC
-*** TODO COMMENT org-roam-bibtex
+*** TODO org-roam-bibtex
:PROPERTIES:
:ID: 2D759E87-0EC4-4DA5-82F4-1F573E99C62A
+:CUSTOM_ID: h:4B038A8F-B3FB-4A08-A40E-1AD2034D8122
:END:
[[https://github.com/org-roam/org-roam-bibtex][org-roam/org-roam-bibtex: Connector between Org-roam, BibTeX-completion, and Org-ref]]
@@ -2690,20 +3794,32 @@ database.
#+END_SRC
*** TODO COMMENT org-roam-protocol extension installation
+:PROPERTIES:
+:CUSTOM_ID: h:F17C77E5-C030-4C72-8F86-9E71328E022D
+:END:
Org-roam's protocol extensions has to be enabled on different platforms
for this to work. I am currently on a Mac.
**** DONE Install platypus
CLOSED: [2020-07-14 Tue 17:49]
+:PROPERTIES:
+:CUSTOM_ID: h:0298DE29-5973-4CC4-836E-F7530B9F5BCB
+:END:
#+BEGIN_SRC sh :results verbatim :async yes
brew cask install platypus
#+END_SRC
**** TODO Create the platypus app
+:PROPERTIES:
+:CUSTOM_ID: h:2BD321CA-4CEE-4C16-A9D0-4978ECEE756E
+:END:
*** TODO COMMENT org-roam-server
+:PROPERTIES:
+:CUSTOM_ID: h:CD78D578-BC25-4E2F-B2CA-2BE63D666FA4
+:END:
#+BEGIN_SRC emacs-lisp
(use-package org-roam-server
@@ -2723,6 +3839,7 @@ brew cask install platypus
*** Ignore notes tagged private from hugo export
:PROPERTIES:
:ID: B1A5C433-7A6A-4005-944B-FF25DF132FDC
+:CUSTOM_ID: h:464D260F-7F91-47F0-8865-2E9A598F4CA4
:END:
#+BEGIN_SRC emacs-lisp
@@ -2745,6 +3862,7 @@ brew cask install platypus
*** Ignore backlinks tagged private from hugo export
:PROPERTIES:
:ID: 5663101F-5171-4828-A177-8AE4F42198DE
+:CUSTOM_ID: h:6C6CF909-C217-47DB-9E6F-5DEB6AE0F623
:END:
#+BEGIN_SRC emacs-lisp
@@ -2755,11 +3873,11 @@ brew cask install platypus
(file-relative-name (car it) org-roam-directory)
(org-roam--get-title-or-slug (car it))))
"" (org-roam-db-query [:select [links:from]
- :from links
- :left :outer :join tags :on (= links:from tags:file)
- :where (and (= to $s1)
- (or (is tags:tags nil)
- (not-like tags:tags '%private%)))]
+ :from links
+ :left :outer :join tags :on (= links:from tags:file)
+ :where (and (= to $s1)
+ (or (is tags:tags nil)
+ (not-like tags:tags '%private%)))]
file))
""))
@@ -2776,6 +3894,7 @@ brew cask install platypus
** define-word
:PROPERTIES:
:ID: 50B2C2AA-D7C4-40FA-8600-138EA575C00F
+:CUSTOM_ID: h:677B0505-E100-44D4-83C5-483EEE1518ED
:END:
#+BEGIN_SRC emacs-lisp
@@ -2784,6 +3903,7 @@ brew cask install platypus
** Wiktionary lookup
:PROPERTIES:
:ID: 0A2D3E61-647E-4665-8CB5-58EEE9DA8028
+:CUSTOM_ID: h:80656735-313C-4A8A-A58A-6AE1247B60A9
:END:
From [[https://www.reddit.com/r/emacs/comments/3yjzmu/dictionary_and_thesaurus_in_emacs/][Dictionary and thesaurus in Emacs : emacs]], this does not seem to
work.
@@ -2796,6 +3916,7 @@ work.
** merriam-webster
:PROPERTIES:
:ID: 59F9E4B2-F865-4DE5-9BF6-DCC9F8A4216C
+:CUSTOM_ID: h:1EBE6200-FBEF-44AE-AC0D-384DC62FDA21
:END:
The advantage of this is that synonyms and other definitions are shown,
and they are apparently within Emacs. Note that it is possible and may
@@ -2806,58 +3927,64 @@ even be necessary to register an API key with merriam-webster.
#+END_SRC
** COMMENT polybrain
+:PROPERTIES:
+:CUSTOM_ID: h:DA505DCD-83D3-43C3-A46F-F5B9874F079F
+:END:
#+name: polybrain
#+begin_src emacs-lisp :noweb t
- (use-package polybrain
- :defer nil
- :after org-brain
- :straight (polybrain :type git :host github :repo "dustinlacewell/polybrain.el")
- :bind (:map org-brain-visualize-mode-map
- ("m" . org-brain-visualize-mind-map)
- ("<tab>" . backward-button)
- ("S-<tab>" . forward-button)
- ("DEL" . org-brain-visualize-back)
- ("r" . org-brain-open-resource)
- ("v" . org-brain-visualize)
-
- ("i" . org-brain-pin)
- ("T" . org-brain-set-title)
- ("t" . org-brain-set-tags)
- ("d" . org-brain-delete-entry)
- ("R" . org-brain-visualize-add-resource)
- ("o" . org-brain-goto-current)
- ("O" . org-brain-goto)
-
- ("c" . org-brain-add-child)
- ("C" . org-brain-remove-child)
-
- ("p" . org-brain-add-parent)
- ("P" . org-brain-remove-parent)
-
- ("f" . org-brain-add-friendship)
- ("F" . org-brain-remove-friendship)
-
- ("e" . org-brain-annotate-edge)
-
-
- ("M-p" . my/avy-brain-jump-parent)
- ("M-c" . my/avy-brain-jump-child)
- ("M-s" . my/avy-brain-jump-sibling)
- ("M-f" . my/avy-brain-jump-friend)
- ("M-h" . my/avy-brain-jump-history)
-
- :map poly-brain-mode-map
- ("C-x C-s" . polybrain-save)
- ("<M-SPC>" . polybrain-switch))
- :config
- (require 'polybrain))
+(use-package polybrain
+ :defer nil
+ :after org-brain
+ :straight (polybrain :type git :host github :repo "dustinlacewell/polybrain.el")
+ :bind (:map org-brain-visualize-mode-map
+ ("m" . org-brain-visualize-mind-map)
+ ("<tab>" . backward-button)
+ ("S-<tab>" . forward-button)
+ ("DEL" . org-brain-visualize-back)
+ ("r" . org-brain-open-resource)
+ ("v" . org-brain-visualize)
+
+ ("i" . org-brain-pin)
+ ("T" . org-brain-set-title)
+ ("t" . org-brain-set-tags)
+ ("d" . org-brain-delete-entry)
+ ("R" . org-brain-visualize-add-resource)
+ ("o" . org-brain-goto-current)
+ ("O" . org-brain-goto)
+
+ ("c" . org-brain-add-child)
+ ("C" . org-brain-remove-child)
+
+ ("p" . org-brain-add-parent)
+ ("P" . org-brain-remove-parent)
+
+ ("f" . org-brain-add-friendship)
+ ("F" . org-brain-remove-friendship)
+
+ ("e" . org-brain-annotate-edge)
+
+
+ ("M-p" . my/avy-brain-jump-parent)
+ ("M-c" . my/avy-brain-jump-child)
+ ("M-s" . my/avy-brain-jump-sibling)
+ ("M-f" . my/avy-brain-jump-friend)
+ ("M-h" . my/avy-brain-jump-history)
+
+ :map poly-brain-mode-map
+ ("C-x C-s" . polybrain-save)
+ ("<M-SPC>" . polybrain-switch))
+ :config
+ (require 'polybrain))
#+end_src
#+RESULTS: polybrain
: polybrain-switch
** COMMENT deflayer
+:PROPERTIES:
+:CUSTOM_ID: h:D436A72A-6F6F-4E50-89C0-AA7CA0D3D297
+:END:
This will help with different settings for different brains. Eventually, it can
also be used for different settings for say the org agenda or other
@@ -2865,19 +3992,19 @@ components.
#+BEGIN_SRC emacs-lisp
- (use-package deflayer
- :straight (deflayer :type git :host github :repo "dustinlacewell/deflayer.el")
- :config
- ;; for some reason map seems to be required first.
- (require 'map)
- (require 'deflayer))
+(use-package deflayer
+ :straight (deflayer :type git :host github :repo "dustinlacewell/deflayer.el")
+ :config
+ ;; for some reason map seems to be required first.
+ (require 'map)
+ (require 'deflayer))
- (deflayer sr-brain org-brain
- ((org-brain-path (sr/fun/org-dir "brain"))))
+(deflayer sr-brain org-brain
+ ((org-brain-path (sr/fun/roam-public-dir ""))))
- (deflayer episteme org-brain
- ((org-brain-path (sr/fun/project-dir "episteme/brain/"))))
+(deflayer episteme org-brain
+ ((org-brain-path (sr/fun/project-dir "episteme/brain/"))))
#+END_SRC
@@ -2888,6 +4015,7 @@ components.
CLOSED: [2020-01-19 Sun 14:33]
:PROPERTIES:
:ID: B1A6F6F9-0713-456A-826E-DCE6E83E2AFF
+:CUSTOM_ID: h:6012C7C6-2649-4148-9FFC-A6E13257C1E4
:END:
- [X] Figure out the auth file settings from before
@@ -2927,21 +4055,23 @@ org-store-link function. I find this very useful.
** org-web-tools
:PROPERTIES:
:ID: CE6402C3-BDF9-4B59-A01A-DC7EF461CC5A
+:CUSTOM_ID: h:2B6422A1-0824-49E9-B61C-85F2825FD65F
:END:
This package contains a bunch of useful tools which can cut down a lot of work
#+BEGIN_SRC emacs-lisp
(use-package org-web-tools
-:defer 5
-:bind (("H-y" . org-web-tools-insert-link-for-url)
- ("H-a" . org-web-tools-insert-web-page-as-entry)))
+ :defer 5
+ :bind (("H-y" . org-web-tools-insert-link-for-url)
+ ("H-a" . org-web-tools-insert-web-page-as-entry)))
#+END_SRC
** org-download
:PROPERTIES:
:ID: A61C506A-FE8A-4051-ACCC-A2F28E8FE4EB
+:CUSTOM_ID: h:82EE0953-25E3-4B54-87F0-09DED130616D
:END:
#+BEGIN_SRC emacs-lisp
@@ -2950,7 +4080,7 @@ This package contains a bunch of useful tools which can cut down a lot of work
:ensure t
;;:after org
:config
- ;; Drag-and-drop to `dired`
+ ;; Drag-and-drop to `dired`
(add-hook 'dired-mode-hook 'org-download-enable)
;; For some reason this still seems required, despite using defer nil
(require 'org-download)
@@ -2960,6 +4090,7 @@ This package contains a bunch of useful tools which can cut down a lot of work
CLOSED: [2020-01-19 Sun 14:33]
:PROPERTIES:
:ID: 782AB8FA-34A6-4E69-8A71-E49A0C95088F
+:CUSTOM_ID: h:FFF632AE-2237-4355-80A9-E091E5B34861
:END:
- Note taken on [2020-01-21 Tue 19:23] \\
converted to the use package method looking at the documentation.
@@ -2973,36 +4104,36 @@ CLOSED: [2020-01-19 Sun 14:33]
;; (oddmuse-curl :type git :host github :repo "kensanata/oddmuse-curl")
;; (add-to-list 'load-path "~/scimax-personal/external_packages/oddmuse-curl/")
- (use-package oddmuse-curl
- :defer t
- :straight (:type git :host github :repo "kensanata/oddmuse-curl")
- :ensure t
- :config
-;; user name
-(setq oddmuse-username "shrysr")
+(use-package oddmuse-curl
+ :defer t
+ :straight (:type git :host github :repo "kensanata/oddmuse-curl")
+ :ensure t
+ :config
+ ;; user name
+ (setq oddmuse-username "shrysr")
-;; Wiki names
-(setq oddmuse-wikis
- '(("EmacsWiki" "https://www.emacswiki.org/emacs" utf-8 "abcd" nil)
- ("sr" "https://shrysr.ragavan.co" utf-8 nil nil)
- ("jobs" "https://wikijobs.ragavan.co" utf-8 nil nil)))
+ ;; Wiki names
+ (setq oddmuse-wikis
+ '(("EmacsWiki" "https://www.emacswiki.org/emacs" utf-8 "abcd" nil)
+ ("sr" "https://shrysr.ragavan.co" utf-8 nil nil)
+ ("jobs" "https://wikijobs.ragavan.co" utf-8 nil nil)))
-;; Directory where files will be downloaded from the wiki for editing.
-(setq oddmuse-directory "~/my_org/01_wiki/oddmuse/")
+ ;; Directory where files will be downloaded from the wiki for editing.
+ (setq oddmuse-directory "~/my_org/01_wiki/oddmuse/")
-;; adding an oddmuse-odd for files in the fiki directory
-(add-to-list 'auto-mode-alist '("~/my_org/01_wiki/oddmuse" . oddmuse-mode))
+ ;; adding an oddmuse-odd for files in the fiki directory
+ (add-to-list 'auto-mode-alist '("~/my_org/01_wiki/oddmuse" . oddmuse-mode))
-;; autoload modes
-(autoload 'oddmuse-edit "oddmuse-curl"
- "Edit a page on an Oddmuse wiki." t)
+ ;; autoload modes
+ (autoload 'oddmuse-edit "oddmuse-curl"
+ "Edit a page on an Oddmuse wiki." t)
-;; Not yet sure what this does and how it related to version control.
-(add-to-list 'vc-handled-backends 'oddmuse)
-(defun vc-oddmuse-registered (file)
- "Handle files in `oddmuse-directory'."
- (string-match (concat "^" (expand-file-name oddmuse-directory))
- (file-name-directory file))))
+ ;; Not yet sure what this does and how it related to version control.
+ (add-to-list 'vc-handled-backends 'oddmuse)
+ (defun vc-oddmuse-registered (file)
+ "Handle files in `oddmuse-directory'."
+ (string-match (concat "^" (expand-file-name oddmuse-directory))
+ (file-name-directory file))))
;; Since I work primarily with org before the wiki - I would rather not have the mode initialised.
;; (oddmuse-mode-initialize)
@@ -3017,27 +4148,61 @@ CLOSED: [2020-01-19 Sun 14:33]
** ox-oddmuse
:PROPERTIES:
:ID: A44CDA20-4B94-4A88-A337-16BB5DF2D759
+:CUSTOM_ID: h:8E0B2A67-3C9A-4DC8-9CFA-8F2D9889F017
:END:
I'm building an oddmuse wiki to use for my blogging and as a repository for my braindump. A wiki driven blog is much more useful in inviting collaboration, and any technical note or article is always worth updating. There are many more advantages in using Oddmuse.
#+BEGIN_SRC emacs-lisp
(use-package ox-oddmuse
:defer t
- :straight (:type git :host github :repo "mbork/ox-oddmuse")
- :init (require 'ox-oddmuse))
+ :straight (:type git :host github :repo "mbork/ox-oddmuse")
+ :init (require 'ox-oddmuse))
#+END_SRC
** COMMENT Epubs in emacs
+:PROPERTIES:
+:CUSTOM_ID: h:8E1C0494-D1D5-4750-95F6-115C860F4B61
+:END:
#+BEGIN_SRC emacs-lisp
(use-package nov
-:straight t
-:config
-(add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode)))
+ :straight t
+ :config
+ (add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode)))
+#+END_SRC
+** info mode for info files
+:PROPERTIES:
+:CUSTOM_ID: h:43FE4AB7-D5DB-473A-93FD-CDC91F5C1147
+:END:
+
+There may be occasions when an info file is avaialble from an external
+source. These can be efficiently browsed in Emacs. As noted in [[https://stackoverflow.com/questions/1921049/how-to-open-info-file-in-emacs-in-info-mode][how to
+open *.info file in emacs in info mode? - Stack Overflow]], the following
+should work:
+
+#+BEGIN_SRC emacs-lisp
+;; Note that the following did not work. Merely setting the Info-mode seems insufficent.
+;; (setq auto-mode-alist
+;; (append '(("\\.info" . Info-mode)) auto-mode-alist))
+
+
+(add-to-list 'auto-mode-alist '("\\.info\\'" . Info-on-current-buffer))
+
+
#+END_SRC
+
+An example of the above was that the mu4e manual would not show up among
+the list of manuals available with Emacs. Perhaps the load path to .el
+files is not sufficient to include the docs which are located in other
+folders that are parents of the source code itself. With the way it is
+defined on the load path it would seem the info files are not read
+in. As a workaround for this, I have added a bookmark to the mu4e
+manual.
+
* Dired
:PROPERTIES:
:ID: 62B42FB8-61E2-4EFB-A51A-D6BA13E31EB2
+:CUSTOM_ID: h:C7DBBCE0-FC3A-453A-AB35-E0651E83D3E2
:END:
- Note taken on [2020-03-28 Sat 15:10] \\
@@ -3047,55 +4212,58 @@ These are settings dervied from the configuration of [[https://github.com/angryb
Note that =C-x C-q= for =dired-toggle-read= only.
+#+name: base/dired-customisation
#+BEGIN_SRC emacs-lisp
(use-package dired-subtree
-:straight t
-:config
-(bind-keys :map dired-mode-map
- ("i" . dired-subtree-insert)
+ :straight t
+ :config
+ (bind-keys :map dired-mode-map
+ ("i" . dired-subtree-insert)
(";" . dired-subtree-toggle)))
;; Show directories first
- (defun me/dired-directories-first ()
- "Sort dired listings with directories first before adding marks."
- (save-excursion
- (let (buffer-read-only)
- (forward-line 2)
- (sort-regexp-fields t "^.*$" "[ ]*." (point) (point-max)))
- (set-buffer-modified-p nil)))
+(defun me/dired-directories-first ()
+ "Sort dired listings with directories first before adding marks."
+ (save-excursion
+ (let (buffer-read-only)
+ (forward-line 2)
+ (sort-regexp-fields t "^.*$" "[ ]*." (point) (point-max)))
+ (set-buffer-modified-p nil)))
(advice-add 'dired-readin :after #'me/dired-directories-first)
(add-hook 'dired-mode-hook (lambda () (dired-hide-details-mode)
- (setq visual-fill-column-mode 'nil)))
+ (setq visual-fill-column-mode 'nil)))
(setq dired-auto-revert-buffer t
- dired-dwim-target t
- dired-hide-details-hide-symlink-targets nil
- dired-listing-switches "-alh"
- dired-ls-F-marks-symlinks nil
- dired-recursive-copies 'always)
+ dired-dwim-target t
+ dired-hide-details-hide-symlink-targets nil
+ dired-listing-switches "-alh"
+ dired-ls-F-marks-symlinks nil
+ dired-recursive-copies 'always)
#+END_SRC
#+RESULTS:
: always
* Treemacs [0/3]
- :PROPERTIES:
- :ID: 2571745f-97de-4fa9-8d56-0e6599bdc489
- :CREATED: [2020-01-21 Tue]
- :PLANNED:
- :END:
+:PROPERTIES:
+:ID: 2571745f-97de-4fa9-8d56-0e6599bdc489
+:CREATED: [2020-01-21 Tue]
+:PLANNED:
+:CUSTOM_ID: h:06253410-2D9D-4CD1-892D-220694E4FDAC
+:END:
- [ ] Learn about treemacs projectile
- [ ] Learn about treemacs-magit
As such most of these
+#+name: base/treemacs
#+BEGIN_SRC emacs-lisp
(use-package treemacs
:ensure t
-
+ :straight t
:init
(with-eval-after-load 'winum
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
@@ -3118,7 +4286,7 @@ As such most of these
ttreemacs-no-png-images nil
treemacs-no-delete-other-windows t
treemacs-project-follow-cleanup nil
- treemacs-persist-file "~/my_org/roam/private/emacs_meta/.treemacs-persist"
+ treemacs-persist-file "~/my_org/emacs_meta/.treemacs-persist"
treemacs-recenter-distance 0.1
treemacs-recenter-after-file-follow nil
treemacs-recenter-after-tag-follow nil
@@ -3187,15 +4355,119 @@ As such most of these
#+RESULTS:
* Selection, search, navigation and jumps
+:PROPERTIES:
+:CUSTOM_ID: h:494FB604-30E1-4C3B-A2D3-C063825FC4E2
+:END:
** smex
:PROPERTIES:
:ID: 09F22945-25AA-4DAE-B1E0-AD309E6FA1DD
+:CUSTOM_ID: h:9F1EC481-263B-414B-891F-207016324B09
:END:
#+BEGIN_SRC emacs-lisp
(straight-use-package 'smex)
#+END_SRC
+#+RESULTS:
+: t
+
+** pulse.el
+:PROPERTIES:
+:ID: 1C87981A-0EA8-4EBA-A8DC-9E2581ECDBD6
+:CUSTOM_ID: h:788A7A84-36C4-4D3A-8517-919BA20775A5
+:END:
+
+This snippet is picked from [[https://protesilaos.com/dotemacs/][GNU Emacs integrated computing environment | Protesilaos Stavrou]].
+
+#+BEGIN_SRC emacs-lisp
+(use-package pulse
+ :config
+ ;; TODO make pulse work with empty lines
+ (defun prot/pulse-line (&optional face)
+ "Temporarily highlight the current line."
+ (interactive)
+ (let ((pulse-delay .06)
+ (face
+ (if face
+ face
+ 'modus-theme-intense-red)))
+ (pulse-momentary-highlight-one-line (point) face)))
+ :bind ("<s-escape>" . prot/pulse-line))
+
+#+END_SRC
+** autorevert
+:PROPERTIES:
+:ID: FAF3A94F-3ABC-424C-9535-21D56EC65267
+:CUSTOM_ID: h:2561F134-9545-4C22-B415-B266B4EB16B3
+:END:
+
+I find it convenient to have auto-revert mode enabled globally. There
+are many instances when this is useful. For example, exporting and
+viewing pdf files generated from Latex.
+
+This snippet is picked from [[https://protesilaos.com/dotemacs/][GNU Emacs integrated computing environment | Protesilaos Stavrou]].
+
+#+BEGIN_SRC emacs-lisp
+(use-package autorevert
+ :diminish
+ :config
+ (setq auto-revert-verbose t)
+ :hook (after-init-hook . global-auto-revert-mode))
+#+END_SRC
+** TODO Autodim the other buffer
+:PROPERTIES:
+:ID: A9FA1E95-2DBB-46BE-A5E4-BB792C88CD37
+:CUSTOM_ID: h:46DEF420-7EDD-4BD3-854D-6A15135C1756
+:END:
+
+#+BEGIN_SRC emacs-lisp
+(use-package auto-dim-other-buffers
+ :straight t
+ :commands auto-dim-other-buffers-mode
+ :config
+ (setq auto-dim-other-buffers-dim-on-switch-to-minibuffer nil)
+ (setq auto-dim-other-buffers-dim-on-focus-out t))
+#+END_SRC
+
+** Scrolling behavior
+:PROPERTIES:
+:ID: 98EC331D-07E8-43DA-84A0-50C1560B99DD
+:CUSTOM_ID: h:A13A41BB-42BE-446B-9164-40F5B7C98143
+:END:
+
+Reference: https://protesilaos.com/dotemacs/#h:0c44b318-813a-4f4a-b596-75df4a86476b
+
+#+BEGIN_SRC emacs-lisp
+(use-package emacs
+ :config
+ (setq-default scroll-preserve-screen-position t)
+ (setq-default scroll-conservatively 1) ; affects `scroll-step'
+ (setq-default scroll-margin 0)
+
+ (define-minor-mode prot/scroll-centre-cursor-mode
+ "Toggle centred cursor scrolling behaviour."
+ :init-value nil
+ :lighter " S="
+ :global nil
+ (if prot/scroll-centre-cursor-mode
+ (setq-local scroll-margin (* (frame-height) 2)
+ scroll-conservatively 0
+ maximum-scroll-margin 0.5)
+ (dolist (local '(scroll-preserve-screen-position
+ scroll-conservatively
+ maximum-scroll-margin
+ scroll-margin))
+ (kill-local-variable `,local))))
+
+ ;; C-c l is used for `org-store-link'. The mnemonic for this is to
+ ;; focus the Line and also works as a variant of C-l.
+ :bind ("C-c L" . prot/scroll-centre-cursor-mode))
+#+END_SRC
+
** TODO Dumb jump
+:PROPERTIES:
+:ID: C4CD3914-22B7-4736-879D-C49FBB7FAC5C
+:CUSTOM_ID: h:092B9A74-8F0B-4B0F-B0FB-651975D2ABEA
+:END:
I have long heard about dumb-jump. My main goal is to be able to mark a
location and be able to jump back to that location easily. This should
@@ -3217,10 +4489,14 @@ addition of the straight flag.
("M-g z" . dumb-jump-go-prefer-external-other-window))
:config ;; (setq dumb-jump-selector 'ivy)
(setq dumb-jump-selector 'helm))
-
+
#+END_SRC
** Create directory while opening files if it doesnt exist
+:PROPERTIES:
+:ID: 370C6E3A-A2BC-4EE9-845A-07235C42FC6E
+:CUSTOM_ID: h:B5FF0C29-01E7-4890-942C-81840B51F66E
+:END:
References:
- [[https://superuser.com/questions/131538/can-i-create-directories-that-dont-exist-while-creating-a-new-file-in-emacs][Can I create directories that don't exist while creating a new file in emacs? - Super User]]
- [[https://stackoverflow.com/questions/24977014/emacs-dired-copy-move-files-create-directory-if-needed][elisp - Emacs -- dired copy / move files -- create directory if needed - Stack Overflow]]
@@ -3243,12 +4519,13 @@ buffers. This is also in line with the opinions in the #Emacs channel.
** Abbrev definitions
:PROPERTIES:
:ID: 6124D83B-6158-4D8F-AA80-407447CDE19E
+:CUSTOM_ID: h:A044EF6C-6F16-4E78-93A1-BACA51801D6B
:END:
There are a number of terms and words that I use regularly in all my
writing, for example, Org mode, Emacs, DevonThink, and so on. These
words should be auto corrected to the correct intention considering the
-frequency of their use.
+frequency of their use.
These definitions should be synced across machines.
@@ -3268,7 +4545,7 @@ References:
#+BEGIN_SRC emacs-lisp
;; Setting abbrev file location specifically
-(setq abbrev-file-name "~/my_org/roam/private/emacs_meta/emacs-abbrev.el")
+(setq abbrev-file-name "~/my_org/emacs_meta/emacs-abbrev.el")
(read-abbrev-file abbrev-file-name t)
;; save abbrevs silently on exit
@@ -3279,9 +4556,9 @@ References:
#+END_SRC
Defining my abbrevs with a z in front to differentiate from day to day
-typing.
+typing.
-#+BEGIN_SRC emacs-lisp :tangle ~/my_org/roam/private/emacs_meta/emacs-abbrev.el
+#+BEGIN_SRC emacs-lisp :tangle ~/my_org/emacs_meta/emacs-abbrev.el
;;-*-coding: utf-8;-*-
(define-abbrev-table 'global-abbrev-table
'(
@@ -3310,7 +4587,12 @@ typing.
** Counsel
:PROPERTIES:
:ID: 4F05CB2A-C98A-433E-AF50-D120F4376192
+:CUSTOM_ID: h:9A05CEEE-F111-40F3-A31A-6C1407871BC5
:END:
+- Note taken on [2020-08-07 Fri 17:00] \\
+ In another reboot of my Emacs configuration, I am beginning with Counsel
+ and ivy for a completion framework and work on building custom functions
+ to add on, similar to Helm.
- Note taken on [2020-03-30 Mon 18:08] \\
Apparently, swiper, counsel, ivy are contained in the same repository
and not as separate packages. Though I would prefer using counsel for
@@ -3332,87 +4614,88 @@ This configuration is picked up from scimax.
- [X] helm-appropos
#+BEGIN_SRC emacs-lisp
- (use-package counsel
- :straight t
- :init
- (require 'ivy)
- (require 'smex)
- ;; switching to using helm for projectile completion
- ;;(setq projectile-completion-system 'ivy)
- (setq ivy-use-virtual-buffers t)
- (define-prefix-command 'counsel-prefix-map)
- (global-set-key (kbd "H-c") 'counsel-prefix-map)
-
- ;; default pattern ignores order.
- (setf (cdr (assoc t ivy-re-builders-alist))
- 'ivy--regex-ignore-order)
- :bind
- (;; ("M-x" . counsel-M-x)
- ;; ("C-x b" . ivy-switch-buffer)
- ;; ("C-x C-f" . counsel-find-file)
- ("C-x l" . counsel-locate)
- ;; ("C-h f" . counsel-describe-function)
- ("C-h v" . counsel-describe-variable)
- ("C-h i" . counsel-info-lookup-symbol)
- ("H-c r" . ivy-resume)
- ("H-c l" . counsel-load-library)
- ("H-c f" . counsel-git)
- ("H-c g" . counsel-git-grep)
- ("H-c a" . counsel-ag)
- ("H-c p" . counsel-pt))
- :diminish ""
- :config
- (progn
- (counsel-mode)
- (define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history)
- (define-key ivy-minibuffer-map (kbd "M-<SPC>") 'ivy-dispatching-done)
-
- ;; C-RET call and go to next
- (define-key ivy-minibuffer-map (kbd "C-<return>")
- (lambda ()
- "Apply action and move to next/previous candidate."
- (interactive)
- (ivy-call)
- (ivy-next-line)))
-
- ;; M-RET calls action on all candidates to end.
- (define-key ivy-minibuffer-map (kbd "M-<return>")
- (lambda ()
- "Apply default action to all candidates."
- (interactive)
- (ivy-beginning-of-buffer)
- (loop for i from 0 to (- ivy--length 1)
- do
- (ivy-call)
- (ivy-next-line)
- (ivy--exhibit))
- (exit-minibuffer)))
-
- ;; s-RET to quit
- (define-key ivy-minibuffer-map (kbd "s-<return>")
- (lambda ()
- "Exit with no action."
- (interactive)
- (ivy-exit-with-action
- (lambda (x) nil))))
-
- ;; Show keys
- (define-key ivy-minibuffer-map (kbd "?")
- (lambda ()
- (interactive)
- (describe-keymap ivy-minibuffer-map)))
-
- (define-key ivy-minibuffer-map (kbd "<left>") 'ivy-backward-delete-char)
- (define-key ivy-minibuffer-map (kbd "<right>") 'ivy-alt-done)
- (define-key ivy-minibuffer-map (kbd "C-d") 'ivy-backward-delete-char)))
+(use-package counsel
+ :straight t
+ :init
+ (require 'ivy)
+ (require 'smex)
+ ;; switching to using helm for projectile completion
+ ;;(setq projectile-completion-system 'ivy)
+ (setq ivy-use-virtual-buffers t)
+ (define-prefix-command 'counsel-prefix-map)
+ (global-set-key (kbd "H-c") 'counsel-prefix-map)
+
+ ;; default pattern ignores order.
+ (setf (cdr (assoc t ivy-re-builders-alist))
+ 'ivy--regex-ignore-order)
+ :bind
+ (("M-x" . counsel-M-x)
+ ("C-x b" . ivy-switch-buffer)
+ ("C-x C-f" . counsel-find-file)
+ ("C-x l" . counsel-locate)
+ ("C-h f" . counsel-describe-function)
+ ("C-h v" . counsel-describe-variable)
+ ("C-h i" . counsel-info-lookup-symbol)
+ ("H-c r" . ivy-resume)
+ ("H-c l" . counsel-load-library)
+ ("H-c f" . counsel-git)
+ ("H-c g" . counsel-git-grep)
+ ("H-c a" . counsel-ag)
+ ("H-c p" . counsel-pt))
+ :diminish ""
+ :config
+ (progn
+ (counsel-mode)
+ (define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history)
+ (define-key ivy-minibuffer-map (kbd "M-<SPC>") 'ivy-dispatching-done)
+
+ ;; C-RET call and go to next
+ (define-key ivy-minibuffer-map (kbd "C-<return>")
+ (lambda ()
+ "Apply action and move to next/previous candidate."
+ (interactive)
+ (ivy-call)
+ (ivy-next-line)))
+
+ ;; M-RET calls action on all candidates to end.
+ (define-key ivy-minibuffer-map (kbd "M-<return>")
+ (lambda ()
+ "Apply default action to all candidates."
+ (interactive)
+ (ivy-beginning-of-buffer)
+ (loop for i from 0 to (- ivy--length 1)
+ do
+ (ivy-call)
+ (ivy-next-line)
+ (ivy--exhibit))
+ (exit-minibuffer)))
+
+ ;; s-RET to quit
+ (define-key ivy-minibuffer-map (kbd "s-<return>")
+ (lambda ()
+ "Exit with no action."
+ (interactive)
+ (ivy-exit-with-action
+ (lambda (x) nil))))
+
+ ;; Show keys
+ (define-key ivy-minibuffer-map (kbd "?")
+ (lambda ()
+ (interactive)
+ (describe-keymap ivy-minibuffer-map)))
+
+ (define-key ivy-minibuffer-map (kbd "<left>") 'ivy-backward-delete-char)
+ (define-key ivy-minibuffer-map (kbd "<right>") 'ivy-alt-done)
+ (define-key ivy-minibuffer-map (kbd "C-d") 'ivy-backward-delete-char)))
#+END_SRC
#+RESULTS:
: counsel-pt
-
+rip
** ripgrep
:PROPERTIES:
:ID: D94B88CA-5B4F-4AB2-AE45-9AB8C7B2255B
+:CUSTOM_ID: h:B4DEA3D6-5B6F-4C08-A667-191FFB0D88A6
:END:
The ripgrep package for the system can be installed via brew or possibly
@@ -3429,12 +4712,14 @@ preferred.
#+BEGIN_SRC emacs-lisp
(straight-use-package 'ripgrep)
+(message "")
#+END_SRC
** Expand region package
- :PROPERTIES:
- :ID: 046c8e8c-a6c0-451e-9e7e-61de54ab0945
- :END:
+:PROPERTIES:
+:ID: 046c8e8c-a6c0-451e-9e7e-61de54ab0945
+:CUSTOM_ID: h:75B17DDD-9A6B-4D31-B1F0-A530B788E35C
+:END:
- Note taken on [2019-02-07 Thu 09:27] \\
Explore how this works, and customise it.
@@ -3443,9 +4728,11 @@ This can be set to intelligently expand the selection of text. For example, Usin
#+begin_src emacs-lisp
(use-package expand-region
:ensure t
- :bind ("C-=" . er/expand-region))
+ :bind ("C-=" . er/expand-region)
+ :config
+ (message "Loaded expand region"))
+
-(message "Loaded easier selection")
#+end_src
#+RESULTS:
@@ -3453,15 +4740,16 @@ This can be set to intelligently expand the selection of text. For example, Usin
** Hippie Expand
:PROPERTIES:
:ID: C2CE1B2C-9935-4D7B-BEA2-96AC344360DE
+:CUSTOM_ID: h:C2CF95F2-6E7A-4BD8-BCB5-B205CFEB4142
:END:
This is a nifty little package that makes expansion of selection at point more customised, and is handy for expanding into variable names and function names in the same buffer, especially for a long snippet of code.
#+BEGIN_SRC emacs-lisp
(global-set-key (kbd "M-/") (make-hippie-expand-function
- '(try-expand-dabbrev-visible
- try-expand-dabbrev
- try-expand-dabbrev-all-buffers) t))
+ '(try-expand-dabbrev-visible
+ try-expand-dabbrev
+ try-expand-dabbrev-all-buffers) t))
#+END_SRC
#+RESULTS:
@@ -3504,15 +4792,16 @@ This is a nifty little package that makes expansion of selection at point more c
** Browse kill ring
:PROPERTIES:
:ID: 91183327-CDC5-482B-8A21-303467ED1AE3
+:CUSTOM_ID: h:6B951C57-5CAB-4D86-A798-F47E46874079
:END:
- Note taken on [2020-03-30 Mon 18:20] \\
This command allows an interactive browsing and insertion from the kill ring. However it does not allow a search. For enabling a search of the kill ring in addition to marking and insertion =helm-king-ring= can be used. However the latter method does not offer a preview of the material being yanked.
#+BEGIN_SRC emacs-lisp
(use-package browse-kill-ring
-:bind ("M-y" . browse-kill-ring)
+ :bind ("M-y" . browse-kill-ring)
:ensure t
-)
+ )
#+END_SRC
#+RESULTS:
@@ -3520,6 +4809,7 @@ This is a nifty little package that makes expansion of selection at point more c
** Multiple Cursors
:PROPERTIES:
:ID: 06039005-b802-43bd-92f5-05439cebc759
+:CUSTOM_ID: h:085A74C5-10C3-4C04-A378-F9DF8CDABA4D
:END:
#+begin_src emacs-lisp
@@ -3541,6 +4831,7 @@ This is a nifty little package that makes expansion of selection at point more c
** Undo tree
:PROPERTIES:
:ID: 1E24E30A-6578-4AA4-8655-4E6EED49ECE5
+:CUSTOM_ID: h:3B67974A-E960-4AF0-92A9-2833871719DC
:END:
Reference: https://github.com/alhassy/emacs.d
This is an indispensable tool. The additional options of showing the timestamp and diff would be.
@@ -3550,22 +4841,26 @@ This is an indispensable tool. The additional options of showing the timestamp a
(use-package undo-tree
:diminish undo-tree-mode ;; Don't show an icon in the modeline
:config
- ;; Always have it on
- (global-undo-tree-mode)
+ ;; Always have it on
+ (global-undo-tree-mode)
- ;; Each node in the undo tree should have a timestamp.
- (setq undo-tree-visualizer-timestamps t)
+ ;; Each node in the undo tree should have a timestamp.
+ (setq undo-tree-visualizer-timestamps t)
- ;; Show a diff window displaying changes between undo nodes.
-;; Execute (undo-tree-visualize) then navigate along the tree to witness
-;; changes being made to your file live!
-)
+ ;; Show a diff window displaying changes between undo nodes.
+ ;; Execute (undo-tree-visualize) then navigate along the tree to witness
+ ;; changes being made to your file live!
+ )
#+END_SRC
#+RESULTS:
: t
** TODO Setting undo limits
+:PROPERTIES:
+:ID: 87E28C55-31EE-4F34-97E4-F5041311C0B4
+:CUSTOM_ID: h:F03EA4B6-3EA0-448A-9DE4-E0DB34D242D1
+:END:
[[https://stackoverflow.com/questions/40793325/emacs-diagnosis-org-mode-unbearably-slow-and-often-stalls/50437758][performance - Emacs diagnosis: Org-mode unbearably slow and often
stalls - Stack Overflow]] talks abou the undo limit being rather large on
@@ -3580,16 +4875,17 @@ based on the performance.
** yasnippet and ivy-yasnippet
:PROPERTIES:
:ID: 2BEDC957-9D0A-4BEC-AE97-CCD186A98724
+:CUSTOM_ID: h:171CB38E-BB58-43D7-A826-BB069D7074D2
:END:
- [ ] setup the shortcut 'H-,' as desinged in scimax default for ivy-yasnippet
#+BEGIN_SRC emacs-lisp
- (use-package yasnippet
- :straight t
- :config
- (setq yas-snippet-dirs (append yas-snippet-dirs
- '("~/.emacs.d/private-snippets/")))
+(use-package yasnippet
+ :straight t
+ :config
+ (setq yas-snippet-dirs (append yas-snippet-dirs
+ '("~/.emacs.d/private-snippets/")))
(yas-global-mode 1))
(use-package ivy-yasnippet
@@ -3602,6 +4898,7 @@ based on the performance.
** swiper
:PROPERTIES:
:ID: 2DEA32C7-F18C-4DC0-B924-450C45F351A6
+:CUSTOM_ID: h:7D294A92-53C5-4551-A66F-53B4F34419B1
:END:
- Note taken on [2020-03-30 Mon 18:05] \\
I had this to counsel-swiper-or-grep. However at times, the grep result would show as a binary file even though the file was clearly not binary. I have switched to using only swiper without counsel.
@@ -3609,7 +4906,7 @@ based on the performance.
#+BEGIN_SRC emacs-lisp
(use-package swiper
:bind
- ("C-s" . swiper)
+ ;; ("C-s" . swiper)
("H-s" . swiper-all)
:diminish ivy-mode
:config
@@ -3622,6 +4919,7 @@ based on the performance.
** avy
:PROPERTIES:
:ID: F9CBA6DB-15F3-45E9-94AB-5E92C3F62AB3
+:CUSTOM_ID: h:F35075EB-70FF-4D19-80FC-FBE6EC84B16B
:END:
#+BEGIN_SRC emacs-lisp
@@ -3630,6 +4928,7 @@ based on the performance.
** Super and Hyper key setting
:PROPERTIES:
:ID: 97DFBDF2-BD73-4DAA-9CA0-2A1D39855CF6
+:CUSTOM_ID: h:A19A2344-C690-4E17-879E-AC45150787E0
:END:
#+BEGIN_SRC emacs-lisp
@@ -3638,13 +4937,24 @@ based on the performance.
(setq mac-left-command-modifier 'super)
(setq mac-right-option-modifier 'hyper)))
#+END_SRC
+
+#+RESULTS:
+: hyper
+
** Helm packages and functions
+:PROPERTIES:
+:ID: 3A97B5D6-CD45-443C-A95B-201E9FC8C6BF
+:CUSTOM_ID: h:0073250A-6C4D-4B94-AC7F-0C4DF081D2B6
+:END:
I am of the opinion that both helm and counsel/ivy have their advantages
for different workflows and mindsets. My configuration will attempt to
use both based on what I find useful.
*** Helm notes
+:PROPERTIES:
+:CUSTOM_ID: h:543D8E91-2577-4202-9CFE-B17839CAD00D
+:END:
Despite using these command frequently, I find that I forget some of
them. This is an attempt to note down useful commands for ready
@@ -3652,7 +4962,7 @@ reference.
=C-u C-c C-k= using helm-find-file will copy the absolute path of the
file to the kill ring. Not using the modifier will copy only the
-filename. =C-c C-i= or =C-c TAB= for copying the path to the current
+filename. =C-c C-i= or =C-c uTAB= for copying the path to the current
buffer.
While browsing directories, use =C-j= to go into a directory and =C-l= to
@@ -3667,28 +4977,42 @@ Find file as root =C-c r= does not require the Tramp syntax!
*** Setting helm for some basic functions
:PROPERTIES:
:ID: BC827A7A-D190-4CC6-95D5-0C80740CB94C
+:CUSTOM_ID: h:4BDABC0C-BE5C-4D34-8E4D-35A51380DA1C
:END:
+#+name: base/helm-setup
#+BEGIN_SRC emacs-lisp
(use-package helm
-:config
-(helm-mode 1)
-(require 'helm-config)
+ :straight t
+ :bind (("M-x" . helm-M-x)
+ ("C-h f" . helm-apropos)
+ ;; ("C-x C-f" . helm-find-file)
+ ;; As per the updated readme, this command is replac
+ ("C-x C-f" . helm-find-files)
+ ("C-x b" . helm-mini)
+ ("C-c y" . helm-show-kill-ring)
+ ("C-x C-r" . helm-recentf))
+ :config
+ (helm-mode t)
+ (require 'helm)
+ (require 'helm-config))
-(global-set-key (kbd "M-x") 'helm-M-x)
-(global-set-key (kbd "C-h f") 'helm-apropos)
-(global-set-key (kbd "C-x C-f") 'helm-find-files)
-(global-set-key (kbd "C-x b") 'helm-mini)
-(global-set-key (kbd "C-c y") 'helm-show-kill-ring)
-(global-set-key (kbd "C-x C-r") 'helm-recentf))
+;; (global-set-key (kbd "M-x") 'helm-M-x)
+;; (global-set-key (kbd "C-h f") 'helm-apropos)
+;; (global-set-key (kbd "C-x C-f") 'helm-find-files)
+;; (global-set-key (kbd "C-x b") 'helm-mini)
+;; (global-set-key (kbd "C-c y") 'helm-show-kill-ring)
+;; (global-set-key (kbd "C-x C-r") 'helm-recentf))
#+END_SRC
-: helm-find-file
+#+RESULTS:
+: helm-recentf
*** General settings for helm
:PROPERTIES:
:ID: 89A1C70C-8C63-43CD-8197-D108E4CA87BD
+:CUSTOM_ID: h:8C669F3A-29F7-4528-8B02-1C925566E8A8
:END:
There are some useful tips in the reddit thread [[https://www.reddit.com/r/emacs/comments/bsc8pc/why_did_you_stop_using_helm/][Why did you stop using
@@ -3696,12 +5020,13 @@ Helm? : emacs]]. The [[https://tuhdo.github.io/helm-intro.html][helm-intro]] is
the best guide as always. Another good resource is the [[https://github.com/clemera/helm-ido-like-guide][Guide to get an
intuitive and more ido-like helm interface in Emacs.]]
+#+name: base/additional-helm-settings
#+BEGIN_SRC emacs-lisp
;; Don't have helm do window management for me
(setq helm-display-function 'pop-to-buffer)
;; optimising highlight speed of token matches
-(setq helm-mp-highlight-delay 0.3)
+(setq helm-mp-highlight-delay 0.4)
;; from the reddit thread above
(setq helm-use-undecorated-frame-option t)
@@ -3709,8 +5034,8 @@ intuitive and more ido-like helm interface in Emacs.]]
;; These are required to prevent crazy jumps in the helm buffer size
(setq helm-autoresize-max-height 0)
-(setq helm-autoresize-min-height 30)
-(helm-autoresize-mode 1)
+(setq helm-autoresize-min-height 10)
+(setq helm-autoresize-mode 1)
(setq helm-split-window-in-side-p t ; open helm buffer inside current window, not occupy whole other window
helm-move-to-line-cycle-in-source nil; move to end or beginning of source when reaching top or bottom of source.
@@ -3719,9 +5044,13 @@ intuitive and more ido-like helm interface in Emacs.]]
#+END_SRC
+#+RESULTS:
+: t
+
*** Helm bibtex and projectile
:PROPERTIES:
:ID: 16FCC72B-7940-4B4D-A139-88B8E039511C
+:CUSTOM_ID: h:7A7E9EA7-9043-4C7F-935F-B2D2A279D7D7
:END:
#+BEGIN_SRC emacs-lisp
(straight-use-package 'helm-bibtex)
@@ -3732,6 +5061,7 @@ intuitive and more ido-like helm interface in Emacs.]]
*** helm-ag
:PROPERTIES:
:ID: B4E26FDE-BA84-4BDB-AA94-B4706E47C64B
+:CUSTOM_ID: h:7C32ACE9-79FA-424D-8754-EF85C70C1771
:END:
- [ ] [[https://emacs.stackexchange.com/questions/30204/how-to-tell-helm-to-ignore-certain-files][How to tell Helm to ignore certain files? - Emacs Stack Exchange]]
@@ -3749,9 +5079,9 @@ making sure the ignored pattern is on helm-boring-file-regexp-list. From
its documentation:
- > Non--nil to skip files matching regexps in
- helm-boring-file-regexp-list. This take effect in helm-find-files and
- file completion used by helm-mode i.e helm-read-file-name.
+> Non--nil to skip files matching regexps in
+helm-boring-file-regexp-list. This take effect in helm-find-files and
+file completion used by helm-mode i.e helm-read-file-name.
And the documentation for helm-boring-file-regexp-list says that by
default it is built from completion-ignored-extensions.
@@ -3762,7 +5092,7 @@ Another option is to use [[https://github.com/emacsorphanage/helm-ag#helm-ag-use
nil by default. This kind of ignore option needs to be used carefully,
or it will exclude important results.
-
+#+name: base/helm-ag
#+BEGIN_SRC emacs-lisp
(straight-use-package 'helm-ag)
(setq helm-ag-use-agignore 1)
@@ -3771,50 +5101,83 @@ or it will exclude important results.
*** helm-rg
:PROPERTIES:
:ID: 223F6137-6B43-4FBB-A501-D62F29F439FD
+:CUSTOM_ID: h:04A61D98-B5DB-46E3-BFC8-8255817648FC
:END:
+Update helm-rg config based on setting up [[https://notes.alexkehayias.com/20200528213830-org_roam/][Alex's notes on org-roam]] which
+has a snippet for using helm-rg to extract links from org mode files.
+
#+BEGIN_SRC emacs-lisp
-(straight-use-package 'helm-rg)
+(use-package helm-rg
+ :straight t
+ :config
+ ;; Add actions for inserting org file link from selected match
+ (defun insert-org-mode-link-from-helm-result (candidate)
+ (interactive)
+ (with-helm-current-buffer
+ (insert (format "[[file:%s][%s]]"
+ (plist-get candidate :file)
+ ;; Extract the title from the file name
+ (subst-char-in-string
+ ?_ ?\s
+ (first
+ (split-string
+ (first
+ (last
+ (split-string (plist-get candidate :file) "\\-")))
+ "\\.")))))))
+
+ (helm-add-action-to-source "Insert org-mode link"
+ 'insert-org-mode-link-from-helm-result
+ helm-rg-process-source))
#+END_SRC
*** helm-org-rifle
:PROPERTIES:
:ID: 510AB91F-1520-487B-9CE3-FF4C69AC09FA
+:CUSTOM_ID: h:613B23FC-39F4-42A0-85EE-3F536B5709AF
:END:
This includes functions for org-brain
#+BEGIN_SRC emacs-lisp
- (use-package helm-org-rifle
- :straight t
- :config
- (global-set-key (kbd "C-c C-w") #'helm-org-rifle--refile)
+(use-package helm-org-rifle
+ :straight t
+ :config
+ (global-set-key (kbd "C-c C-w") #'helm-org-rifle--refile)
- (defun helm-org-rifle-brain ()
- "Rifle files in `org-brain-path'."
- (interactive)
- (let ((helm-org-rifle-close-unopened-file-buffers nil))
- (helm-org-rifle-directories (list org-brain-path))))
+ (defun helm-org-rifle-brain ()
+ "Rifle files in `org-brain-path'."
+ (interactive)
+ (let ((helm-org-rifle-close-unopened-file-buffers nil))
+ (helm-org-rifle-directories (list org-brain-path))))
- (defun helm-org-rifle-open-in-brain (candidate)
- (-let (((buffer . pos) candidate))
- (with-current-buffer buffer
- (goto-char pos)
- (org-brain-visualize-entry-at-pt))))
+ (defun helm-org-rifle-open-in-brain (candidate)
+ (-let (((buffer . pos) candidate))
+ (with-current-buffer buffer
+ (goto-char pos)
+ (org-brain-visualize-entry-at-pt))))
- (add-to-list 'helm-org-rifle-actions
- (cons "Show entry in org-brain" 'helm-org-rifle-open-in-brain)
- t))
+ (add-to-list 'helm-org-rifle-actions
+ (cons "Show entry in org-brain" 'helm-org-rifle-open-in-brain)
+ t))
#+END_SRC
*** Helm swoop
:PROPERTIES:
:ID: 6539A414-F78C-4926-86D3-12C076D567FF
+:CUSTOM_ID: h:2348BCF2-A228-403E-B39D-5064BD751E8C
:END:
+- Note taken on [2020-07-31 Fri 16:52] \\
+ Since additional context actions can be setup via helm, and it can focus
+ on code blocks or headings alone out of the box - I have replaced Swiper
+ with helm-swoop as a test.
+
+#+name: base/helm-swoop
#+BEGIN_SRC emacs-lisp
(use-package helm-swoop
:ensure t
- :bind (("M-i" . helm-swoop)
- ("M-I" . helm-swoop-back-to-last-point)
+ :bind (("C-s" . helm-swoop)
+ ("C-i" . helm-swoop-back-to-last-point)
("C-c M-i" . helm-multi-swoop))
:config
;; When doing isearch, hand the word over to helm-swoop
@@ -3828,33 +5191,39 @@ This includes functions for org-brain
;; Split direcion. 'split-window-vertically or 'split-window-horizontally
helm-swoop-split-direction 'split-window-vertically
;; If nil, you can slightly boost invoke speed in exchange for text color
- helm-swoop-speed-or-color nil))
+ helm-swoop-speed-or-color t))
#+END_SRC
: helm-multi-swoop
*** helm-dash
:PROPERTIES:
:ID: 5E890FD9-DBD9-47C9-A5DE-56943A783528
+:CUSTOM_ID: h:B9BE3864-C8D9-48B4-8863-4A286C21353F
:END:
#+BEGIN_SRC emacs-lisp
(use-package helm-dash
-:straight t
-:config
- (setq helm-dash-common-docsets '("Redis" "Python 3" "Python 2" "PostgreSQL" "MongoDB")) )
+ :straight t
+ :config
+ (setq helm-dash-common-docsets '("Redis" "python_3" "python_2" "PostgreSQL" "MongoDB" "Emacs Lisp"
+ "Common Lisp" "OpenCV Python" "NumPy" "SciPy" "MySQL")) )
#+END_SRC
*** helm-ls-git
+:PROPERTIES:
+:ID: 6EA03921-727C-4005-95C0-45D7C99BA5AB
+:CUSTOM_ID: h:A97A7DDE-7F61-4166-9155-1E2D8939DBB2
+:END:
#+BEGIN_SRC emacs-lisp
(use-package helm-ls-git
-:straight t)
+ :straight t)
#+END_SRC
-
** TODO Projectile and helm
:PROPERTIES:
:ID: CEEF5675-26B7-4EEF-8F07-62383E9614EE
+:CUSTOM_ID: h:DDE4F766-6934-41E8-82F8-D68B4024D2DC
:END:
Since implementing the Doom GC optimisation, the slight lag I
experienced while typing really fast in helm commands has
@@ -3876,6 +5245,9 @@ tips in setting up projectile with helm.
#+END_SRC
** COMMENT ace-isearch
+:PROPERTIES:
+:CUSTOM_ID: h:169B31F0-FAFB-423C-902C-BBEE9108D90B
+:END:
- Note taken on [2020-04-04 Sat 16:46] \\
While the concept is clear, I am not yet sure how the function is
getting activated or whether it will work as I think it might. I am
@@ -3884,13 +5256,14 @@ tips in setting up projectile with helm.
#+BEGIN_SRC emacs-lisp
(use-package ace-isearch
-:after helm-swoop avy
-:config
-(global-ace-isearch-mode +1))
+ :after helm-swoop avy
+ :config
+ (global-ace-isearch-mode +1))
#+END_SRC
** Copy simple without breaks
:PROPERTIES:
:ID: BC6DEF7C-F884-47AC-9A48-04D748C172B1
+:CUSTOM_ID: h:96274376-EB2A-4DD0-9C96-C7B7B190C7D0
:END:
#+BEGIN_SRC emacs-lisp
@@ -3903,7 +5276,7 @@ tips in setting up projectile with helm.
(list (region-beginning) (region-end))
(list (line-beginning-position) (line-end-position))))
(let ((my-text (buffer-substring-no-properties beg end)))
- (with-temp-buffer
+ (with-temp-buffer
(insert my-text)
(goto-char 1)
(while (looking-at "[ \t\n]")
@@ -3912,13 +5285,17 @@ tips in setting up projectile with helm.
(fill-region (point-min) (point-max)))
(kill-region (point-min) (point-max)))))
#+END_SRC
-** TODO Perspective and persp-projectile
+** TODO perspective-el
+:PROPERTIES:
+:ID: EA9E9BF1-A0B7-49B8-84E4-C73B8C47849C
+:CUSTOM_ID: h:AADDE6DE-3826-4708-AD7E-BD174998A186
+:END:
- [X] Start with [[https://github.com/nex3/perspective-el][perspective minor mode]]
- [X] [[https://github.com/howardabrams/dot-files/blob/master/emacs.org#perspective][Refer Howard's config snippet]] to setup a test.
- [X] Figure out how this can be leveraged.
- [X] A hydra is required to use perspective in a rapid and streamlined
- manner.
+ manner.
Essentially with persp-projectile, I get a clean buffer list to choose from when I look for files, in a new perspective. This would be especially convenient when working with multiple projects having similar filenames.
@@ -3928,20 +5305,17 @@ Note that all the commands are prefixed with the =C-x x= prefix.
- [ ] Create a hydra to add to Scimax's existing list, with options.
+#+name: perspective-el
#+BEGIN_SRC emacs-lisp
(use-package perspective
- :ensure t
-
:bind ("C-x x x" . persp-switch-last)
:init (persp-mode +1)
-
- (use-package persp-projectile
- :ensure t
- :bind ("C-x x P" . projectile-persp-switch-project))
-
:config
(setq persp-interactive-completion-function #'ido-completing-read)
- (setq persp-state-default-file "~/my_org/emacs_meta/sr-standard.persp"))
+ (setq persp-state-default-file (sr/fun/emacs-meta-dir "sr-standard.persp"))
+ ;; Experiment with showing th perspetive only in the header and not cluttering up the modeline
+ (setq persp-show-modestring 'header)
+ (setq persp-show-modestring t))
#+END_SRC
@@ -3955,177 +5329,301 @@ I am now able to switch perspectives when I switch projects. I presume that with
In addition, I combine the above with Treemacs, which gives me access to the tags and functions in various files.
+** persp-projectile
+:PROPERTIES:
+:ID: E07CE184-9553-47CF-B2A1-09FE3F01BAF2
+:CUSTOM_ID: h:40FA2C61-FECD-49F5-AB69-D6D618AD4413
+:END:
+
+- [ ] Sort the issue of not being able to select a file when a new
+ project and perspective is created.
+ #+BEGIN_SRC emacs-lisp
+(use-package persp-projectile
+ :ensure t
+ :bind ("C-x x P" . projectile-persp-switch-project))
-* Email
-** TODO mu4e via use-package
+ #+END_SRC
+
+** COMMENT persp-mode
:PROPERTIES:
-:ID: 658B1502-41E1-487A-B0CF-5F1D1A366368
+:CUSTOM_ID: h:DBCF552F-8D3A-44A5-8EF3-64C83C077272
:END:
-- [ ] Transfer all the settings for mu4e into a use-package layout with hooks.
+THis package is a fork of the perspective-el package and enabls
+perspective to work across Emacs frames which is useful at times. It
+also seems to have more customization options. Note that these
+packages cannot be used simultaneously.
#+BEGIN_SRC emacs-lisp
-(use-package mu4e
-:straight t
-:ensure nil
-:hook
- ((mu4e-compose-mode . (lambda ()
- (visual-line-mode)
- (use-hard-newlines -1)
- (flyspell-mode)
- (turn-off-auto-fill)))
- (mu4e-view-mode . (lambda() ;; try to emulate some of the eww key-bindings
- (local-set-key (kbd "<tab>") 'shr-next-link)
- (local-set-key (kbd "<backtab>") 'shr-previous-link)
- (fill-paragraph)
- (visual-line-mode)))
- (mu4e-headers-mode . (lambda ()
- (interactive)
- (setq mu4e-headers-fields
- `((:human-date . 25) ;; alternatively, use :date
- (:flags . 6)
- (:from . 22)
- (:thread-subject . ,(- (window-body-width) 70)) ;; alternatively, use :subject
- (:size . 7))))))
+(use-package persp-mode
+ :straight t
:config
- (require 'mu4e)
- (require 'mu4e-contrib)
- (require 'org-mu4e)
+ (persp-mode))
+#+END_SRC
- (setq
- mail-user-agent 'mu4e-user-agent
- mue4e-headers-skip-duplicates 't
- mu4e-view-show-images 't
- mu4e-view-show-addresses 't
- mu4e-split-view 'vertical
- mu4e-headers-visible-columns 100
- mu4e-compose-format-flowed t
- ;;mu4e-update-interval 200
- message-ignored-cited-headers 'nil
- mu4e-date-format "%y/%m/%d"
- mu4e-headers-date-format "%Y/%m/%d"
- mu4e-change-filenames-when-moving t
- mu4e-attachments-dir "~/Downloads/Mail-Attachments/"
- mu4e-maildir (expand-file-name "~/my_mail/fmail")
- message-citation-line-format "On %Y-%m-%d at %R %Z, %f wrote..."
- mu4e-index-lazy-check t
- ;; After Years. I've finally found you.
- mu4e-compose-dont-reply-to-self t
- mu4e-headers-auto-update t
- message-kill-buffer-on-exit t
- mu4e-update-interval 500
- )
+** ace-link
+:PROPERTIES:
+:CUSTOM_ID: h:EB253550-D8D0-4D04-A420-073C09C2B014
+:END:
- ;; mu4e email refiling loations
- (setq
- mu4e-refile-folder "/Archive"
- mu4e-trash-folder "/Trash"
- mu4e-sent-folder "/Sent"
- mu4e-drafts-folder "/Drafts")
+- [X] 'o' was bound to open in external browser from eww. This is
+ changed to 'O' since ace-link's default setup uses 'o'.
+
+#+BEGIN_SRC emacs-lisp
+(use-package ace-link
+ :straight t
+ :config
+ (ace-link-setup-default))
+#+END_SRC
- ;; setup some handy shortcuts
- (setq mu4e-maildir-shortcuts
- '(("/INBOX" . ?i)
- ("/Sent" . ?s)
- ("/Archive" . ?a)
- ("/Trash" . ?t)))
+* Email
+:PROPERTIES:
+:CUSTOM_ID: h:161F1359-EC19-497B-963A-0706E5DD39E1
+:END:
+*** TODO mu4e via use-package
+:PROPERTIES:
+:ID: 17E1FE52-6E1A-4763-A9AC-8E42BB410859
+:CUSTOM_ID: h:B5987F9F-D52E-4048-92FA-BF696FA75E21
+:END:
- ;;store link to message if in header view, not to header query
- (setq org-mu4e-link-query-in-headers-mode nil
- org-mu4e-convert-to-html t) ;; org -> html
+I have mu installed via brew in my Mac OS.
+- [ ] Transfer all the settings for mu4e into a use-package layout with hooks.
+- [ ] What is the correct load path to include the documentation as well
+ as the site-lisp folder which contains the path to the mu4e
+ executable.
- (autoload 'mu4e "mu4e" "mu for Emacs." t)
+#+BEGIN_SRC emacs-lisp
+ (use-package mu4e
+ :straight t
+ :ensure nil
+ :init (setq mu4e-mu-binary "/usr/local/bin/mu")
+ :load-path ("/usr/local/Cellar/mu/1.4.12/share/emacs/site-lisp/mu/mu4e")
+ :hook
+ ((mu4e-compose-mode . (lambda ()
+ (visual-line-mode)
+ (use-hard-newlines -1)
+ (flyspell-mode)
+ (turn-off-auto-fill)))
+ (mu4e-view-mode . (lambda() ;; try to emulate some of the eww key-bindings
+ (local-set-key (kbd "<tab>") 'shr-next-link)
+ (local-set-key (kbd "<backtab>") 'shr-previous-link)
+ (fill-paragraph)
+ (visual-line-mode)))
+ (mu4e-headers-mode . (lambda ()
+ (interactive)
+ (setq mu4e-headers-fields
+ `((:human-date . 25) ;; alternatively, use :date
+ (:flags . 6)
+ (:from . 22)
+ (:thread-subject . ,(- (window-body-width) 70)) ;; alternatively, use :subject
+ (:size . 7))))))
+ :config
+ ;; (require 'mu4e)
+ (require 'mu4e-contrib)
+ (require 'org-mu4e)
+
+ (setq
+ mail-user-agent 'mu4e-user-agent
+ mu4e-headers-skip-duplicates 't
+ mu4e-view-show-images 't
+ mu4e-view-show-addresses 't
+ mu4e-split-view 'vertical
+ mu4e-headers-visible-columns 130
+ mu4e-compose-format-flowed t
+ message-ignored-cited-headers 'nil
+ mu4e-date-format "%y/%m/%d"
+ mu4e-headers-date-format "%Y/%m/%d"
+ mu4e-change-filenames-when-moving t
+ mu4e-attachments-dir "~/Downloads/Mail-Attachments/"
+ mu4e-maildir (expand-file-name "~/my_mail/fmail")
+ message-citation-line-format "On %Y-%m-%d at %R %Z, %f wrote..."
+ mu4e-index-lazy-check t
+ ;; After Years. I've finally found you.
+ mu4e-compose-dont-reply-to-self 't
+ mu4e-headers-auto-update 't
+ message-kill-buffer-on-exit 't
+ mu4e-update-interval 500
+ )
- ;; Earlier Config for sending email
- ;; (setq
- ;; message-send-mail-function 'message-send-mail-with-sendmail
- ;; send-mail-function 'sendmail-send-it
- ;; message-kill-buffer-on-exit t
- ;; )
+ ;; mu4e email refiling loations
+ (setq
+ mu4e-refile-folder "/Archive"
+ mu4e-trash-folder "/Trash"
+ mu4e-sent-folder "/Sent"
+ mu4e-drafts-folder "/Drafts")
- ;; allow for updating mail using 'U' in the main view:
- (setq mu4e-get-mail-command "mbsync -q fins")
+ ;; setup some handy shortcuts
+ (setq mu4e-maildir-shortcuts
+ '(("/INBOX" . ?i)
+ ("/Sent" . ?s)
+ ("/Archive" . ?a)
+ ("/Trash" . ?t)))
- ;; Stolen from https://github.com/djcb/mu/issues/1431 and found thanks to parsnip in #emacs
- (defun my-mu4e-mbsync-current-maildir (msg)
- (interactive)
- (let* ((maildir (downcase (substring (plist-get msg :maildir) 1)))
- (mu4e-get-mail-command (format "mbsync %s" maildir)))
- (mu4e-update-mail-and-index t)))
+ ;;store link to message if in header view, not to header query
+ (setq org-mu4e-link-query-in-headers-mode nil
+ org-mu4e-convert-to-html t) ;; org -> html
- ;; Enabling view in browser for HTML heavy emails that don't render well
- (add-to-list 'mu4e-view-actions
- '("ViewInBrowser" . mu4e-action-view-in-browser) t)
- (add-to-list 'mu4e-view-actions
- '("mbsync maildir of mail at point" . my-mu4e-mbsync-current-maildir) t)
- (setq mu4e-view-use-gnus t)
+ (autoload 'mu4e "mu4e" "mu for Emacs." t)
- ;; Don't keep asking for confirmation for every action
- (defun my-mu4e-mark-execute-all-no-confirm ()
- "Execute all marks without confirmation."
- (interactive)
- (mu4e-mark-execute-all 'no-confirm))
- ;; mapping x to above function
- (define-key mu4e-headers-mode-map "x" #'my-mu4e-mark-execute-all-no-confirm)
+ ;; Earlier Config for sending email
+ ;; (setq
+ ;; message-send-mail-function 'message-send-mail-with-sendmail
+ ;; send-mail-function 'sendmail-send-it
+ ;; message-kill-buffer-on-exit t
+ ;; )
- ;; source: http://matt.hackinghistory.ca/2016/11/18/sending-html-mail-with-mu4e/
+ ;; allow for updating mail using 'U' in the main view:
+ (setq mu4e-get-mail-command "mbsync -q fins")
- ;; this is stolen from John but it didn't work for me until I
- ;; made those changes to mu4e-compose.el
- (defun htmlize-and-send ()
- "When in an org-mu4e-compose-org-mode message, htmlize and send it."
- (interactive)
- (when
- (member 'org~mu4e-mime-switch-headers-or-body post-command-hook)
- (org-mime-htmlize)
- (org-mu4e-compose-org-mode)
- (mu4e-compose-mode)
- (message-send-and-exit)))
+ ;; Stolen from https://github.com/djcb/mu/issues/1431 and found thanks to parsnip in #emacs
+ (defun my-mu4e-mbsync-current-maildir (msg)
+ (interactive)
+ (let* ((maildir (downcase (substring (plist-get msg :maildir) 1)))
+ (mu4e-get-mail-command (format "mbsync %s" maildir)))
+ (mu4e-update-mail-and-index t)))
- ;; This overloads the amazing C-c C-c commands in org-mode with one more function
- ;; namely the htmlize-and-send, above.
- (add-hook 'org-ctrl-c-ctrl-c-hook 'htmlize-and-send t)
+ ;; Enabling view in browser for HTML heavy emails that don't render well
+ (add-to-list 'mu4e-view-actions
+ '("ViewInBrowser" . mu4e-action-view-in-browser) t)
+ (add-to-list 'mu4e-view-actions
+ '("mbsync maildir of mail at point" . my-mu4e-mbsync-current-maildir) t)
+ (setq mu4e-view-use-gnus t)
- ;; Config for queued sending of emails
- ;; Reference :https://vxlabs.com/2017/02/07/mu4e-0-9-18-e-mailing-with-emacs-now-even-better/https://vxlabs.com/2017/02/07/mu4e-0-9-18-e-mailing-with-emacs-now-even-better/
+ ;; Don't keep asking for confirmation for every action
+ (defun my-mu4e-mark-execute-all-no-confirm ()
+ "Execute all marks without confirmation."
+ (interactive)
+ (mu4e-mark-execute-all 'no-confirm))
+ ;; mapping x to above function
+ (define-key mu4e-headers-mode-map "x" #'my-mu4e-mark-execute-all-no-confirm)
- ;; when switch off queue mode, I still prefer async sending
- (use-package async
- :ensure t
- :defer nil
- :config (require 'smtpmail-async))
+ ;; source: http://matt.hackinghistory.ca/2016/11/18/sending-html-mail-with-mu4e/
- (setq
- send-mail-function 'async-smtpmail-send-it
- message-send-mail-function 'async-smtpmail-send-it
- ;; replace with your email provider's settings
- smtpmail-smtp-server "smtp.fastmail.com"
- smtpmail-smtp-service 465
- smtpmail-stream-type 'ssl
- ;; if you need offline mode, set to true -- and create the queue dir
- ;; with 'mu mkdir', i.e:
- ;; mu mkdir /home/user/Mail/queue && touch ~/Maildir/queue/.noindex
- ;; https://www.djcbsoftware.nl/code/mu/mu4e/Queuing-mail.html
- smtpmail-queue-mail nil
- smtpmail-queue-dir (expand-file-name "~/my_mail/fmail/Queue/cur")))
+ ;; this is stolen from John but it didn't work for me until I
+ ;; made those changes to mu4e-compose.el
+ (defun htmlize-and-send ()
+ "When in an org-mu4e-compose-org-mode message, htmlize and send it."
+ (interactive)
+ (when
+ (member 'org~mu4e-mime-switch-headers-or-body post-command-hook)
+ (org-mime-htmlize)
+ (org-mu4e-compose-org-mode)
+ (mu4e-compose-mode)
+ (message-send-and-exit)))
+
+ ;; This overloads the amazing C-c C-c commands in org-mode with one more function
+ ;; namely the htmlize-and-send, above.
+ (add-hook 'org-ctrl-c-ctrl-c-hook 'htmlize-and-send t)
+
+
+ ;; Config for queued sending of emails
+ ;; Reference :https://vxlabs.com/2017/02/07/mu4e-0-9-18-e-mailing-with-emacs-now-even-better/https://vxlabs.com/2017/02/07/mu4e-0-9-18-e-mailing-with-emacs-now-even-better/
+
+ ;; when switch off queue mode, I still prefer async sending
+ (use-package async
+ :ensure t
+ :defer nil
+ :config (require 'smtpmail-async))
+
+ (setq
+ send-mail-function 'async-smtpmail-send-it
+ message-send-mail-function 'async-smtpmail-send-it
+ ;; replace with your email provider's settings
+ smtpmail-smtp-server "smtp.fastmail.com"
+ smtpmail-smtp-service 465
+ smtpmail-stream-type 'ssl
+ ;; if you need offline mode, set to true -- and create the queue dir
+ ;; with 'mu mkdir', i.e:
+ ;; mu mkdir /home/user/Mail/queue && touch ~/Maildir/queue/.noindex
+ ;; https://www.djcbsoftware.nl/code/mu/mu4e/Queuing-mail.html
+ smtpmail-queue-mail nil
+ smtpmail-queue-dir (expand-file-name "~/my_mail/fmail/Queue/cur"))
+
+ ;; Adding Hooks
+ ;; Reference: https://www.djcbsoftware.nl/code/mu/mu4e/Compose-hooks.html
+
+ ;; Adds a BCC header
+ (add-hook 'mu4e-compose-mode-hook
+ (defun my-add-bcc ()
+ "Add a Bcc: header."
+ (save-excursion (message-add-header "Bcc:\n"))))
+
+ (message "Loaded basic mu4e config"))
+
+
+#+END_SRC
+
+#+RESULTS:
+| (lambda nil (interactive) (setq mu4e-headers-fields `((:human-date . 25) (:flags . 6) (:from . 22) (:thread-subject , (- (window-body-width) 70)) (:size . 7)))) | #[0 \301\300!\210\302\211\207 [bookmark-make-record-function make-local-variable mu4e-view-bookmark-make-record] 2] |
+
+** HTML email viewing settings
+:PROPERTIES:
+:ID: 641003FC-C7DD-47F9-BC8E-0D5D429F466A
+:CUSTOM_ID: h:B1AD4D8F-E8C4-4A76-BC8B-FF5C7D89EFB3
+:END:
+
+#+begin_src emacs-lisp
+(use-package shr
+ :straight t
+ :config
+ (setq shr-use-fonts nil)
+ (setq shr-use-colors nil)
+ (setq shr-max-image-proportion 0.7)
+ (setq shr-image-animate nil)
+ (setq shr-width (current-fill-column)))
+#+end_src
+
+Support the HTML =pre= tag with proper syntax highlighting. Got this
+snippet directly from [[https://github.com/xuchunyang/shr-tag-pre-highlight.el][its GitHub project page]].
+#+begin_src emacs-lisp
+(use-package shr-tag-pre-highlight
+ :straight t
+ :after shr
+ :config
+ (add-to-list 'shr-external-rendering-functions
+ '(pre . shr-tag-pre-highlight))
+ (when (version< emacs-version "26")
+ (with-eval-after-load 'eww
+ (advice-add 'eww-display-html :around
+ 'eww-display-html--override-shr-external-rendering-functions))))
+#+end_src
+** COMMENT helm-mu
+:PROPERTIES:
+:ID: 7D350214-DAC8-4E40-A226-B00028B3F88A
+:CUSTOM_ID: h:D46C6832-6A4F-42EC-AF7E-7CF4CC6D2C68
+:END:
+- Note taken on [2020-07-23 Thu 09:27] \\
+ For some reason this does not seem to work for me. I am not sure what
+ the package is for either.
+
+#+BEGIN_SRC emacs-lisp
+(use-package helm-mu
+ :ensure nil
+ :after mu4e
+ :config (progn
+ (bind-key "S" #'helm-mu mu4e-main-mode-map)))
#+END_SRC
+
** COMMENT mu4e alerts
:PROPERTIES:
:ID: C488CFF8-F77B-4AF6-98ED-9CF5BDC792F2
+:CUSTOM_ID: h:158492D4-909F-4E56-AFC2-DDD7F188FA12
:END:
+- [ ] integrate with sauron
+
#+BEGIN_SRC emacs-lisp
(use-package mu4e-alert
:config
(when (executable-find "notify-send")
(mu4e-alert-set-default-style 'libnotify))
;; This is required for mac-os which does not ship with libnotif
-(when (executable-find "terminal-notifier")
+ (when (executable-find "terminal-notifier")
(mu4e-alert-set-default-style 'notifier))
:hook
((after-init . mu4e-alert-enable-notifications)
@@ -4135,11 +5633,14 @@ In addition, I combine the above with Treemacs, which gives me access to the tag
** TEST org-msg
:PROPERTIES:
:ID: DA714BCF-BB6B-478C-92B2-6D8388961019
+:CUSTOM_ID: h:4B28DCD2-CA37-4DD8-BAEA-A8E8F5F0C138
:END:
-*** Basic setup
+*** COMMENT Earlier config
+**** Basic setup
:PROPERTIES:
:ID: 03261375-9996-490F-BE46-31D3A93E62A4
+:CUSTOM_ID: h:B198F125-A641-4524-9930-40F9BBE732EC
:END:
#+BEGIN_SRC emacs-lisp
@@ -4150,10 +5651,10 @@ In addition, I combine the above with Treemacs, which gives me access to the tag
(require 'org-msg)
(setq org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil"
- org-msg-startup "hidestars indent inlineimages"
- org-msg-greeting-fmt "\nHi %s,\n\n"
- org-msg-greeting-name-limit 3
- org-msg-signature "
+ org-msg-startup "hidestars indent inlineimages"
+ org-msg-greeting-fmt "\nHi %s,\n\n"
+ org-msg-greeting-name-limit 3
+ org-msg-signature "
Regards,
@@ -4164,123 +5665,125 @@ In addition, I combine the above with Treemacs, which gives me access to the tag
W: https://shreyas.ragavan.co \\\\
M: +1 647-671-1851 \\\\
,#+end_signature")
-;; Disabling the activation of org-msg mode. This can be used when
+ ;; Disabling the activation of org-msg mode. This can be used when
;; required.
;; (org-msg-mode)
)
;; Attempt to solve the problem of forwarding emails especailly with attachments.
-;(advice-add '(org-msg-mode) :after #'mu4e-compose-forward))
+ ;(advice-add '(org-msg-mode) :after #'mu4e-compose-forward))
#+END_SRC
#+RESULTS:
: t
-*** Compose CSS
+**** Compose CSS
:PROPERTIES:
:ID: 531433C5-5BE0-4377-BBC0-1D6B8EDCA686
+:CUSTOM_ID: h:78A49609-B909-4C2F-877B-177C6C38F69D
:END:
- Note taken on [2020-03-25 Wed 23:33] \\
For some reason, the basic CSS does not look good. Even though some customisation is done below, it does not appear the font choice is respected. In any case, the size and line height are now acceptable.
#+BEGIN_SRC emacs-lisp
(defconst sr/org-msg-style
(let* ((font-family '(font-family . "\"Calibri\""))
- (font-size '(font-size . "12pt"))
- (font `(,font-family ,font-size))
- (line-height '(line-height . "1.5em"))
- (bold '(font-weight . "bold"))
- (theme-color "#0071c5")
- (color `(color . ,theme-color))
- (table `(,@font (margin-top . "0px")))
- (ftl-number `(,@font ,color ,bold (text-align . "left")))
- (inline-modes '(asl c c++ conf cpp csv diff ditaa emacs-lisp
- fundamental ini json makefile man org plantuml
- python sh xml R))
- (inline-src `((color . ,(face-foreground 'default))
- (background-color . ,(face-background 'default))))
- (code-src
- (mapcar (lambda (mode)
- `(code ,(intern (concat "src src-" (symbol-name mode)))
- ,inline-src))
- inline-modes)))
- `((del nil (,@font (color . "grey") (border-left . "none")
- (text-decoration . "line-through") (margin-bottom . "0px")
- (margin-top . "10px") (line-height . "11pt")))
- (a nil (,color))
- (a reply-header ((color . "black") (text-decoration . "none")))
- (div reply-header ((padding . "3.0pt 0in 0in 0in")
- (border-top . "solid #e1e1e1 1.0pt")
- (margin-bottom . "20px")))
- (span underline ((text-decoration . "underline")))
- (li nil (,@font ,line-height (margin-bottom . "0px")
- (margin-top . "2px")))
- (nil org-ul ((list-style-type . "square")))
- (nil org-ol (,@font ,line-height (margin-bottom . "0px")
- (margin-top . "0px") (margin-left . "30px")
- (padding-top . "0px") (padding-left . "5px")))
- (nil signature (,@font (margin-bottom . "20px")))
- (blockquote nil ((padding-left . "5px") (margin-left . "10px")
- (margin-top . "20px") (margin-bottom . "0")
- (border-left . "3px solid #ccc") (font-style . "italic")
- (background . "#f9f9f9")))
- (code nil (,font-size (font-family . "monospace") (background . "#f9f9f9")))
- ,@code-src
- (nil linenr ((padding-right . "1em")
- (color . "black")
- (background-color . "#aaaaaa")))
- (pre nil ((line-height . "12pt")
- ,@inline-src
- (margin . "0px")
- (font-size . "9pt")
- (font-family . "monospace")))
- (div org-src-container ((margin-top . "10px")))
- (nil figure-number ,ftl-number)
- (nil table-number)
- (caption nil ((text-align . "left")
- (background . ,theme-color)
- (color . "white")
- ,bold))
- (nil t-above ((caption-side . "top")))
- (nil t-bottom ((caption-side . "bottom")))
- (nil listing-number ,ftl-number)
- (nil figure ,ftl-number)
- (nil org-src-name ,ftl-number)
-
- (table nil (,@table ,line-height (border-collapse . "collapse")))
- (th nil ((border . "1px solid white")
- (background-color . ,theme-color)
- (color . "white")
- (padding-left . "10px") (padding-right . "10px")))
- (td nil (,@table (padding-left . "10px") (padding-right . "10px")
- (background-color . "#f9f9f9") (border . "1px solid white")))
- (td org-left ((text-align . "left")))
- (td org-right ((text-align . "right")))
- (td org-center ((text-align . "center")))
-
- (div outline-text-4 ((margin-left . "15px")))
- (div outline-4 ((margin-left . "10px")))
- (h4 nil ((margin-bottom . "0px") (font-size . "11pt")
- ,font-family))
- (h3 nil ((margin-bottom . "0px") (text-decoration . "underline")
- ,color (font-size . "12pt")
- ,font-family))
- (h2 nil ((margin-top . "20px") (margin-bottom . "20px")
- (font-style . "italic") ,color (font-size . "13pt")
- ,font-family))
- (h1 nil ((margin-top . "20px")
- (margin-bottom . "0px") ,color (font-size . "12pt")
- ,font-family))
- (p nil ((text-decoration . "none") (margin-bottom . "0px")
- (margin-top . "10px") (line-height . "11pt") ,font-size
- ,font-family (max-width . "100ch")))
- (div nil (,@font (line-height . "11pt"))))))
+ (font-size '(font-size . "12pt"))
+ (font `(,font-family ,font-size))
+ (line-height '(line-height . "1.5em"))
+ (bold '(font-weight . "bold"))
+ (theme-color "#0071c5")
+ (color `(color . ,theme-color))
+ (table `(,@font (margin-top . "0px")))
+ (ftl-number `(,@font ,color ,bold (text-align . "left")))
+ (inline-modes '(asl c c++ conf cpp csv diff ditaa emacs-lisp
+ fundamental ini json makefile man org plantuml
+ python sh xml R))
+ (inline-src `((color . ,(face-foreground 'default))
+ (background-color . ,(face-background 'default))))
+ (code-src
+ (mapcar (lambda (mode)
+ `(code ,(intern (concat "src src-" (symbol-name mode)))
+ ,inline-src))
+ inline-modes)))
+ `((del nil (,@font (color . "grey") (border-left . "none")
+ (text-decoration . "line-through") (margin-bottom . "0px")
+ (margin-top . "10px") (line-height . "11pt")))
+ (a nil (,color))
+ (a reply-header ((color . "black") (text-decoration . "none")))
+ (div reply-header ((padding . "3.0pt 0in 0in 0in")
+ (border-top . "solid #e1e1e1 1.0pt")
+ (margin-bottom . "20px")))
+ (span underline ((text-decoration . "underline")))
+ (li nil (,@font ,line-height (margin-bottom . "0px")
+ (margin-top . "2px")))
+ (nil org-ul ((list-style-type . "square")))
+ (nil org-ol (,@font ,line-height (margin-bottom . "0px")
+ (margin-top . "0px") (margin-left . "30px")
+ (padding-top . "0px") (padding-left . "5px")))
+ (nil signature (,@font (margin-bottom . "20px")))
+ (blockquote nil ((padding-left . "5px") (margin-left . "10px")
+ (margin-top . "20px") (margin-bottom . "0")
+ (border-left . "3px solid #ccc") (font-style . "italic")
+ (background . "#f9f9f9")))
+ (code nil (,font-size (font-family . "monospace") (background . "#f9f9f9")))
+ ,@code-src
+ (nil linenr ((padding-right . "1em")
+ (color . "black")
+ (background-color . "#aaaaaa")))
+ (pre nil ((line-height . "12pt")
+ ,@inline-src
+ (margin . "0px")
+ (font-size . "9pt")
+ (font-family . "monospace")))
+ (div org-src-container ((margin-top . "10px")))
+ (nil figure-number ,ftl-number)
+ (nil table-number)
+ (caption nil ((text-align . "left")
+ (background . ,theme-color)
+ (color . "white")
+ ,bold))
+ (nil t-above ((caption-side . "top")))
+ (nil t-bottom ((caption-side . "bottom")))
+ (nil listing-number ,ftl-number)
+ (nil figure ,ftl-number)
+ (nil org-src-name ,ftl-number)
+
+ (table nil (,@table ,line-height (border-collapse . "collapse")))
+ (th nil ((border . "1px solid white")
+ (background-color . ,theme-color)
+ (color . "white")
+ (padding-left . "10px") (padding-right . "10px")))
+ (td nil (,@table (padding-left . "10px") (padding-right . "10px")
+ (background-color . "#f9f9f9") (border . "1px solid white")))
+ (td org-left ((text-align . "left")))
+ (td org-right ((text-align . "right")))
+ (td org-center ((text-align . "center")))
+
+ (div outline-text-4 ((margin-left . "15px")))
+ (div outline-4 ((margin-left . "10px")))
+ (h4 nil ((margin-bottom . "0px") (font-size . "11pt")
+ ,font-family))
+ (h3 nil ((margin-bottom . "0px") (text-decoration . "underline")
+ ,color (font-size . "12pt")
+ ,font-family))
+ (h2 nil ((margin-top . "20px") (margin-bottom . "20px")
+ (font-style . "italic") ,color (font-size . "13pt")
+ ,font-family))
+ (h1 nil ((margin-top . "20px")
+ (margin-bottom . "0px") ,color (font-size . "12pt")
+ ,font-family))
+ (p nil ((text-decoration . "none") (margin-bottom . "0px")
+ (margin-top . "10px") (line-height . "11pt") ,font-size
+ ,font-family (max-width . "100ch")))
+ (div nil (,@font (line-height . "11pt"))))))
#+END_SRC
#+RESULTS:
: sr/org-msg-style
-*** Set the css to the above custom function
+**** Set the css to the above custom function
:PROPERTIES:
:ID: BA4A13BA-632B-4AC9-80DB-64E1CE560F14
+:CUSTOM_ID: h:AE124DA4-E704-4905-B669-2C12216691A8
:END:
#+BEGIN_SRC emacs-lisp
@@ -4290,20 +5793,223 @@ In addition, I combine the above with Treemacs, which gives me access to the tag
#+RESULTS:
: sr/org-msg-style
+*** COMMENT tecosaur's config
+
+Per reports from tecosaur, his configuration works reliably with
+org-msg. This is also linked to his html export functions in any case.
+
+- [ ] replace the doom-color symbols in the configuration below with
+ suitable colors. This could be borrowed from the modus-themes.
+
+#+BEGIN_SRC emacs-lisp :noweb yes
+(defvar org-msg-currently-exporting nil
+ "Helper variable to indicate whether org-msg is currently exporting the org buffer to HTML.
+Usefull for affecting some of my HTML export config.")
+
+(use-package org-msg
+ :after mu4e
+ :config
+ (setq org-msg-options "html-postamble:nil H:5 num:nil ^:{} toc:nil author:nil email:nil \\n:t tex:dvipng"
+ org-msg-startup "hidestars indent inlineimages"
+ org-msg-greeting-fmt "\nHi %s,\n\n"
+ org-msg-greeting-name-limit 3
+ org-msg-text-plain-alternative t)
+ (map! :map org-msg-edit-mode-map
+ :n "G" #'org-msg-goto-body)
+ (defadvice! org-msg--now-exporting (&rest _)
+ :before #'org-msg-org-to-xml
+ (setq org-msg-currently-exporting t))
+ (defadvice! org-msg--not-exporting (&rest _)
+ :after #'org-msg-org-to-xml
+ (setq org-msg-currently-exporting nil))
+ <<org-msg-restyle>>
+ (org-msg-mode t))
+#+END_SRC
+
+To make this look a little nicer, we will overwrite the default style.
+
+#+NAME: org-msg-restyle
+#+BEGIN_SRC emacs-lisp :tangle no
+(setq org-msg-enforce-css
+ (let* ((font-family '(font-family . "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell,\
+ \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";"))
+ (monospace-font '(font-family . "SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;"))
+ (font-size '(font-size . "11pt"))
+ (font `(,font-family ,font-size))
+ (line-height '(line-height . "1.2"))
+ (theme-color "#2654BF")
+ (bold '(font-weight . "bold"))
+ (color `(color . ,theme-color))
+ (table `((margin-top . "6px") (margin-bottom . "6px")
+ (border-left . "none") (border-right . "none")
+ (border-top . "2px solid #222222") (border-bottom . "2px solid #222222")
+ ))
+ (ftl-number `(,color ,bold (text-align . "left")))
+ (inline-modes '(asl c c++ conf cpp csv diff ditaa emacs-lisp
+ fundamental ini json makefile man org plantuml
+ python sh xml))
+ (inline-src `((background-color . "rgba(27,31,35,.05)")
+ (border-radius . "3px")
+ (padding . ".2em .4em")
+ (font-size . "90%") ,monospace-font
+ (margin . 0)))
+ (code-src
+ (mapcar (lambda (mode)
+ `(code ,(intern (concat "src src-" (symbol-name mode)))
+ ,inline-src))
+ inline-modes)))
+ `((del nil ((color . "grey") (border-left . "none")
+ (text-decoration . "line-through") (margin-bottom . "0px")
+ (margin-top . "10px") (line-height . "11pt")))
+ (a nil (,color))
+ (a reply-header ((color . "black") (text-decoration . "none")))
+ (div reply-header ((padding . "3.0pt 0in 0in 0in")
+ (border-top . "solid #e1e1e1 1.0pt")
+ (margin-bottom . "20px")))
+ (span underline ((text-decoration . "underline")))
+ (li nil (,line-height (margin-bottom . "0px")
+ (margin-top . "2px")))
+ (nil org-ul ((list-style-type . "square")))
+ (nil org-ol (,@font ,line-height (margin-bottom . "0px")
+ (margin-top . "0px") (margin-left . "30px")
+ (padding-top . "0px") (padding-left . "5px")))
+ (nil signature (,@font (margin-bottom . "20px")))
+ (blockquote nil ((padding . "0px 10px") (margin-left . "10px")
+ (margin-top . "20px") (margin-bottom . "0")
+ (border-left . "3px solid #ccc") (font-style . "italic")
+ (background . "#f9f9f9")))
+ (code nil (,font-size ,monospace-font (background . "#f9f9f9")))
+ ,@code-src
+ (nil linenr ((padding-right . "1em")
+ (color . "black")
+ (background-color . "#aaaaaa")))
+ (pre nil ((line-height . "1.2")
+ ;; the original doom-color symbol is not defined in my
+ ;; configuration. This needs to be changed since I do not use doom
+ ;; (color . ,(doom-color 'fg))
+ ;; (background-color . ,(doom-color 'bg))
+ (margin . "4px 0px 8px 0px")
+ (padding . "8px 12px")
+ (width . "95%")
+ (border-radius . "5px")
+ (font-weight . "500")
+ ,monospace-font))
+ (div org-src-container ((margin-top . "10px")))
+ (nil figure-number ,ftl-number)
+ (nil table-number)
+ (caption nil ((text-align . "left")
+ (background . ,theme-color)
+ (color . "white")
+ ,bold))
+ (nil t-above ((caption-side . "top")))
+ (nil t-bottom ((caption-side . "bottom")))
+ (nil listing-number ,ftl-number)
+ (nil figure ,ftl-number)
+ (nil org-src-name ,ftl-number)
+ (img nil ((vertical-align . "middle")
+ (max-width . "100%")))
+ (img latex-fragment-inline ((transform . ,(format "translateY(-1px) scale(%.3f)"
+ (/ 1.0 (if (boundp 'preview-scale)
+ preview-scale 1.4))))
+ (margin . "0 -0.35em")))
+ (table nil (,@table ,line-height (border-collapse . "collapse")))
+ (th nil ((border . "none") (border-bottom . "1px solid #222222")
+ (background-color . "#EDEDED") (font-weight . "500")
+ (padding . "3px 10px")))
+ (td nil (,@table (padding . "1px 10px")
+ (background-color . "#f9f9f9") (border . "none")))
+ (td org-left ((text-align . "left")))
+ (td org-right ((text-align . "right")))
+ (td org-center ((text-align . "center")))
+ (kbd nil ((border . "1px solid #d1d5da") (border-radius . "3px")
+ (box-shadow . "inset 0 -1px 0 #d1d5da") (background-color . "#fafbfc")
+ (color . "#444d56") (padding . "3px 5px") (display . "inline-block")))
+ (div outline-text-4 ((margin-left . "15px")))
+ (div outline-4 ((margin-left . "10px")))
+ (h4 nil ((margin-bottom . "0px") (font-size . "11pt")))
+ (h3 nil ((margin-bottom . "0px")
+ ,color (font-size . "14pt")))
+ (h2 nil ((margin-top . "20px") (margin-bottom . "20px")
+ ,color (font-size . "18pt")))
+ (h1 nil ((margin-top . "20px")
+ (margin-bottom . "0px") ,color (font-size . "24pt")))
+ (p nil ((text-decoration . "none") (margin-bottom . "0px")
+ (margin-top . "10px") (line-height . "11pt") ,font-size
+ (max-width . "100ch")))
+ (b nil ((font-weight . "500") (color . ,theme-color)))
+ (div nil (,@font (line-height . "12pt"))))))
+
+#+END_SRC
+
** TODO COMMENT mu4e-conversation
+:PROPERTIES:
+:CUSTOM_ID: h:321D00AE-D0CE-4B81-B75A-0CC0E0515B7A
+:END:
#+BEGIN_SRC emacs-lisp
(use-package mu4e-conversation
:after mu4e
:straight t
:config
- (require 'mu4e-conversation))
+ (with-eval-after-load 'mu4e (require 'mu4e-conversation)))
+
#+END_SRC
* Programming customisations
+:PROPERTIES:
+:CUSTOM_ID: h:1DA3A62F-A744-417D-AA0B-23BEBEE73E7B
+:END:
+** prog-mode hooks
+
+These are borrowed from [[https://git.sr.ht/~technomancy/dotfiles][Technomancy's]] config.
+
+#+BEGIN_SRC emacs-lisp
+(add-hook 'prog-mode-hook 'whitespace-mode)
+(add-hook 'prog-mode-hook 'prettify-symbols-mode)
+;; Does this need an additional package installed? Possibly yes.
+;; (add-hook 'prog-mode-hook 'idle-highlight-mode)
+
+;; I think this is a good option and enhances focus on the line and the
+;; code being written.
+(add-hook 'prog-mode-hook 'hl-line-mode)
+#+END_SRC
+** elisp
+
+These are borrowed from [[https://git.sr.ht/~technomancy/dotfiles][Technomancy's]] config. I have started looking in
+more detail at lisp files, functions and documentations. Needless to
+say that there are a bunch of things to learn like actually using
+paredit mode and the various shortcuts to edit sexps.
+
+#+BEGIN_SRC emacs-lisp
+(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
+(add-hook 'emacs-lisp-mode-hook 'paredit-mode)
+
+(define-key emacs-lisp-mode-map (kbd "C-c v") 'eval-buffer)
+
+(define-key read-expression-map (kbd "TAB") 'lisp-complete-symbol)
+
+(define-key emacs-lisp-mode-map (kbd "C-c e")
+ (defun eval-and-replace ()
+ "Replace the preceding sexp with its value."
+ (interactive)
+ (backward-kill-sexp)
+ (condition-case nil
+ (prin1 (eval (read (current-kill 0)))
+ (current-buffer))
+ (error (message "Invalid expression")
+ (insert (current-kill 0))))))
+
+;; Lets enable lispy and learn to use it.
+(use-package lispy
+ :config
+ (add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1)))
+
+#+END_SRC
+
** Markdown-mode
:PROPERTIES:
:ID: EDDB1530-E130-48E2-A7FF-2BF0AC787BC5
+:CUSTOM_ID: h:5F9E313C-E8A6-4F9E-87B7-3FA72DB82689
:END:
#+BEGIN_SRC emacs-lisp
@@ -4318,6 +6024,10 @@ In addition, I combine the above with Treemacs, which gives me access to the tag
:mode ("\\.md$" . markdown-mode))
#+END_SRC
** Enabling Flyspell
+:PROPERTIES:
+:ID: 6C5B8555-5DBA-44BA-AE1F-AB5DF2E22C73
+:CUSTOM_ID: h:AF0F0FE3-387F-4B4A-9794-767FF81A671A
+:END:
Reference: https://alhassy.github.io/init/
@@ -4326,19 +6036,22 @@ Org mode is derived from text mode, therefore it is sufficient to activate for t
#+BEGIN_SRC emacs-lisp
(use-package flyspell
:hook (
- (prog-mode . flyspell-prog-mode)
- (text-mode . flyspell-mode))
-)
+ (prog-mode . flyspell-prog-mode)
+ (markdown-mode . flyspell-mode)
+ (text-mode . flyspell-mode))
+ :config
+ (message "Flyspell hooks")
+ )
#+END_SRC
#+RESULTS:
| flyspell-mode | er/add-text-mode-expansions | dubcaps-mode | flycheck-mode | text-mode-hook-identify |
-
** Common editing modes
:PROPERTIES:
:ID: A655C868-0A42-4F78-80FA-163B15FFA14B
+:CUSTOM_ID: h:3498E253-CDB3-4C8B-806F-5E9A2C131789
:END:
Source: [[https://github.com/zakandrewking/.emacs.d/blob/master/init.el][.emacs.d/init.el at master · zakandrewking/.emacs.d · GitHub]]
@@ -4348,31 +6061,35 @@ added more easily. For exmaple electric-pair mode.
#+BEGIN_SRC emacs-lisp
(defvar common-editing-modes
- (list 'latex-mode 'lisp-mode 'emacs-lisp-mode 'python-mode 'matlab-mode
- 'sh-mode 'js2-mode 'markdown-mode 'haskell-mode 'org-mode 'c-mode 'css-mode
- 'web-mode 'typescript-mode 'plantuml-mode))
+ (list 'latex-mode 'lisp-mode 'emacs-lisp-mode 'python-mode 'matlab-mode
+ 'sh-mode 'js2-mode 'markdown-mode 'haskell-mode 'org-mode 'c-mode 'css-mode
+ 'web-mode 'typescript-mode 'plantuml-mode))
#+END_SRC
** hl-todo
:PROPERTIES:
:ID: 1562C2DE-F59C-4456-B2AD-FEF3750A5318
+:CUSTOM_ID: h:C7413B62-AF6D-4149-890F-C443FEE417E8
:END:
Borrowed from [[file:../my_org/roam/20200729113305-grym.org][grym - Graham Voysey]]'s Emacs configuration: https://github.com/gvoysey/emacs.d
#+BEGIN_SRC emacs-lisp
(use-package hl-todo
- :straight (hl-todo :type git
- :host github
- :repo "tarsius/hl-todo")
- :init (setq hl-todo-exclude-modes nil)
- :config
- (global-hl-todo-mode)
- (setq hl-todo-keyword-faces
- '(("todo" . "#FF0000")
- ("fixme" . "#FF0000"))))
+ :straight (hl-todo :type git
+ :host github
+ :repo "tarsius/hl-todo")
+ :init (setq hl-todo-exclude-modes nil)
+ :config
+ (global-hl-todo-mode)
+ (setq hl-todo-keyword-faces
+ '(("todo" . "#FF0000")
+ ("fixme" . "#FF0000"))))
#+END_SRC
** Terraform stuff
+:PROPERTIES:
+:CUSTOM_ID: h:5E478B60-51A6-4D2D-BAAB-338B92B31011
+:END:
These are Emacs packages to help work with [[file:../my_org/roam/20200727145440-terraform.org][terraform]] configuration
files.
@@ -4380,6 +6097,7 @@ files.
*** terraform-mode
:PROPERTIES:
:ID: A439D309-5C54-47BB-A4A8-D2054B4C7BD8
+:CUSTOM_ID: h:B300A2B9-8B43-44A0-A12F-0EE216D49F2F
:END:
This enables syntax highlighting and other goodies for terraform
@@ -4392,6 +6110,7 @@ configuration files. This also works within org source blocks.
*** terraform-doc
:PROPERTIES:
:ID: 85CDE432-8975-41FB-9F32-0C532F8F8BD8
+:CUSTOM_ID: h:30165518-CC4B-48A7-9BBB-EDCE0CE16F9D
:END:
For easy lookup of terraform docs from Emacs.
@@ -4409,19 +6128,21 @@ Azure as the provider does work.
** exec-path-from-shell
:PROPERTIES:
:ID: 76ABA16A-81FA-4437-8940-5E97AF94FE4E
+:CUSTOM_ID: h:C61118B6-88FF-4560-B13E-73C56D729D24
:END:
#+BEGIN_SRC emacs-lisp
- (use-package exec-path-from-shell
- :straight t
- :config
- (when (memq window-system '(mac ns x))
- (exec-path-from-shell-initialize)))
+(use-package exec-path-from-shell
+ :straight t
+ :config
+ (when (memq window-system '(mac ns x))
+ (exec-path-from-shell-initialize)))
#+END_SRC
** Electic pair mode only for specified modes
:PROPERTIES:
:ID: 365B6C3A-C9D4-4ACE-BD56-026DE22A75D1
+:CUSTOM_ID: h:4624FF55-CCAA-4538-ABB1-509B0A1529D2
:END:
Source: [[https://github.com/zakandrewking/.emacs.d/blob/master/init.el][.emacs.d/init.el at master · zakandrewking/.emacs.d · GitHub]]
@@ -4435,6 +6156,10 @@ Source: [[https://github.com/zakandrewking/.emacs.d/blob/master/init.el][.emacs.
(electric-pair-mode 1)
#+END_SRC
** flyspell with markdown
+:PROPERTIES:
+:ID: 11DBC933-13A1-41B1-A6D7-A0DE9913E954
+:CUSTOM_ID: h:073B2BB0-F3C1-423F-A0B0-7AC359CF2607
+:END:
Source: [[https://emacs.stackexchange.com/questions/17266/how-to-automatically-load-flyspell-mode-when-markdown-md-mdwn-file-is-open][How to automatically load flyspell-mode when Markdown (.md, .mdwn) file is open? - Emacs Stack Exchange]]
#+BEGIN_SRC emacs-lisp
@@ -4442,33 +6167,38 @@ Source: [[https://emacs.stackexchange.com/questions/17266/how-to-automatically-
#+END_SRC
** eshell
+:PROPERTIES:
+:CUSTOM_ID: h:79DA203C-7352-489D-96D3-2A3D45765AD8
+:END:
The following is borrowed from [[https://github.com/howardabrams/dot-files/blob/master/emacs-eshell.org][howardabrams/dot-files · GitHub]]. The ruby
functions are commented out since I do not use ruby.
*** configuration
:PROPERTIES:
:ID: 0DAEFD6D-DD9C-4B07-AF28-303626C68997
+:CUSTOM_ID: h:643A82F3-73AA-4BF3-AE67-011C73BBDA1A
:END:
#+BEGIN_SRC emacs-lisp
(use-package eshell
:init
(setq ;; eshell-buffer-shorthand t ... Can't see Bug#19391
- eshell-scroll-to-bottom-on-input 'all
- eshell-error-if-no-glob t
- eshell-hist-ignoredups t
- eshell-save-history-on-exit t
- eshell-prefer-lisp-functions nil
- eshell-destroy-buffer-when-process-dies t))
+ eshell-scroll-to-bottom-on-input 'all
+ eshell-error-if-no-glob t
+ eshell-hist-ignoredups t
+ eshell-save-history-on-exit t
+ eshell-prefer-lisp-functions nil
+ eshell-destroy-buffer-when-process-dies t))
#+END_SRC
*** Visual executables
:PROPERTIES:
:ID: 7CD41883-F90E-4AD0-B97E-C92F1B01F375
+:CUSTOM_ID: h:32DB88D2-357E-4C40-B3BE-1B2AD4E1BDAC
:END:
#+BEGIN_SRC emacs-lisp
(use-package eshell
:init
- (add-hook 'eshell-mode-hook
+ (add-hook 'eshell-mode-hook
(lambda ()
(add-to-list 'eshell-visual-commands "ssh")
(add-to-list 'eshell-visual-commands "tail")
@@ -4478,28 +6208,30 @@ functions are commented out since I do not use ruby.
*** Aliases
:PROPERTIES:
:ID: 969C250D-E271-4F34-BE3A-D7B9067DE6D4
+:CUSTOM_ID: h:FCB4B913-7812-4467-8052-370456058C7B
:END:
#+BEGIN_SRC emacs-lisp
(add-hook 'eshell-mode-hook (lambda ()
- (eshell/alias "e" "find-file $1")
- (eshell/alias "ff" "find-file $1")
- (eshell/alias "emacs" "find-file $1")
- (eshell/alias "ee" "find-file-other-window $1")
+ (eshell/alias "e" "find-file $1")
+ (eshell/alias "ff" "find-file $1")
+ (eshell/alias "emacs" "find-file $1")
+ (eshell/alias "ee" "find-file-other-window $1")
- (eshell/alias "gd" "magit-diff-unstaged")
- (eshell/alias "gds" "magit-diff-staged")
- (eshell/alias "d" "dired $1")
+ (eshell/alias "gd" "magit-diff-unstaged")
+ (eshell/alias "gds" "magit-diff-staged")
+ (eshell/alias "d" "dired $1")
- ;; The 'ls' executable requires the Gnu version on the Mac
- (let ((ls (if (file-exists-p "/usr/local/bin/gls")
- "/usr/local/bin/gls"
- "/bin/ls")))
- (eshell/alias "ll" (concat ls " -AlohG --color=always")))))
+ ;; The 'ls' executable requires the Gnu version on the Mac
+ (let ((ls (if (file-exists-p "/usr/local/bin/gls")
+ "/usr/local/bin/gls"
+ "/bin/ls")))
+ (eshell/alias "ll" (concat ls " -AlohG --color=always")))))
#+END_SRC
*** Find file and edit
:PROPERTIES:
:ID: 998329EC-A965-438F-946E-8F16DF458B14
+:CUSTOM_ID: h:B58F7FFA-43E4-4527-A195-5E34B6503F27
:END:
#+BEGIN_SRC emacs-lisp
@@ -4544,6 +6276,7 @@ file to edit."
*** git repo
:PROPERTIES:
:ID: CAB118D1-B571-4A3E-BC17-44C013F607F4
+:CUSTOM_ID: h:F14BF489-D4BE-431B-9B6C-84C17E1EFF29
:END:
#+BEGIN_SRC emacs-lisp
@@ -4566,6 +6299,7 @@ PWD is not in a git repo (or the git command is not found)."
*** Replacing $HOME with tilde
:PROPERTIES:
:ID: BECBB9D9-F980-4EC1-B1E1-ED8CA6B90A19
+:CUSTOM_ID: h:729165AE-81B9-4E62-A0D6-D92D12DA00B4
:END:
#+BEGIN_SRC emacs-lisp
@@ -4584,6 +6318,7 @@ PWD is not in a git repo (or the git command is not found)."
*** shorter directory names
:PROPERTIES:
:ID: EC001E70-CC8B-4A1F-A6A4-7E2D72B6BB78
+:CUSTOM_ID: h:EC7CD8F9-5D90-4906-8797-87235B855A39
:END:
#+BEGIN_SRC emacs-lisp
@@ -4593,7 +6328,7 @@ PWD is not in a git repo (or the git command is not found)."
(if (> (length p-lst) 2)
(concat
(mapconcat (lambda (elm) (if (zerop (length elm)) ""
- (substring elm 0 1)))
+ (substring elm 0 1)))
(butlast p-lst 2)
"/")
"/"
@@ -4606,6 +6341,7 @@ PWD is not in a git repo (or the git command is not found)."
*** break up directory into parent and base
:PROPERTIES:
:ID: 2D7F243C-3DEB-4ED7-8973-846BB1434970
+:CUSTOM_ID: h:E0965076-048A-4EAD-A44C-BCAB86664D68
:END:
#+BEGIN_SRC emacs-lisp
@@ -4618,6 +6354,7 @@ PWD is not in a git repo (or the git command is not found)."
*** virtual environments
:PROPERTIES:
:ID: 467E6FCD-B300-4509-9EF9-466527B213F0
+:CUSTOM_ID: h:9FA841DB-742B-4DAC-BD11-5070F3C2608F
:END:
This below is for working with pyenv.
@@ -4638,6 +6375,7 @@ This below is for working with pyenv.
*** Tie up
:PROPERTIES:
:ID: 10BD3DEF-6326-4EAE-838B-F64601F33F73
+:CUSTOM_ID: h:74536929-D779-4571-8EAB-A5F2B60E34E4
:END:
#+BEGIN_SRC emacs-lisp
@@ -4655,7 +6393,7 @@ more-helpful local prompt."
(branch (curr-dir-git-branch-string pwd))
- ;; (ruby (when (not (file-remote-p pwd)) (ruby-prompt)))
+ ;; (ruby (when (not (file-remote-p pwd)) (ruby-prompt)))
(python (when (not (file-remote-p pwd)) (python-prompt)))
(dark-env (eq 'dark (frame-parameter nil 'background-mode)))
@@ -4691,6 +6429,7 @@ more-helpful local prompt."
*** eshell here
:PROPERTIES:
:ID: 600E67FA-B009-40E9-8E2B-396C270C029A
+:CUSTOM_ID: h:9A17E26D-4250-4877-9BDC-CA7068714F96
:END:
#+BEGIN_SRC emacs-lisp
@@ -4718,6 +6457,7 @@ directory to make multiple eshell windows easier."
*** C-d behavior
:PROPERTIES:
:ID: E947745F-CB5C-489F-8273-45B048F194F1
+:CUSTOM_ID: h:0181CC81-95A3-443A-93A4-035D06036157
:END:
#+BEGIN_SRC emacs-lisp
@@ -4739,6 +6479,9 @@ directory to make multiple eshell windows easier."
#+END_SRC
*** COMMENT eshell prompt customistion
+:PROPERTIES:
+:CUSTOM_ID: h:0DB58F9B-A547-406E-972A-73ABBF7DB0B0
+:END:
Source: [[https://superuser.com/questions/495912/how-to-customize-the-eshell-prompt][shell - How to customize the eshell prompt? - Super User]]
@@ -4764,32 +6507,40 @@ Source: [[https://superuser.com/questions/495912/how-to-customize-the-eshell-pro
#+END_SRC
** TODO lsp mode setup
+:PROPERTIES:
+:ID: 4AFFD42D-31A3-4A34-93FB-0B0609C44D8C
+:CUSTOM_ID: h:A26B44C8-8E63-4EA1-ABA0-9D146F986456
+:END:
-References:
-- [[Sandeep Nambiar][Sandeep Nambiar]].
-- [[https://www.youtube.com/watch?v=zg6JJI-kwhE][YouTube]] video of Mike Zamansky showing his lsp configuration.
+References:
+- [[file:../my_org/roam/20200723004706-sandeep_nambiar.org][Sandeep Nambiar]]
+- [[https://www.youtube.com/watch?v=zg6JJI-kwhE][YouTube]] video of Mike Zamansky showing his lsp configuration.
*** lsp-mode
:PROPERTIES:
:ID: 1E3B3826-35C0-4BD5-BBBA-0C15D5B9B574
+:CUSTOM_ID: h:3D67F106-42F8-404B-A1E2-4279C5648F83
:END:
-- [ ] enable the experimental org mode integration
+- [ ] enable the experimental org mode integration
#+BEGIN_SRC emacs-lisp
;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
(setq lsp-keymap-prefix "s-l")
(use-package lsp-mode
- :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 lsp-deferred
- :config
- (add-hook 'c++-mode-hook #'lsp)
- (add-hook 'python-mode-hook #'lsp)
- (add-hook 'rust-mode-hook #'lsp))
+ :hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode)
+ (c++-mode . lsp)
+ (python-mode-hook . lsp)
+
+ ;; if you want which-key integration
+ (lsp-mode . lsp-enable-which-key-integration))
+ :commands lsp lsp-deferred
+ :config
+ ;; (add-hook 'c++-mode-hook #'lsp)
+ ;; (add-hook 'python-mode-hook #'lsp)
+ ;; (add-hook 'rust-mode-hook #'lsp)
+ )
;; (use-package lsp-mode
;; :straight t
@@ -4799,10 +6550,17 @@ References:
;; (add-hook 'rust-mode-hook #'lsp))
#+END_SRC
+#+RESULTS:
+| lsp-enable-which-key-integration |
+
*** Also note [[id:89C3133D-6C43-42FC-B0B9-9B3A34458AD3][Emacs python lsp configuration]]
+:PROPERTIES:
+:CUSTOM_ID: h:CEB38441-5009-4DDF-83D4-90B5782E42AC
+:END:
*** helm-lsp
:PROPERTIES:
:ID: 2C4FF74E-A528-4AEC-9DCA-E4A9E92BBF45
+:CUSTOM_ID: h:613738EE-7F69-4808-A7A5-E2E4DFD39C75
:END:
#+BEGIN_SRC emacs-lisp
@@ -4812,6 +6570,7 @@ References:
*** lsp-ivy
:PROPERTIES:
:ID: B43E4BF6-9A0D-43BD-A324-997B250882D9
+:CUSTOM_ID: h:0F2D2D44-F97C-4A7A-A3D6-A0DD14510807
:END:
#+BEGIN_SRC emacs-lisp
@@ -4819,13 +6578,19 @@ References:
#+END_SRC
*** COMMENT lsp-ui
+:PROPERTIES:
+:CUSTOM_ID: h:AF17382C-2FC8-49C6-88DD-059EABCBDE6E
+:END:
#+BEGIN_SRC emacs-lisp
(use-package lsp-ui :commands lsp-ui-mode :straight t)
#+END_SRC
*** COMMENT company-lsp
-#+BEGIN_SRC emacs-lisp
+:PROPERTIES:
+:CUSTOM_ID: h:9E2B3A84-B297-4DD9-993C-F1315DD0ABDB
+:END:
+#+BEGIN_SRC emacs-lisp
(use-package company-lsp
:straight t
:commands company-lsp
@@ -4835,6 +6600,7 @@ References:
*** ccls with flymake disabled
:PROPERTIES:
:ID: AE4392DA-B650-4398-9B62-4CAD7E25A4B9
+:CUSTOM_ID: h:6C16F254-A1AF-4B1B-BD50-56CF2D1E46C7
:END:
#+BEGIN_SRC emacs-lisp
@@ -4849,6 +6615,9 @@ References:
#+END_SRC
*** COMMENT setting the path to ccls executable
+:PROPERTIES:
+:CUSTOM_ID: h:16581A4F-693D-4C49-8114-916D590B3D88
+:END:
#+BEGIN_SRC emacs-lisp
(setq ccls-executable "/path/to/ccls/Release/ccls")
@@ -4858,6 +6627,7 @@ References:
*** emacs-cquery
:PROPERTIES:
:ID: B0EF4141-877E-4CAB-95AF-ED08C1A31FB1
+:CUSTOM_ID: h:F9366F0A-8279-487A-8B0E-66FFFDF458A5
:END:
#+BEGIN_SRC emacs-lisp
@@ -4867,19 +6637,64 @@ References:
(setq cquery-executable "/path/to/cquery/build/release/bin/cquery"))
#+END_SRC
-** COMMENT C IDE
+*** COMMENT lsp for source code blocks
+:PROPERTIES:
+:ID: EE272206-0580-4737-A702-C7A13A8BEB06
+:CUSTOM_ID: h:FFF1E8EA-8624-4258-8EBF-842523BB4D69
+:END:
+- https://tecosaur.github.io/emacs-config/config.html#lsp-support-src
+
+ #+BEGIN_SRC emacs-lisp
+(cl-defmacro lsp-org-babel-enable (lang)
+ "Support LANG in org source code block."
+ (setq centaur-lsp 'lsp-mode)
+ (cl-check-type lang stringp)
+ (let* ((edit-pre (intern (format "org-babel-edit-prep:%s" lang)))
+ (intern-pre (intern (format "lsp--%s" (symbol-name edit-pre)))))
+ `(progn
+ (defun ,intern-pre (info)
+ (let ((file-name (->> info caddr (alist-get :file))))
+ (unless file-name
+ (setq file-name (make-temp-file "babel-lsp-")))
+ (setq buffer-file-name file-name)
+ (lsp-deferred)))
+ (put ',intern-pre 'function-documentation
+ (format "Enable lsp-mode in the buffer of org source block (%s)."
+ (upcase ,lang)))
+ (if (fboundp ',edit-pre)
+ (advice-add ',edit-pre :after ',intern-pre)
+ (progn
+ (defun ,edit-pre (info)
+ (,intern-pre info))
+ (put ',edit-pre 'function-documentation
+ (format "Prepare local buffer environment for org source block (%s)."
+ (upcase ,lang))))))))
+(defvar org-babel-lang-list
+ '("go" "python" "ipython" "bash" "sh"))
+(dolist (lang org-babel-lang-list)
+ (eval `(lsp-org-babel-enable ,lang)))
+
+ #+END_SRC
+
+** COMMENT C IDE
+:PROPERTIES:
+:CUSTOM_ID: h:76EFAFFC-521D-4F83-9F29-56268F97EE56
+:END:
This borrows heavily from [[https://tuhdo.github.io/c-ide.html][C/C++ Development Environment for Emacs]] which
is an excellent guide as always. All the features shared in that blog
post are those that I desire in my environment.
Note here that the ctags and gtags libraries are available in the global
-package and via brew.
+package and via brew.
#+BEGIN_SRC sh :tangle no
brew install global
#+END_SRC
*** COMMENT helm-ggtags
+:PROPERTIES:
+:CUSTOM_ID: h:657E0CB2-00FD-42E6-BE2D-F564D302E187
+:END:
#+BEGIN_SRC emacs-lisp
(use-package helm-gtags
@@ -4912,7 +6727,10 @@ brew install global
#+END_SRC
*** COMMENT Optional gtags setup
-#+BEGIN_SRC emacs-lisp
+:PROPERTIES:
+:CUSTOM_ID: h:3044C97C-22CD-4238-8A8F-2A6533A50800
+:END:
+#+BEGIN_SRC emacs-lisp
;; (require 'ggtags)
;; (add-hook 'c-mode-common-hook
@@ -4935,11 +6753,12 @@ brew install global
** shell-pop - ansi term
:PROPERTIES:
:ID: 47EF3E93-3085-4327-A745-B59613E662A3
+:CUSTOM_ID: h:48EDABF2-A213-4146-9EE8-B799FAB8DA2F
:END:
Found this [[http://pragmaticemacs.com/emacs/pop-up-a-quick-shell-with-shell-pop/][on a pragmatic emacs blog post]]. The issue at the moment is
the hijacking of the C-t shortcut, and also that once popped, the shell
-buffer does not close.
+buffer does not close.
Eshell is useful for many purposes, however at times, there are commands
and operations which work better on an emulator. =ansi-term= seems to be
@@ -4958,6 +6777,7 @@ more useful than =term=.
** orgit
:PROPERTIES:
:ID: 258A45F4-EE8E-4836-A47A-93225178E316
+:CUSTOM_ID: h:931E77A1-58CF-4422-A248-3F26C718EA96
:END:
I would like to be able to create links to specific commits in
@@ -4967,13 +6787,14 @@ revision.
#+BEGIN_SRC emacs-lisp
(use-package orgit
- :straight (orgit :type git :host github :repo "magit/orgit"))
+ :straight (orgit :type git :host github :repo "magit/orgit"))
#+END_SRC
** TODO COMMENT realgud
:PROPERTIES:
:ID: C5C7E842-2234-4F94-A8C0-E74068D9C5BF
+:CUSTOM_ID: h:FCC100E5-9A62-4B3D-9A55-87D2D7D1BE48
:END:
Apparently this packages enhances the debuggers of many languages. Yet
@@ -4987,33 +6808,37 @@ shortcuts with respect to python.
** emmet-mode
:PROPERTIES:
:ID: 8BB48A4C-E7D2-4167-B210-5B732A0280E9
+:CUSTOM_ID: h:ACF7AEE7-48D3-4A9C-9785-3227B4BA40E1
:END:
#+BEGIN_SRC emacs-lisp
(use-package emmet-mode
-:straight t
-:config
+ :straight t
+ :config
-;; Auto-start on any markup modes
-(add-hook 'sgml-mode-hook 'emmet-mode)
-;; enable Emmet's css abbreviation.
-(add-hook 'css-mode-hook 'emmet-mode)
-;; enable HTML
-(add-hook 'html-mode-hook 'emmet-mode)
-;; Enable cursor to be placed within quotes
-(setq emmet-move-cursor-between-quotes t)
-)
+ ;; Auto-start on any markup modes
+ (add-hook 'sgml-mode-hook 'emmet-mode)
+ ;; enable Emmet's css abbreviation.
+ (add-hook 'css-mode-hook 'emmet-mode)
+ ;; enable HTML
+ (add-hook 'html-mode-hook 'emmet-mode)
+ ;; Enable cursor to be placed within quotes
+ (setq emmet-move-cursor-between-quotes t)
+ )
#+END_SRC
#+RESULTS:
: t
-
-** web-mode
+** web-mode
:PROPERTIES:
:ID: D678D668-F061-42C7-8859-B22E195F57C5
+:CUSTOM_ID: h:5FDEF252-6CD3-4B47-BB45-31BF3F33BD1F
:END:
+- [ ] Find relation of this package with emmet mode, and whether both
+ the modes can co-exist or whether that is even necessary.
+
#+BEGIN_SRC emacs-lisp :results silent
(straight-use-package 'web-mode)
(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
@@ -5039,6 +6864,7 @@ Forcing django engine for now
** ESS configuration
:PROPERTIES:
:ID: 867736B8-D21A-4734-9FCD-73D10997E192
+:CUSTOM_ID: h:D4F929D0-5679-4068-98E8-76A3E0A6BC95
:END:
#+BEGIN_SRC emacs-lisp
@@ -5054,7 +6880,7 @@ Forcing django engine for now
(setq ess-rutils-keys +1)
(setq ess-eval-visibly 'nil)
(setq ess-use-flymake "lintr::default_linters()")
- (setq ess-use-company t)
+ (setq ess-use-company t)
(setq ess-history-file "~/.Rhistory")
(setq ess-use-ido t)
(setq ess-roxy-hide-show-p t)
@@ -5063,10 +6889,10 @@ Forcing django engine for now
(setq comint-scroll-to-bottom-on-output t)
(setq comint-move-point-for-output t)
-;;setting up eldoc
-(setq ess-use-eldoc t)
-(setq ess-eldoc-show-on-symbol t)
-(setq ess-doc-abbreviation-style 'aggresive)
+ ;;setting up eldoc
+ (setq ess-use-eldoc t)
+ (setq ess-eldoc-show-on-symbol t)
+ (setq ess-doc-abbreviation-style 'aggresive)
)
;; The following chunk is taken from: https://github.com/syl20bnr/spacemacs/blob/master/layers/%2Blang/ess/packages.el
@@ -5131,25 +6957,10 @@ Forcing django engine for now
(message "Loaded ESS configuration")
#+END_SRC
-** lispy
-:PROPERTIES:
-:ID: 0D58C0FC-C29D-4BEF-9030-904200CD2F85
-:END:
-
-#+BEGIN_SRC emacs-lisp
-;; Superior lisp editing
-(use-package lispy
- :config
- (dolist (hook '(emacs-lisp-mode-hook
- hy-mode-hook))
- (add-hook hook
- (lambda ()
- (lispy-mode)
- (eldoc-mode)))))
-#+END_SRC
** flycheck
:PROPERTIES:
:ID: C8BBC1FA-A0D3-4CC6-9053-D7DAD0A28491
+:CUSTOM_ID: h:78F67D18-7881-4F36-961C-70122FAC3E13
:END:
#+BEGIN_SRC emacs-lisp
@@ -5157,13 +6968,18 @@ Forcing django engine for now
#+END_SRC
** TODO Python [0/1]
+:PROPERTIES:
+:ID: 3723A51F-E386-48DA-A705-457ED801E8D6
+:CUSTOM_ID: h:07D0EBC4-4285-49F9-8101-57C50AE45303
+:END:
- Note taken on [2020-03-23 Mon 18:10] \\
For now I will disable this as it appears logical to use pyenv and
other packages to set the correct interpreter. However, since shims
are being used, one would assume that the correct environment will be
used anyway.
-At the moment, [[nb:.emacs.d::init.org::#MY Scimax packages][Scimax packages]] require pydoc, elpy and jedi, which are already installed. These packages have to be grouped here.
+At the moment, Scimax packages require pydoc, elpy and jedi, which are
+already installed. These packages have to be grouped here.
[[https://realpython.com/emacs-the-best-python-editor/][Emacs: The Best Python Editor? Real Python]] is a good guide towards
setting up Emacs and python. [[https://medium.com/analytics-vidhya/managing-a-python-development-environment-in-emacs-43897fd48c6a][Managing a Python development environment
@@ -5172,6 +6988,9 @@ configuration with customisations for python. The latter guide is worth
following.
*** TODO COMMENT Earlier settings
+:PROPERTIES:
+:CUSTOM_ID: h:7403709E-4810-4262-B18F-F1CBAA51C82A
+:END:
#+BEGIN_SRC emacs-lisp
;; Enabling python 3 to be the default interpreter.
@@ -5183,7 +7002,7 @@ following.
(when (require 'flycheck nil t)
(setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
- (add-hook 'elpy-mode-hook 'flycheck-mode))
+ (add-hook 'elpy-mode-hook 'flycheck-mode 'electric-pair-local-mode))
#+END_SRC
@@ -5198,6 +7017,7 @@ following.
*** EIN notebooks
:PROPERTIES:
:ID: B1F4434B-0D69-401D-AF08-84FBB4089149
+:CUSTOM_ID: h:C917585C-ADFD-401A-B0AB-4C3F82C3E072
:END:
- [ ] enable visual line mode?
@@ -5206,18 +7026,32 @@ following.
#+BEGIN_SRC emacs-lisp
(use-package ein
-:defer t
-:ensure t
-:config
-(package-initialize)
-(require 'ein)
-(require 'ein-notebook)
-(require 'ein-subpackages))
+ :defer t
+ :ensure t
+ :config
+ (package-initialize)
+ (require 'ein)
+ (require 'ein-notebook)
+ ;; (require 'ein-subpackages)
+ )
+#+END_SRC
+
+*** COMMENT Emacs-jupyter
+:PROPERTIES:
+:CUSTOM_ID: h:5F1C8126-A681-4C3C-AE1A-9D5FB07DD901
+:END:
+
+#+BEGIN_SRC emacs-lisp
+(straight-use-package 'jupyter)
#+END_SRC
+#+RESULTS:
+: t
+
*** emacs-lsp : =lsp-python-ms=
:PROPERTIES:
:ID: 89C3133D-6C43-42FC-B0B9-9B3A34458AD3
+:CUSTOM_ID: h:8D910F38-1EE6-4115-9F83-713A78B04929
:END:
- Note taken on [2020-07-05 Sun 18:18] \\
@@ -5232,8 +7066,8 @@ following.
(use-package lsp-python-ms
:ensure t
:hook (python-mode . (lambda ()
- (require 'lsp-python-ms)
- (lsp-deferred)))) ; or lsp-deferred
+ (require 'lsp-python-ms)
+ (lsp-deferred)))) ; or lsp-deferred
#+END_SRC
| (lambda nil (require 'lsp-python-ms) (lsp)) | er/add-python-mode-expansions | blacken-mode | elpy-mode |
@@ -5241,11 +7075,23 @@ following.
*** pyvenv, pydoc and elpy
:PROPERTIES:
:ID: 7708D432-4E0E-47D0-B294-73CA27520E82
+:CUSTOM_ID: h:AB6AAF22-6C4C-450B-9E2D-6D0E842DF40F
:END:
#+BEGIN_SRC emacs-lisp
(straight-use-package 'pyvenv)
(straight-use-package 'pydoc)
+(setq pyvenv-default-virtual-env-name "ds-base")
+
+;; it's possible that this setting below does not make a large
+;; difference. The idea is to basically use the same shell everywhere,
+;; howevever as dale pointed out in #Emacs, it may not be so that pyvenv
+;; uses the zshrc settings in any discernible way.
+(setq pyvenv-exec-shell
+ (or (executable-find "zsh")
+ (executable-find "bash")
+ (executable-find "sh")))
+
(use-package elpy
:straight t
:config
@@ -5253,22 +7099,25 @@ following.
#+END_SRC
*** COMMENT pyenv
+:PROPERTIES:
+:CUSTOM_ID: h:2997D557-FDD3-4955-99AB-3C3E5A383017
+:END:
- Note taken on [2020-03-29 Sun 17:00] \\
I am predominantly using pyvenv at the moment with a single pyenv. This will be useful to look into down the line.
#+BEGIN_SRC emacs-lisp
(use-package pyenv
- :straight (:host github :repo "aiguofer/pyenv.el")
- :init (setq pyenv-installation-dir "~/.pyenv/versions")
- :config
- (setq pyenv-use-alias 't)
- (setq pyenv-modestring-prefix "PyE-")
- (setq pyenv-modestring-postfix nil)
- (setq pyenv-set-path nil)(global-pyenv-mode)
- (defun pyenv-update-on-buffer-switch (prev curr)
- (if (string-equal "Python" (format-mode-line mode-name nil nil curr))
- (pyenv-use-corresponding)))
- (add-hook 'switch-buffer-functions 'pyenv-update-on-buffer-switch))
+ :straight (:host github :repo "aiguofer/pyenv.el")
+ :init (setq pyenv-installation-dir "~/.pyenv/versions")
+ :config
+ (setq pyenv-use-alias 't)
+ (setq pyenv-modestring-prefix "PyE-")
+ (setq pyenv-modestring-postfix nil)
+ (setq pyenv-set-path nil)(global-pyenv-mode)
+ (defun pyenv-update-on-buffer-switch (prev curr)
+ (if (string-equal "Python" (format-mode-line mode-name nil nil curr))
+ (pyenv-use-corresponding)))
+ (add-hook 'switch-buffer-functions 'pyenv-update-on-buffer-switch))
#+END_SRC
#+RESULTS:
@@ -5277,6 +7126,7 @@ following.
*** Blacken
:PROPERTIES:
:ID: C874811C-37CA-4353-9C61-DBC6793AFC82
+:CUSTOM_ID: h:A953CC57-DB9E-4D6A-B9A2-74E94CAEED2D
:END:
The black library will re-format the code on a save. Elpy will automatically use black, as long as the elisp package installed, along with the python black package which can be installed using pip
@@ -5287,40 +7137,69 @@ pip3 install black
#+BEGIN_SRC emacs-lisp
(use-package blacken
-:straight t
-:hook (python-mode . blacken-mode))
+ :straight t
+ :hook (python-mode . blacken-mode))
#+END_SRC
*** poetry
+:PROPERTIES:
+:ID: 2FB3FE7A-434D-46B7-AA19-BB0CE16771D7
+:CUSTOM_ID: h:F779AA00-1E9A-4BF7-80AB-CC84E50676BE
+:END:
Borrowed from [[file:../my_org/roam/20200729113305-grym.org][grym - Graham Voysey]]'s config.
#+BEGIN_SRC emacs-lisp
(use-package poetry
-:straight (poetry :type git
- :host github
- :repo "galaunay/poetry.el")
-;; :config (poetry-tracking-mode)
-)
+ :straight (poetry :type git
+ :host github
+ :repo "galaunay/poetry.el")
+ ;; :config (poetry-tracking-mode)
+ )
#+END_SRC
-
** emacssql-sqlite
:PROPERTIES:
:ID: 34B0A562-D6DC-4347-A528-9680F243B886
+:CUSTOM_ID: h:7FC33425-BCF9-4638-9850-D55AF93A3B57
:END:
#+BEGIN_SRC emacs-lisp
(straight-use-package 'emacsql-sqlite)
#+END_SRC
+** TODO COMMENT vterm
+:PROPERTIES:
+:CUSTOM_ID: h:26A51D3A-C7BF-4057-9408-99DDCB47A06F
+:END:
+
+- Note taken on [2020-08-16 Sun 00:45] \\
+ The problem is that vterm-module is not getting compiled. The same error
+ is reached via automatic as welll as manual installation.
+
+On Mac OS the cmake package needed to be installed. This does not take
+long.
+
+#+BEGIN_SRC sh :tangle no
+brew install cmake
+#+END_SRC
+
+
+#+BEGIN_SRC emacs-lisp
+(straight-use-package 'vterm)
+#+END_SRC
+
* Docker
+:PROPERTIES:
+:CUSTOM_ID: h:21F9EF82-021A-4CE9-B2C2-8695124AD76E
+:END:
The following packages will enable me to handle docker containers right within Emacs.
*** Docker package
:PROPERTIES:
:ID: 91f02de1-f2d3-4722-9e18-df78f4b6ad95
+:CUSTOM_ID: h:BDCD1DFE-68A4-49D2-A452-124977B7C494
:END:
With this package, I can easily view the containers available and run commands on them from emac without switching over the terminal.
@@ -5330,7 +7209,7 @@ With this package, I can easily view the containers available and run commands o
:ensure t
:bind ("M-s d" . docker)
-)
+ )
#+END_SRC
#+RESULTS:
@@ -5339,6 +7218,7 @@ With this package, I can easily view the containers available and run commands o
*** COMMENT docker-compose-mode
:PROPERTIES:
:ID: e887c7b6-5e53-49fb-ab13-a37ab7944407
+:CUSTOM_ID: h:DD109A50-4765-48DB-A377-424619F8EE77
:END:
Enabling syntax highlighting for docker-compose files.
@@ -5348,7 +7228,7 @@ Enabling syntax highlighting for docker-compose files.
:ensure t
:config
-;; (require 'docker-compose-mode)
+ ;; (require 'docker-compose-mode)
(add-to-list 'auto-mode-alist
'("docker-compose\\" . docker-compose-mode))
)
@@ -5359,6 +7239,7 @@ Enabling syntax highlighting for docker-compose files.
*** COMMENT docker-file-mode
:PROPERTIES:
:ID: 33fdbbf6-5e67-43e7-8c84-aa90fa6b9de6
+:CUSTOM_ID: h:8C6C0204-CA6D-43CE-B384-AF39F242BCC1
:END:
This is required for syntax highlighting in dockerfiles.
@@ -5377,7 +7258,20 @@ This is required for syntax highlighting in dockerfiles.
#+RESULTS:
+*** Message for docker completion
+:PROPERTIES:
+:CUSTOM_ID: h:FF88C2A1-301F-4E52-BF70-295BA5BD44A2
+:END:
+
+#+BEGIN_SRC emacs-lisp
+(message "Docker config done")
+#+END_SRC
+
* Bongo
+:PROPERTIES:
+:ID: 4C1D09A5-F834-4FBC-88CE-1DBF943B19A0
+:CUSTOM_ID: h:1C69BBD7-174F-45C3-B2EC-595857AF97E3
+:END:
Managing my media with Emacs was something I had not planned to do, but
itunes is annoying and there are a certain set of tracks that I prefer
@@ -5680,6 +7574,9 @@ Also see `prot/bongo-playlist-insert-playlist-file'."
#+END_SRC
* TODO Custom search functions [0/1]
+:PROPERTIES:
+:CUSTOM_ID: h:A48B7527-AD91-4BE3-97E1-B4E2852717F0
+:END:
This section contains sections to search in specific directories, with customised options.
- [ ] Incorporate these functions into a hydra.
@@ -5688,6 +7585,7 @@ This section contains sections to search in specific directories, with customise
** Episteme search
:PROPERTIES:
:ID: 001EE8FC-2C5B-4A7C-8BA7-DEAB94A808AA
+:CUSTOM_ID: h:6D12B05C-6FD5-4667-9336-567D4808F960
:END:
Adapted from ldlework
@@ -5707,6 +7605,7 @@ Adapted from ldlework
** Projects search [1/6]
:PROPERTIES:
:ID: 8351BECB-609E-4D19-9DAE-C03728380FCB
+:CUSTOM_ID: h:8F1E40A3-8BF0-4E95-B9E7-538EA46A91FF
:END:
- [ ] Exclude git files
- [ ] Exclude csv files
@@ -5724,6 +7623,7 @@ Adapted from ldlework
** Org files search
:PROPERTIES:
:ID: E34847DB-7470-4BBC-8DA1-0A1823FD5890
+:CUSTOM_ID: h:F1E62670-1320-4833-9CCD-C29F325A9488
:END:
#+BEGIN_SRC emacs-lisp
@@ -5735,20 +7635,28 @@ Adapted from ldlework
** Journal files search
:PROPERTIES:
:ID: 8C603D99-7741-448F-91A4-3787F3454628
+:CUSTOM_ID: h:6E8233E3-8850-434D-A61F-1F19494778E0
:END:
#+BEGIN_SRC emacs-lisp
(defun sr/fun/org-journal-search ()
(interactive)
- (helm-do-ag (sr/fun/org-dir "journal")))
+ (helm-do-ag (sr/fun/roam-private-dir "journal")))
#+END_SRC
-** Downloads and Desktop search
+** TODO Downloads and Desktop search
+:PROPERTIES:
+:CUSTOM_ID: h:973CEE34-63FF-473A-9ADC-8392307A30FB
+:END:
* Pastes and gists
+:PROPERTIES:
+:CUSTOM_ID: h:754FFA59-0E05-47BF-976C-2DC693F53440
+:END:
** Webpaste
:PROPERTIES:
:ID: A784F369-9BD2-4A7F-B895-3F38F361D3FE
+:CUSTOM_ID: h:7EFC7C94-B2A2-4E8C-964D-279133A055E6
:END:
- Note taken on [2020-03-29 Sun 11:18] \\
This package is useful to use multiple paste services with a fallback. dpaste has a pleasant format and therefore chosen as the first priority. The advantage of using github gists is that org mode exports can be directly rendered. This package can also be configured to use a custom paste service.
@@ -5764,20 +7672,24 @@ Adapted from ldlework
#+RESULTS:
: t
-** github gists
+** github gists
:PROPERTIES:
:ID: E33FD48A-4049-464E-B956-9BEA3A48B07E
+:CUSTOM_ID: h:52A435B0-7A36-4E7A-9F1E-1BB00C7E3795
:END:
Gists posted right from emacs.
#+BEGIN_SRC emacs-lisp
(use-package gist
-:straight (gist :type git :host github :repo "defunkt/gist.el"))
+ :straight (gist :type git :host github :repo "defunkt/gist.el"))
#+END_SRC
#+RESULTS:
* TODO Hydra Hera and nougat
+:PROPERTIES:
+:CUSTOM_ID: h:24E5881B-1430-4898-BADF-80FE43DCDFE3
+:END:
This hydra setup is based off hera and nougat, which are packages
available in [[https://dustinlacewell.github.io/emacs.d/][ldlework's init.el]]. I've adapted, modified and expanded his
@@ -5787,14 +7699,15 @@ especially in a stack.
** hera
:PROPERTIES:
:ID: E6516FB9-DC4A-44EC-98F9-8A2420F2B219
+:CUSTOM_ID: h:6B34220F-219B-4C84-B78A-7B18C219E9FF
:END:
ldlework's package that provides an API for defining a stack of hydras.
#+BEGIN_SRC emacs-lisp
(use-package hera
-:demand t
-:straight (hera :type git :host github :repo "dustinlacewell/hera"))
+ :demand t
+ :straight (hera :type git :host github :repo "dustinlacewell/hera"))
#+END_SRC
#+RESULTS:
@@ -5802,67 +7715,68 @@ ldlework's package that provides an API for defining a stack of hydras.
** nougat-hydra
:PROPERTIES:
:ID: 70D6E497-A30F-4027-8D4D-D5CF9C21E788
+:CUSTOM_ID: h:074937FD-0609-47B0-9734-FFDC76343B92
:END:
#+BEGIN_SRC emacs-lisp
(defun nougat--inject-hint (symbol hint)
-(-let* ((name (symbol-name symbol))
-(hint-symbol (intern (format "%s/hint" name)))
-(format-form (eval hint-symbol))
-(string-cdr (nthcdr 1 format-form))
-(format-string (string-trim (car string-cdr)))
-(amended-string (format "%s\n\n%s" format-string hint)))
-(setcar string-cdr amended-string)))
+ (-let* ((name (symbol-name symbol))
+ (hint-symbol (intern (format "%s/hint" name)))
+ (format-form (eval hint-symbol))
+ (string-cdr (nthcdr 1 format-form))
+ (format-string (string-trim (car string-cdr)))
+ (amended-string (format "%s\n\n%s" format-string hint)))
+ (setcar string-cdr amended-string)))
(defun nougat--make-head-hint (head default-color)
-(-let (((key _ hint . rest) head))
-(when key
-(-let* (((&plist :color color) rest)
-(color (or color default-color))
-(face (intern (format "hydra-face-%s" color)))
-(propertized-key (propertize key 'face face)))
-(format " [%s]: %s" propertized-key hint)))))
+ (-let (((key _ hint . rest) head))
+ (when key
+ (-let* (((&plist :color color) rest)
+ (color (or color default-color))
+ (face (intern (format "hydra-face-%s" color)))
+ (propertized-key (propertize key 'face face)))
+ (format " [%s]: %s" propertized-key hint)))))
(defun nougat--make-hint (heads default-color)
-(string-join
-(cl-loop for head in heads
-for hint = (nougat--make-head-hint head default-color)
-do (pp hint)
-collect hint) "\n"))
+ (string-join
+ (cl-loop for head in heads
+ for hint = (nougat--make-head-hint head default-color)
+ do (pp hint)
+ collect hint) "\n"))
(defun nougat--clear-hint (head)
-(-let* (((key form _ . rest) head))
-`(,key ,form nil ,@rest)))
+ (-let* (((key form _ . rest) head))
+ `(,key ,form nil ,@rest)))
(defun nougat--add-exit-head (heads)
-(let ((exit-head '("SPC" (hera-pop) "to exit" :color blue)))
-(append heads `(,exit-head))))
+ (let ((exit-head '("SPC" (hera-pop) "to exit" :color blue)))
+ (append heads `(,exit-head))))
(defun nougat--add-heads (columns extra-heads)
-(let* ((cell (nthcdr 1 columns))
-(heads (car cell))
-(extra-heads (mapcar 'nougat--clear-hint extra-heads)))
-(setcar cell (append heads extra-heads))))
+ (let* ((cell (nthcdr 1 columns))
+ (heads (car cell))
+ (extra-heads (mapcar 'nougat--clear-hint extra-heads)))
+ (setcar cell (append heads extra-heads))))
(defmacro nougat-hydra (name body columns &optional extra-heads)
-(declare (indent defun))
-(-let* (((&plist :color default-color :major-mode mode) body)
-(extra-heads (nougat--add-exit-head extra-heads))
-(extra-hint (nougat--make-hint extra-heads default-color))
-(body (plist-put body :hint nil))
-(body-name (format "%s/body" (symbol-name name)))
-(body-symbol (intern body-name))
-(mode-support
-`(when ',mode
-(setq major-mode-hydra--body-cache
-(a-assoc major-mode-hydra--body-cache ',mode ',body-symbol)))))
-(nougat--add-heads columns extra-heads)
-(when mode
-(remf body :major-mode))
-`(progn
-(pretty-hydra-define ,name ,body ,columns)
-(nougat--inject-hint ',name ,extra-hint)
-,mode-support)))
+ (declare (indent defun))
+ (-let* (((&plist :color default-color :major-mode mode) body)
+ (extra-heads (nougat--add-exit-head extra-heads))
+ (extra-hint (nougat--make-hint extra-heads default-color))
+ (body (plist-put body :hint nil))
+ (body-name (format "%s/body" (symbol-name name)))
+ (body-symbol (intern body-name))
+ (mode-support
+ `(when ',mode
+ (setq major-mode-hydra--body-cache
+ (a-assoc major-mode-hydra--body-cache ',mode ',body-symbol)))))
+ (nougat--add-heads columns extra-heads)
+ (when mode
+ (remf body :major-mode))
+ `(progn
+ (pretty-hydra-define ,name ,body ,columns)
+ (nougat--inject-hint ',name ,extra-hint)
+ ,mode-support)))
;; (nougat-hydra hydra-test (:color red :major-mode fundamental-mode)
;; ("First"
@@ -5879,6 +7793,7 @@ collect hint) "\n"))
** hydra-dwim
:PROPERTIES:
:ID: 83B2E03A-A2DF-468B-9004-C36FDA0FAE9C
+:CUSTOM_ID: h:0DC38E01-34EB-48C6-A317-EAAAF354BD40
:END:
- Note taken on [2020-04-04 Sat 17:17] \\
I still need to integrate these hydras with scimax hydras and figure out
@@ -5886,10 +7801,10 @@ collect hint) "\n"))
#+BEGIN_SRC emacs-lisp
(defun my/hydra-dwim ()
-(interactive)
-(-let (((&alist major-mode mode) major-mode-hydra--body-cache))
-(if mode (major-mode-hydra)
-(hera-start 'hydra-default/body))))
+ (interactive)
+ (-let (((&alist major-mode mode) major-mode-hydra--body-cache))
+ (if mode (major-mode-hydra)
+ (hera-start 'hydra-default/body))))
(setq kbd-hera-pop "Q")
(global-set-key (kbd "H-l") 'my/hydra-dwim)
@@ -5903,37 +7818,38 @@ collect hint) "\n"))
** hydra-default
:PROPERTIES:
:ID: 76AD6939-FBF3-40A1-8AAB-31355ED12259
+:CUSTOM_ID: h:B1BD216A-1D5C-4207-9915-E1E7E9DBCF84
:END:
#+BEGIN_SRC emacs-lisp
(defhydra hydra-default (:color blue :hint nil)
-"
+ "
Entrypoint Hydra
"
-("a" (org-agenda nil "a") "agenda" :column "Open")
-;; ("p" (hera-push 'hydra-projectile/body) "projectile")
-("c" (org-capture) "capture")
-("t" (hera-push 'hydra-treemacs/body))
-("f" (hera-push 'hydra-functions/body) "Functions" :column "Emacs")
-("m" (hera-push 'hydra-mu4e/body) "mail")
-("w" (hera-push 'hydra-window/body) "windows")
-("z" (hera-push 'hydra-zoom/body) "zoom")
-("R" (hera-push 'hydra-registers/body) "registers")
-("e" (hera-push 'hydra-eyebrowse/body) "eyebrowse")
-("n" (hera-push 'hydra-notes/body) "notes" :column "Misc")
-("S" (hera-push 'hydra-straight/body) "Straight")
-("s" (call-interactively 'helm-imenu) "semantic")
-("g" (hera-push 'hydra-git/body) "Git, paste and gist")
-("v" (hera-push 'hydra-pyvenv/body) "pyvenv" :column "python")
-("j" (hera-push 'hydra-jumper/body) "Jump around" :column "Daily")
-("J" (hera-push 'hydra-journal/body) "Journal" :column "Daily")
-("p" (hera-push 'hydra-perspective/body) "pyvenv" :column "Daily")
-("-" (hera-push 'hydra-clock/body) "Clock" :column "Daily")
-("o" (hera-push 'hydra-org-roam/body) "Clock" :column "Daily")
-("l" (hera-push 'hydra-links/body) "Links")
-("b" (hera-push 'hydra-brain/body) "brain"))
+ ("a" (org-agenda nil "a") "agenda" :column "Open")
+ ;; ("p" (hera-push 'hydra-projectile/body) "projectile")
+ ("c" (org-capture) "capture")
+ ("t" (hera-push 'hydra-treemacs/body))
+ ("f" (hera-push 'hydra-functions/body) "Functions" :column "Emacs")
+ ("m" (hera-push 'hydra-mu4e/body) "mail")
+ ("w" (hera-push 'hydra-window/body) "windows")
+ ("z" (hera-push 'hydra-zoom/body) "zoom")
+ ("R" (hera-push 'hydra-registers/body) "registers")
+ ("e" (hera-push 'hydra-eyebrowse/body) "eyebrowse")
+ ("n" (hera-push 'hydra-notes/body) "notes" :column "Misc")
+ ("S" (hera-push 'hydra-straight/body) "Straight")
+ ("s" (call-interactively 'helm-semantic-or-imenu) "semantic")
+ ("g" (hera-push 'hydra-git/body) "Git, paste and gist")
+ ("v" (hera-push 'hydra-pyvenv/body) "pyvenv" :column "python")
+ ("j" (hera-push 'hydra-jumper/body) "Jump around" :column "Daily")
+ ("J" (hera-push 'hydra-journal/body) "Journal" :column "Daily")
+ ("p" (hera-push 'hydra-perspective/body) "pyvenv" :column "Daily")
+ ("-" (hera-push 'hydra-clock/body) "Clock" :column "Daily")
+ ("o" (hera-push 'hydra-org-roam/body) "Clock" :column "Daily")
+ ("l" (hera-push 'hydra-links/body) "Links")
+ ("b" (hera-push 'hydra-brain/body) "brain"))
#+END_SRC
@@ -5942,6 +7858,7 @@ Entrypoint Hydra
** hydra-straight
:PROPERTIES:
:ID: 6CAF1975-F604-41AB-B402-27F3461D068C
+:CUSTOM_ID: h:968DC6A1-372D-4E3D-A3F3-F7A42FC8D416
:END:
#+BEGIN_SRC emacs-lisp
@@ -5967,7 +7884,7 @@ Entrypoint Hydra
("w" (call-interactively 'straight-visit-package-website) "visit package Website")
("g" (call-interactively 'straight-get-recipe)
"Get recipe")
- ("r" (call-interactively 'straight-rebuild-package)
+ ("r" (call-interactively 'straight-rebuild-package)
"rebuild package")
)))
#+END_SRC
@@ -5976,33 +7893,35 @@ Entrypoint Hydra
** hydra-mu4e
:PROPERTIES:
:ID: C319B9EC-65A6-48B9-B89D-849C866CA4B9
+:CUSTOM_ID: h:ACD1EC48-F94C-40B8-B6D2-9D1C3DE8B792
:END:
#+BEGIN_SRC emacs-lisp
(nougat-hydra hydra-mu4e (:color blue)
-("mu4e" (("m" (mu4e) "mail")
- ("i" mu4e-compose-attach-captured-message "Insert captured mu4e mail in compose" :color red)
- ("o" switch-to-prev-buffer "Previous buffer" :color red)
- ("c" mu4e-compose-attach-captured-message "Capture Mail" :color red)
- ("u" mu4e-update-mail-and-index "Update mail and index"))))
+ ("mu4e" (("m" (mu4e) "mail")
+ ("i" mu4e-compose-attach-captured-message "Insert captured mu4e mail in compose" :color red)
+ ("o" switch-to-prev-buffer "Previous buffer" :color red)
+ ("c" mu4e-compose-attach-captured-message "Capture Mail" :color red)
+ ("u" mu4e-update-mail-and-index "Update mail and index"))))
#+END_SRC
#+RESULTS:
** hydra-pyvenv
:PROPERTIES:
:ID: 52E4B983-F0A4-433B-B2DC-A464127E8933
+:CUSTOM_ID: h:6BDE1C3B-B5AE-432D-817D-FFABF32891FE
:END:
#+BEGIN_SRC emacs-lisp
(nougat-hydra hydra-pyvenv (:color red)
("pyvenv - virtualenv" (("c" (call-interactively 'pyvenv-create)
- "create")
- ("w" (call-interactively 'pyvenv-workon) "work on")
- ("a" (call-interactively 'pyvenv-activate) "activate")
- ("d" (call-interactively 'pyvenv-deactivate) "deactivate")
- ("t" (call-interactively 'pyvenv-tracking-mode) "tracking mode")
- ("r" (call-interactively 'pyvenv-restart-python) "restart python")
- )))
+ "create")
+ ("w" (call-interactively 'pyvenv-workon) "work on")
+ ("a" (call-interactively 'pyvenv-activate) "activate")
+ ("d" (call-interactively 'pyvenv-deactivate) "deactivate")
+ ("t" (call-interactively 'pyvenv-tracking-mode) "tracking mode")
+ ("r" (call-interactively 'pyvenv-restart-python) "restart python")
+ )))
#+END_SRC
#+RESULTS:
@@ -6010,6 +7929,7 @@ Entrypoint Hydra
** hydra-window
:PROPERTIES:
:ID: 57D86E22-C409-46CF-982F-8397622B125C
+:CUSTOM_ID: h:0090044A-A639-4AC2-B38E-F1F49389A6B5
:END:
- Note taken on [2020-04-08 Wed 12:34] \\
@@ -6022,100 +7942,80 @@ Entrypoint Hydra
(winner-mode 1)
(nougat-hydra hydra-window (:color red)
-("Jump"
-(("h" windmove-left "left")
-("l" windmove-right "right")
-("k" windmove-up "up")
-("j" windmove-down "down")
-("a" ace-select-window "ace")
-("s" ace-swap-window "ace-swap"))
-"Split"
-(("q" split-window-right "left")
-("r" (progn (split-window-right) (call-interactively 'other-window)) "right")
-("e" split-window-below "up")
-("w" (progn (split-window-below) (call-interactively 'other-window)) "down"))
-"Do"
-(("d" delete-window "delete")
-("o" delete-other-windows "delete others")
-("u" winner-undo "undo")
-("R" winner-redo "redo")
-("t" nougat-hydra-toggle-window "toggle"))))
-#+END_SRC
-
-Toggle window split
-
-#+BEGIN_SRC emacs-lisp
-(defun my/toggle-window-split (&optional arg)
-"Switch between 2 windows split horizontally or vertically.
-With ARG, swap them instead."
-(interactive "P")
-(unless (= (count-windows) 2)
-(user-error "Not two windows"))
-;; Swap two windows
-(if arg
-(let ((this-win-buffer (window-buffer))
-(next-win-buffer (window-buffer (next-window))))
-(set-window-buffer (selected-window) next-win-buffer)
-(set-window-buffer (next-window) this-win-buffer))
-;; Swap between horizontal and vertical splits
-(let* ((this-win-buffer (window-buffer))
-(next-win-buffer (window-buffer (next-window)))
-(this-win-edges (window-edges (selected-window)))
-(next-win-edges (window-edges (next-window)))
-(this-win-2nd (not (and (<= (car this-win-edges)
-(car next-win-edges))
-(<= (cadr this-win-edges)
-(cadr next-win-edges)))))
-(splitter
-(if (= (car this-win-edges)
-(car (window-edges (next-window))))
-'split-window-horizontally
-'split-window-vertically)))
-(delete-other-windows)
-(let ((first-win (selected-window)))
-(funcall splitter)
-(if this-win-2nd (other-window 1))
-(set-window-buffer (selected-window) this-win-buffer)
-(set-window-buffer (next-window) next-win-buffer)
-(select-window first-win)
-(if this-win-2nd (other-window 1))))))
+ ("Window Jump"
+ (("a" windmove-left "left")
+ ("f" windmove-right "right")
+ ("d" windmove-up "up")
+ ("s" windmove-down "down")
+ ("1" ace-select-window "ace select")
+ ("2" ace-swap-window "ace-swap"))
+ "Window Split"
+ (("q" split-window-right "left")
+ ("r" (progn (split-window-right) (call-interactively 'other-window)) "right")
+ ("e" split-window-below "up")
+ ("w" (progn (split-window-below) (call-interactively 'other-window)) "down"))
+ ;; "Org side bar"
+ ;; (("ot" org-sidebar-toggle)
+ ;; ("oT" org-sidebar-tree))
+ "Deletion and Transposing"
+ (("x" delete-window "delete")
+ ("c" delete-other-windows "delete others")
+ ("[" winner-undo "undo")
+ ("]" winner-redo "redo")
+ ("tr" transpose-frame "transpose frame")
+ ("tm" crux-transpose-windows "crux (mirror) windows"))))
+
+;; SEtting a better shortcut key to access this hydra.
+(global-set-key (kbd "H-w") 'hydra-window/body)
+
+
#+END_SRC
** hydra-treemacs
:PROPERTIES:
:ID: CE1CE162-60B6-40A9-AF09-31E5807F7E6E
+:CUSTOM_ID: h:F4C3AC6C-240C-41B3-9CDD-AC6641382C6F
:END:
#+BEGIN_SRC emacs-lisp
(nougat-hydra hydra-treemacs (:color red)
-("Workspace"
-(("t" treemacs "Treemacs buffer" :color red)
-("o" treemacs-switch-workspace "switch workspace" :color red)
-("n" treemacs-create-workspace "new workspace" :color red)
-("k" treemacs-delete-workspace "kill")
-("r" treemacs-rename-workspace "rename")
-("c" treemacs-collapse-other-projects "collapse other projects" :color blue))))
+ ("Workspace"
+ (("t" treemacs "Treemacs buffer" :color red)
+ ("o" treemacs-switch-workspace "switch workspace" :color red)
+ ("n" treemacs-create-workspace "new workspace" :color red)
+ ("k" treemacs-delete-workspace "kill")
+ ("r" treemacs-rename-workspace "rename")
+ ("c" treemacs-collapse-other-projects "collapse other projects" :color blue))))
#+END_SRC
** hydra-journal
:PROPERTIES:
:ID: 571B0402-C81E-457D-994F-80F98ECAC4B3
+:CUSTOM_ID: h:F1A338E3-8862-4FEF-9965-A948DAD5719C
:END:
#+BEGIN_SRC emacs-lisp
(nougat-hydra hydra-journal (:color blue)
-("Journal"
-(("j" org-journal-new-entry "Entry" :color red)
- ("k" org-journal-open-next-entry "Next entry" :color red)
- ("h" org-journal-open-previous-entry "Previous entry" :color red)
- ("g" counsel-org-goto "Buffer org headings" :color red)
- ("F" org-journal-new-scheduled-entry "Future scheduled")
- ("s" sr/fun/org-journal-search "Journal search")
- ("n" (org-speed-move-safe 'org-next-visible-heading) "Next heading" :color red)
- ("b" (org-speed-move-safe 'org-previous-visible-heading) "Previous heading" :color red)
- ("c" org-overview "Previous heading" :color red)
- ("O" ivy-org-jump-to-open-headline "All Org headings - ivy" :color red)
- ("S" sr/fun/org-search "Org directory search"))))
+ ("Journal"
+ (("j" org-journal-new-entry "Entry" :color blue)
+ ("F" org-journal-new-scheduled-entry "Future scheduled"))
+ "Navigation"
+ (("J" org-journal-open-current-journal-file "Open Today" :color blue)
+ ("k" org-journal-open-next-entry "Next entry" :color red)
+ ("h" org-journal-open-previous-entry "Previous entry" :color red)
+ ("n" (org-speed-move-safe 'org-next-visible-heading) "Next heading" :color red)
+ ("b" (org-speed-move-safe 'org-previous-visible-heading) "Previous heading" :color red))
+ "View"
+ (("c" org-overview "Collapse headlines" :color red)
+ ("a" org-show-all "Expand all headlines" :color red)
+ ("v" scroll-up "Scroll up C-v" :color red)
+ )
+ "Search and Jump"
+ (("S" sr/fun/org-journal-search "Journal search")
+ ("g" counsel-org-goto "Buffer org headings" :color red)
+ ("o" helm-org-rifle "Helm org rifle" :color red)
+ ("" helm-org-rifle "Helm org rifle" :color red)
+ ("s" sr/fun/org-search "Org directory search"))))
(global-set-key (kbd "H-j") (lambda () (interactive) (hera-start 'hydra-journal/body)))
#+END_SRC
@@ -6123,28 +8023,30 @@ With ARG, swap them instead."
** hydra-clock [1/2]
:PROPERTIES:
:ID: 693EC203-0897-4032-9873-62FC71277584
+:CUSTOM_ID: h:828936F9-4E2C-43A1-981C-99F6FA85A6B4
:END:
- [ ] I will need to integrate this down the line with shortcuts for org mode.
- [X] Added the shortcuts to jump to the last captured heading and also
to switch back to the previous buffer. This will be useful when
- capture buffers are dismissed by mistake.
+ capture buffers are dismissed by mistake.
#+BEGIN_SRC emacs-lisp
(nougat-hydra hydra-clock (:color blue)
-("clock"
-(("j" counsel-org-clock-goto "clock go to current/last" :color red)
- ("i" counsel-org-clock-history "counsel clock in/historyo" :color blue)
- ("c" counsel-org-clock-context "counsel clock context" :color blue)
- ("o" org-clock-out "clock out" :color red)
- ("l" org-capture-goto-last-stored "Go to last capture stored" :color red)
- (";" switch-to-prev-buffer "Previous buffer" :color red)
- ("h" org-mru-clock-in "mru clock in" :color blue))))
+ ("clock"
+ (("j" counsel-org-clock-goto "clock go to current/last" :color red)
+ ("i" counsel-org-clock-history "counsel clock in/historyo" :color blue)
+ ("c" counsel-org-clock-context "counsel clock context" :color blue)
+ ("o" org-clock-out "clock out" :color red)
+ ("l" org-capture-goto-last-stored "Go to last capture stored" :color red)
+ (";" switch-to-prev-buffer "Previous buffer" :color red)
+ ("h" org-mru-clock-in "mru clock in" :color blue))))
#+END_SRC
** hydra-links
:PROPERTIES:
:ID: 598D93F4-CD40-49D4-AA10-275F45148AD2
+:CUSTOM_ID: h:A80C7523-2E9F-4683-BB3D-521409C87FE4
:END:
- [ ] [[https://beepb00p.xyz/pkm-search.html#web][Building personal search infrastructure for your knowledge and
@@ -6164,30 +8066,34 @@ With ARG, swap them instead."
("b" bongo "wiktionary lookup" :color red)
("i" mu4e-compose-attach-captured-message "Insert captured mu4e mail in compose" :color blue)
("m" mw-thesaurus-lookup-at-point "Merriam-webster thesaurus" :color red))
- "Music"
- (("b" bongo "bongo" :color blue)
- ("l" bongo-library "Bongo library" :color blue)
- ("p" bongo-play-previous "Play previous" :color red)
- ("n" bongo-play-next "Play next" :color red))))
+ "Music"
+ (("b" bongo "bongo" :color blue)
+ ("l" bongo-library "Bongo library" :color blue)
+ ("p" bongo-play-previous "Play previous" :color red)
+ ("s" bongo-seek "Seek" :color red)
+ ("b" bongo-pause/resume "Pause/resume" :color red)
+ ("n" bongo-play-next "Play next" :color red))))
#+END_SRC
** hydra-brain
:PROPERTIES:
:ID: A99388A9-D6F7-4379-ABA4-AE061BDC5AC6
+:CUSTOM_ID: h:3E915E4C-1715-4649-A657-15E59C515202
:END:
#+BEGIN_SRC emacs-lisp
(nougat-hydra hydra-brain (:color blue)
-("brain"
-(("b" helm-brain "helm-brain" :color blue)
-("s" helm-org-rifle-brain "helm rifle brain" :color blue)
-("r" org-brain-refile "refile to brain" :color blue)
-("v" org-brain-visualize "Org brain visualize" :color blue))))
+ ("brain"
+ (("b" helm-brain "helm-brain" :color blue)
+ ("s" helm-org-rifle-brain "helm rifle brain" :color blue)
+ ("r" org-brain-refile "refile to brain" :color blue)
+ ("v" org-brain-visualize "Org brain visualize" :color blue))))
#+END_SRC
** hydra-functions
:PROPERTIES:
:ID: 367212A1-1091-49C5-865D-44E6A128C872
+:CUSTOM_ID: h:93642C1A-3715-40BF-8686-B26F60F0BD3B
:END:
This is an attempt to collect some functions that I presume to use on a
@@ -6203,29 +8109,37 @@ eyebrowse and restoring the org-refile command
#+BEGIN_SRC emacs-lisp
(nougat-hydra hydra-functions (:color blue)
-("functions"
-(("j" helm-org-rifle "helm org rifle" :color blue)
-("r" org-refile "org refile" :color blue)
-("hb" helm-org-rifle-current-buffer "helm org rifle current buffer" :color red)
-("hsp" helm-multi-swoop-projectile "helm multi swoop projectile" :color red)
-("hsm" helm-multi-swoop "helm multi swoop" :color blue)
-("en" eyebrowse-rename-window-config "eyebrowse rename" :color red)
-("ec" eyebrowse-create-window-config "eyebrowse create" :color red)
-("es" eyebrowse-switch-to-window-config "eyebrowse switch" :color blue)
-("[" winner-undo "winner UNDO" :color red)
-("]" winner-redo "winner REDO" :color red)
-("sp" sr/fun/proj-search "Ag PROJECTS directory" :color blue)
-("so" sr/fun/org-search "Ag ORG directory" :color blue)
-("og" oddmuse-go "oddmuse go" :color red)
-("on" oddmuse-new "oddmuse new" :color blue)
-("or" oddmuse-rc "oddmuse rc" :color red)
-("os" oddmuse-search "oddmuse search" :color red)
-("oi" oddmuse-insert-link "oddmuse insert lnk" :color blue)
-("om" oddmuse-insert-page-name "oddmuse insert page name" :color red))))
+ ("Helm org rifle"
+ (("j" helm-org-rifle "helm org rifle" :color blue)
+ ("hb" helm-org-rifle-current-buffer "helm org rifle current buffer" :color red))
+ "Helm Swoop"
+ (("hsp" helm-multi-swoop-projectile "helm multi swoop projectile" :color red)
+ ("hsm" helm-multi-swoop "helm multi swoop" :color blue))
+ "Other"
+ (("r" org-refile "org refile" :color blue)
+ ("e" hydra-eyebrowse/body "eyebrowse functions" :color red))
+ "Winner mode"
+ (("[" winner-undo "winner UNDO" :color red)
+ ("]" winner-redo "winner REDO" :color red))
+ "Search"
+ (("sp" sr/fun/proj-search "Ag PROJECTS directory" :color blue)
+ ("so" sr/fun/org-search "Ag ORG directory" :color blue))
+ "Oddmuse"
+ (("og" oddmuse-go "oddmuse go" :color red)
+ ("oe" oddmuse-edit "oddmuse edit" :color red)
+ ("on" oddmuse-new "oddmuse new" :color blue)
+ ("or" oddmuse-rc "oddmuse rc" :color red)
+ ("os" oddmuse-search "oddmuse search" :color red)
+ ("oi" oddmuse-insert-link "oddmuse insert lnk" :color blue)
+ ("om" oddmuse-insert-page-name "oddmuse insert page name" :color red))))
#+END_SRC
** hydra-eyebrowse
+:PROPERTIES:
+:ID: 6DB2E625-10DC-4E4B-B569-90221F419C4D
+:CUSTOM_ID: h:537FB8B2-E46C-42DF-8B8F-0D4B0C7BE234
+:END:
It is time to have a faster hydra for eyebrowse. The common functions that I
use are renaming are captured below. These enable me to quickly switch
@@ -6235,70 +8149,75 @@ their own views.
#+BEGIN_SRC emacs-lisp
(nougat-hydra hydra-eyebrowse (:color blue)
-("eyebrowse"
-(("r" eyebrowse-rename-window-config "rename" :color red)
-("c" eyebrowse-create-window-config "create" :color red)
-("s" eyebrowse-switch-to-window-config "switch" :color blue)
-("l" eyebrowse-last-window-config "last window config" :color rede)
-("<" eyebrowse-previous-window-config "previous window config" :color red)
-(">" eyebrowse-next-window-config "previous window config" :color red)
-("[" winner-undo "winner UNDO" :color red)
-("]" winner-redo "winner REDO" :color red)
-("ps" sr/fun/proj-search "Ag PROJECTS directory" :color blue)
-("os" sr/fun/org-search "Ag ORG directory" :color blue))))
+ ("eyebrowse"
+ (("r" eyebrowse-rename-window-config "rename" :color red)
+ ("c" eyebrowse-create-window-config "create" :color red)
+ ("s" eyebrowse-switch-to-window-config "switch" :color blue)
+ ("l" eyebrowse-last-window-config "last window config" :color rede)
+ ("<" eyebrowse-previous-window-config "previous window config" :color red)
+ (">" eyebrowse-next-window-config "previous window config" :color red)
+ ("[" winner-undo "winner UNDO" :color red)
+ ("]" winner-redo "winner REDO" :color red)
+ ("ps" sr/fun/proj-search "Ag PROJECTS directory" :color blue)
+ ("os" sr/fun/org-search "Ag ORG directory" :color blue))))
#+END_SRC
** hydra-perspective
:PROPERTIES:
:ID: B3144404-6F5A-47E5-A5DB-11D96BE64111
+:CUSTOM_ID: h:C6C50314-5263-4BBC-B2BA-42B4FAE710B6
:END:
This is a hydra for accessing perspective-el.
#+BEGIN_SRC emacs-lisp
(nougat-hydra hydra-perspective (:color red)
-("Navigation"
-(("[" persp-prev "previous perspective" :color red)
- ("]" persp-next "next perspective" :color red)
- ("s" persp-switch "switch perspective" :color blue)
- ("l" persp-switch-last "Last persective" :color red)
-("b" persp-ivy-switch-buffer "switch persp buffer" :color red))
-"State Modification"
-(("x" persp-state-save "save perspective state" red)
- ("r" persp-rename "rename persp" :color red)
- ("K" persp-remove-buffer "remove buffer from perspective" :color red)
-("a" persp-add-buffer "Add buffer to persp" :color blue)
- ("k" persp-kill "kill perspective" :color red))
-"State Load and import"
- (("o" persp-state-load "Load perspective" :color red)
- ("i" persp-import "import perspective" :color blue))
-"General"
- (("p" projectile-persp-switch-project "Project: persp switch" :color blue)
- ("e" hydra-eyebrowse/body "hydra eyebrowse" :color blue))))
+ ("Navigation"
+ (("[" persp-prev "previous perspective" :color red)
+ ("]" persp-next "next perspective" :color red)
+ ("s" persp-switch "switch perspective" :color blue)
+ ("l" persp-switch-last "Last persective" :color red)
+ ("b" persp-ivy-switch-buffer "switch persp buffer" :color red))
+ "State Modification"
+ (("x" persp-state-save "save perspective state" red)
+ ("r" persp-rename "rename persp" :color red)
+ ("K" persp-remove-buffer "remove buffer from perspective" :color red)
+ ("a" persp-add-buffer "Add buffer to persp" :color blue)
+ ("k" persp-kill "kill perspective" :color red))
+ "State Load and import"
+ (("o" persp-state-load "Load perspective" :color red)
+ ("i" persp-import "import perspective" :color blue))
+ "General"
+ (("p" projectile-persp-switch-project "Project: persp switch" :color blue)
+ ("e" hydra-eyebrowse/body "hydra eyebrowse" :color blue))))
#+END_SRC
** TODO COMMENT hydra-dumb-jump
+:PROPERTIES:
+:CUSTOM_ID: h:2A06219B-D2E2-465C-A430-26D6A489F65C
+:END:
#+BEGIN_SRC emacs-lisp
(nougat-hydra hydra-eyebrowse (:color blue)
-("dumb-jump"
-(("r" eyebrowse-rename-window-config "rename" :color red))))
+ ("dumb-jump"
+ (("r" eyebrowse-rename-window-config "rename" :color red))))
(defhydra dumb-jump-hydra (:color blue :columns 3)
- "Dumb Jump"
- ("j" dumb-jump-go "Go")
- ("o" dumb-jump-go-other-window "Other window")
- ("e" dumb-jump-go-prefer-external "Go external")
- ("x" dumb-jump-go-prefer-external-other-window "Go external other window")
- ("i" dumb-jump-go-prompt "Prompt")
- ("l" dumb-jump-quick-look "Quick look")
- ("b" dumb-jump-back "Back"))
+ "Dumb Jump"
+ ("j" dumb-jump-go "Go")
+ ("o" dumb-jump-go-other-window "Other window")
+ ("e" dumb-jump-go-prefer-external "Go external")
+ ("x" dumb-jump-go-prefer-external-other-window "Go external other window")
+ ("i" dumb-jump-go-prompt "Prompt")
+ ("l" dumb-jump-quick-look "Quick look")
+ ("b" dumb-jump-back "Back"))
#+END_SRC
** TODO hydra-jumper
:PROPERTIES:
:ID: 0E96A1C4-2660-4062-8959-8CFCEC8EFEF5
+:CUSTOM_ID: h:8002382F-4F56-41EA-8D40-E8072F5C61C1
:END:
Thanks to jamzattack on #Emacs, I was able to push the current point to
@@ -6307,24 +8226,29 @@ option as this pushes to the current location Org and Emacs mark ring at the sam
#+BEGIN_SRC emacs-lisp
(nougat-hydra hydra-jumper (:color red)
-("Code and blocks"
- (("b" scimax-jump-to-block "Jump to block" :color red))
- "Mark ring"
- (("m" helm-mark-ring "helm local mark ring" :color red)
- ("n" helm-global-mark-ring
- "helm global mark ring" :color red)
-("o" org-mark-ring-goto
- "org mark ring goto" :color red)
- ;; ("," (push (point-marker) mark-ring) "Push location mark ring" :color red)
- ("," org-mark-ring-push "Push to org and Emacs mark ring" :color red))
- "Headlines"
- (("j" helm-org-rifle "helm org rifle" :color red)
- ("h" ivy-org-jump-to-open-headline "ivy jump to org headline" :color red)
- ("l" hydra-clock/org-capture-goto-last-stored "Last captured heading" :color red))
- "Misc"
- (("r" scimax-registers/body "scimax register hydra" :color blue)
- ("dl" crux-duplicate-current-line-or-region "crux duplicate line/region" :color blue)
- ("dc" crux-duplicate-and-comment-current-line-or-region "crux duplicate + comment line/region" :color blue))))
+ ("Code and blocks"
+ (("b" scimax-jump-to-block "Jump to block" :color red))
+ "Mark ring"
+ (("m" helm-mark-ring "helm local mark ring" :color red)
+ ("n" helm-global-mark-ring
+ "helm global mark ring" :color red)
+ ("o" org-mark-ring-goto
+ "org mark ring goto" :color red)
+ ;; ("," (push (point-marker) mark-ring) "Push location mark ring" :color red)
+ ("," org-mark-ring-push "Push to org and Emacs mark ring" :color red))
+ "Headlines"
+ (("j" helm-org-rifle "helm org rifle" :color red)
+ ("h" ivy-org-jump-to-open-headline "ivy jump to org headline" :color red)
+ ("l" hydra-clock/org-capture-goto-last-stored "Last captured heading" :color red))
+ "Dired Searches and Ops"
+ (("dg" find-grep-dired "Find grep dired" :color red)
+ ("dn" find-name-dired "Find name dired" :color red)
+ ("dw" dired-find-file-other-window "Find file other window" :color blue)
+ ("ds" scimax-dired/body "Scimax dired hydra" :color blue))
+ "Misc"
+ (("r" scimax-registers/body "scimax register hydra" :color blue)
+ ("dl" crux-duplicate-current-line-or-region "crux duplicate line/region" :color blue)
+ ("dc" crux-duplicate-and-comment-current-line-or-region "crux duplicate + comment line/region" :color blue))))
;; note that there are several other jump and movement functions defined in scimax hydras.
(global-set-key (kbd "H-k") 'hydra-jumper/body)
@@ -6333,6 +8257,7 @@ option as this pushes to the current location Org and Emacs mark ring at the sam
** TODO hydra-org-roam
:PROPERTIES:
:ID: A829ED34-FB49-46C9-8299-A7D1476802B9
+:CUSTOM_ID: h:62E47AF9-A7E9-43EC-8826-DDAE12241762
:END:
- [ ] Jump to org-roam buffer and back.
@@ -6343,23 +8268,23 @@ option as this pushes to the current location Org and Emacs mark ring at the sam
#+BEGIN_SRC emacs-lisp
(nougat-hydra hydra-org-roam (:color red)
-("Insert"
- (("i" org-roam-insert-immediate "insert immediate" :color blue)
- ("u" org-roam-insert "insert with capture" :color red)
- ("9" company-org-roam "company org roam" :color blue)
- ("u" org-ref-url-html-to-bibtex "URL to bibtex" :color blue))
-"Window"
- (("o" org-roam "Org roam window" :color red)
- ("[" winner-undo "winner UNDO" :color red)
- ("]" winner-redo "winner REDO" :color red))
-"Jumping"
-(("f" org-roam-find-file "find file" :color red)
- ("h" ivy-org-jump-to-open-headline "ivy jump to org headline" :color red)
- ("l" hydra-clock/org-capture-goto-last-stored "Last captured heading" :color red)
- ("r" scimax-registers/body "scimax register hydra" :color blue))
-"Editing"
-(("dl" crux-duplicate-current-line-or-region "crux duplicate line/region" :color red)
- ("dc" crux-duplicate-and-comment-current-line-or-region "crux duplicate + comment line/region" :color red))))
+ ("Insert"
+ (("i" org-roam-insert-immediate "insert immediate" :color blue)
+ ("u" org-roam-insert "insert with capture" :color red)
+ ("9" company-org-roam "company org roam" :color blue)
+ ("u" org-ref-url-html-to-bibtex "URL to bibtex" :color blue))
+ "Window"
+ (("o" org-roam "Org roam window" :color red)
+ ("[" winner-undo "winner UNDO" :color red)
+ ("]" winner-redo "winner REDO" :color red))
+ "Jumping"
+ (("f" org-roam-find-file "find file" :color red)
+ ("h" ivy-org-jump-to-open-headline "ivy jump to org headline" :color red)
+ ("l" hydra-clock/org-capture-goto-last-stored "Last captured heading" :color red)
+ ("r" scimax-registers/body "scimax register hydra" :color blue))
+ "Editing"
+ (("dl" crux-duplicate-current-line-or-region "crux duplicate line/region" :color red)
+ ("dc" crux-duplicate-and-comment-current-line-or-region "crux duplicate + comment line/region" :color red))))
(global-set-key (kbd "H-o") (lambda () (interactive) (hera-start 'hydra-org-roam/body)))
@@ -6368,6 +8293,7 @@ option as this pushes to the current location Org and Emacs mark ring at the sam
** TODO hydra-git
:PROPERTIES:
:ID: 66EF7974-003B-4D21-9FFB-5BC5B5B253C2
+:CUSTOM_ID: h:253A6B33-F50E-4EB4-AC29-752A1AAEE73E
:END:
- Note taken on [2020-05-23 Sat 11:02] \\
paste region does not seem to work as expected. The mistake seems to
@@ -6384,46 +8310,71 @@ a chunk.
#+BEGIN_SRC emacs-lisp
(nougat-hydra hydra-git (:color blue)
-("Pastes and gists"
-(("g" (gist-region-or-buffer) "public gist")
-("G" gist-region-or-buffer-private "private gist")
-("b" (browse-url "https://gist.github.com/shrysr") "browse gists")
-("pb" webpaste-paste-buffer "webpaste buffer")
-("pr" webpaste-paste-buffer-or-region "webpaste selected region"))
-"Git"
-(("m" git-gutter:mark-hunk "mark hunk" :color red )
- ("s" git-gutter:stage-hunk "stage hunk" :color red)
- ("n" git-gutter:next-hunk "next hunk" :color red)
- ("v" magit-status "magit status" :color red)
- ("p" git-gutter:previous-hunk "previous hunk" :color red))))
+ ("Pastes and gists"
+ (("g" (gist-region-or-buffer) "public gist")
+ ("G" gist-region-or-buffer-private "private gist")
+ ("b" (browse-url "https://gist.github.com/shrysr") "browse gists")
+ ("wb" webpaste-paste-buffer "webpaste buffer")
+ ("wr" webpaste-paste-region "webpaste selected region" :color blue))
+ "Git"
+ (("m" git-gutter:mark-hunk "mark hunk" :color red )
+ ("s" git-gutter:stage-hunk "stage hunk" :color red)
+ ("n" git-gutter:next-hunk "next hunk" :color red)
+ ("v" magit-status "magit status" :color red)
+ ("p" git-gutter:previous-hunk "previous hunk" :color red))))
#+END_SRC
* COMMENT Elfeed :elfeed:
+:PROPERTIES:
+:CUSTOM_ID: h:50CDCFC0-5D63-44F0-BA8D-6793B0FEC0F6
+:END:
- Note taken on [2019-09-25 Wed 14:09] \\
Scimax's elfeed is enabled, along with elfeed-org and elfeeed-goodies
- Note taken on [2019-07-08 Mon 08:10] \\
Disabling elfeed for now.
+** Prot's configuration
+:PROPERTIES:
+:CUSTOM_ID: h:E36380FD-5AE7-44FC-8327-DDC7586E0751
+:END:
+
+#+BEGIN_SRC emacs-lisp
+(use-package elfeed
+ :straight t
+ :config
+ (setq elfeed-use-curl t)
+ (setq elfeed-curl-max-connections 10)
+ (setq elfeed-db-directory "~/temp/elfeed/")
+ (setq elfeed-enclosure-default-dir "~/Downloads/")
+ (setq elfeed-search-filter "@4-months-ago +unread")
+ (setq elfeed-sort-order 'descending)
+ (setq elfeed-search-clipboard-type 'CLIPBOARD)
+ (setq elfeed-search-title-max-width 100)
+ (setq elfeed-search-title-min-width 30)
+ (setq elfeed-search-trailing-width 25)
+ (setq elfeed-show-truncate-long-urls t)
+ (setq elfeed-show-unique-buffers t))
+#+END_SRC
+
** Scimax + Elfeed-org and elfeed-goodies setup [/]
:PROPERTIES:
:ID: 8302d89f-756b-4a47-87aa-3f3df5a39a3f
+:CUSTOM_ID: h:70988842-F535-422C-A487-9DD062F4D307
:END:
Using an org source is the easiest way to organise my RSS feeds for reading with Elfeed.
#+BEGIN_SRC emacs-lisp
-(straight-use-package 'elfeed)
+;; (straight-use-package 'elfeed)
;; use an org file to organise feeds
(use-package elfeed-org
:ensure t
:config
- (setq rmh-elfeed-org-files (list "~/my_org/elfeed.org"))
- )
+ (setq rmh-elfeed-org-files (list "~/my_org/roam/elfeed.org")))
(use-package elfeed-goodies
:ensure t
:init
- (elfeed-goodies/setup)
- )
+ (elfeed-goodies/setup))
;; (require 'scimax-elfeed)
@@ -6432,6 +8383,9 @@ Using an org source is the easiest way to organise my RSS feeds for reading with
#+RESULTS:
** Elfeed get full entry
+:PROPERTIES:
+:CUSTOM_ID: h:BE005FF2-F9F9-464D-9560-D9D591257FE9
+:END:
Source: [[https://punchagan.muse-amuse.in/blog/elfeed-hook-to-fetch-full-content/][Elfeed hook to fetch full content - Noetic Nought]]
@@ -6462,6 +8416,9 @@ Source: [[https://punchagan.muse-amuse.in/blog/elfeed-hook-to-fetch-full-content
| pc/get-entry-content | elfeed-goodies/html-decode-title | elfeed-org-run-new-entry-hook |
** COMMENT Elfeed Basic + Customisations
+:PROPERTIES:
+:CUSTOM_ID: h:1BCB92CA-9950-4948-BF97-2540B6A94FE4
+:END:
- Note taken on [2020-03-28 Sat 15:50] \\
This was my earlier configuration. However, there are issues with the save db feature and I am anyway not really syncing across computers anymore. I read feeds on my VPS. Scimax's elfeed customisations provide me the functions that I need as I can easily email an article to instapaper or anywhere else. However, these remain here for reference, as there are some useful functions here.
@@ -6476,9 +8433,9 @@ Source: [[http://heikkil.github.io/blog/2015/05/09/notes-from-elfeed-entries/][N
("D" . bjm/elfeed-show-daily)
("q" . bjm/elfeed-save-db-and-bury))
:init
- (setq my/default-elfeed-search-filter "@1-month-ago +unread !sport ")
+ (setq my/default-elfeed-search-filter "@4-months-ago +unread !sport ")
(setq-default elfeed-search-filter my/default-elfeed-search-filter)
- (setq elfeed-db-direcory "~/scimax/user/elfeeddb")
+ (setq elfeed-db-direcory "~/my_org/roam/private/emacs_meta/elfeeddb")
:config
(elfeed-org)
(elfeed-goodies/setup)
@@ -6547,7 +8504,7 @@ Source: [[http://heikkil.github.io/blog/2015/05/09/notes-from-elfeed-entries/][N
("l" . elfeed-search-link-title)
("v" . elfeed-search-quick-url-note))
- ;;functions to support syncing .elfeed between machines
+ ;;functions to support syncing .elfeed between machines
;;makes sure elfeed reads index from disk before launching
(defun bjm/elfeed-load-db-and-open ()
"Wrapper to load the elfeed db from disk before opening"
@@ -6569,6 +8526,9 @@ Source: [[http://heikkil.github.io/blog/2015/05/09/notes-from-elfeed-entries/][N
: bjm/elfeed-save-db-and-bury
** COMMENT TEST Removing Scimax's default colors
+:PROPERTIES:
+:CUSTOM_ID: h:83CFCEFE-41AC-4CE5-9FA3-BE2179E70FA5
+:END:
#+BEGIN_SRC emacs-lisp :tangle no
(set-face-attribute 'python-elfeed-entry nil :background nil :weight 'normal)
@@ -6578,9 +8538,13 @@ Source: [[http://heikkil.github.io/blog/2015/05/09/notes-from-elfeed-entries/][N
#+END_SRC
* eww
-*** Default browser to be eww and basic settings
+:PROPERTIES:
+:CUSTOM_ID: h:8C4B1E3B-0D84-44D3-95B7-429155F2B90A
+:END:
+** Default browser to be eww and basic settings
:PROPERTIES:
:ID: 97B74055-86BA-4471-853C-96BD35055AF5
+:CUSTOM_ID: h:AFE6F3C2-0B4D-4A21-A109-D005AE6DBF74
:END:
#+BEGIN_SRC emacs-lisp
@@ -6590,25 +8554,27 @@ Source: [[http://heikkil.github.io/blog/2015/05/09/notes-from-elfeed-entries/][N
#+RESULTS:
: eww-browse-url
-*** Keyboard map for default external browser
+** Keyboard map for default external browser
:PROPERTIES:
:ID: 5E6E35E7-08EF-47F1-AFC0-ADE231C4BD38
+:CUSTOM_ID: h:AFB6CDF7-DCB5-4A4C-A5C2-C8D67C29C165
:END:
#+BEGIN_SRC emacs-lisp
;; Open the current URL in the default external browser
(eval-after-load 'eww
'(progn
- (define-key eww-mode-map "o" 'eww-browse-with-external-browser)
+ (define-key eww-mode-map "O" 'eww-browse-with-external-browser)
))
#+END_SRC
#+RESULTS:
: eww-browse-with-external-browser
-*** Wikipedia search
+** Wikipedia search
:PROPERTIES:
:ID: 1E0D1DBF-8D54-472D-8B32-E1E371586389
+:CUSTOM_ID: h:77876541-1D57-45E5-ADDA-AABF08E642B6
:END:
#+BEGIN_SRC emacs-lisp
@@ -6633,9 +8599,10 @@ Source: [[http://heikkil.github.io/blog/2015/05/09/notes-from-elfeed-entries/][N
#+RESULTS:
: wikipedia-search
-*** Access Hacker News
+** Access Hacker News
:PROPERTIES:
:ID: 076038EA-5427-4C17-9530-7298911256F7
+:CUSTOM_ID: h:DBFC683F-4BD1-4716-BD21-B3F167F7543F
:END:
#+BEGIN_SRC emacs-lisp
@@ -6647,55 +8614,78 @@ Source: [[http://heikkil.github.io/blog/2015/05/09/notes-from-elfeed-entries/][N
#+RESULTS:
: hn
-*** Youtube music playlist
+** Youtube music playlist
:PROPERTIES:
:ID: 1096CA91-D712-42FE-A7D9-9FBED45F2EEC
+:CUSTOM_ID: h:0A64A3BE-8C4B-4462-9939-5C60613311A0
:END:
#+BEGIN_SRC emacs-lisp
(defun yt ()
(interactive)
- (browse-url "https://www.youtube.com/playlist?list=PLzDQK0UVrg2TiemiFoRmrwq-YbQ-Zn1AN"))
+ (browse-url-default-macosx-browser "https://www.youtube.com/playlist?list=PLzDQK0UVrg2TiemiFoRmrwq-YbQ-Zn1AN"))
#+END_SRC
-*** TODO Open specific browser depending on the URL
+** TODO Open specific browser depending on the URL
:PROPERTIES:
:ID: 19C305A8-367F-4BD8-9D3F-AF87CEDC910B
+:CUSTOM_ID: h:50C5A32C-C060-4AA9-AFC3-7C7CCC3F1BBC
:END:
- Note taken on [2020-05-11 Mon 20:57] \\
- I find that it is better to use eww as the default browser to maximise
- my use. From eww it is easier to access other websites.
+ I find that it is better to use eww as the default browser and have
+ specific websites open in the default browser. From eww it is easier
+ to access other websites through the bookmark system.
- Note taken on [2020-04-26 Sun 06:46] \\
The idea here is to gather the websites and links which work fine on eww
and have the remaining links open directly on the default web browser.
- Note taken on [2019-03-07 Thu 11:59] \\
- This is worth setting up. It would be convenient for frequently visited websites like reddit and others, to open in the external browser, especially as they do not render well within w3m.
+ This is worth setting up. It would be convenient for frequently
+ visited websites like reddit and others, to open in the external
+ browser, especially as they do not render well within w3m.
+
+Source :
+- http://ergoemacs.org/emacs/emacs_set_default_browser.Html
+- https://github.com/syl20bnr/spacemacs/
+
+
+- [ ] the setup below will not work on linux since the
+ browse-url-command would be different. This has to be improved.
-Source : http://ergoemacs.org/emacs/emacs_set_default_browser.Html
#+BEGIN_SRC emacs-lisp
;; use browser depending on url
(setq
browse-url-browser-function
'(
- ("wikipedia\\.org" . eww-browse-url)
- ("wiktionary\\.org" . eww-browse-url)
- ("github" . eww-browse-url)
- ("thefreedictionary\\.com" . eww-browse-url)
- ("link\\.wired\\.com" . eww-browse-url)
- ("links\\.gatesnotes\\.com" . eww-browse-url)
- ("bitbucket\\.org\\blog*+" . eww-browse-url)
- ("dev\\.to\*+" . eww-browse-url)
-;; ("." . browse-url-default-browser)
- ("." . eww-browse-url)
- ("youtube" . browse-url-default-macosx-browser)))
+ ("wikipedia\\.org" . eww-browse-url)
+ ("wiktionary\\.org" . eww-browse-url)
+ ("github\\.com*+" . browse-url-default-macosx-browser)
+ ("lunchlub\\.ai*+" . browse-url-default-macosx-browser)
+ ("linkedin\\.com*+" . browse-url-default-macosx-browser)
+ ("go1\\.mode\\.com*+" . browse-url-default-macosx-browser)
+ ("jobbank\\.gc\\.ca*+" . browse-url-default-macosx-browser)
+ ("portal\\.healthmyself\\.net*+" . browse-url-default-macosx-browser)
+ ("thefreedictionary\\.com" . eww-browse-url)
+ ("link\\.wired\\.com*+" . eww-browse-url)
+ ("links\\.gatesnotes\\.com" . eww-browse-url)
+ ("bitbucket\\.org\\\\blog*+" . eww-browse-url)
+ ("dev\\.to\*+" . eww-browse-url)
+ ;; ("." . browse-url-default-browser)
+ ("." . eww-browse-url)
+ ("*youtube\\.com" . browse-url-default-macosx-browser)))
#+END_SRC
#+RESULTS:
: ((wikipedia\.org . eww-browse-url) (github . eww-browse-url) (thefreedictionary\.com . eww-browse-url) (. . browse-url-default-browser))
-* New Scimax port
+* TODO New Scimax port
+:PROPERTIES:
+:CUSTOM_ID: h:568C5130-2E2C-41BE-BD93-39FB7F1DA850
+:END:
+
+- Note taken on [2020-08-20 Thu 01:37] \\
+ THis is not yet setup satisfactorily.
I am currently sourcing these portions of scimax from a forked
repository. Portions of the scimax setup packages are modified to work
@@ -6704,115 +8694,77 @@ headings below. The package list has been extracted into separate
use-packages and settings for the same. ob-ipython and John's
enhancements ot the same are also incorporated.
+
+
** COMMENT Adding scimax folder to load path
:PROPERTIES:
:ID: 07625F90-FBFE-46A1-8FDE-2E4D0B664B9D
+:CUSTOM_ID: h:74D4B19E-F17D-4F1F-8FC8-66A0B26C430B
:END:
- Note taken on [2020-07-12 Sun 18:50] \\
This is no longer necessary, and also introduces errors, unless the
upstream code is included without modifications, especially packages.el
-#+BEGIN_SRC emacs-lisp :results silent
-;; (add-to-list 'load-path (sr/fun/scimax-ref-dir "scimax-stuff"))
-;; (defvar scimax-dir (sr/fun/scimax-ref-dir "scimax-stuff"))
-#+END_SRC
-
-** org-ref
-:PROPERTIES:
-:ID: D74176E1-6899-442A-9C7A-B2193C7ADCF7
-:END:
-- Note taken on [2020-03-11 Wed 23:18] \\
- Apparently, the scimax org-ref module required the gitter package. This is strange because it is pulled in as a git submodule. However, the issue was resolved when org-ref was pulled in from it's own repo.
-
-#+BEGIN_SRC emacs-lisp
- (use-package org-ref
- :straight (org-ref :host github :repo "jkitchin/org-ref")
-:config
-(require 'doi-utils)
-(require 'org-ref-wos)
-(require 'org-ref-pubmed)
-(require 'org-ref-arxiv)
-(require 'org-ref-bibtex)
-(require 'org-ref-pdf)
-(require 'org-ref-url-utils)
-(require 'org-ref-helm)
-(require 'org-ref-isbn)
-
-(setq org-ref-completion-library 'org-ref-ivy-cite)
-;; note and bib location
-
-(setq org-ref-bibliography-notes "~/my_org/references/references.org"
- org-ref-bibliography-notes "~/my_org/references/research_notes.org"
- org-ref-default-bibliography '("~/my_org/references/references.bib")
- org-ref-pdf-directory "~/my_org/references/pdfs/")
-
-;; setting up helm-bibtex
-(setq helm-bibtex-bibliography "~/my_org/references/references.bib"
- helm-bibtex-library-path "~/my_org/org/references/pdfs"
- helm-bibtex-notes-path "~/my_org/references/research_notes.org")
-
-(setq bibtex-autokey-year-length 4
- bibtex-autokey-name-year-separator "-"
- bibtex-autokey-year-title-separator "-"
- bibtex-autokey-titleword-separator "-"
- bibtex-autokey-titlewords 2
- bibtex-autokey-titlewords-stretch 1
- bibtex-autokey-titleword-length 5
- org-ref-bibtex-hydra-key-binding (kbd "H-b")))
-#+END_SRC
-
-#+RESULTS:
-: t
-** scimax-org port
-*** General Org mode related
-:PROPERTIES:
-:ID: 064C080D-4C7E-4EA5-A173-2EA058A7B19A
-:END:
-
-#+BEGIN_SRC emacs-lisp
-(require 'org-inlinetask)
-(require 'org-mouse)
-
-;; Make editing invisible regions smart
-(setq org-catch-invisible-edits 'smart)
-
-;; allow lists with letters in them.
-(setq org-list-allow-alphabetical t)
-
-(setq org-src-tab-acts-natively t)
-
-(setq org-use-speed-commands t)
-
-(add-to-list 'org-speed-commands-user (cons "P" 'org-set-property))
-(add-to-list 'org-speed-commands-user (cons "d" 'org-deadline))
-
-;; Mark a subtree
-(add-to-list 'org-speed-commands-user (cons "m" 'org-mark-subtree))
-
-;; Widen
-(add-to-list 'org-speed-commands-user (cons "S" 'widen))
-
-;; kill a subtree
-(add-to-list 'org-speed-commands-user (cons "k" (lambda ()
- (org-mark-subtree)
- (kill-region
- (region-beginning)
- (region-end)))))
-
-;; Jump to headline
-(add-to-list 'org-speed-commands-user
- (cons "q" (lambda ()
- (avy-with avy-goto-line
- (avy--generic-jump "^\\*+" nil avy-style)))))
+#+BEGIN_SRC emacs-lisp :results silent
+;; (add-to-list 'load-path (sr/fun/scimax-ref-dir "scimax-stuff"))
+;; (defvar scimax-dir (sr/fun/scimax-ref-dir "scimax-stuff"))
+#+END_SRC
+
+** org-ref
+:PROPERTIES:
+:ID: D74176E1-6899-442A-9C7A-B2193C7ADCF7
+:CUSTOM_ID: h:E63B034B-5895-4CE8-B68F-9EAA09213301
+:END:
+- Note taken on [2020-03-11 Wed 23:18] \\
+ Apparently, the scimax org-ref module required the gitter package. This is strange because it is pulled in as a git submodule. However, the issue was resolved when org-ref was pulled in from it's own repo.
+#+BEGIN_SRC emacs-lisp
+(use-package org-ref
+ :straight (org-ref :host github :repo "jkitchin/org-ref")
+ :config
+ (require 'doi-utils)
+ (require 'org-ref-wos)
+ (require 'org-ref-pubmed)
+ (require 'org-ref-arxiv)
+ (require 'org-ref-bibtex)
+ (require 'org-ref-pdf)
+ (require 'org-ref-url-utils)
+ (require 'org-ref-helm)
+ (require 'org-ref-isbn)
+
+ (setq org-ref-completion-library 'org-ref-ivy-cite)
+ ;; note and bib location
+
+ (setq org-ref-bibliography-notes "~/my_org/roam/references/references.org"
+ org-ref-bibliography-notes "~/my_org/roam/references/research_notes.org"
+ org-ref-default-bibliography '("~/my_org/roam/references/references.bib")
+ org-ref-pdf-directory "~/my_org/roam/references/pdfs/")
+
+ ;; setting up helm-bibtex
+ (setq helm-bibtex-bibliography "~/my_org/roam/references/references.bib"
+ helm-bibtex-library-path "~/my_org/roam/references/pdfs"
+ helm-bibtex-notes-path "~/my_org/roam/references/research_notes.org")
+
+ (setq bibtex-autokey-year-length 4
+ bibtex-autokey-name-year-separator "-"
+ bibtex-autokey-year-title-separator "-"
+ bibtex-autokey-titleword-separator "-"
+ bibtex-autokey-titlewords 2
+ bibtex-autokey-titlewords-stretch 1
+ bibtex-autokey-titleword-length 5
+ org-ref-bibtex-hydra-key-binding (kbd "H-b")))
#+END_SRC
#+RESULTS:
-: ((q lambda nil (avy-with avy-goto-line (avy--generic-jump ^\*+ nil avy-style))) (q lambda nil (let ((avy-keys (or (cdr (assq (quote avy-goto-line) avy-keys-alist)) avy-keys)) (avy-style (or (cdr (assq (quote avy-goto-line) avy-styles-alist)) avy-style)) (avy-command (quote avy-goto-line))) (setq avy-action nil) (fset (quote avy-resume) (function (lambda nil (interactive) (avy--generic-jump ^\*+ nil avy-style)))) (avy--generic-jump ^\*+ nil avy-style))) (k lambda nil (org-mark-subtree) (kill-region (region-beginning) (region-end))) (S . widen) (m . org-mark-subtree) (d . org-deadline) (P . org-set-property))
-
+: t
+** scimax-org port
+:PROPERTIES:
+:CUSTOM_ID: h:3E88CF26-1ED5-4B5C-9C0B-A2118193827D
+:END:
*** Babel settings
:PROPERTIES:
:ID: BD32BC22-7F2B-4872-A950-23BDCB128CF9
+:CUSTOM_ID: h:0A4ADB25-0734-4FDC-94F8-DED3C4F461B8
:END:
#+BEGIN_SRC emacs-lisp
@@ -6832,9 +8784,9 @@ enhancements ot the same are also incorporated.
(matlab . nil)
(sqlite . t)
(ruby . nil)
- (perl . t)
+ ;; (erl . t)
(org . t)
- (dot . t)
+ ;; (dot . t)
(plantuml . t)
(R . t)
(fortran . nil)
@@ -6846,6 +8798,7 @@ enhancements ot the same are also incorporated.
;; use syntax highlighting in org-file code blocks
(setq org-src-fontify-natively t)
+
(setq org-babel-default-header-args:python
'((:results . "output replace")
(:session . "none")
@@ -6886,8 +8839,30 @@ enhancements ot the same are also incorporated.
*** Org formatting functions
:PROPERTIES:
:ID: DF1FBFBF-886B-4951-B077-105805A7A1AF
+:CUSTOM_ID: h:0DD1CE17-7611-4C68-9D68-E5B7FAB9338D
:END:
+These functions are lifted from Scimax. I would like these to be a part
+of a larger group of handy editing functions. I wonder if these are
+better placed in a hydra rather than relying on the super keys.
+
+We have the following functions here:
+
+1. org-markup-region-or-point
+2. org-italics-region-or-point
+3. org-bold-region-or-point
+4. org-underline-region-or-point
+5. org-code-region-or-point
+6. org-verbatim-region-or-point
+7. org-subscript-region-or-point
+8. org-superscript-region-or-point
+9. org-strikethrough-region-or-point
+
+
+- [ ] define a hydra for covering the above functions.
+
+
+
#+BEGIN_SRC emacs-lisp
;; * Markup commands for org-mode
@@ -6901,30 +8876,30 @@ subscripts and superscripts."
;; We have an active region we want to apply
((region-active-p)
(let* ((bounds (list (region-beginning) (region-end)))
- (start (apply 'min bounds))
- (end (apply 'max bounds))
- (lines))
+ (start (apply 'min bounds))
+ (end (apply 'max bounds))
+ (lines))
(unless (memq type '(subscript superscript))
- (save-excursion
- (goto-char start)
- (unless (looking-at " \\|\\<")
- (backward-word)
- (setq start (point)))
- (goto-char end)
- (unless (or (looking-at " \\|\\>")
- (looking-back "\\>" 1))
- (forward-word)
- (setq end (point)))))
+ (save-excursion
+ (goto-char start)
+ (unless (looking-at " \\|\\<")
+ (backward-word)
+ (setq start (point)))
+ (goto-char end)
+ (unless (or (looking-at " \\|\\>")
+ (looking-back "\\>" 1))
+ (forward-word)
+ (setq end (point)))))
(setq lines
- (s-join "\n" (mapcar
- (lambda (s)
- (if (not (string= (s-trim s) ""))
- (concat beginning-marker
- (s-trim s)
- end-marker)
- s))
- (split-string
- (buffer-substring start end) "\n"))))
+ (s-join "\n" (mapcar
+ (lambda (s)
+ (if (not (string= (s-trim s) ""))
+ (concat beginning-marker
+ (s-trim s)
+ end-marker)
+ s))
+ (split-string
+ (buffer-substring start end) "\n"))))
(setf (buffer-substring start end) lines)
(forward-char (length lines))))
;; We are on a word with no region selected
@@ -7052,6 +9027,7 @@ bound to anything.
*** Links and Jumping functions
:PROPERTIES:
:ID: 566F6D94-A39B-40D9-BD0A-321B56FC34B4
+:CUSTOM_ID: h:6DF595DA-64A1-48A1-A148-C5FFED203CFD
:END:
#+BEGIN_SRC emacs-lisp
@@ -7061,28 +9037,28 @@ bound to anything.
(org-link-set-parameters
"pydoc"
:follow (lambda (path)
- (pydoc path))
+ (pydoc path))
:export (lambda (path desc format)
- "Generate a url"
- (let (url)
- (setq url (cond
- ((s-starts-with? "scipy" path)
- (format
- "https://docs.scipy.org/doc/scipy/reference/generated/%s.html"
- path))
- ((s-starts-with? "numpy" path)
- (format
- "https://docs.scipy.org/doc/numpy/reference/generated/%s.html"
- path))
- (t
- (format
- "https://www.google.com/#safe=off&q=%s"
- path))))
-
-
- (cond
- ((eq format 'md)
- (format "[%s](%s)" (or desc path) url))))))
+ "Generate a url"
+ (let (url)
+ (setq url (cond
+ ((s-starts-with? "scipy" path)
+ (format
+ "https://docs.scipy.org/doc/scipy/reference/generated/%s.html"
+ path))
+ ((s-starts-with? "numpy" path)
+ (format
+ "https://docs.scipy.org/doc/numpy/reference/generated/%s.html"
+ path))
+ (t
+ (format
+ "https://www.google.com/#safe=off&q=%s"
+ path))))
+
+
+ (cond
+ ((eq format 'md)
+ (format "[%s](%s)" (or desc path) url))))))
(org-add-link-type
"pydoc"
(lambda (path)
@@ -7093,11 +9069,11 @@ bound to anything.
"attachfile"
:follow (lambda (link-string) (org-open-file link-string))
:export (lambda (keyword desc format)
- (cond
- ((eq format 'html) (format "")) ; no output for html
- ((eq format 'latex)
- ;; write out the latex command
- (format "\\attachfile{%s}" keyword)))))
+ (cond
+ ((eq format 'html) (format "")) ; no output for html
+ ((eq format 'latex)
+ ;; write out the latex command
+ (format "\\attachfile{%s}" keyword)))))
(org-add-link-type
"attachfile"
@@ -7114,14 +9090,14 @@ bound to anything.
(org-link-set-parameters
"altmetric"
:follow (lambda (doi)
- (browse-url (format "http://dx.doi.org/%s" doi)))
+ (browse-url (format "http://dx.doi.org/%s" doi)))
:export (lambda (keyword desc format)
- (cond
- ((eq format 'html)
- (format "<script type='text/javascript' src='https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js'></script>
+ (cond
+ ((eq format 'html)
+ (format "<script type='text/javascript' src='https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js'></script>
<div data-badge-type='medium-donut' class='altmetric-embed' data-badge-details='right' data-doi='%s'></div>" keyword))
- ((eq format 'latex)
- ""))))
+ ((eq format 'latex)
+ ""))))
(org-add-link-type
"altmetric"
@@ -7140,11 +9116,11 @@ bound to anything.
"Store a link to a man page."
(when (memq major-mode '(Man-mode woman-mode))
(let* ((page (save-excursion
- (goto-char (point-min))
- (re-search-forward " ")
- (buffer-substring (point-min) (point))))
- (link (concat "man:" page))
- (description (format "Manpage for %s" page)))
+ (goto-char (point-min))
+ (re-search-forward " ")
+ (buffer-substring (point-min) (point))))
+ (link (concat "man:" page))
+ (description (format "Manpage for %s" page)))
(org-store-link-props
:type "man"
:link link
@@ -7154,7 +9130,7 @@ bound to anything.
(org-link-set-parameters
"man"
:follow (lambda (path)
- (man path))
+ (man path))
:store 'org-man-store-link))
@@ -7181,19 +9157,19 @@ bound to anything.
(save-excursion
(goto-char (point-min))
(while (re-search-forward
- ;; this matches org headings in elisp too.
- "^\\(;; \\)?\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ ]*$" nil t)
- (cl-pushnew (list
- (format "%-80s"
- (match-string 0))
- (cons 'position (match-beginning 0)))
- headlines)))
+ ;; this matches org headings in elisp too.
+ "^\\(;; \\)?\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ ]*$" nil t)
+ (cl-pushnew (list
+ (format "%-80s"
+ (match-string 0))
+ (cons 'position (match-beginning 0)))
+ headlines)))
(ivy-read "Headline: "
- (reverse headlines)
- :action (lambda (candidate)
- (org-mark-ring-push)
- (goto-char (cdr (assoc 'position candidate)))
- (outline-show-entry)))))
+ (reverse headlines)
+ :action (lambda (candidate)
+ (org-mark-ring-push)
+ (goto-char (cdr (assoc 'position candidate)))
+ (outline-show-entry)))))
(defun ivy-org-jump-to-agenda-heading ()
@@ -7202,24 +9178,24 @@ bound to anything.
(let ((headlines '()))
;; these files should be open already since they are agenda files.
(loop for file in (org-agenda-files) do
- (with-current-buffer (find-file-noselect file)
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward org-heading-regexp nil t)
- (cl-pushnew (list
- (format "%-80s (%s)"
- (match-string 0)
- (file-name-nondirectory file))
- :file file
- :position (match-beginning 0))
- headlines)))))
+ (with-current-buffer (find-file-noselect file)
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward org-heading-regexp nil t)
+ (cl-pushnew (list
+ (format "%-80s (%s)"
+ (match-string 0)
+ (file-name-nondirectory file))
+ :file file
+ :position (match-beginning 0))
+ headlines)))))
(ivy-read "Headline: "
- (reverse headlines)
- :action (lambda (candidate)
- (org-mark-ring-push)
- (find-file (plist-get (cdr candidate) :file))
- (goto-char (plist-get (cdr candidate) :position))
- (outline-show-entry)))))
+ (reverse headlines)
+ :action (lambda (candidate)
+ (org-mark-ring-push)
+ (find-file (plist-get (cdr candidate) :file))
+ (goto-char (plist-get (cdr candidate) :position))
+ (outline-show-entry)))))
(defun ivy-org-jump-to-heading-in-files (files &optional fontify)
@@ -7229,28 +9205,28 @@ a lot with large numbers of org-files or long org-files. This
function does not open the files."
(let ((headlines '()))
(loop for file in files do
- (when (file-exists-p file)
- (with-temp-buffer
- (insert-file-contents file)
- (when fontify
- (org-mode)
- (font-lock-fontify-buffer))
- (goto-char (point-min))
- (while (re-search-forward org-heading-regexp nil t)
- (cl-pushnew (list
- (format "%-80s (%s)"
- (match-string 0)
- (file-name-nondirectory file))
- :file file
- :position (match-beginning 0))
- headlines)))))
+ (when (file-exists-p file)
+ (with-temp-buffer
+ (insert-file-contents file)
+ (when fontify
+ (org-mode)
+ (font-lock-fontify-buffer))
+ (goto-char (point-min))
+ (while (re-search-forward org-heading-regexp nil t)
+ (cl-pushnew (list
+ (format "%-80s (%s)"
+ (match-string 0)
+ (file-name-nondirectory file))
+ :file file
+ :position (match-beginning 0))
+ headlines)))))
(ivy-read "Headline: "
- (reverse headlines)
- :action (lambda (candidate)
- (org-mark-ring-push)
- (find-file (plist-get (cdr candidate) :file))
- (goto-char (plist-get (cdr candidate) :position))
- (outline-show-entry)))))
+ (reverse headlines)
+ :action (lambda (candidate)
+ (org-mark-ring-push)
+ (find-file (plist-get (cdr candidate) :file))
+ (goto-char (plist-get (cdr candidate) :position))
+ (outline-show-entry)))))
(defun ivy-org-jump-to-heading-in-directory (&optional recursive)
@@ -7263,11 +9239,11 @@ Use a double prefix to make it recursive and fontified."
(setq fontify t))
(ivy-org-jump-to-heading-in-files
(f-entries "."
- (lambda (f)
- (and
- (f-ext? f "org")
- (not (s-contains? "#" f))))
- recursive)
+ (lambda (f)
+ (and
+ (f-ext? f "org")
+ (not (s-contains? "#" f))))
+ recursive)
fontify)))
@@ -7280,10 +9256,10 @@ for colored headlines."
(mapcar
(lambda (f) (expand-file-name f (projectile-project-root)))
(-filter (lambda (f)
- (and
- (f-ext? f "org")
- (not (s-contains? "#" f))))
- (projectile-current-project-files)))
+ (and
+ (f-ext? f "org")
+ (not (s-contains? "#" f))))
+ (projectile-current-project-files)))
fontify))
@@ -7293,10 +9269,10 @@ Use a prefix arg FONTIFY for colored headlines."
(interactive "P")
(ivy-org-jump-to-heading-in-files
(mapcar 'buffer-file-name
- (-filter (lambda (b)
- (-when-let (f (buffer-file-name b))
- (f-ext? f "org")))
- (buffer-list)))
+ (-filter (lambda (b)
+ (-when-let (f (buffer-file-name b))
+ (f-ext? f "org")))
+ (buffer-list)))
fontify))
@@ -7325,8 +9301,8 @@ in `scimax-ivy-jump-functions'. With a prefix arg, you can choose
the scope."
(interactive "P")
(let ((jumpfn (if arg (cdr (assoc (intern-soft (ivy-read "Scope: " scimax-ivy-jump-functions)) scimax-ivy-jump-functions))
- ;; the default choice.
- (cdr (car scimax-ivy-jump-functions)))))
+ ;; the default choice.
+ (cdr (car scimax-ivy-jump-functions)))))
(funcall jumpfn)))
#+END_SRC
@@ -7334,6 +9310,7 @@ the scope."
*** Better return
:PROPERTIES:
:ID: A4E26EAE-9189-4000-807B-B2BF2778A3F8
+:CUSTOM_ID: h:AD25CB66-9A93-462C-8B21-F7C4FC48B304
:END:
#+BEGIN_SRC emacs-lisp
@@ -7354,7 +9331,7 @@ Use a prefix arg to get regular RET. "
;; Open links like usual, unless point is at the end of a line.
;; and if at beginning of line, just press enter.
((or (and (eq 'link (car (org-element-context))) (not (eolp)))
- (bolp))
+ (bolp))
(org-return))
;; It doesn't make sense to add headings in inline tasks. Thanks Anders
@@ -7367,16 +9344,16 @@ Use a prefix arg to get regular RET. "
(cond
;; at the end of a line.
((and (eolp)
- (not (eq 'item (car (org-element-context)))))
- (org-insert-todo-heading nil))
+ (not (eq 'item (car (org-element-context)))))
+ (org-insert-todo-heading nil))
;; no content, delete
((and (eolp) (eq 'item (car (org-element-context))))
- (setf (buffer-substring (line-beginning-position) (point)) ""))
+ (setf (buffer-substring (line-beginning-position) (point)) ""))
((eq 'paragraph (car (org-element-context)))
- (goto-char (org-element-property :end (org-element-context)))
- (org-insert-todo-heading nil))
+ (goto-char (org-element-property :end (org-element-context)))
+ (org-insert-todo-heading nil))
(t
- (org-return))))
+ (org-return))))
;; lists end with two blank lines, so we need to make sure we are also not
;; at the beginning of a line to avoid a loop where a new entry gets
@@ -7385,50 +9362,50 @@ Use a prefix arg to get regular RET. "
(cond
;; empty definition list
((and (looking-at " ::")
- (looking-back "- " 3))
- (beginning-of-line)
- (delete-region (line-beginning-position) (line-end-position)))
+ (looking-back "- " 3))
+ (beginning-of-line)
+ (delete-region (line-beginning-position) (line-end-position)))
;; empty item
((and (looking-at "$")
- (looking-back "- " 3))
- (beginning-of-line)
- (delete-region (line-beginning-position) (line-end-position)))
+ (looking-back "- " 3))
+ (beginning-of-line)
+ (delete-region (line-beginning-position) (line-end-position)))
;; numbered list
((and (looking-at "$")
- (looking-back "[0-9]+. " (line-beginning-position)))
- (beginning-of-line)
- (delete-region (line-beginning-position) (line-end-position)))
+ (looking-back "[0-9]+. " (line-beginning-position)))
+ (beginning-of-line)
+ (delete-region (line-beginning-position) (line-end-position)))
;; insert new item
(t
- (end-of-line)
- (org-insert-item))))
+ (end-of-line)
+ (org-insert-item))))
;; org-heading
((org-at-heading-p)
(if (not (string= "" (org-element-property :title (org-element-context))))
- (progn
- ;; Go to end of subtree suggested by Pablo GG on Disqus post.
- (org-end-of-subtree)
- (org-insert-heading-respect-content)
- (outline-show-entry))
- ;; The heading was empty, so we delete it
- (beginning-of-line)
- (setf (buffer-substring
- (line-beginning-position) (line-end-position)) "")))
+ (progn
+ ;; Go to end of subtree suggested by Pablo GG on Disqus post.
+ (org-end-of-subtree)
+ (org-insert-heading-respect-content)
+ (outline-show-entry))
+ ;; The heading was empty, so we delete it
+ (beginning-of-line)
+ (setf (buffer-substring
+ (line-beginning-position) (line-end-position)) "")))
;; tables
((org-at-table-p)
(if (-any?
- (lambda (x) (not (string= "" x)))
- (nth
- (- (org-table-current-dline) 1)
- (remove 'hline (org-table-to-lisp))))
- (org-return)
- ;; empty row
- (beginning-of-line)
- (setf (buffer-substring
- (line-beginning-position) (line-end-position)) "")
- (org-return)))
+ (lambda (x) (not (string= "" x)))
+ (nth
+ (- (org-table-current-dline) 1)
+ (remove 'hline (org-table-to-lisp))))
+ (org-return)
+ ;; empty row
+ (beginning-of-line)
+ (setf (buffer-substring
+ (line-beginning-position) (line-end-position)) "")
+ (org-return)))
;; fall-through case
(t
@@ -7450,27 +9427,54 @@ Use a prefix arg to get regular RET. "
: scimax/org-return
*** TODO Numbered headings and overlays
+:PROPERTIES:
+:CUSTOM_ID: h:1B30C8F8-4B74-4BEC-B034-5841AC02363F
+:END:
*** TODO PDF and EPS images in org mode
+:PROPERTIES:
+:CUSTOM_ID: h:FE6EE163-709D-4B22-8AB4-E128A7C1C4EE
+:END:
+** Adding forked scimax as source
+:PROPERTIES:
+:ID: 707EE928-F2A7-4A05-9C85-EE483221C7B4
+:CUSTOM_ID: h:464AE55E-6CB4-488F-8805-B661CF80799B
+:END:
+
+This forked repo is being used as a code base for the time being as I
+port over things in scimax that I like.
+
+- [ ] do not load this package
+
+#+BEGIN_SRC emacs-lisp
+(use-package scimax-subset
+ :straight (scimax-subset
+ :no-build t :repo "https://git.sr.ht/~shrysr/scimax-subset"))
+#+END_SRC
+
** scimax-yas
:PROPERTIES:
:ID: 259205AA-4D49-4917-B79D-0A785822C33F
+:CUSTOM_ID: h:2CAB2132-507E-455C-8510-AA1CBFA46F8E
:END:
-#+BEGIN_SRC emacs-lisp
- (use-package scimax-yas
- :init (setq scimax-snippet-dir (sr/fun/emacs-dir "snippets"))
- :straight (scimax-yas :repo "git@git.sr.ht:~shrysr/scimax-subset" :files ("scimax-yas.el")))
-(require 'scimax-yas)
+#+BEGIN_SRC emacs-lisp
+(use-package scimax-yas
+ :init (setq scimax-snippet-dir (sr/fun/emacs-dir "snippets"))
+ :straight (scimax-yas :local-repo "scimax-subset" :files ("scimax-yas.el")))
+;; Not entirely sure whether this is required.
+;; (require 'scimax-yas)
#+END_SRC
** scimax-ivy
:PROPERTIES:
:ID: 5883CE00-AEAE-46E3-8C47-B74554B7F0CD
+:CUSTOM_ID: h:2362B132-5BA5-4BBE-A986-EA1AA19D5E7A
:END:
#+BEGIN_SRC emacs-lisp
- (use-package scimax-ivy
- :straight (scimax-ivy :repo "git@git.sr.ht:~shrysr/scimax-subset" :files ("scimax-ivy.el")))
+(use-package scimax-ivy
+ :straight (scimax-ivy :local-repo "scimax-subset" :files ("scimax-ivy.el")))
(require 'scimax-ivy)
+
#+END_SRC
#+RESULTS:
@@ -7478,12 +9482,13 @@ Use a prefix arg to get regular RET. "
** scimax-apps
:PROPERTIES:
:ID: 217D4F99-21D9-4FEE-8ACC-24113C70A750
+:CUSTOM_ID: h:61C03C78-EAF1-471C-84DC-03A1D7CF8D9A
:END:
#+BEGIN_SRC emacs-lisp
- (use-package scimax-apps
- :after scimax-org
- :straight (scimax-apps :repo "git@git.sr.ht:~shrysr/scimax-subset" :files ("scimax-apps.el")))
+(use-package scimax-apps
+ :after scimax-org
+ :straight (scimax-apps :local-repo "scimax-subset" :files ("scimax-apps.el")))
(require 'scimax-apps)
#+END_SRC
@@ -7493,10 +9498,18 @@ Use a prefix arg to get regular RET. "
** TODO scimax-hydra
:PROPERTIES:
:ID: D3004CAB-BFAF-48B8-8FBA-7CB75FC33007
+:CUSTOM_ID: h:4A4AA21B-6192-47FC-88A5-4468D6033AF6
:END:
- Note taken on [2020-03-24 Tue 10:38] \\
For some reason, the scimax-hydra package will not byte compile.
+This package has a bunch of hydras that I still use, though there are
+many that I would rather replace. Remapping the capslock key to F12 and
+mapping this to launch the scimax hydra is an approach that works on the
+terminal as well, rather than only relying on the hyper key as the
+entry to nougat-hydras. This has to be addressed down the line.
+
+
#+BEGIN_SRC emacs-lisp
(load-file (concat (sr/fun/emacs-dir "straight/repos/scimax-subset/scimax-hydras.el")))
@@ -7511,15 +9524,27 @@ Use a prefix arg to get regular RET. "
** scimax-notebook
:PROPERTIES:
:ID: D6B5E656-0A40-4B50-A37C-889FE990C063
+:CUSTOM_ID: h:23A66EDB-5F7D-4098-ABE6-3553B5447BC4
:END:
-#+BEGIN_SRC emacs-lisp
+- Note taken on [2020-07-15 Wed 00:12] \\
+ The one issue I have faced with enabling scimax-notebook as a whole is
+ that the org-store-links function is augmented with the nb type
+ link. These links work great in a particular context, but from what I
+ have understood - I would prefer the default links to always be an
+ org-id unless other specified. This would make things a lot more
+ smoother for me, especially now that I am migrating towards publishing
+ my notes online and maintaining an integrated system through org-roam,
+ org-brain and of course Emacs. The solution has been to comment out
+ the code pertaining to adding the nb
+ link. Commit #9c3de84.
+#+BEGIN_SRC emacs-lisp
(use-package scimax-notebook
- :straight (scimax-notebook :repo "git@git.sr.ht:~shrysr/scimax-subset" :files ("scimax-notebook.el"))
+ :straight (scimax-notebook :local-repo "scimax-subset" :files ("scimax-notebook.el"))
:bind ("M-s n" . 'nb-hydra/body)
:config
-(setq nb-notebook-directory "~/my_projects/"))
+ (setq nb-notebook-directory "~/my_projects/"))
;; (global-set-key (kbd "M-s n") 'nb-hydra/body))
(require 'scimax-notebook)
#+END_SRC
@@ -7527,16 +9552,23 @@ Use a prefix arg to get regular RET. "
#+RESULTS:
: scimax-notebook
** org-db
+:PROPERTIES:
+:ID: BF86653F-5AD1-4AAE-8F04-AD2E72F050F6
+:CUSTOM_ID: h:8DF3FA72-4612-4B41-A0D4-7294890F3315
+:END:
#+BEGIN_SRC emacs-lisp
- (use-package org-db
- :straight (org-db :local-repo "scimax-subset" :files ("org-db.el")))
-(require 'org-db)
+(use-package org-db
+ :straight (org-db :local-repo "scimax-subset" :files ("org-db.el"))
+ :defer 10
+ :config
+ (require 'org-db))
#+END_SRC
** COMMENT scimax-journal
:PROPERTIES:
:ID: 61A12586-DAA7-4601-92F3-DD688B9725D5
+:CUSTOM_ID: h:E9AB45DC-D8FF-44C2-A8EC-E874AB5D7121
:END:
- Note taken on [2020-04-10 Fri 18:37] \\
Switching back to org-journal
@@ -7545,51 +9577,55 @@ Use a prefix arg to get regular RET. "
(use-package scimax-journal
:init (setq scimax-journal-root-dir "~/my_org/journal/")
:bind ("H-j" . scimax-journal/body)
- :straight (scimax-journal :repo "git@git.sr.ht:~shrysr/scimax-subset" :files ("scimax-journal.el")))
+ :straight (scimax-journal :local-repo "scimax-subset" :files ("scimax-journal.el")))
(require 'scimax-journal)
#+END_SRC
#+RESULTS:
: scimax-journal
** COMMENT scimax utils
+:PROPERTIES:
+:CUSTOM_ID: h:0FA27DAC-5084-4A24-A45A-A15BEDDAE99B
+:END:
#+BEGIN_SRC emacs-lisp
- (use-package scimax-utils
- :straight (scimax-utils :repo "git@git.sr.ht:~shrysr/scimax-subset" :files ("scimax-utils.el")))
+(use-package scimax-utils
+ :straight (scimax-utils :local-repo "scimax-subset" :files ("scimax-utils.el")))
(require 'scimax-utils)
#+END_SRC
#+RESULTS:
: scimax-utils
-** scimax-ipython
+** COMMENT scimax-ipython
:PROPERTIES:
:ID: 06455092-7B57-4E40-A474-6252B67B4D1B
+:CUSTOM_ID: h:EFF078EA-E17A-443C-B878-595447A279B5
:END:
- [X] use the file keyword to add the client.py file as a symlink. Note here that the entire list of files have to be provided.
#+BEGIN_SRC emacs-lisp
- (use-package ob-ipython
- :straight (ob-ipython
- :host github
- :repo "gregsexton/ob-ipython"
- :files ("client.py" "ob-ipython.el"))
- :config
- (require 'ob-ipython))
+(use-package ob-ipython
+ :straight (ob-ipython
+ :host github
+ :repo "gregsexton/ob-ipython"
+ :files ("client.py" "ob-ipython.el"))
+ :config
+ (require 'ob-ipython))
;;; * Applying John's customisations and monkeypatches
;;; These are related to ipython kernel management
;;; * These are related mostly to org-babel customisations
- (use-package scimax-ob
- :straight (scimax-ob
- :repo "git@git.sr.ht:~shrysr/scimax-subset"
- :files ("scimax-ob.el")))
+(use-package scimax-ob
+ :straight (scimax-ob
+ :local-repo "scimax-subset"
+ :files ("scimax-ob.el")))
- (use-package scimax-org-babel-ipython-upstream
- :straight (scimax-org-babel-ipython-upstream
- :repo "git@git.sr.ht:~shrysr/scimax-subset"
- :files ("scimax-org-babel-ipython-upstream.el")))
+(use-package scimax-org-babel-ipython-upstream
+ :straight (scimax-org-babel-ipython-upstream
+ :local-repo "scimax-subset"
+ :files ("scimax-org-babel-ipython-upstream.el")))
#+END_SRC
@@ -7598,7 +9634,7 @@ Use a prefix arg to get regular RET. "
scimax-ipython upstream
-- [ ] Apparently, this is not required?
+- [ ] Apparently, this is not required?
#+BEGIN_SRC emacs-lisp :tangle no
(require 'scimax-org-babel-ipython-upstream)
@@ -7608,13 +9644,27 @@ scimax-ipython upstream
#+RESULTS:
: scimax-ob
** COMMENT scimax-elfeed
+:PROPERTIES:
+:CUSTOM_ID: h:78D4CF32-B635-4A7D-AFE0-D857181E4C6C
+:END:
#+BEGIN_SRC emacs-lisp
(use-package scimax-elfeed
- :straight (scimax-elfeed :repo "git@git.sr.ht:~shrysr/scimax-subset" :files ("scimax-elfeed.el")))
+ :straight (scimax-elfeed :local-repo "scimax-subset" :files ("scimax-elfeed.el")))
#+END_SRC
#+RESULTS:
+
+*** Noted on the scimax hydra
+:PROPERTIES:
+:CUSTOM_ID: h:851868AB-8BF9-45A7-95B5-F31488B79917
+:END:
+
+Scimax-jump contains a bunch of interesting methods to jump to a
+particular line, character, org headline and so on. The commands used
+for this purpose should be studied and integrated carefully into my
+workflow.
+
* Aesthetics
:PROPERTIES:
:CUSTOM_ID: h:E3856DC0-C71D-48D7-9D20-EB37E64CD645
@@ -7666,6 +9716,7 @@ scimax-ipython upstream
** Setting custom themes to be safe
:PROPERTIES:
:ID: E7FEA82C-0CCD-40D2-842A-E6797A9BB3BF
+:CUSTOM_ID: h:860C7DBA-B672-4C96-AAA8-FFB4CABD90F5
:END:
#+BEGIN_SRC emacs-lisp
@@ -7675,6 +9726,7 @@ scimax-ipython upstream
** Enable fontification of example and quote blocks
:PROPERTIES:
:ID: C2D3C30F-7297-484A-90DA-C332B5006139
+:CUSTOM_ID: h:F2B51A92-46A1-4D64-B4A8-DCE76C285698
:END:
As noted in https://gitlab.com/protesilaos/modus-themes/-/issues/68
@@ -7686,10 +9738,12 @@ As noted in https://gitlab.com/protesilaos/modus-themes/-/issues/68
** Theme : modus
:PROPERTIES:
:ID: 1F5F41EC-6BDA-46BC-B1E6-DED28B899196
+:CUSTOM_ID: h:6C82B400-F77E-4946-9D8C-11C471D246CC
:END:
*** modus operandi
:PROPERTIES:
:ID: 4353F3D3-6528-49E2-B9A3-16F98A490FF1
+:CUSTOM_ID: h:7223DF48-7A1F-4BC2-BA05-6CF455BA8561
:END:
- Note taken on [2020-07-08 Wed 21:52] \\
The settings are now directly borrowed from the package readme.
@@ -7722,10 +9776,10 @@ As noted in https://gitlab.com/protesilaos/modus-themes/-/issues/68
modus-operandi-theme-scale-3 1.15
modus-operandi-theme-scale-4 1.2
modus-operandi-theme-scale-5 1.3)
-
-
:config
(load-theme 'modus-operandi t))
+
+
#+END_SRC
#+RESULTS:
@@ -7769,10 +9823,10 @@ As noted in https://gitlab.com/protesilaos/modus-themes/-/issues/68
(load-theme 'modus-vivendi t)
;; *("is the symbol powerline-reset bound to a function")
(fboundp 'powerline-reset))
+
;; ALternatives
;; This will attemp to load powerline, if it is available and not loaded.
-
;; (require 'powerline nil t ) (if (featurep 'powerline) ...)
#+END_SRC
*** TODO Function to update and rebuild both modus theme packages
@@ -7780,11 +9834,32 @@ As noted in https://gitlab.com/protesilaos/modus-themes/-/issues/68
This may be in-built into the theme
+#+BEGIN_SRC emacs-lisp :noweb t
+(defun modus-themes-toggle (&optional arg)
+ "Toggle between `modus-operandi' and `modus-vivendi' themes."
+ (interactive)
+ (if (eq (car custom-enabled-themes) 'modus-operandi)
+ (progn
+ (disable-theme 'modus-operandi)
+<<modus-vivendi>>)
+ (disable-theme 'modus-vivendi)
+<<modus-operandi>>))
#+END_SRC
** Font and other aesthetics
+:PROPERTIES:
+:CUSTOM_ID: h:006F06FD-22A1-4EF2-BB63-DD16E5984D6B
+:END:
+
+I did not really think the day would arrive when I preferred a
+particular type of font and that it would work out for me. Some
+additional work is required of these settings. These will follow in a
+separate post.
*** COMMENT Old config
+:PROPERTIES:
+:CUSTOM_ID: h:76DDFAB6-D745-4E4A-BE0C-15306100CD84
+:END:
#+BEGIN_SRC emacs-lisp
;; My customisations
(set-face-attribute 'default nil :family "iA Writer Mono V" :height 130)
@@ -7798,31 +9873,37 @@ This may be in-built into the theme
*** Fixed pitch and variable pitch fonts
:PROPERTIES:
:ID: 7257A394-D3EE-4918-9939-1BA885C1A51E
+:CUSTOM_ID: h:F2A3F29F-7762-43F0-AEF5-87BE8940ACE0
:END:
+- [[help:set-face-attribute][See the help documentation]] for the function =set-face-attribute=.
+
#+BEGIN_SRC emacs-lisp
(custom-theme-set-faces
'user
'(variable-pitch ((t (:family "iA Writer Mono V"))))
'(fixed-pitch ((t ( :family "Iosevka term"
- :slant normal
- :weight normal
- :height 1.1
- :width normal)))))
+ :slant normal
+ :weight normal
+ :height 1.12
+ :width normal)))))
;; Setting the default general font
(set-face-attribute 'default nil
- :family "iA Writer Mono V"
- :height 130
+ :family "iA Writer Mono V"
+ :height 133
+ ;; unable to define the :width argument here for some reason. The documentation indicates that this should be possible
+
)
#+END_SRC
#+RESULTS:
-*** Faces for specific org elements
+*** COMMENT Faces for specific org elements
:PROPERTIES:
:ID: 3C14EDA6-1BA3-4FE0-ADA5-FF6D7424B38D
+:CUSTOM_ID: h:159147F5-98C6-45D0-BB3C-F4A35021EEBD
:END:
#+BEGIN_SRC emacs-lisp
@@ -7833,7 +9914,7 @@ This may be in-built into the theme
'(org-document-info ((t (:foreground "dark orange"))))
'(org-document-info-keyword ((t (:inherit (shadow fixed-pitch)))))
'(org-indent ((t (:inherit (org-hide variable-pitch)))))
- '(org-link ((t (:foreground "royal blue" :underline t))))
+ ;; '(org-link ((t (:foreground "royal blue" :underline t))))
'(org-meta-line ((t (:inherit (font-lock-comment-face -pitch)))))
'(org-property-value ((t (:inherit fixed-pitch))) t)
'(org-special-keyword ((t (:inherit (font-lock-comment-face fixed-pitch)))))
@@ -7846,9 +9927,13 @@ This may be in-built into the theme
#+RESULTS:
** Modeline
+:PROPERTIES:
+:CUSTOM_ID: h:6D3CB948-4416-4BCA-B4AD-06F85345FB15
+:END:
*** COMMENT Doom modeline
:PROPERTIES:
:ID: 84F55D71-F357-4DD7-A322-BF7B726AD5F2
+ :CUSTOM_ID: h:CDAED2ED-5BD8-408A-A8F8-9ECCA90F2A24
:END:
- Note taken on [2020-05-17 Sun 00:18] \\
Apparently, this is consuming a lot of CPU cycles in the org agenda
@@ -7883,9 +9968,10 @@ This may be in-built into the theme
#+END_SRC
-*** COMMENT Spaceline : modeline configuration
+*** Spaceline : modeline configuration
:PROPERTIES:
:ID: 1505e226-1321-4f3c-89e9-9dc8a5c91bd0
+ :CUSTOM_ID: h:9AD29E9C-99C1-4F3E-915D-12EC5FCD8622
:END:
- [X] [[http://pragmaticemacs.com/emacs/get-that-spacemacs-look-without-spacemacs/][Get that spacemacs look without spacemacs | Pragmatic Emacs]] - this provides a bare bones setup
- [ ] [[http://amitp.blogspot.com/2017/01/emacs-spaceline-mode-line.html][Amit's Thoughts: Emacs spaceline mode line]] : This is an excellent guide covering a lot of possibilities to customise so many aspects of the modeline and make it look great.
@@ -7897,31 +9983,38 @@ This may be in-built into the theme
:init
(setq powerline-default-separator 'arrow-fade)
:config
- (disable-theme 'smart-mode-line-light)
+ ;; (disable-theme 'smart-mode-line-light)
(require 'spaceline-config)
- (spaceline-spacemacs-theme)
+ (spaceline-emacs-theme)
(spaceline-toggle-buffer-position-off)
(spaceline-toggle-hud-off)
(setq spaceline-python-pyvenv-on 1)
- (spaceline-toggle-minor-modes-off t)
-(spaceline-toggle-buffer-id t))
+ (spaceline-toggle-minor-modes-off)
+(spaceline-toggle-buffer-id))
#+END_SRC
#+RESULTS:
: t
-*** powerline
+*** COMMENT powerline
+:PROPERTIES:
+:CUSTOM_ID: h:92CEB2E6-00EE-4665-8A05-0E429556E4B7
+:END:
+- Note taken on [2020-08-20 Thu 14:49] \\
+ I like that spaceline has a lot of configuration options out of the
+ box. However, I prefer the bold colors of the default powerline theme.
#+BEGIN_SRC emacs-lisp
(use-package powerline
:straight t
:config
- (setq powerline-arrow-shape 'curve)
+ ;; (setq powerline-arrow-shape 'curve)
(powerline-default-theme))
#+END_SRC
*** Diminishing modes
:PROPERTIES:
:ID: EE5F4610-0D7D-42F8-9D7B-B4E28C9A6085
+:CUSTOM_ID: h:7401F886-81D9-4CFF-897C-C3E329B75595
:END:
These are borrowed from scimax. I want to de-clutter my modeline.
@@ -7956,6 +10049,7 @@ These are borrowed from scimax. I want to de-clutter my modeline.
*** Delightful modes
:PROPERTIES:
:ID: 9AF32F03-2E2F-403D-9479-2D1533C2707A
+:CUSTOM_ID: h:D2F1F03B-3A29-4AA9-ABF3-88ACE81E1D42
:END:
There are some modes that I would like displayed. Let's lift this from https://www.emacswiki.org/emacs/DelightedModes
@@ -7984,6 +10078,7 @@ There are some modes that I would like displayed. Let's lift this from https://w
** COMMENT Visual Fill Column and global visual line
:PROPERTIES:
:ID: 5113A22F-D29A-4AAD-A1CE-937983FCF06C
+:CUSTOM_ID: h:700C3AD3-C27E-4D4A-9CE6-2B3D1D5F6568
:END:
- Note taken on [2020-04-01 Wed 08:43] \\
I have had trouble in using the visual fill column mode. Overall it
@@ -8022,6 +10117,9 @@ and then have the visual line mode to
| visual-fill-column-mode | visual-line-mode-set-explicitly |
** COMMENT Org Aesthetics Headline scales
+:PROPERTIES:
+:CUSTOM_ID: h:99F318BD-810A-43DB-9700-2025C8C732B5
+:END:
- Note taken on [2020-03-28 Sat 19:56] \\
These are not required for the modus theme, as inbuilt options exist upto level 4.
@@ -8040,6 +10138,7 @@ and then have the visual line mode to
** Olivetti mode
:PROPERTIES:
:ID: 5586B98F-3230-42B0-9CAC-3F8207990C60
+:CUSTOM_ID: h:83A8FC05-F691-4C3E-A04D-821B12575B59
:END:
- Note taken on [2020-07-29 Wed 10:16] \\
I have this available so that it can be enabled when desired. The config
@@ -8047,15 +10146,20 @@ and then have the visual line mode to
- Note taken on [2020-03-28 Sat 20:04] \\
+The problem with this mode is that it seems to activate and deactivate constantly, especially when the buffer is saved. However it is certainly very useful with wide screens in general.+
-This package is useful in centering the text in a buffer, and is particularly helpful with wide screens.
+This package is useful in centering the text in a buffer, and is
+particularly helpful with wide screens.
+
+- use prot/olivetti-mode as an aid for focused writing and reading as well.
+- disable git-gutter mode when this mode is enabled.
#+BEGIN_SRC emacs-lisp
(use-package olivetti
:straight t
:diminish
+ :defer 6
:config
(setq olivetti-body-width 0.65)
- (setq olivetti-minimum-body-width 72)
+ (setq olivetti-minimum-body-width 82)
(setq olivetti-recall-visual-line-mode-entry-state t)
(define-minor-mode prot/olivetti-mode
@@ -8072,7 +10176,8 @@ The cursor becomes a blinking bar, per `prot/cursor-type-mode'."
(progn
(olivetti-mode 1)
(set-window-fringes (selected-window) 0 0)
- ;; (prot/variable-pitch-mode 1)
+ (git-gutter-mode 'nil)
+ ;; (prot/variable-pitch-mode 1)
;; (prot/cursor-type-mode 1)
(unless (derived-mode-p 'prog-mode)
(prot/hidden-mode-line-mode 1)))
@@ -8089,16 +10194,20 @@ The cursor becomes a blinking bar, per `prot/cursor-type-mode'."
** COMMENT Strike out Done headlines
:PROPERTIES:
:ID: 3263d812-c3f5-4947-b2de-c75c537d19df
+:CUSTOM_ID: h:3DCF858F-E7F6-48FE-934D-4AEB5429D611
:END:
+- Note taken on [2020-08-04 Tue 12:15] \\
+ This interferes with Links not being shown clearly.
+
source: Sacha Chua
#+begin_src emacs-lisp
(setq org-fontify-done-headline t)
(custom-set-faces
'(org-done ((t (:foreground "DarkGreen"
- :weight normal
- :strike-through t))))
+ :weight normal
+ :strike-through t))))
'(org-headline-done
((((class color) (min-colors 16) (background dark))
(:foreground "LightSalmon" :strike-through t)))))
@@ -8106,9 +10215,10 @@ source: Sacha Chua
#+RESULTS:
-** COMMENT keywords as boxes with inverted colors
+** keywords as boxes with inverted colors
:PROPERTIES:
:ID: 62dcdc53-ee2f-4db2-afda-6b68a05cbeda
+:CUSTOM_ID: h:ADC42D39-981E-4C5B-973B-10B96FAD6E63
:END:
Source : SO [[https://stackoverflow.com/questions/12707492/add-custom-markers-to-emacs-org-mode][link]] ,
@@ -8116,29 +10226,29 @@ Source : SO [[https://stackoverflow.com/questions/12707492/add-custom-markers-to
#+BEGIN_SRC emacs-lisp
(set-face-attribute 'org-todo nil
:box '(:line-width 2
- :color "red"
- :style released-button)
+ :color "red"
+ :style released-button)
:inverse-video t)
(set-face-attribute 'org-done nil
:box '(:line-width 2
- :color "lightgreen"
- :style released-button)
+ :color "lightgreen"
+ :style released-button)
:inverse-video t
)
(set-face-attribute 'org-priority nil
:inherit font-lock-keyword-face
:inverse-video t
:box '(:line-width 2
- :color "black"
- :style released-button))
+ :color "black"
+ :style released-button))
(set-face-attribute 'org-checkbox
- nil
- :inherit font-lock-keyword-face
- :inverse-video t
- :box '(:line-width 2
- :color "black"
- :style released-button))
+ nil
+ :inherit font-lock-keyword-face
+ :inverse-video t
+ :box '(:line-width 2
+ :color "black"
+ :style released-button))
#+END_SRC
#+RESULTS:
@@ -8146,6 +10256,7 @@ Source : SO [[https://stackoverflow.com/questions/12707492/add-custom-markers-to
** Remove the bars and startup messages
:PROPERTIES:
:ID: 38F9FE46-13E7-4281-8DC0-7C9F9AAB673C
+:CUSTOM_ID: h:D679ED49-A96D-48AF-B03B-E09750AD4D25
:END:
#+BEGIN_SRC emacs-lisp
@@ -8160,6 +10271,7 @@ Source : SO [[https://stackoverflow.com/questions/12707492/add-custom-markers-to
** Display time and date information
:PROPERTIES:
:ID: 5DA8D260-214D-4D7C-BA49-F9EEEAF2161F
+:CUSTOM_ID: h:1672C66B-CD03-4D9E-82FC-CBF26F2523CD
:END:
#+BEGIN_SRC emacs-lisp
@@ -8176,11 +10288,19 @@ Source : SO [[https://stackoverflow.com/questions/12707492/add-custom-markers-to
#+END_SRC
* Hugo
+:PROPERTIES:
+:CUSTOM_ID: h:0BE931E2-F99F-4F65-9CFB-7D283F509343
+:END:
** ox-hugo setup
:PROPERTIES:
:ID: 9551342B-2FC5-425A-BBFA-3D7F34ABD15F
+:CUSTOM_ID: h:080CC5FE-AD02-4F8F-8CA9-BAA6F11D96E9
:END:
+- Note taken on [2020-07-23 Thu 01:32] \\
+ In my current setup, the auto export mode introduces a noticeable lag
+ between saving a buffer that is already being tangled to multiple
+ files.
#+BEGIN_SRC emacs-lisp
(use-package ox-hugo
:ensure t
@@ -8193,6 +10313,9 @@ Source : SO [[https://stackoverflow.com/questions/12707492/add-custom-markers-to
#+RESULTS:
** TODO Auto-generate some properties
+:PROPERTIES:
+:CUSTOM_ID: h:86D6A5E6-847D-4A08-B337-450E9859FA1E
+:END:
The earlier procedure by choice was to use the org-id to name
posts. This ensured that the post URL's would remain unique and
@@ -8270,6 +10393,7 @@ file which do not already have one."
* Loading secret config
:PROPERTIES:
:ID: F71603D8-BA36-4055-9417-FFED3ABF9E4B
+:CUSTOM_ID: h:2BC7EA34-5F1B-46B5-B252-33884A753AE0
:END:
#+BEGIN_SRC emacs-lisp
@@ -8280,214 +10404,265 @@ file which do not already have one."
#+RESULTS:
: Loaded /Users/shrysr/.emacs.d/sr-secrets.org.el
-* TODO org-id setup
- :PROPERTIES:
- :CUSTOM_ID: h:AE14D623-BB71-41D9-8AA4-5C7B21DCBD24
- :ID: 19A7C4F6-EFB5-4B55-A4DF-3DEEE5A161C9
- :END:
- - Note taken on [2020-08-23 Sun 00:03] \\
- Shuffling this here till I figure out a way to integrate org id and nb
- links, as well as create custom ID's.
- Reference: [[file:~/my_projects/protesilaos dotfiles/emacs/.emacs.d/emacs-init.org::#h:031f7dbf-19e4-4ddf-a3d3-f648261412f6][Consistent Org heading IDs (and anchor tags)]]
+* TODO COMMENT Bare minimum baseline Emacs Config
+:PROPERTIES:
+:CUSTOM_ID: h:A4545484-E502-4DC0-99C6-FB97459F9BDE
+:END:
+** Option as Meta for Mitsuharu Emacs
+:PROPERTIES:
+:CUSTOM_ID: h:7553BD75-041F-4961-9981-03AF94D44895
+:END:
- Using the org-id for reference to headings ensures that even if the
- heading changes, the links will still work.
+I have decided to try the Mitsuharu version of Emacs to check whether
+the performance on my mac is better, particularly for larger and
+multiple screens.
- In addition, I would like an org id to be created every time the capture
- is used. This facilitates using packages like org-brain which rely
- extensively on org-id's.
+Some caveats here are that - an old version of Emacs is being used and
+there are issues in calling multi-tty or emacsclient. This is a serious
+problem for me since I use Emacs daemon and client all the time.
- - [ ] create custom id's if they do not exist.
+#+BEGIN_SRC emacs-lisp
+(setq mac-option-modifier 'meta)
+#+END_SRC
+** TODO emacs-nougat
+:PROPERTIES:
+:CUSTOM_ID: h:472EB5B7-3CC3-4D4B-AA45-5125A9E02B69
+:END:
+** Server
+:PROPERTIES:
+:CUSTOM_ID: h:90046BAB-628D-4DE7-98B9-F4B104BD9D1F
+:END:
- #+BEGIN_SRC emacs-lisp
- (require 'org-id)
- (setq org-id-link-to-org-use-id t)
- ;; (org-link-set-parameters "id" :store #'org-id-store-link)
- ;; (org-link-set-parameters "nb" :store nil)
- ;; (org-link-set-parameters 'nil)
- ;; (org-link-set-parameters "nb" :store nil)
- ;; ;; Update ID file .org-id-locations on startup
- ;; ;; This adds too much time to startup
- ;; ;; (org-id-update-id-locations)
+With the Mitsuharu build
+(https://github.com/railwaycat/homebrew-emacsmacport/issues/52#issuecomment-572271448),
+this workaround is necessary.
- (setq org-id-method (quote uuidgen))
- (setq org-id-track-globally t)
- (setq org-id-locations-file "~/my_org/emacs_meta/.org-id-locations")
- ;; (add-hook 'org-capture-prepare-finalize-hook 'org-id-get-create)
+#+BEGIN_SRC emacs-lisp
+(use-package mac-pseudo-daemon
+ :straight (:type git :host github :repo "DarwinAwardWinner/mac-pseudo-daemon")
+ :config
+(mac-pseudo-daemon-mode 1))
- ;; (setq org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id)
- (setq org-id-link-to-org-use-id 't)
+(server-start)
- (defun contrib/org-get-id (&optional pom create prefix)
- "Get the CUSTOM_ID property of the entry at point-or-marker
-POM. If POM is nil, refer to the entry at point. If the entry
-does not have an CUSTOM_ID, the function returns nil. However,
-when CREATE is non nil, create a CUSTOM_ID if none is present
-already. PREFIX will be passed through to `org-id-new'. In any
-case, the CUSTOM_ID of the entry is returned."
- (interactive)
- (org-with-point-at pom
- (let ((id (org-entry-get nil "CUSTOM_ID")))
- (cond
- ((and id (stringp id) (string-match "\\S-" id))
- id)
- (create
- (setq id (org-id-new (concat prefix "h")))
- (org-entry-put pom "CUSTOM_ID" id)
- (org-id-add-location id (buffer-file-name (buffer-base-buffer)))
- id)))))
+#+END_SRC
+** Source block tangling
+:PROPERTIES:
+:CUSTOM_ID: h:47BB41E6-2393-4EAC-9559-5F440CA83BCA
+:END:
- (defun contrib/org-id-headlines ()
- "Add CUSTOM_ID properties to all headlines in the current
-file which do not already have one."
- (interactive)
- (org-map-entries (lambda ()
- (contrib/org-get-id (point) 'create))))
+The correct way out would be to name source blocks and tangle out only
+the bare minimum required source blocks. So far this has not turned out
+too difficult, despite the modularity of the source blocks, since each
+block has pertained to a specific package or a reason. It should be
+possible to list all the names using =occur= or =helm-swoop=.
- #+end_src
+There would be different flavors, like one with org mode enabled full on
+and others focused only on Python or R and integration with ipython.
-* Loading secret config
+*** Base config with python flavor
:PROPERTIES:
-:ID: F71603D8-BA36-4055-9417-FFED3ABF9E4B
+:CUSTOM_ID: h:43A07039-4C81-4F6A-AEE7-CC61017520C7
:END:
-#+BEGIN_SRC emacs-lisp
-;; Loading secret config containing personal information
-(org-babel-load-file (sr/fun/emacs-dir "sr-secrets.org.gpg"))
+
+#+BEGIN_SRC emacs-lisp :mkdirp t :noweb t :tangle ./src/emacs-python.el
+;; Basic setup
+<<straight-setup>>
+<<use-package-with-straight>>
+<<directory-definitions >>
+<<em-shorten-yn>>
+<<emacs-autosave-settings>>
+<<os-level-variables>>
+
+;; Org mode installation
+<<org-installation-with-straight-1>>
+
+;; <<polybrain>>
+
+<<dired-customisation>>
+<<treemacs>>
+<<perspective-el>>
#+END_SRC
-#+RESULTS:
-: Loaded /Users/shrysr/.emacs.d/sr-secrets.org.el
+*** Base with org mode and projectile
+:PROPERTIES:
+:ID: C5B4AA6F-FC03-4C4E-92D7-4AEA6779BD3E
+:CUSTOM_ID: h:5F5B8BA3-44C3-404C-8E88-4D46A2651E2A
+:END:
+** TODO Multiple tangle and export
+:PROPERTIES:
+:CUSTOM_ID: h:4D522BAB-86C5-4F49-96D3-7908DA529041
+:END:
-* TODO org-id setup
- :PROPERTIES:
- :CUSTOM_ID: h:AE14D623-BB71-41D9-8AA4-5C7B21DCBD24
- :ID: 19A7C4F6-EFB5-4B55-A4DF-3DEEE5A161C9
- :END:
- - Note taken on [2020-08-23 Sun 00:03] \\
- Shuffling this here till I figure out a way to integrate org id and nb
- links, as well as create custom ID's.
- Reference: [[file:~/my_projects/protesilaos dotfiles/emacs/.emacs.d/emacs-init.org::#h:031f7dbf-19e4-4ddf-a3d3-f648261412f6][Consistent Org heading IDs (and anchor tags)]]
+#+BEGIN_SRC org :tangle ./base-emacs-config.org
+,#+TITLE: Baseline Emacs configuration for servers
- Using the org-id for reference to headings ensures that even if the
- heading changes, the links will still work.
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:83310F21-750B-4535-93E9-EE603B7CC367"
- In addition, I would like an org id to be created every time the capture
- is used. This facilitates using packages like org-brain which rely
- extensively on org-id's.
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:40A16A11-0E8F-4512-814E-2630E728F68B"
- - [ ] create custom id's if they do not exist.
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:2B68F7DB-C669-44D7-99A2-636D08786CB5"
- #+BEGIN_SRC emacs-lisp
- (require 'org-id)
- (setq org-id-link-to-org-use-id t)
- ;; (org-link-set-parameters "id" :store #'org-id-store-link)
- ;; (org-link-set-parameters "nb" :store nil)
- ;; (org-link-set-parameters 'nil)
- ;; (org-link-set-parameters "nb" :store nil)
- ;; ;; Update ID file .org-id-locations on startup
- ;; ;; This adds too much time to startup
- ;; ;; (org-id-update-id-locations)
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:727B49EA-4A90-4BCA-9F70-23BB0F2C72D1"
- (setq org-id-method (quote uuidgen))
- (setq org-id-track-globally t)
- (setq org-id-locations-file "~/my_org/emacs_meta/.org-id-locations")
- ;; (add-hook 'org-capture-prepare-finalize-hook 'org-id-get-create)
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:7F152A0D-F0BC-40F8-92D5-739182298BB6"
- ;; (setq org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id)
- (setq org-id-link-to-org-use-id 't)
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:F7939FA9-4BFF-4BA3-8262-044C4C18BB45"
- (defun contrib/org-get-id (&optional pom create prefix)
- "Get the CUSTOM_ID property of the entry at point-or-marker
-POM. If POM is nil, refer to the entry at point. If the entry
-does not have an CUSTOM_ID, the function returns nil. However,
-when CREATE is non nil, create a CUSTOM_ID if none is present
-already. PREFIX will be passed through to `org-id-new'. In any
-case, the CUSTOM_ID of the entry is returned."
- (interactive)
- (org-with-point-at pom
- (let ((id (org-entry-get nil "CUSTOM_ID")))
- (cond
- ((and id (stringp id) (string-match "\\S-" id))
- id)
- (create
- (setq id (org-id-new (concat prefix "h")))
- (org-entry-put pom "CUSTOM_ID" id)
- (org-id-add-location id (buffer-file-name (buffer-base-buffer)))
- id)))))
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:2EF177CD-7C3C-4A54-8D36-E21A6F6F8ACF"
+
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:55E36B85-FBF7-4574-85E8-6E554D6CC593"
+
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:F7B81D1E-1621-46F9-B5EF-B8EF4FCC51BC"
- (defun contrib/org-id-headlines ()
- "Add CUSTOM_ID properties to all headlines in the current
-file which do not already have one."
- (interactive)
- (org-map-entries (lambda ()
- (contrib/org-get-id (point) 'create))))
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:C1EFBC56-6FFD-40D8-BEF2-8D85E6797B11"
- #+end_src
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:19F2E4DE-F0C8-4C98-855C-0F25EEA3777D"
-* Loading secret config
-:PROPERTIES:
-:ID: F71603D8-BA36-4055-9417-FFED3ABF9E4B
-:END:
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:69B02AC5-E2EC-4F54-A95A-529107FDBC90"
-#+BEGIN_SRC emacs-lisp
-;; Loading secret config containing personal information
-(org-babel-load-file (sr/fun/emacs-dir "sr-secrets.org.gpg"))
-#+END_SRC
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:097D5570-E4C3-4A6F-9053-6E376B322690"
-#+RESULTS:
-: Loaded /Users/shrysr/.emacs.d/sr-secrets.org.el
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:52B84D34-975B-4FA5-ACE0-25B5E8B03CA2"
-* TODO COMMENT Bare minimum Emacs Config
-** Option as Meta for Misuharu Emacs
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:82EE0953-25E3-4B54-87F0-09DED130616D"
-I have decided to try the Mitsuharu version of Emacs to check whether
-the performance on my mac is better, particularly for larger and
-multiple screens.
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:2B6422A1-0824-49E9-B61C-85F2825FD65F"
-Some caveats here are that - an old version of Emacs is being used and
-there are issues in calling multi-tty or emacsclient. This is a serious
-problem for me since I use Emacs daemon and client all the time.
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:9F1EC481-263B-414B-891F-207016324B09"
+
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:9A05CEEE-F111-40F3-A31A-6C1407871BC5"
+
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:3B67974A-E960-4AF0-92A9-2833871719DC"
+
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:6B640E4D-83FA-49C6-8FE8-FA2024369E5A"
+
+,#+INCLUDE: "~/.emacs.d/emacs-config.org::#h:E3856DC0-C71D-48D7-9D20-EB37E64CD645"
+
+#+END_SRC
+
+Lets process the above includes using Emacs and over-write the file to
+contain the actual Org headers and source blocks. Subsequently, we can
+launch a separate tangle into lisp files.
#+BEGIN_SRC emacs-lisp
-(setq mac-option-modifier 'meta)
+
#+END_SRC
-** Server
-With the Mitsuharu build
-(https://github.com/railwaycat/homebrew-emacsmacport/issues/52#issuecomment-572271448),
-this workaround is necessary.
+* COMMENT #Testing Area
+:PROPERTIES:
+:CUSTOM_ID: h:CC27A0B8-3720-481D-AD8B-DF28AF76194A
+:END:
+
+This section will be the place where all new packages and their settings
+make an entrance. In short the test will be that they are not activated
+by default and if I seek out the package, that would mean I find it
+useful to include in my main configuration.
+** Emacs rsync
+:PROPERTIES:
+:CUSTOM_ID: h:1A0BC197-3093-4012-97A8-1B8003959980
+:END:
+
+ I have always wanted an Emacs interface rsync and this may help me
+ manage my files and pastes from my VPS a little better.
+
+ #+BEGIN_SRC emacs-lisp
+(use-package rsync
+ :straight (rsync :host github :repo "esac-io/rsync.el")
+:config
+(require 'rysnc nil t))
+
+ #+END_SRC
+** weechat
+THis is an attempt to use erc to connect to a weechat instance running
+on Tmux on my VPS.
+Apparently the rx-package is a requirement for this packaeg and it also
+depends on circe.
#+BEGIN_SRC emacs-lisp
-(use-package mac-pseudo-daemon
- :straight (:type git :host github :repo "DarwinAwardWinner/mac-pseudo-daemon")
- :config
-(mac-pseudo-daemon-mode 1))
+(straight-use-package 'rx)
+(require 'rx)
+(straight-use-package 's)
+(straight-use-package 'cl-lib)
+#+END_SRC
-(server-start)
+#+BEGIN_SRC emacs-lisp
+(use-package weechat
+:config
+(require 'weechat))
#+END_SRC
-* Loading secret config
+** Org bullets
:PROPERTIES:
-:ID: F71603D8-BA36-4055-9417-FFED3ABF9E4B
+:ID: 0A9A08EC-7693-43CF-85B3-85CAC5129AE1
+:CUSTOM_ID: h:3AE7B8B9-C9D3-4D11-A5AA-0AD562395276
:END:
-#+BEGIN_SRC emacs-lisp
-;; Loading secret config containing personal information
-(org-babel-load-file (sr/fun/emacs-dir "sr-secrets.org.gpg"))
+- Note taken on [2020-08-21 Fri 04:14] \\
+ The org-superstar package supercedes this package and is being used.
+- Note taken on [2020-08-15 Sat 19:58] \\
+ A discussion on #Emacs indicated that others are not experiencing any
+ significant lag by enabling org-bullets. Re-enabling to check the
+ performance.
+- Note taken on [2020-03-23 Mon 08:50] \\
+ This appears to slow down the loading of org files considerably. I
+ want a consistent setup that also works well on terminal and across
+ Tramp. There may be better choices to spend this overhead on rather
+ than aesthetics.
+
+#+BEGIN_SRC emacs-lisp :tangle no
+(use-package org-bullets
+:after (org)
+:straight t
+:config
+(add-hook 'org-mode-hook 'org-bullets-mode))
#+END_SRC
-#+RESULTS:
-: Loaded /Users/shrysr/.emacs.d/sr-secrets.org.el
+Alternately: Hide leading stars
-* COMMENT #Testing Area
+Though org-bullets and other packages make org-mode documents look
+great, this is a simpler in-built option that serves the purpose in
+general. There are some other difficulties as outlined in this [[https://emacs.stackexchange.com/questions/7429/how-to-customize-org-mode-indentation][SE
+Discussion]].
+
+/Note the variable documentation stating font-lock-mode has to be
+restarted for regions that are already fontified./
+
+#+BEGIN_SRC emacs-lisp :tangle no
+(setq org-hide-leading-stars t)
+#+END_SRC
+** TODO direnv
:PROPERTIES:
+:ID: 8A15FBDF-429B-42B5-BDD8-D782504E4D2E
+:CUSTOM_ID: h:C263FA3E-687F-42C2-AD9B-1AC7AFA2987C
:END:
-This section will be the place where all new packages and their settings make an entrance. In short the test will be that they are not activated by default and if I seek out the package, that would mean I find it useful to include in my main configuration.
+#+BEGIN_QUOTE
+it works by invoking direnv to obtain the environment for the current
+file, then updating the emacs variables process-environment and
+exec-path.
+
+the result is that programs started from within emacs, such as inferior
+shells, linters, compilers, and test runners, will be looked up in the
+correct $PATH, and will be started with the correct environment
+variables set.
+
+https://github.com/wbolster/emacs-direnv
+#+END_QUOTE
+
+The above desription sounds like exactly what I need. This requires direnv installed in the system.
+#+BEGIN_SRC emacs-lisp
+(use-package direnv
+ :config
+ (direnv-mode))
+#+END_SRC
** org-id-cleanup
+:PROPERTIES:
+:CUSTOM_ID: h:EB26B678-3941-41D1-BDF3-E501F722E846
+:END:
- Note taken on [2020-05-11 Mon 21:46] \\
I am not sure if this will erase mail links of mu4e. I have to find a
@@ -8497,14 +10672,43 @@ This section will be the place where all new packages and their settings make an
(use-package org-id-cleanup
:straight (org-id-cleanup :type git :host github :repo "marcIhm/org-id-cleanup"))
#+END_SRC
+
+** TODO org-tanglesync
+:PROPERTIES:
+:ID: B6B44B8F-3F8C-4CE5-8763-CCC2F4A85874
+:CUSTOM_ID: h:624B72C6-A077-488E-A2C4-C9B39046F0FC
+:END:
+
+- [ ] Do I want this enabled globally?
+- [ ] Global files that I want to watch?
+ - [ ] Emacs config. This may negate the need for a separate function
+ to tangle on save?
+-
+
+#+BEGIN_SRC emacs-lisp
+(use-package org-tanglesync
+ :straight t
+ :hook ((org-mode . org-tanglesync-mode)
+ ;; enable watch-mode globally:
+ ((prog-mode text-mode) . org-tanglesync-watch-mode))
+ :custom
+ (org-tanglesync-watch-files '("emacs-config.org" "myotherconf.org"))
+ :bind
+ (( "C-c M-i" . org-tanglesync-process-buffer-interactive)
+ ( "C-c M-a" . org-tanglesync-process-buffer-automatic)))
+#+END_SRC
+
** org-roam
+:PROPERTIES:
+:CUSTOM_ID: h:714B43A1-0AA7-47A6-BB9F-17B70BBDE52C
+:END:
#+BEGIN_SRC emacs-lisp
(use-package org-roam
:hook
(after-init . org-roam-mode)
:custom
- (org-roam-directory (sr/fun/org-dir ""))
+ (org-roam-directory (sr/fun/roam-public-dir ""))
:bind (:map org-roam-mode-map
(("C-c n l" . org-roam)
("C-c n f" . org-roam-find-file)
@@ -8517,11 +10721,12 @@ This section will be the place where all new packages and their settings make an
:PROPERTIES:
:CREATED: [2020-07-13 Mon 12:49]
:ID: 1E97AAF4-F43A-4811-9AA2-0EDF5285FD95
+:CUSTOM_ID: h:8A8ACE4B-C872-44B6-866E-F7431C3A1964
:END:
Though this is an aesthetic setting, it is somewhat more related to
lisp. Staring at my Emacs configuration for a long makes me think that
-this could be a useful addition.
+this could be a useful addition.
- [ ] Reference: Gitlab issue with Modus Themes
@@ -8533,13 +10738,22 @@ this could be a useful addition.
#+END_SRC
** Enhanced python config
+:PROPERTIES:
+:CUSTOM_ID: h:19A54136-C2B3-4A8C-8783-A040677CD21C
+:END:
*** TODO COMMENT Adapted python config
+:PROPERTIES:
+:CUSTOM_ID: h:F8369F9F-B9B4-4BF4-AF79-9F265D01CDD4
+:END:
Source [[https://github.com/PythonNut/quark-emacs/blob/dev/modules/config-python.el][quark-emacs/config-python.el at dev · PythonNut/quark-emacs · GitHub]]
This is a nice and detailed configuration for python that is worth
studying. I will be adapting this to my purposes.
**** Find local virtualenv
+:PROPERTIES:
+:CUSTOM_ID: h:4ED7C78A-B29E-42A9-A460-5D9BE71AD717
+:END:
- Note taken on [2020-04-05 Sun 15:16] \\
THe savehist package needs to be installed to use this
configuration. I have taken a minimal bunch of settings. This appears
@@ -8561,46 +10775,46 @@ studying. I will be adapting this to my purposes.
Return either a string or nil."
(message "Searching for Python virtual environment at %s" default-directory)
(let* ((default-directory (or dir default-directory))
- (path
- (cl-block nil
- (when (and (my/local-executable-find "poetry")
- (locate-dominating-file default-directory
- "pyproject.toml"))
- ;; First, we try poetry env, which is safe and a bit
- ;; faster, but only works in poetry versions 1.0 and up
- (cl-destructuring-bind (return-code . output)
- (my/process-file-to-string "poetry" nil '(t nil) nil
- "env"
- "info"
- "-p")
- (when (= 0 return-code)
- (cl-return output)))
- ;; Fall back to poetry <1.0 check TODO: This code
- ;; will become stale over time, so get rid of it
- ;; after a while.
- ;; Radon: May create virtualenv, but whatever.
- (cl-destructuring-bind (return-code . output)
- (my/process-file-to-string "poetry" nil '(t nil) nil
- "run"
- "which"
- "python")
- (when (and (= 0 return-code)
- (string-match (rx bol
- (group (1+ any))
- "/bin/python\n")
- output))
- (cl-return (match-string 1 output)))))
- (when (and (my/local-executable-find "pipenv")
- (locate-dominating-file default-directory
- "Pipfile"))
- (cl-destructuring-bind (return-code . output)
- (my/process-file-to-string "pipenv" nil '(t nil) nil
- "--venv")
- (when (= 0 return-code)
- (cl-return (string-trim output)))))))
- (universal-path (if (tramp-tramp-file-p default-directory)
- (my/tramp-build-name-from-localname path)
- path)))
+ (path
+ (cl-block nil
+ (when (and (my/local-executable-find "poetry")
+ (locate-dominating-file default-directory
+ "pyproject.toml"))
+ ;; First, we try poetry env, which is safe and a bit
+ ;; faster, but only works in poetry versions 1.0 and up
+ (cl-destructuring-bind (return-code . output)
+ (my/process-file-to-string "poetry" nil '(t nil) nil
+ "env"
+ "info"
+ "-p")
+ (when (= 0 return-code)
+ (cl-return output)))
+ ;; Fall back to poetry <1.0 check TODO: This code
+ ;; will become stale over time, so get rid of it
+ ;; after a while.
+ ;; Radon: May create virtualenv, but whatever.
+ (cl-destructuring-bind (return-code . output)
+ (my/process-file-to-string "poetry" nil '(t nil) nil
+ "run"
+ "which"
+ "python")
+ (when (and (= 0 return-code)
+ (string-match (rx bol
+ (group (1+ any))
+ "/bin/python\n")
+ output))
+ (cl-return (match-string 1 output)))))
+ (when (and (my/local-executable-find "pipenv")
+ (locate-dominating-file default-directory
+ "Pipfile"))
+ (cl-destructuring-bind (return-code . output)
+ (my/process-file-to-string "pipenv" nil '(t nil) nil
+ "--venv")
+ (when (= 0 return-code)
+ (cl-return (string-trim output)))))))
+ (universal-path (if (tramp-tramp-file-p default-directory)
+ (my/tramp-build-name-from-localname path)
+ path)))
(when (file-directory-p universal-path)
(substring-no-properties universal-path))))
@@ -8609,23 +10823,26 @@ studying. I will be adapting this to my purposes.
(defun my/python-find-virtualenv-cached (&optional dir)
(let* ((dir (or dir default-directory))
- (pyproject (locate-dominating-file dir "pyproject.toml")))
+ (pyproject (locate-dominating-file dir "pyproject.toml")))
(unless my/python-virtualenv-cache
(setq my/python-virtualenv-cache (make-hash-table :test #'equal)))
(if (and (my/local-executable-find "poetry")
- dir
- (not (file-exists-p (expand-file-name ".venv" dir))))
- (let ((cached (or (gethash dir my/python-virtualenv-cache)
- (puthash dir
- (my/python-find-virtualenv dir)
- my/python-virtualenv-cache))))
- (if (file-exists-p cached)
- cached
- (my/python-find-virtualenv dir)))
+ dir
+ (not (file-exists-p (expand-file-name ".venv" dir))))
+ (let ((cached (or (gethash dir my/python-virtualenv-cache)
+ (puthash dir
+ (my/python-find-virtualenv dir)
+ my/python-virtualenv-cache))))
+ (if (file-exists-p cached)
+ cached
+ (my/python-find-virtualenv dir)))
(my/python-find-virtualenv dir))))
#+END_SRC
**** Remote python
+:PROPERTIES:
+:CUSTOM_ID: h:FEE37502-C528-4A35-AA86-620E731A332A
+:END:
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'pythonic
@@ -8660,6 +10877,9 @@ studying. I will be adapting this to my purposes.
#+END_SRC
**** pyvenv
+:PROPERTIES:
+:CUSTOM_ID: h:7860C326-AA96-4351-857D-2143772B9D46
+:END:
#+BEGIN_SRC emacs-lisp
(use-package pyvenv
@@ -8668,14 +10888,20 @@ studying. I will be adapting this to my purposes.
(interactive "P")
(let ((default-venv (my/python-find-virtualenv-cached)))
(if (or (not default-venv) (consp (car arg)))
- (list (read-directory-name "Activate venv: "))
- (list default-venv))))
+ (list (read-directory-name "Activate venv: "))
+ (list default-venv))))
(advice-add 'pyvenv-activate :filter-args #'nadvice/pyvenv-activate))
#+END_SRC
**** TODO ms-lsp detailed config
+:PROPERTIES:
+:CUSTOM_ID: h:61605C51-5418-418D-842B-A4AB68516AD1
+:END:
*** TODO COMMENT Standard set of requirements for pip installations
+:PROPERTIES:
+:CUSTOM_ID: h:479BCBFD-F48D-44CB-9ADB-78FA5B9DB0DA
+:END:
- Note taken on [2020-04-05 Sun 15:37] \\
The goal is to create a standard set of installations for any
virtualenvironment that is created. This basic set can be built further
@@ -8685,6 +10911,9 @@ studying. I will be adapting this to my purposes.
pip install numpy pandas jupyter scikitlearn black
#+END_SRC
** Org spacer
+:PROPERTIES:
+:CUSTOM_ID: h:D4C85050-F584-4FC9-BB32-55B162127AD7
+:END:
#+BEGIN_QUOTE
This simple package allows you to enforce the number of blanks lines after elements in an org-mode document.
@@ -8718,6 +10947,9 @@ Perhaps this package can extended as some tool belt of org utilities. Some ideas
| 1 | paragraph | src-block | table | property-drawer |
** Python source block tests
+:PROPERTIES:
+:CUSTOM_ID: h:47A775CB-A056-471E-8727-B6EFAB378AA7
+:END:
- Syntax highlighting is taking place
-
@@ -8760,13 +10992,16 @@ print(sys.path)
#+RESULTS:
: ['', '/Users/shrysr/.pyenv/versions/3.7.5/lib/python37.zip', '/Users/shrysr/.pyenv/versions/3.7.5/lib/python3.7', '/Users/shrysr/.pyenv/versions/3.7.5/lib/python3.7/lib-dynload', '/Users/shrysr/.local/pipx/venvs/numpy/lib/python3.7/site-packages', '/Users/shrysr/.local/pipx/shared/lib/python3.7/site-packages']
-#+BEGIN_SRC zsh :tangle no
+#+BEGIN_SRC sh :tangle no
pipx inject numpy jupyter
#+END_SRC
#+RESULTS:
** Modeline adjustments
+:PROPERTIES:
+:CUSTOM_ID: h:DB4B092B-B784-4667-927B-70F8372EE0B5
+:END:
#+BEGIN_SRC emacs-lisp
;; (defun set-eyeliner-colors ()
@@ -8803,6 +11038,9 @@ pipx inject numpy jupyter
#+END_SRC
** helpful
+:PROPERTIES:
+:CUSTOM_ID: h:B3CD6B12-53F3-4D6A-A1DA-800F18FBFDFC
+:END:
#+BEGIN_SRC emacs-lisp
(use-package helpful :straight (helpful :type git :host github :repo "Wilfred/helpful"))
@@ -8819,13 +11057,16 @@ pipx inject numpy jupyter
: helpful-key
** Linkmarks
+:PROPERTIES:
+:CUSTOM_ID: h:F5D82DD8-1F6F-4552-81A0-4B8C50CACF2F
+:END:
#+BEGIN_SRC emacs-lisp
(use-package linkmarks
:straight (linkmarks
- :type git
- :host github
- :repo "dustinlacewell/linkmarks")
+ :type git
+ :host github
+ :repo "dustinlacewell/linkmarks")
:config
(setq linkmarks-file "~/my_org/roam/private/emacs_meta/bookmarks.org"))
@@ -8834,13 +11075,18 @@ pipx inject numpy jupyter
#+RESULTS:
: t
** outshine
+:PROPERTIES:
+:CUSTOM_ID: h:5F86FF00-3937-4C97-B241-1B36DD70D5D8
+:END:
#+BEGIN_SRC emacs-lisp
(use-package outshine
:init (defvar outline-minor-mode-prefix "\M-#")
:config (setq outshine-use-speed-commands t)
:hook ((emacs-lisp-mode . outshine-mode)
-(nix-mode . outshine-mode)
+;; (nix-mode . outshine-mode)
+(markdown-mode . outshine-mode)
+(lisp-mode . outshine-mode)
(python-mode . outshine-mode)))
#+END_SRC
@@ -8848,6 +11094,9 @@ pipx inject numpy jupyter
#+RESULTS:
| outshine-mode |
** TODO Ensure one line space between org headlines
+:PROPERTIES:
+:CUSTOM_ID: h:65FD21E9-1984-4D78-B53D-4D83407658D7
+:END:
While this improves readability, the main reason is an odd color of the source blocks which bleeds into the headings. This snippet will ensure a single space between blocks which prevents the above.
@@ -8884,6 +11133,7 @@ nil 'make-it-local))))
** Theme : org-beautify
:PROPERTIES:
:ID: C93143D4-EEC8-4D14-A008-1E74BF447D63
+:CUSTOM_ID: h:E027A505-65FB-4509-8E2A-89A401AB83F5
:END:
- Note taken on [2020-03-22 Sun 08:59] \\
The poet theme seems a better candidate for hacking, primarily from the point
@@ -8907,12 +11157,14 @@ Found this theme thanks to Dustin. It feels therapeutic, though Leuven and Zenbu
** TODO Theme : Zenburn
:PROPERTIES:
:ID: F7BFD50A-F0A9-4107-BE53-80D8A7EFDFB6
+:CUSTOM_ID: h:C1E68AA9-644C-4EDA-A32F-A7167689212C
:END:
For a long period, I was using the zenburn theme and had started customising it for my needs. However, I think leuven with a greyish background is really quite suitable. Even so, it's nice to have a dark theme available when required. I'm keeping this around for tinkering down the line.
*** Disabling leuven and loading other theme
:PROPERTIES:
:ID: ecce6509-d04c-4e2d-a6a6-c5cd63b1e2e7
+ :CUSTOM_ID: h:E3A680EE-3640-4042-BBA4-24B7F599FF66
:END:
#+BEGIN_SRC emacs-lisp
@@ -8924,6 +11176,7 @@ For a long period, I was using the zenburn theme and had started customising it
*** TEST Background color for org source Blocks
:PROPERTIES:
:ID: 5dfffd10-35b1-495f-8782-380f014b23ae
+ :CUSTOM_ID: h:78A8A288-CBDC-4E27-A6D5-55DF8A6A0485
:END:
This is necessary due to the customisation in scimax
@@ -8940,6 +11193,7 @@ This is necessary due to the customisation in scimax
*** TEST Initial setup of Zenburn
:PROPERTIES:
:ID: 06b3970f-94e2-4325-ae27-d63c1b3b796c
+ :CUSTOM_ID: h:598F3C6F-EB1E-4021-827C-5C1C1862AFA5
:END:
#+BEGIN_SRC emacs-lisp
@@ -8954,6 +11208,9 @@ This is necessary due to the customisation in scimax
#+END_SRC
*** TODO Use-package based template for customising zenburn
+:PROPERTIES:
+:CUSTOM_ID: h:8B286CFC-E1A4-4F38-B551-F1A46E6D4F0A
+:END:
Source: https://github.com/m-parashar/emax64/issues/5
@@ -9001,6 +11258,7 @@ Source: https://github.com/m-parashar/emax64/issues/5
*** Setting font faces for headline level
:PROPERTIES:
:ID: 59bca88c-42dc-46b6-b556-d8f1eec81931
+ :CUSTOM_ID: h:321E9053-DB53-4FF6-98BF-122DB45D9907
:END:
- Note taken on [2019-03-28 Thu 07:09] \\
This is available as in-built settings for the zenburn theme. However, once the font is changed, the
@@ -9019,15 +11277,19 @@ Source: https://github.com/m-parashar/emax64/issues/5
** TODO org-babel
:PROPERTIES:
+:CUSTOM_ID: h:F11FC310-2A8E-45E2-98E2-3247E7483E24
+:END:
+:PROPERTIES:
:header-args: tangle no
:END
Since I work a lot with org babel for my mixed code notebooks, this gets it's own section. I would like to incorporate useful scimax customisations for this as well.
- [ ] Incorporate Scimax's customisations in general
- [ ] Particularly incorporate ipython block customisation
-*** Languages to load
+*** COMMENT Languages to load
:PROPERTIES:
:ID: 2FEFFC39-99A5-4C72-A814-008D82B49492
+:CUSTOM_ID: h:234A4CF5-2B7B-461B-96A0-F5396272FF7B
:END:
#+BEGIN_SRC emacs-lisp
(org-babel-do-load-languages
@@ -9040,15 +11302,18 @@ Since I work a lot with org babel for my mixed code notebooks, this gets it's ow
(sql . t)
(shell . t)
;; (ipython . t)
- ;; (jupyter . t)
+ ;; (jupyter . t)
;; (ein . t)
)
)
#+end_src
+#+RESULTS:
+
*** TODO Default Header arguments and other options
:PROPERTIES:
:ID: EC40BAAB-3EC9-4E5C-B90C-806AEDAB83DE
+:CUSTOM_ID: h:1E43BCCA-D4F6-4C68-BA40-ED5AE5BD208E
:END:
#+BEGIN_SRC emacs-lisp
@@ -9056,6 +11321,7 @@ Since I work a lot with org babel for my mixed code notebooks, this gets it's ow
(setq org-babel-default-header-args
'((:session . "none")
(:results . "silent")
+(:mkdirp . "yes")
(:exports . "code")
(:cache . "no")
(:noweb . "no")
@@ -9068,15 +11334,23 @@ Since I work a lot with org babel for my mixed code notebooks, this gets it's ow
(setq org-confirm-elisp-link-function nil))
#+END_SRC
+#+RESULTS:
+
* COMMENT #Disabled
:PROPERTIES:
:ID: 50D44546-9A06-4F1D-A582-FAD07286D962
-:LINK: [[nb:.emacs.d::emacs-config.org::c154188]]
+:CUSTOM_ID: h:8C947DD9-F0EB-435D-9B7F-C92844792593
:END:
-These are packages and snippets that disabled from tangling and execution and placed here for general reference. Some of them have been explored and discarded for various reasons. The rest are packages / features I could not get working satisfactorily.
+These are packages and snippets that disabled from tangling and
+execution and placed here for general reference. Some of them have been
+explored and discarded for various reasons. The rest are packages /
+features I could not get working satisfactorily.
** Old Hugo export functions
+:PROPERTIES:
+:CUSTOM_ID: h:88CF096F-CF12-433A-9F8E-0959A695E633
+:END:
I was using these functions earlier to generate the essential properties
and export a post to hugo. My current workflow is using
ox-hugo. THe functions are slightly modified from where I picked them up
@@ -9084,6 +11358,7 @@ ox-hugo. THe functions are slightly modified from where I picked them up
*** Defining content directory
:PROPERTIES:
:ID: 3a7485ab-33cf-4e94-ac93-7063db94a094
+:CUSTOM_ID: h:7B5536AE-246E-4EEF-8BE6-EE1AD7F0C381
:END:
- Note taken on [2019-02-07 Thu 08:06] \\
Need to check if this is still required since I have switche to ox-hugo
@@ -9096,6 +11371,7 @@ ox-hugo. THe functions are slightly modified from where I picked them up
*** Ensuring properties exist and creating if they dont exist
:PROPERTIES:
:ID: e5a99a03-c3da-420c-ae9c-9ac6e50ecbdf
+:CUSTOM_ID: h:6FB610E5-FCB9-416F-9B59-3232C64E99A1
:END:
#+BEGIN_SRC emacs-lisp
@@ -9140,6 +11416,7 @@ Returns the property name if the property has been created, otherwise nil."
*** Hugo function calling the above
:PROPERTIES:
:ID: c677537c-c70b-4be9-b91a-40bc283d5f40
+:CUSTOM_ID: h:70E49E12-0BA1-4119-913B-308C0EEFE432
:END:
#+BEGIN_SRC emacs-lisp
@@ -9159,7 +11436,7 @@ Returns the property name if the property has been created, otherwise nil."
"\\( *, *\\)" t) "\", \"") "\" ]\n"))
(fm (concat "+++\n"
title
- type
+ type
date
tags
topics
@@ -9189,6 +11466,9 @@ Returns the property name if the property has been created, otherwise nil."
#+RESULTS:
: hugo
** Earlier mu4e config
+:PROPERTIES:
+:CUSTOM_ID: h:D5EDD6CF-C04E-4A51-9443-7A75C298033F
+:END:
- Note taken on [2020-04-01 Wed 11:49] \\
All this content has been transferred to the use package hook.
- Note taken on [2019-02-12 Tue 14:53] \\
@@ -9237,9 +11517,9 @@ Returns the property name if the property has been created, otherwise nil."
;; setup some handy shortcuts
(setq mu4e-maildir-shortcuts
'(("/INBOX" . ?i)
- ("/Sent" . ?s)
- ("/Archive" . ?a)
- ("/Trash" . ?t)))
+ ("/Sent" . ?s)
+ ("/Archive" . ?a)
+ ("/Trash" . ?t)))
;;store link to message if in header view, not to header query
(setq org-mu4e-link-query-in-headers-mode nil
@@ -9260,35 +11540,35 @@ Returns the property name if the property has been created, otherwise nil."
;; Stolen from https://github.com/djcb/mu/issues/1431 and found thanks to parsnip in #emacs
(defun my-mu4e-mbsync-current-maildir (msg)
- (interactive)
- (let* ((maildir (downcase (substring (plist-get msg :maildir) 1)))
- (mu4e-get-mail-command (format "mbsync %s" maildir)))
- (mu4e-update-mail-and-index t)))
+ (interactive)
+ (let* ((maildir (downcase (substring (plist-get msg :maildir) 1)))
+ (mu4e-get-mail-command (format "mbsync %s" maildir)))
+ (mu4e-update-mail-and-index t)))
;; Enabling view in browser for HTML heavy emails that don't render well
(add-to-list 'mu4e-view-actions
- '("ViewInBrowser" . mu4e-action-view-in-browser) t)
+ '("ViewInBrowser" . mu4e-action-view-in-browser) t)
(add-to-list 'mu4e-view-actions
- '("mbsync maildir of mail at point" . my-mu4e-mbsync-current-maildir) t)
+ '("mbsync maildir of mail at point" . my-mu4e-mbsync-current-maildir) t)
(add-hook 'mu4e-headers-mode-hook
- (defun my/mu4e-change-headers ()
- (interactive)
- (setq mu4e-headers-fields
- `((:human-date . 12)
- (:flags . 4)
- (:from-or-to . 15)
- (:subject . ,(- (window-body-width) 47))
- (:size . 7)))))
+ (defun my/mu4e-change-headers ()
+ (interactive)
+ (setq mu4e-headers-fields
+ `((:human-date . 12)
+ (:flags . 4)
+ (:from-or-to . 15)
+ (:subject . ,(- (window-body-width) 47))
+ (:size . 7)))))
(add-hook 'mu4e-view-mode-hook (lambda () (fill-paragraph)))
(setq mu4e-view-use-gnus t)
;; Don't keep asking for confirmation for every action
(defun my-mu4e-mark-execute-all-no-confirm ()
- "Execute all marks without confirmation."
- (interactive)
- (mu4e-mark-execute-all 'no-confirm))
+ "Execute all marks without confirmation."
+ (interactive)
+ (mu4e-mark-execute-all 'no-confirm))
;; mapping x to above function
(define-key mu4e-headers-mode-map "x" #'my-mu4e-mark-execute-all-no-confirm)
@@ -9297,14 +11577,14 @@ Returns the property name if the property has been created, otherwise nil."
;; this is stolen from John but it didn't work for me until I
;; made those changes to mu4e-compose.el
(defun htmlize-and-send ()
- "When in an org-mu4e-compose-org-mode message, htmlize and send it."
- (interactive)
- (when
- (member 'org~mu4e-mime-switch-headers-or-body post-command-hook)
- (org-mime-htmlize)
- (org-mu4e-compose-org-mode)
- (mu4e-compose-mode)
- (message-send-and-exit)))
+ "When in an org-mu4e-compose-org-mode message, htmlize and send it."
+ (interactive)
+ (when
+ (member 'org~mu4e-mime-switch-headers-or-body post-command-hook)
+ (org-mime-htmlize)
+ (org-mu4e-compose-org-mode)
+ (mu4e-compose-mode)
+ (message-send-and-exit)))
;; This overloads the amazing C-c C-c commands in org-mode with one more function
;; namely the htmlize-and-send, above.
@@ -9318,9 +11598,9 @@ Returns the property name if the property has been created, otherwise nil."
;; when switch off queue mode, I still prefer async sending
(use-package async
- :ensure t
- :defer nil
- :config (require 'smtpmail-async))
+ :ensure t
+ :defer nil
+ :config (require 'smtpmail-async))
(setq
send-mail-function 'async-smtpmail-send-it
@@ -9344,6 +11624,9 @@ Returns the property name if the property has been created, otherwise nil."
#+RESULTS:
: /Users/shrysr/my_mail/fmail/Queue/cur
** Archival Retain file structure
+:PROPERTIES:
+:CUSTOM_ID: h:64A86652-D5F8-4B43-9DA2-AD5E2532E18E
+:END:
- Note taken on [2020-04-05 Sun 08:57] \\
Apparently, a new org version does not have the org-extract-archive-file
function any more. Otherwise, this was my earlier preferred
@@ -9381,6 +11664,9 @@ Archive organised by Top level headings in the original file and with Tag preser
(org-set-tags-to tags)))))
#+end_src
** ag.el
+:PROPERTIES:
+:CUSTOM_ID: h:28720BD6-47BB-4E85-B14D-D15AE1AD1309
+:END:
- Note taken on [2020-03-30 Mon 18:06] \\
Though helm-do-ag is avialable, this appears to be a separate ag implementation that does not required the separate silver searcher program to be installed in the system. This remains to be verified.
@@ -9391,6 +11677,7 @@ Archive organised by Top level headings in the original file and with Tag preser
** Removing timestamp from datetree captures
:PROPERTIES:
:ID: 4ED98157-D6D9-463C-BE2B-FAE5DB1FC3C6
+:CUSTOM_ID: h:8481F27C-C574-462D-88DC-00EA492019FF
:END:
- Note taken on [2020-04-02 Thu 01:39] \\
This was needed due to some setting in scimax or an org mode
@@ -9403,6 +11690,9 @@ Archive organised by Top level headings in the original file and with Tag preser
#+RESULTS:
** Theme : Poet
+:PROPERTIES:
+:CUSTOM_ID: h:81DAB4F9-43F8-4269-B213-23C9D4A15FC4
+:END:
- Note taken on [2020-03-22 Sun 12:41] \\
Apparently, with a high gloss screen, it makes no difference whether the theme is light or dark. The distracting reflection still exists. Interestingly enough, the macbook pro screen does not reflect much under the same conditions and position with respect to light source.
@@ -9411,58 +11701,41 @@ Archive organised by Top level headings in the original file and with Tag preser
:straight t
:config
(set-face-attribute 'default nil
- :family "iA Writer Mono V"
- :height 130)
+ :family "iA Writer Mono V"
+ :height 130)
(set-face-attribute 'fixed-pitch nil :family "Iosevka term")
(set-face-attribute 'variable-pitch nil :family "iA Writer Duo S")
(custom-set-faces
'(org-level-1 ((t (:inherit outline-1
- :height 1.5
- :weight bold))))
+ :height 1.5
+ :weight bold))))
'(org-level-2 ((t (:inherit outline-2
- :height 1.3
- :weight bold))))
+ :height 1.3
+ :weight bold))))
'(org-level-3 ((t (:inherit outline-3
- :height 1.2
- :weight bold))))
+ :height 1.2
+ :weight bold))))
'(org-level-4 ((t (:inherit outline-4
- :height 1.1
- :weight bold))))
+ :height 1.1
+ :weight bold))))
'(org-level-5 ((t (:inherit outline-5
- :height 1.0
- :weight bold)))))
+ :height 1.0
+ :weight bold)))))
;; Enabling the variable pitch mode
(add-hook 'text-mode-hook
- (lambda ()
- (variable-pitch-mode 1)
- (visual-line-mode 1)))
+ (lambda ()
+ (variable-pitch-mode 1)
+ (visual-line-mode 1)))
(load-theme 'poet-dark))
#+END_SRC
#+RESULTS:
: t
-** Org bullets
-:PROPERTIES:
-:ID: 0A9A08EC-7693-43CF-85B3-85CAC5129AE1
-:END:
-
-- Note taken on [2020-03-23 Mon 08:50] \\
- This appears to slow down the loading of org files considerably. I want a consistent setup that also works well on terminal and across Tramp. There may be better choices to spend this overhead on rather than aesthetics.
-
-#+BEGIN_SRC emacs-lisp :tangle no
-(use-package org-bullets
-:after (org)
-:config
-(add-hook 'org-mode-hook 'org-bullets-mode))
-#+END_SRC
-
-#+RESULTS:
-: t
-
** Auto-fill text mode
:PROPERTIES:
:ID: 751B3E4C-1BBC-419D-BAD3-8F4A3880FB6D
+:CUSTOM_ID: h:5DB6E5CC-3637-4E8C-A138-455BA1178D1E
:END:
- Note taken on [2020-03-22 Sun 15:04] \\
This seems to introduce some weird characteristics in terms of line
@@ -9478,6 +11751,7 @@ Archive organised by Top level headings in the original file and with Tag preser
** Font Customisation based on OS
:PROPERTIES:
:ID: 9e3c92e5-1049-4582-b165-0cd3ba7e2d95
+ :CUSTOM_ID: h:1245DB97-F106-4F00-A0C3-A1A1A28D0F35
:END:
- Note taken on [2020-03-22 Sun 12:35] \\
@@ -9500,6 +11774,7 @@ The same font is named differently in Antergos (Linux) and in the Mac OS.
** Org babel load
:PROPERTIES:
:ID: DDDC0DB7-8E9B-4509-B315-73BEB30F6D29
+:CUSTOM_ID: h:CD1D5C56-32F1-4D68-B29A-5274C6B9337B
:END:
- Note taken on [2020-03-22 Sun 11:15] \\
This is not required. The overhead of tangling during the loading of Emacs is
@@ -9514,9 +11789,13 @@ The same font is named differently in Antergos (Linux) and in the Mac OS.
#+END_SRC
** Earlier Brain :archive:
+:PROPERTIES:
+:CUSTOM_ID: h:5809492E-A97B-41B6-A26E-FB46C2DA329F
+:END:
*** org-brain
:PROPERTIES:
:header-args: :tangle no
+:CUSTOM_ID: h:2ACB4E7F-1E17-4EA4-AEC0-BE587C5A7094
:END:
#+BEGIN_QUOTE
@@ -9531,6 +11810,7 @@ You can think of org-brain as a combination of a wiki and a mind map, where each
CLOSED: [2019-04-11 Thu 08:52]
:PROPERTIES:
:ID: ae3c3f14-d570-4fc0-b3b2-156020ba7c61
+:CUSTOM_ID: h:AF9B9BE2-A430-44F7-BEFB-7790E3B46A33
:END:
Since org-brain requires the org id for a heading to be recognized and displayed, it is convenient to have capture and refile mechanisms that create the org-id if the heading does not have it.
@@ -9562,7 +11842,13 @@ Further streamlining is necessary as such.
#+RESULTS:
: helm-brain
*** Polybrain
+:PROPERTIES:
+:CUSTOM_ID: h:DA9D26EB-1C2C-4A17-B9A5-C8067A9F71A2
+:END:
**** Dustin's forked org-brain
+:PROPERTIES:
+:CUSTOM_ID: h:8F31290B-1B56-411F-8433-2D7D249F4DA3
+:END:
#+BEGIN_SRC emacs-lisp :tangle no
(use-package org-brain
@@ -9575,7 +11861,7 @@ Further streamlining is necessary as such.
("C-p" . my/org-brain-visualize-parent)
("C-n" . my/org-brain-visualize-child))
:init
- (setq org-brain-path "~/my_org/brain/")
+ (setq org-brain-path "~/my_org/roam/")
;; ;; For Evil users
;; (with-eval-after-load 'evil
;; (evil-set-initial-state 'org-brain-visualize-mode 'emacs))
@@ -9594,6 +11880,7 @@ Further streamlining is necessary as such.
**** polybrain navigation helpers
:PROPERTIES:
:ID: 097E6DB9-79E7-4AFB-9533-E625603B60F4
+:CUSTOM_ID: h:A37F46A1-0FEC-48DB-852B-C0821CC374DE
:END:
#+BEGIN_SRC emacs-lisp
@@ -9619,6 +11906,7 @@ Further streamlining is necessary as such.
**** polybrain package
:PROPERTIES:
:ID: DC735D2F-8395-4C5E-BB66-5918110B02BD
+:CUSTOM_ID: h:0908417B-9A0B-4111-A4EB-8F6BC986C1F5
:END:
#+BEGIN_SRC emacs-lisp
@@ -9636,6 +11924,7 @@ Further streamlining is necessary as such.
** TEST Org-brain export
:PROPERTIES:
:ID: 37472632-AC12-4DD9-998C-A25D5B444695
+:CUSTOM_ID: h:7F9CD7F9-FCDE-471A-A837-CEEA3605EA36
:END:
- Note taken on [2020-02-24 Mon 17:51] \\
I have this working for normal text based entries. However, it appears an explicit instruction has to be provided for code snippets to not execute. The HTML output, mentioned as a desired enhancement is also quite lacking. I wonder if it would be possible to use the existing CSS samples for a basic output.
@@ -9672,6 +11961,9 @@ git clone https://github.com/Kungsgeten/org-brain-export.git
: t
** scimax-gitter
+:PROPERTIES:
+:CUSTOM_ID: h:1A846289-2298-4CEE-9BB8-92472D3FC28A
+:END:
#+BEGIN_SRC emacs-lisp :tangle no
(use-package scimax-gitter
@@ -9686,6 +11978,7 @@ git clone https://github.com/Kungsgeten/org-brain-export.git
** yanking links in org format
:PROPERTIES:
:ID: 8fa6f610-3dcf-40ab-96f4-7d1d6e975f72
+ :CUSTOM_ID: h:497C3271-CCF6-441A-B092-51BA9A7353C2
:END:
- Note taken on [2020-03-05 Thu 08:36] \\
@@ -9706,6 +11999,7 @@ git clone https://github.com/Kungsgeten/org-brain-export.git
** TEST Enabling adding tags in the capture window
:PROPERTIES:
:ID: 7e96fe9d-9f6e-4fc6-9eb4-09c53139d29b
+ :CUSTOM_ID: h:AE48C273-229C-4E7A-BF8C-8C4597DEEF01
:END:
#+BEGIN_SRC emacs-lisp
@@ -9723,6 +12017,7 @@ git clone https://github.com/Kungsgeten/org-brain-export.git
** TEST Enabling org capture and org protocol
:PROPERTIES:
:ID: 30b75dfc-72d9-4d45-b9ce-ea7da17642a0
+:CUSTOM_ID: h:49B12692-E48D-4CD2-8796-030A44955759
:END:
- Note taken on [2019-02-07 Thu 08:55] \\
@@ -9738,18 +12033,27 @@ Source: http://www.diegoberrocal.com/blog/2015/08/19/org-protocol/
#+RESULTS:
: org-capture
** CANCEL org-wiki
+:PROPERTIES:
+:CUSTOM_ID: h:18235EE4-EBEA-443B-845B-B3ADE37181D4
+:END:
*** Installation
+:PROPERTIES:
+:CUSTOM_ID: h:E5322785-B3A5-40FF-AFC8-BA83B7C40DDA
+:END:
#+BEGIN_SRC elisp :tangle no
(let ((url "https://raw.githubusercontent.com/caiorss/org-wiki/master/org-wiki.el"))
(with-current-buffer (url-retrieve-synchronously url)
- (goto-char (point-min))
- (re-search-forward "^$")
- (delete-region (point) (point-min))
- (kill-whole-line)
- (package-install-from-buffer)))
+ (goto-char (point-min))
+ (re-search-forward "^$")
+ (delete-region (point) (point-min))
+ (kill-whole-line)
+ (package-install-from-buffer)))
#+END_SRC
*** Setup
+:PROPERTIES:
+:CUSTOM_ID: h:A07F33D5-8E2C-4A8A-AA09-9559C098F389
+:END:
#+BEGIN_SRC emacs-lisp :tangle no
(require 'org-wiki)
(setq org-wiki-location "~/my_projects/ds-job-search")
@@ -9761,6 +12065,7 @@ Source: http://www.diegoberrocal.com/blog/2015/08/19/org-protocol/
** SLIME and lisp
:PROPERTIES:
:ID: 18C0EBA2-3AD0-434B-ACBC-D62785AC5D8A
+:CUSTOM_ID: h:79736718-D146-41AE-84EA-79530AE8A010
:END:
Installing the SLIME package
@@ -9790,6 +12095,7 @@ Setting the location of the lisp interpreter based on the OS being used:
** org2blog : publishing to wordpress [0/1]
:PROPERTIES:
:CREATED: [2019-07-21 Sun]
+:CUSTOM_ID: h:790B218F-51DE-4264-9084-7ED91945E29D
:END:
- Note taken on [2020-01-23 Thu 10:46] \\
I am not using org2blog anymore.
@@ -9867,6 +12173,9 @@ This was intimidating in the past, but reading the source code may be the best w
: t
** TEST helm-ext
+:PROPERTIES:
+:CUSTOM_ID: h:2523EF1C-A7ED-4F85-8B5B-35DA6CC11AE5
+:END:
- Note taken on [2019-04-29 Mon 08:01] \\
Disabling excecution for the time being.
@@ -9890,8 +12199,14 @@ https://github.com/cute-jumper/helm-ext
: t
** Scimax customisations
+:PROPERTIES:
+:CUSTOM_ID: h:948B68E9-08BA-4009-AFFD-340709DA84EB
+:END:
*** Enabling Scimax Statistics
+:PROPERTIES:
+:CUSTOM_ID: h:95280BAB-0FD1-423C-A5A3-85595E2B912F
+:END:
- Note taken on [2019-10-07 Mon 13:17] \\
The default config is insufficient and in particular, uses the ess-smart-underscore package which is not useful to my general workflow.
@@ -9904,6 +12219,7 @@ https://github.com/cute-jumper/helm-ext
** TEST Activating windmove to facilitate Hydras
:PROPERTIES:
:ID: 5a4803e5-f18f-4704-b4e7-a717649d30f6
+ :CUSTOM_ID: h:726C5EFF-8110-4229-9B2B-A3AE64056442
:END:
Super would actually be a good option. However, this interferes with default configurations in MS Windows, especially while using virtualbox. Using Meta for now.
@@ -9913,6 +12229,9 @@ Super would actually be a good option. However, this interferes with default con
#+END_SRC
** TEST Export async
+:PROPERTIES:
+:CUSTOM_ID: h:0684D38A-3343-4C0E-B5DF-13711B931732
+:END:
- Note taken on [2019-02-14 Thu 16:03] \\
This requires a separate init file to be setup that enables Emacs to launch a separate process to export large files. It would be better as a vanilla emacs file.
@@ -9928,6 +12247,7 @@ Super would actually be a good option. However, this interferes with default con
** TEST Ob-async
:PROPERTIES:
:ID: 79f2263f-8da8-4b80-952e-c1c2e7f0ea12
+ :CUSTOM_ID: h:5BC22784-7EDF-425C-A696-B9713E8154E0
:END:
- Note taken on [2019-02-14 Thu 16:02] \\
This should enable evaluating code in org babel source blocks asynchronously. The header in the source block should have the async enabled.
@@ -9941,6 +12261,9 @@ Super would actually be a good option. However, this interferes with default con
#+RESULTS:
** TEST Tags setup
+:PROPERTIES:
+:CUSTOM_ID: h:ED89B315-5BC8-48C7-8A1F-F7C534A4CBE0
+:END:
Borrowing [[https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setup-tags.el][Kaushal modi's setup]] for tags. I will start with using gtags and expand later to ctags.
@@ -9987,6 +12310,9 @@ Borrowing [[https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setu
#+RESULTS:
** TEST Icicles
+:PROPERTIES:
+:CUSTOM_ID: h:31245A12-2B23-466C-9A80-118FD3A4BB1C
+:END:
- Note taken on [2019-02-28 Thu 16:01] \\
The default key bindings of icicles changes the org source block edit shortcut. However, the package appears very interesting so far, if not a bit slow to respond. Switching over to icicles will need some research for making sure none of the existing keybindings and workflows are crippled. This package cannot be installed via Melpa. The easiest method appears to be to download the files as a zip folder from the [[https://github.com/emacsmirror/icicles][icicle git repository]]. The automatic install script draws files from the Emacs wiki, which at times may be down. As such icicles can be switched off by using =M-x icy-mode=.
@@ -10005,6 +12331,7 @@ Borrowing [[https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setu
** erc
:PROPERTIES:
:ID: 1984eb94-3d71-4de0-abe2-900f534d1696
+:CUSTOM_ID: h:B44B4D56-5305-4742-A4D9-8E36B80B4D6F
:END:
- Note taken on [2019-10-23 Wed 09:15] \\
I'm currently using weechat over tmux, but there are great conveniences in using erc. It is possible then to capture conversation and make notes more easily.
@@ -10042,6 +12369,7 @@ Loading ERC without password (temporarily). The password has to be set in the .a
** Scheme setup
:PROPERTIES:
:ID: b60ce433-989d-4339-a573-72550ff61d98
+ :CUSTOM_ID: h:D0FCACAC-477B-4E65-9BF0-5E1C1C878EED
:END:
- Note taken on [2019-10-23 Wed 09:21] \\
I used this briefly during a foray into the SICP course.
@@ -10057,6 +12385,9 @@ Loading ERC without password (temporarily). The password has to be set in the .a
#+end_src
** TODO lintr
+:PROPERTIES:
+:CUSTOM_ID: h:5B0F2151-4BD3-4EB9-A448-54C9E15CA612
+:END:
- Note taken on [2019-02-11 Mon 07:21] \\
It appears there is no package called lintr. This needs further investigation.
@@ -10074,6 +12405,7 @@ This package is deemed necessary to enable flymake in ESS. Without it, there is
** Better defaults
:PROPERTIES:
:ID: 8d1243f5-a37d-4d17-b141-d54b862dcb73
+ :CUSTOM_ID: h:7272FDB7-D036-48CF-AA12-E656DC6BFEBE
:END:
- Note taken on [2019-08-28 Wed 13:45] \\
Disabling this package until it is explored better.
@@ -10089,6 +12421,9 @@ I need to explore the changed made by this package. For now, it is loaded right
#+end_src
** w3m customisation
+:PROPERTIES:
+:CUSTOM_ID: h:64E7A25F-84D4-43DE-873F-0C33975D4E80
+:END:
- Note taken on [2020-01-23 Thu 10:46] \\
I have switched to using eww for my browsing within Emacs.
@@ -10101,6 +12436,7 @@ A few snippets were sourced from: http://beatofthegeek.com/2014/02/my-setup-for-
*** Setting default browser to be w3m
:PROPERTIES:
:ID: EEB1BA54-2032-4022-8353-FA0FEBCB19EC
+:CUSTOM_ID: h:170FDA24-DAE2-4ABB-8B6A-84FEE2AFEF80
:END:
#+BEGIN_SRC emacs-lisp
@@ -10115,6 +12451,7 @@ A few snippets were sourced from: http://beatofthegeek.com/2014/02/my-setup-for-
*** TODO Appending HTTP to web addresses entered by hand
:PROPERTIES:
:ID: 675ef613-8495-482e-941c-67b0853adac4
+ :CUSTOM_ID: h:8872A702-1992-40A1-9CF5-79FA726EBDA8
:END:
- Note taken on [2019-02-07 Thu 07:40] \\
Check whether this is necessary
@@ -10135,6 +12472,7 @@ A few snippets were sourced from: http://beatofthegeek.com/2014/02/my-setup-for-
*** Changing w3m shortcuts for better tabbed browsing
:PROPERTIES:
:ID: f3b7f225-80fc-4b3a-b31b-b56d2bbf01ca
+ :CUSTOM_ID: h:EFF87A3E-96A7-4067-BE9D-5D3CDAB1AA02
:END:
Source: Sacha Chua : http://sachachua.com/blog/2008/09/emacs-and-w3m-making-tabbed-browsing-easier/
@@ -10152,6 +12490,7 @@ Source: Sacha Chua : http://sachachua.com/blog/2008/09/emacs-and-w3m-making-tab
*** TODO Default external browser settings
:PROPERTIES:
:ID: c59e3f50-35d4-4939-a05e-0b3e97976963
+ :CUSTOM_ID: h:D3D8A15A-CF9B-47BC-B61F-BD50FC8404DF
:END:
- Note taken on [2019-02-07 Thu 07:37] \\
Need to have this change depending whether the OS is Linux or Mac OS
@@ -10179,6 +12518,7 @@ Source: Sacha Chua : http://sachachua.com/blog/2008/09/emacs-and-w3m-making-tab
** ediff
:PROPERTIES:
:ID: 969553a4-6279-4566-b751-51218fedb41f
+ :CUSTOM_ID: h:4678D85A-7AC4-4DD8-B210-890CAA3A0079
:END:
I have to diff between org files pretty often, and need the headings to be unfolded.
@@ -10210,8 +12550,14 @@ Source: http://emacs.stackexchange.com/questions/21335/prevent-folding-org-files
#+end_src
** Spell Checking
+:PROPERTIES:
+:CUSTOM_ID: h:271C2D28-8AC3-45E3-9DC1-5EF64F302206
+:END:
*** Flycheck
+:PROPERTIES:
+:CUSTOM_ID: h:FB3D7470-429B-418C-92F4-87557195A74B
+:END:
- Note taken on [2019-02-09 Sat 11:51] \\
disabling flycheck for the moment and enabling flymake
@@ -10221,7 +12567,6 @@ Basic config
#+BEGIN_SRC emacs-lisp
(use-package flycheck
- :defer 5
:bind (("M-g M-n" . flycheck-next-error)
("M-g M-p" . flycheck-previous-error)
("M-g M-=" . flycheck-list-errors))
@@ -10241,26 +12586,10 @@ Basic config
#+RESULTS:
: flycheck-list-errors
-*** Enabling Flyspell
-
-Reference: https://alhassy.github.io/init/
-
-Org mode is derived from text mode, therefore it is sufficient to activate for text mode.
-
-#+BEGIN_SRC emacs-lisp
-(use-package flyspell
- :hook (
- (prog-mode . flyspell-prog-mode)
- (text-mode . flyspell-mode))
-)
-#+END_SRC
-
-#+RESULTS:
-| flyspell-mode | er/add-text-mode-expansions | dubcaps-mode | flycheck-mode | text-mode-hook-identify |
-
*** Replacing flycheck with flymake
:PROPERTIES:
:ID: 68a17c10-540a-48ce-bf16-6b891060bd79
+ :CUSTOM_ID: h:5DDD939C-9F21-4210-A62F-B6438DC2208B
:END:
This is especially for python modules at the moment.
@@ -10277,6 +12606,7 @@ This is especially for python modules at the moment.
CLOSED: [2019-07-12 Fri 20:23]
:PROPERTIES:
:ID: 7dfcba0b-55f4-4cbe-aa34-c155935aa0da
+:CUSTOM_ID: h:92534818-D127-4733-B5B2-13633604F379
:END:
- Note taken on [2019-07-12 Fri 20:22] \\
So far this is working out rather well, and as expected.
@@ -10293,12 +12623,16 @@ Facing trouble enabling flyspell in the mac. This seems to be a solution, as out
#+RESULTS:
: /usr/local/Cellar/aspell/0.60.6.1_1/bin/aspell
** Old Scimax stuff
+:PROPERTIES:
+:CUSTOM_ID: h:2949EDF6-29D4-4729-9126-0132B5C91580
+:END:
These packages and customisations are the ones I enjoy using from Scimax. Note that these have to be customised and patched at the moment and I am working on an optimal solution to port the necessary packages, while maintaining some semblance of compatibility with the upstream.
*** Setting the scimax directory
:PROPERTIES:
:ID: 977B7B1D-29CA-4096-8413-6ECDDED932C2
+:CUSTOM_ID: h:FC2BCCC2-300C-43EA-BA13-F9A88037A204
:END:
- Note taken on [2020-03-11 Wed 17:32] \\
Some package here seems to be interfering with tramp. Functions can be loaded selectively using straight.el, and this helps keeps things lighter as well. Adding the scimax directory to the path seems to trigger the tramp issue. The scimax directory is being defined, because it is used in the packages. Using straight.el changes the location of the scimax directory.
@@ -10314,10 +12648,12 @@ These packages and customisations are the ones I enjoy using from Scimax. Note t
:PROPERTIES:
:ID: FBCA07CC-C0AF-4159-A71E-5D2827F01876
:header-args: :tangle no
+:CUSTOM_ID: h:E71C0924-0B72-4950-A6D6-BE9B31B436BF
:END:
**** MY scimax packages
:PROPERTIES:
:ID: AD6CDDD5-E3B4-41CC-B1A0-67E9E9348077
+:CUSTOM_ID: h:3F9B84E3-D15D-42A8-B016-8419EEC295C6
:END:
#+BEGIN_SRC emacs-lisp
@@ -10387,11 +12723,11 @@ These packages and customisations are the ones I enjoy using from Scimax. Note t
:ensure nil
:load-path (lambda () (expand-file-name "org-mime" scimax-dir))
:init (setq org-mime-up-subtree-heading 'org-back-to-heading
- org-mime-export-options '
+ org-mime-export-options '
(:section-numbers nil
- :with-author nil
- :with-toc nil
- :with-latex dvipng)))
+ :with-author nil
+ :with-toc nil
+ :with-latex dvipng)))
(straight-use-package 'auctex)
@@ -10407,6 +12743,7 @@ These packages and customisations are the ones I enjoy using from Scimax. Note t
**** scimax-org
:PROPERTIES:
:ID: 055A34FB-F13E-4521-9BAF-C4C785F20F5F
+:CUSTOM_ID: h:73F8DB72-3683-4937-AFAF-1E40422412CB
:END:
This requires the scimax-ob-ipython-upstream package, as well as a bunch of
@@ -10444,6 +12781,9 @@ packages being used by scimax-org are :
: ivy-insert-org-entity
**** scimax literate programming
+:PROPERTIES:
+:CUSTOM_ID: h:53ACEB43-60CA-4D85-B998-EB994B4434E7
+:END:
#+BEGIN_SRC emacs-lisp :tangle no
(use-package scimax-literate-programming
@@ -10455,6 +12795,7 @@ packages being used by scimax-org are :
**** scimax-hydra
:PROPERTIES:
:ID: D3004CAB-BFAF-48B8-8FBA-7CB75FC33007
+:CUSTOM_ID: h:4E0D9BCE-FCC9-4921-A64C-51A8ECD7F48A
:END:
#+BEGIN_SRC emacs-lisp
@@ -10496,6 +12837,7 @@ packages being used by scimax-org are :
**** scimax-journal
:PROPERTIES:
:ID: 61A12586-DAA7-4601-92F3-DD688B9725D5
+:CUSTOM_ID: h:FBB0320E-7940-4766-9047-1B67B0CB76DD
:END:
#+BEGIN_SRC emacs-lisp
@@ -10512,6 +12854,7 @@ packages being used by scimax-org are :
**** scimax-yas
:PROPERTIES:
:ID: 259205AA-4D49-4917-B79D-0A785822C33F
+:CUSTOM_ID: h:EA818ABD-9F7D-48AA-93F6-D8DA855623B4
:END:
#+BEGIN_SRC emacs-lisp
@@ -10523,6 +12866,9 @@ packages being used by scimax-org are :
#+RESULTS:
**** scimax utils
+:PROPERTIES:
+:CUSTOM_ID: h:EFA90748-1A80-4276-806F-5465E522EB77
+:END:
#+BEGIN_SRC emacs-lisp
(use-package scimax-utils
@@ -10534,6 +12880,7 @@ packages being used by scimax-org are :
**** scimax-ivy
:PROPERTIES:
:ID: 5883CE00-AEAE-46E3-8C47-B74554B7F0CD
+:CUSTOM_ID: h:08CAEEF6-82C4-420B-BC0F-DA13CF73DCEE
:END:
#+BEGIN_SRC emacs-lisp
(use-package scimax-ivy
@@ -10546,6 +12893,7 @@ packages being used by scimax-org are :
**** TODO scimax-ipython
:PROPERTIES:
:ID: D134F9A9-5391-480D-8124-31C7B8C60C34
+:CUSTOM_ID: h:A2947585-7C70-49D4-A346-1064216256E3
:END:
- [ ] Bind the org-babel autocomplete to a convenient key. The function is
@@ -10593,6 +12941,9 @@ Summary of scimax's ipython customisations:
: ob-ipython
**** scimax-python enhancements
+:PROPERTIES:
+:CUSTOM_ID: h:669A31A2-A2B9-4612-91AF-1BBBD237AD75
+:END:
This requires the beacon package and is a requirement for scimax-org as well.
#+BEGIN_SRC emacs-lisp
@@ -10608,6 +12959,7 @@ This requires the beacon package and is a requirement for scimax-org as well.
:PROPERTIES:
:ID: A2A59FA7-505B-401D-B344-226F5C873C2D
:header-args: :tangle no
+:CUSTOM_ID: h:E75C4454-0041-4805-80FA-7C1497B513D9
:END:
- Note taken on [2020-03-12 Thu 09:12] \\
@@ -10620,6 +12972,9 @@ This requires the beacon package and is a requirement for scimax-org as well.
into my init.
**** Initial code using the notebook as a package
+:PROPERTIES:
+:CUSTOM_ID: h:76D0B5C3-4C3D-44E0-BAA5-7949654BE622
+:END:
- Note taken on [2020-03-12 Thu 09:34] \\
This is left here as a reference.
@@ -10637,6 +12992,7 @@ This requires the beacon package and is a requirement for scimax-org as well.
**** The notebook code
:PROPERTIES:
:ID: 51CA5905-9994-4DE8-A90C-2E1E70172A76
+:CUSTOM_ID: h:FC2A8C32-B2B0-40D4-A067-6C1F59DD6C44
:END:
- Note taken on [2020-03-12 Thu 09:36] \\
I'm not sure if the preamble and lexical binding are required any more. It is
@@ -10684,6 +13040,7 @@ This requires the beacon package and is a requirement for scimax-org as well.
***** Variable definitions
:PROPERTIES:
:ID: 9CB70DCC-04A0-4484-8B23-3BA76B732879
+:CUSTOM_ID: h:902F85A4-C0D3-497A-A89D-CDF2749FF8FA
:END:
#+BEGIN_SRC emacs-lisp :results silent
@@ -10699,8 +13056,8 @@ This requires the beacon package and is a requirement for scimax-org as well.
(defcustom nb-master-file (lambda (&optional name)
- "Return the master file name for the project."
- "README.org")
+ "Return the master file name for the project."
+ "README.org")
"A function that returns the master file in each project.
The function must take one optional argument that is a project
name. This function will be run in the root directory of the
@@ -10729,8 +13086,8 @@ current directory. In this example the master file is an org-file
with the name of the root directory, with a @ prefix so it sorts
to the top of the directory with ls."
(concat "@"
- (file-name-base (directory-file-name default-directory))
- ".org"))
+ (file-name-base (directory-file-name default-directory))
+ ".org"))
(defcustom nb-switch-project-action
(lambda ()
@@ -10742,10 +13099,14 @@ to the top of the directory with ls."
#+END_SRC
***** Notebook functions
+:PROPERTIES:
+:CUSTOM_ID: h:330B1DE7-2DC7-4D37-8414-235A02A50FB5
+:END:
****** Make a new notebook
:PROPERTIES:
:ID: 93CAE051-4EEF-4E8E-B40B-A69D88DAF324
+:CUSTOM_ID: h:7753E1DD-E166-4D39-943C-4ED8A9489E5E
:END:
We store all projects by default in nb-notebook-directory. You can use nested directories in this to make hierarchies of projects, e.g. if you have several research projects you might use research/project-one and research/project-two as the directory names. It is also ok to have even deeper nesting eg. letters/undergraduates/student-1 or administrative/nonsense/committees/committee-on-committees.
@@ -10758,17 +13119,17 @@ We store all projects by default in nb-notebook-directory. You can use nested di
(when (file-directory-p name)
(user-error "%s already exists." name))
(let ((dir (file-name-as-directory (expand-file-name name nb-notebook-directory)))
- (nb-master-file-name (funcall nb-master-file name)))
+ (nb-master-file-name (funcall nb-master-file name)))
(unless (file-directory-p dir)
(make-directory dir t)
(cond ((eq 'git nb-project-type)
- (let ((default-directory dir))
- (shell-command "git init")))
- ((eq 'projectile nb-project-type)
- (let ((default-directory dir))
- (shell-command "touch .projectile")))
- (t
- (error "Unknown kind of project: %s" nb-project-type))))
+ (let ((default-directory dir))
+ (shell-command "git init")))
+ ((eq 'projectile nb-project-type)
+ (let ((default-directory dir))
+ (shell-command "touch .projectile")))
+ (t
+ (error "Unknown kind of project: %s" nb-project-type))))
(projectile-add-known-project dir)
(projectile-save-known-projects)
(find-file (expand-file-name nb-master-file-name dir))))
@@ -10779,6 +13140,7 @@ We store all projects by default in nb-notebook-directory. You can use nested di
****** Open an existing project
:PROPERTIES:
:ID: CA616277-5C46-4BDA-BB36-04639EBCCCC5
+:CUSTOM_ID: h:CF77CAFF-21B6-40FC-9232-6BD8B04E0276
:END:
This just uses a custom switch project action for opening an existing project.
@@ -10798,6 +13160,7 @@ This is a thin wrapper on `projectile-switch-project' that opens the master file
****** Make a notebook by cloning a git repo
:PROPERTIES:
:ID: 9C18D282-62AF-4329-8062-90801B54AF1D
+:CUSTOM_ID: h:63AB4814-0B9D-4F88-BB4C-7B10DD170163
:END:
This is a convenience function that should allow you to make a notebook from a git repo url.
@@ -10811,10 +13174,10 @@ PATH. You need to specify the path you want the file to be in. A
default name based on the url is suggested."
(interactive (list (read-string "git url: ") nil))
(setq path (read-directory-name "Path: " nb-notebook-directory
- nil nil
- (replace-regexp-in-string
- "\\.git\\'" ""
- (car (last (f-split url))))))
+ nil nil
+ (replace-regexp-in-string
+ "\\.git\\'" ""
+ (car (last (f-split url))))))
(let ((default-directory nb-notebook-directory))
(when (file-exists-p path)
(error "%S already exists" path))
@@ -10828,6 +13191,7 @@ default name based on the url is suggested."
****** Clone an existing project
:PROPERTIES:
:ID: 708C4EA1-9EFD-48D1-B8E8-855CE69CE053
+:CUSTOM_ID: h:E2894B56-D8A1-4D88-95E5-73323D707C0F
:END:
This is helpful when you want to keep a copy of the repo, for example. It is not a feature I use a lot though.
@@ -10838,12 +13202,12 @@ This is helpful when you want to keep a copy of the repo, for example. It is not
"Create a clone (by a recursive copy) of the current notebook."
(interactive)
(let* ((project-root (projectile-project-root))
- (dir-one-up (file-name-directory (directory-file-name project-root)))
- (name (file-name-base (directory-file-name project-root)))
- (clone-base-name (read-directory-name
- "Clone name: "
- dir-one-up nil nil
- (concat name "-clone"))))
+ (dir-one-up (file-name-directory (directory-file-name project-root)))
+ (name (file-name-base (directory-file-name project-root)))
+ (clone-base-name (read-directory-name
+ "Clone name: "
+ dir-one-up nil nil
+ (concat name "-clone"))))
(let ((default-directory dir-one-up))
(shell-command (format "cp -R %s %s" name clone-base-name))
(projectile-add-known-project clone-base-name)
@@ -10856,6 +13220,7 @@ This is helpful when you want to keep a copy of the repo, for example. It is not
***** Notebook agenda
:PROPERTIES:
:ID: 1A8350CF-266C-4BDF-A366-A5E9AD75F222
+:CUSTOM_ID: h:E6084588-4642-48AC-8B34-DA845089DF1A
:END:
I usually want to do project management in a notebook, e.g. keep track of TODOs, what to do next etc. I don't always put project org-files in my regular agenda files for performance reasons. Here we generate an agenda for that using just the org-files in the current directory.
@@ -10875,33 +13240,33 @@ directory. You may want to make this a directory local variable."
(defun nb-agenda (project &optional all-org-files)
"Show org-agenda for org-files in the notebook."
(interactive (list (completing-read "Project: "
- (mapcar 'expand-file-name
- (append
- (list (projectile-project-root
- (projectile-project-name)))
- (projectile-relevant-known-projects)))
- nil t
- (projectile-project-root (projectile-project-name)))
- current-prefix-arg))
+ (mapcar 'expand-file-name
+ (append
+ (list (projectile-project-root
+ (projectile-project-name)))
+ (projectile-relevant-known-projects)))
+ nil t
+ (projectile-project-root (projectile-project-name)))
+ current-prefix-arg))
(let ((org-agenda-files (if (or all-org-files
- (null nb-agenda-files))
- (mapcar
- (lambda (f) (expand-file-name
- f (projectile-project-root)))
- (-filter (lambda (f)
- (and
- (f-ext? f "org")
- (not (s-contains? "#" f))))
- (projectile-current-project-files)))
- (cond
- ((listp nb-agenda-files)
- nb-agenda-files)
- ((functionp nb-agenda-files)
- (let ((default-directory (projectile-project-root
- (projectile-project-name))))
- (funcall nb-agenda-files)))
- (t
- nb-agenda-files)))))
+ (null nb-agenda-files))
+ (mapcar
+ (lambda (f) (expand-file-name
+ f (projectile-project-root)))
+ (-filter (lambda (f)
+ (and
+ (f-ext? f "org")
+ (not (s-contains? "#" f))))
+ (projectile-current-project-files)))
+ (cond
+ ((listp nb-agenda-files)
+ nb-agenda-files)
+ ((functionp nb-agenda-files)
+ (let ((default-directory (projectile-project-root
+ (projectile-project-name))))
+ (funcall nb-agenda-files)))
+ (t
+ nb-agenda-files)))))
(org-agenda)))
@@ -10910,6 +13275,7 @@ directory. You may want to make this a directory local variable."
***** Notebook archive files
:PROPERTIES:
:ID: 541FA6B1-591A-442D-8B19-3CDA9C525D96
+:CUSTOM_ID: h:48DD5B5A-28B3-40E2-A642-89474138ECC6
:END:
The idea here is it is sometimes useful to create an archive file (e.g. a zip file) of your project, e.g. to upload to zenodo/figshare, or to share with a collaborator.
@@ -10925,15 +13291,15 @@ uncommitted changes, you will be prompted to continue."
(let ((output (shell-command-to-string "git status --porcelain")))
(unless (string= "" output)
(when
- (y-or-n-p
- (format
- "Your notebook contains uncommitted changes or files:\n%s\n Continue? " output))
- (shell-command
- (format
- "git archive --format zip HEAD -o \"%s-%s.zip\""
- (f-join (projectile-project-root)
- (car (last (f-split (projectile-project-root)))))
- (format-time-string "%Y-%m-%d-%H:%M%p")))))))
+ (y-or-n-p
+ (format
+ "Your notebook contains uncommitted changes or files:\n%s\n Continue? " output))
+ (shell-command
+ (format
+ "git archive --format zip HEAD -o \"%s-%s.zip\""
+ (f-join (projectile-project-root)
+ (car (last (f-split (projectile-project-root)))))
+ (format-time-string "%Y-%m-%d-%H:%M%p")))))))
#+END_SRC
@@ -10966,15 +13332,15 @@ For tar with -cjf I recommend .tbz2"
"Create an archive file of the project.
The type of archive is determined by `nb-archive-command'."
(interactive (list (read-string
- "Archive name: "
- (concat (projectile-project-name) nb-archive-extension))
- (projectile-completing-read "Project: "
- (projectile-relevant-known-projects))))
+ "Archive name: "
+ (concat (projectile-project-name) nb-archive-extension))
+ (projectile-completing-read "Project: "
+ (projectile-relevant-known-projects))))
(let ((default-directory project))
(message
(format "%s %s %s \"%s\""
- nb-archive-command nb-archive-command-options
- zip-file project))))
+ nb-archive-command nb-archive-command-options
+ zip-file project))))
#+END_SRC
@@ -10984,6 +13350,7 @@ The type of archive is determined by `nb-archive-command'."
***** TODO List the tags in a notebook
:PROPERTIES:
:ID: 927FE3C7-9430-462C-988E-495EB9218754
+:CUSTOM_ID: h:97891876-F09F-4D73-BEF1-EBD8429DC3D2
:END:
The notebook is just a collection of org-files, so it should be possible to use the agenda commands to search for things in it using tags and properties. That means it would be helpful to get a list of tags in the notebook, e.g. to help construct the queries, or to make sure you use them consistently. Here we loop through all the org-files and collect the tags in a list. This is lightly tested, and in a large project might be slow.
@@ -10993,30 +13360,30 @@ The notebook is just a collection of org-files, so it should be possible to use
"Get a list of tags in the notebook."
(interactive)
(let ((tags '())
- (already-open nil)
- (org-files (mapcar
- (lambda (f) (expand-file-name
- f (projectile-project-root)))
- (-filter (lambda (f)
- (and
- (f-ext? f "org")
- (not (s-contains? "#" f))))
- (projectile-current-project-files))))
- (inhibit-local-variables-regexps))
+ (already-open nil)
+ (org-files (mapcar
+ (lambda (f) (expand-file-name
+ f (projectile-project-root)))
+ (-filter (lambda (f)
+ (and
+ (f-ext? f "org")
+ (not (s-contains? "#" f))))
+ (projectile-current-project-files))))
+ (inhibit-local-variables-regexps))
;; Ignore local variables for this.
(push "\\.org\\'" inhibit-local-variables-regexps)
(cl-loop for org-file in org-files do
- (setq already-open (find-buffer-visiting org-file))
- (with-current-buffer (find-file-noselect org-file)
- (save-excursion
- (save-restriction
- (widen)
- (goto-char (point-min))
- (while (re-search-forward org-heading-regexp nil t)
- (setq tags (append tags (org-get-tags)))))))
- (unless already-open
- (kill-buffer already-open)
- (setq already-open nil)))
+ (setq already-open (find-buffer-visiting org-file))
+ (with-current-buffer (find-file-noselect org-file)
+ (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (while (re-search-forward org-heading-regexp nil t)
+ (setq tags (append tags (org-get-tags)))))))
+ (unless already-open
+ (kill-buffer already-open)
+ (setq already-open nil)))
(-uniq tags)))
@@ -11036,6 +13403,9 @@ Here are the tags in this project.
***** CANCEL Notebook menu
+:PROPERTIES:
+:CUSTOM_ID: h:4CF8FBB1-B7F2-4FB4-8A5E-F75FFFD600DD
+:END:
Sometimes I find it helpful to use a menu instead of keyboard commands. This creates that menu, so it is easy to create a new notebook or open an existing one, and also to see a list of known projects. When that list gets very long it can get somewhat slow to list them all. By default the list of projects is only made once when this library is loaded. You can set =nb-scimax-update-menu-p= to be non-nil so it is updated all the time, or manually run =nb-update-scimax-projects-menu= to update it if you have new projects you want to see there.
@@ -11056,17 +13426,17 @@ Sometimes I find it helpful to use a menu instead of keyboard commands. This cre
(easy-menu-change
'("Scimax" "notebook") "Projects"
(mapcar (lambda (x)
- (vector
- ;; entry
- (file-name-nondirectory (substring x 0 -1))
- ;; action
- `(lambda ()
- (interactive)
- (projectile-switch-project-by-name
- ,x))
- ;; visibility
- t))
- (projectile-relevant-known-projects))
+ (vector
+ ;; entry
+ (file-name-nondirectory (substring x 0 -1))
+ ;; action
+ `(lambda ()
+ (interactive)
+ (projectile-switch-project-by-name
+ ,x))
+ ;; visibility
+ t))
+ (projectile-relevant-known-projects))
"words"))
@@ -11078,8 +13448,14 @@ Sometimes I find it helpful to use a menu instead of keyboard commands. This cre
***** Searching the notebook
+:PROPERTIES:
+:CUSTOM_ID: h:661B93EB-7190-49D9-B05C-CE6F77074FE1
+:END:
****** Searching whole notebook for a string
+:PROPERTIES:
+:CUSTOM_ID: h:79FBD150-1032-41A9-98CB-0B3D6DD78097
+:END:
These search for strings in files in whole notebook. You run these commands, enter the search string and press enter. Then a new window pops up with the results.
@@ -11093,6 +13469,9 @@ This uses a counsel/ivy interface for searching.
| M-x counsel-git-grep | | H-c g | Only searches files in a git repo |
****** Limiting the search scope to the current directory
+:PROPERTIES:
+:CUSTOM_ID: h:31F891B4-25DB-4C37-BC44-EDEAF8EECE58
+:END:
These commands will search for text in files in the current directory.
@@ -11101,6 +13480,9 @@ These commands will search for text in files in the current directory.
| counsel-pt | H-c p | |
****** Finding files/directories in the notebook
+:PROPERTIES:
+:CUSTOM_ID: h:DC947530-3B8D-4940-A491-D63849D6EFBB
+:END:
| M-x projectile-find-file | C-c p f | H-p f | |
| M-x projectile-find-file-dwim | | H-p g | |
@@ -11111,6 +13493,9 @@ These commands will search for text in files in the current directory.
| M-x projectile-find-file-in-known-projects | | H-p F | May be slow! |
****** Searching in open project buffers
+:PROPERTIES:
+:CUSTOM_ID: h:2BAD5920-2269-43DD-B213-F9649228B1AA
+:END:
| M-x projectile-multi-occur | | H-p o |
@@ -11118,6 +13503,7 @@ These commands will search for text in files in the current directory.
****** Limiting scope to some kinds of files
:PROPERTIES:
:ID: 60CC553B-8E8C-4763-BD0A-EE743F48491F
+:CUSTOM_ID: h:423D6211-9B15-4F28-8E30-2945625ACC85
:END:
Here is a function you can use to interactively search files by pattern. For example to find the string xref in org files you could do this:
@@ -11138,16 +13524,16 @@ Here is a function you can use to interactively search files by pattern. For exa
"Search files matching FILE-PATTERN for REGEXP and show matches."
(interactive "sfile pattern: \nsSearch for: ")
(let* ((files (projectile-project-files (projectile-project-root)))
- (ignores (nconc (mapcar
+ (ignores (nconc (mapcar
(lambda (s) (concat s "/"))
grep-find-ignored-directories)
grep-find-ignored-files))
- (xrefs (cl-mapcan
+ (xrefs (cl-mapcan
(lambda (file)
- (when (file-exists-p file)
+ (when (file-exists-p file)
(xref-collect-matches regexp "*" file
(and (file-directory-p file)
- ignores))))
+ ignores))))
files)))
(unless xrefs
(user-error "No matches for: %s" regexp))
@@ -11158,26 +13544,26 @@ Here is a function you can use to interactively search files by pattern. For exa
"Search files for REGEXP and show matches."
(interactive "sSearch for: ")
(let* ((files (projectile-project-files (projectile-project-root)))
- (ignores (nconc (mapcar
+ (ignores (nconc (mapcar
(lambda (s) (concat s "/"))
grep-find-ignored-directories)
(append '("*.pdf") grep-find-ignored-files)))
- ;; This was a little surprising, I had to add -a in a few places to treat binary files like text
- (grep-host-defaults-alist '((localhost
- (grep-command "grep -nH --null -e -a ")
- (grep-template "grep <X> <C> -nH --null -e <R> <F>")
- (grep-use-null-device nil)
- (grep-find-command ("find . -type f -exec grep -nH --null -e -a \\{\\} +" . 42))
- (grep-find-template "find <D> <X> -type f <F> -exec grep <C> -nH --null -e <R> -a \\{\\} +")
- (grep-use-null-filename-separator t) (grep-find-use-xargs exec-plus)
- (grep-highlight-matches nil))))
-
- (xrefs (cl-mapcan
+ ;; This was a little surprising, I had to add -a in a few places to treat binary files like text
+ (grep-host-defaults-alist '((localhost
+ (grep-command "grep -nH --null -e -a ")
+ (grep-template "grep <X> <C> -nH --null -e <R> <F>")
+ (grep-use-null-device nil)
+ (grep-find-command ("find . -type f -exec grep -nH --null -e -a \\{\\} +" . 42))
+ (grep-find-template "find <D> <X> -type f <F> -exec grep <C> -nH --null -e <R> -a \\{\\} +")
+ (grep-use-null-filename-separator t) (grep-find-use-xargs exec-plus)
+ (grep-highlight-matches nil))))
+
+ (xrefs (cl-mapcan
(lambda (file)
- (when (file-exists-p file)
+ (when (file-exists-p file)
(xref-collect-matches regexp "*" file
(and (file-directory-p file)
- ignores))))
+ ignores))))
files)))
(unless xrefs
(user-error "No matches for: %s" regexp))
@@ -11192,6 +13578,7 @@ Here is a function you can use to interactively search files by pattern. For exa
***** Jump to an org file in the notebook / table of contents
:PROPERTIES:
:ID: D1BD9E4A-B16D-492E-BA41-DDCEC099C6C8
+:CUSTOM_ID: h:FEAF1639-042A-4EB0-A50E-F84EAEC466CE
:END:
Issue [[https://github.com/jkitchin/scimax/issues/332][332]] requested a way to make something like a table of contents for the org files in a notebook. This function builds a list of candidates that show the title, date and filename for selection.
@@ -11201,59 +13588,59 @@ Issue [[https://github.com/jkitchin/scimax/issues/332][332]] requested a way to
"Select a notebook file by title, date or filename."
(interactive)
(let* ((project-root (projectile-project-root))
- (org-files (mapcar (lambda (f)
- (expand-file-name f project-root))
- (-filter (lambda (f) (f-ext? f "org"))
- (projectile-project-files project-root))))
- data
- candidates
- format-string
- title
- date)
+ (org-files (mapcar (lambda (f)
+ (expand-file-name f project-root))
+ (-filter (lambda (f) (f-ext? f "org"))
+ (projectile-project-files project-root))))
+ data
+ candidates
+ format-string
+ title
+ date)
;; Get title, date and filename for each org-file. If there is no date, we
;; use last modified time. It doesn't seem possible to get the file creation
;; time. I am not sure this is robust for all things you might put into the
;; DATE field. I assume it is something org can read and convert to a time.
(setq data (mapcar
- (lambda (f)
- (when (file-exists-p f)
- (with-temp-buffer
- (insert-file-contents f)
- (setq title (if (re-search-forward "#\\+TITLE:\\(.*\\)" nil t)
- (match-string 1)
- "No title"))
-
-
- (goto-char (point-min))
- (setq date (if (re-search-forward "#\\+DATE:\\(.*\\)" nil t)
- (format-time-string "%Y-%m-%d"
- (org-read-date nil t (match-string 1)))
- (format-time-string
- "mod-%Y-%m-%d"
- (file-attribute-modification-time
- (file-attributes f)))))
-
- (list title date f))))
- org-files))
+ (lambda (f)
+ (when (file-exists-p f)
+ (with-temp-buffer
+ (insert-file-contents f)
+ (setq title (if (re-search-forward "#\\+TITLE:\\(.*\\)" nil t)
+ (match-string 1)
+ "No title"))
+
+
+ (goto-char (point-min))
+ (setq date (if (re-search-forward "#\\+DATE:\\(.*\\)" nil t)
+ (format-time-string "%Y-%m-%d"
+ (org-read-date nil t (match-string 1)))
+ (format-time-string
+ "mod-%Y-%m-%d"
+ (file-attribute-modification-time
+ (file-attributes f)))))
+
+ (list title date f))))
+ org-files))
;; Sort by date, more recent things will be first
(setq data (cl-sort (copy-sequence data)
- (lambda (a b) (org-time> (nth 1 a) (nth 1 b)))))
+ (lambda (a b) (org-time> (nth 1 a) (nth 1 b)))))
;; Now create a format string so the longest title fits and is aligned.
(setq format-string (format "%%%ss | %%16s | %%s"
- (apply 'max (mapcar (lambda (e) (length (car e))) data))))
+ (apply 'max (mapcar (lambda (e) (length (car e))) data))))
;; These are the candidates we will choose from.
(setq candidates (cl-loop for (title date f) in data
- collect
- (list (format format-string title date f) f)))
+ collect
+ (list (format format-string title date f) f)))
;; I use completing-read here so you can use your own backend. The only
;; downside is I can't put many actions like in a dedicated ivy command.
(find-file (cadr (assoc
- (completing-read "Open: " candidates)
- candidates)))))
+ (completing-read "Open: " candidates)
+ candidates)))))
#+END_SRC
#+RESULTS:
@@ -11264,6 +13651,7 @@ Issue [[https://github.com/jkitchin/scimax/issues/332][332]] requested a way to
***** Help
:PROPERTIES:
:ID: 25BA9C42-C628-4BDF-A568-F3345938B640
+:CUSTOM_ID: h:050CAA78-F6CE-4BC9-A100-64B69A25BE94
:END:
#+BEGIN_SRC emacs-lisp
@@ -11276,6 +13664,7 @@ Issue [[https://github.com/jkitchin/scimax/issues/332][332]] requested a way to
**** Notebook/project links
:PROPERTIES:
:ID: 69002193-A5B4-425B-9B9D-62F7EBAB95B8
+:CUSTOM_ID: h:D04AA893-D21F-4F3B-AC20-29F6F3E4D051
:END:
I often want to make links between projects. For example, I may have notes in a proposal I want to reference, or I may want a link to work one of my students has done. Regular links don't work well for this. You cannot use absolute paths, because your project directory may be in another path than a collaborators. Absolute paths also break if you move the directory. Even relative paths don't work reliably because you may store the two projects in different relative locations. id links have potential to work, but I find them slow especially when you have never opened the org-file with that id in it; then org-mode may not be able to find it.
@@ -11300,7 +13689,7 @@ The link target is optional, and defaults to line 1."
(save-match-data
(let* ((parts (split-string path "::")))
(when (> (length parts) 3)
- (error "There should only be 3 parts separated by ::"))
+ (error "There should only be 3 parts separated by ::"))
(list
(nth 0 parts)
(nth 1 parts)
@@ -11325,6 +13714,7 @@ Here are a few example paths and how they are parsed.
***** Follow a link
:PROPERTIES:
:ID: 2691DB45-A415-442C-87CE-19C9D507E872
+:CUSTOM_ID: h:8A444B45-DDEA-4133-9B57-6675B8186ACE
:END:
Following a link means opening the file it points to.
@@ -11336,118 +13726,118 @@ Following a link means opening the file it points to.
(interactive (list (org-element-property :path (org-element-context))))
(destructuring-bind (project fpath link-target) (nb-parse-path path)
(let* ((projects (remove nil (append (projectile-relevant-known-projects)
- (list
- (when (projectile-project-p)
- (projectile-project-root))))))
- ;; These are projects that match the project spec
- (project-candidates (-filter (lambda (p)
- (string-match (concat project "/\\'") p))
- projects))
- ;; These are projects that match the spec, and that have the file we want.
- (candidates (-filter (lambda (p)
- (file-exists-p (expand-file-name fpath p)))
- project-candidates)))
+ (list
+ (when (projectile-project-p)
+ (projectile-project-root))))))
+ ;; These are projects that match the project spec
+ (project-candidates (-filter (lambda (p)
+ (string-match (concat project "/\\'") p))
+ projects))
+ ;; These are projects that match the spec, and that have the file we want.
+ (candidates (-filter (lambda (p)
+ (file-exists-p (expand-file-name fpath p)))
+ project-candidates)))
(cond
((null project-candidates)
- (error "%s is not a known project" project))
+ (error "%s is not a known project" project))
((null candidates)
- (error "%s was not found in %s\nproject-candidates: %S\ncandidates: %s" fpath project project-candidates candidates))
+ (error "%s was not found in %s\nproject-candidates: %S\ncandidates: %s" fpath project project-candidates candidates))
;; one project, and the file exists
((and (= 1 (length candidates))
- (file-exists-p (expand-file-name fpath (car candidates))))
- (org-mark-ring-push)
- (find-file (expand-file-name fpath (car candidates))))
+ (file-exists-p (expand-file-name fpath (car candidates))))
+ (org-mark-ring-push)
+ (find-file (expand-file-name fpath (car candidates))))
;; multiple matches, select project interactively
(t
- (org-mark-ring-push)
- (find-file (expand-file-name fpath (completing-read "Project: " candidates)))))
+ (org-mark-ring-push)
+ (find-file (expand-file-name fpath (completing-read "Project: " candidates)))))
;; If we get here, we have not errored and should have opened a file. Now,
;; link-target the end link.
(cond
((eq major-mode 'org-mode)
- (when (not (or (null link-target) (string= "" link-target)))
- (cond
- ((string-match "\\<[0-9]+\\>" link-target)
- (forward-line (- (string-to-number link-target) 1)))
- ((string-match "\\<c\\([0-9]+\\)\\>" link-target)
- (goto-char (string-to-number (match-string 1 link-target))))
- (t
- (org-open-link-from-string (format "[[%s]]" link-target)))))
- (org-show-entry))
+ (when (not (or (null link-target) (string= "" link-target)))
+ (cond
+ ((string-match "\\<[0-9]+\\>" link-target)
+ (forward-line (- (string-to-number link-target) 1)))
+ ((string-match "\\<c\\([0-9]+\\)\\>" link-target)
+ (goto-char (string-to-number (match-string 1 link-target))))
+ (t
+ (org-open-link-from-string (format "[[%s]]" link-target)))))
+ (org-show-entry))
;; everything else
(t
- (cond
- ;; if it is just a number it is a line number
- ((string-match "\\<[0-9]*\\>" link-target)
- (forward-line (- (string-to-number link-target) 1)))
- ;; a pattern like c23 means go to char 23
- ((string-match "^c\\([0-9]*\\)" link-target)
- (goto-char (string-to-number (match-string 1 link-target))))
- (t
- (goto-char (point-min))
- (goto-char (re-search-forward (regexp-quote link-target) nil t)))))))))
+ (cond
+ ;; if it is just a number it is a line number
+ ((string-match "\\<[0-9]*\\>" link-target)
+ (forward-line (- (string-to-number link-target) 1)))
+ ;; a pattern like c23 means go to char 23
+ ((string-match "^c\\([0-9]*\\)" link-target)
+ (goto-char (string-to-number (match-string 1 link-target))))
+ (t
+ (goto-char (point-min))
+ (goto-char (re-search-forward (regexp-quote link-target) nil t)))))))))
(defun nb-follow-other (path &optional new-frame)
"Open the project at PATH in other window."
(interactive (list (org-element-property :path (org-element-context))
- current-prefix-arg))
+ current-prefix-arg))
(destructuring-bind (project fpath link-target) (nb-parse-path path)
(let* ((projects (remove nil (append (projectile-relevant-known-projects)
- (list
- (when (projectile-project-p)
- (projectile-project-root))))))
- ;; These are projects that match the project spec
- (project-candidates (-filter (lambda (p)
- (string-match (concat project "/\\'") p))
- projects))
- ;; These are projects that match the spec, and that have the file we want.
- (candidates (-filter (lambda (p)
- (file-exists-p (expand-file-name fpath p)))
- project-candidates)))
+ (list
+ (when (projectile-project-p)
+ (projectile-project-root))))))
+ ;; These are projects that match the project spec
+ (project-candidates (-filter (lambda (p)
+ (string-match (concat project "/\\'") p))
+ projects))
+ ;; These are projects that match the spec, and that have the file we want.
+ (candidates (-filter (lambda (p)
+ (file-exists-p (expand-file-name fpath p)))
+ project-candidates)))
(cond
((null project-candidates)
- (error "%s is not a known project" project))
+ (error "%s is not a known project" project))
((null candidates)
- (error "%s was not found in %s\nproject-candidates: %S\ncandidates: %s" fpath project project-candidates candidates))
+ (error "%s was not found in %s\nproject-candidates: %S\ncandidates: %s" fpath project project-candidates candidates))
;; one project, and the file exists
((and (= 1 (length candidates))
- (file-exists-p (expand-file-name fpath (car candidates))))
- (org-mark-ring-push)
- (if new-frame
- (find-file-other-frame (expand-file-name fpath (car candidates)))
- (find-file-other-window (expand-file-name fpath (car candidates)))))
+ (file-exists-p (expand-file-name fpath (car candidates))))
+ (org-mark-ring-push)
+ (if new-frame
+ (find-file-other-frame (expand-file-name fpath (car candidates)))
+ (find-file-other-window (expand-file-name fpath (car candidates)))))
;; multiple matches, select project interactively
(t
- (org-mark-ring-push)
- (if new-frame
- (find-file-other-frame (expand-file-name fpath (completing-read "Project: " candidates)))
- (find-file-other-window (expand-file-name fpath (completing-read "Project: " candidates))))))
+ (org-mark-ring-push)
+ (if new-frame
+ (find-file-other-frame (expand-file-name fpath (completing-read "Project: " candidates)))
+ (find-file-other-window (expand-file-name fpath (completing-read "Project: " candidates))))))
;; If we get here, we have not errored and should have opened a file. Now,
;; link-target the end link.
(cond
((eq major-mode 'org-mode)
- (when (not (or (null link-target) (string= "" link-target)))
- (cond
- ((string-match "\\<[0-9]+\\>" link-target)
- (forward-line (- (string-to-number link-target) 1)))
- ((string-match "\\<c\\([0-9]+\\)\\>" link-target)
- (goto-char (string-to-number (match-string 1 link-target))))
- (t
- (org-open-link-from-string (format "[[%s]]" link-target)))))
- (org-show-entry))
+ (when (not (or (null link-target) (string= "" link-target)))
+ (cond
+ ((string-match "\\<[0-9]+\\>" link-target)
+ (forward-line (- (string-to-number link-target) 1)))
+ ((string-match "\\<c\\([0-9]+\\)\\>" link-target)
+ (goto-char (string-to-number (match-string 1 link-target))))
+ (t
+ (org-open-link-from-string (format "[[%s]]" link-target)))))
+ (org-show-entry))
;; everything else
(t
- (cond
- ;; if it is just a number it is a line number
- ((string-match "\\<[0-9]*\\>" link-target)
- (forward-line (- (string-to-number link-target) 1)))
- ;; a pattern like c23 means go to char 23
- ((string-match "c\\([0-9]*\\)" link-target)
- (goto-char (string-to-number (match-string 1 link-target))))
- ;; Everything else means search for it. I don't know why I have to
- ;; use goto-char here. I thought it should just go.
- (t
- (goto-char (re-search-forward link-target nil 'mv)))))))))
+ (cond
+ ;; if it is just a number it is a line number
+ ((string-match "\\<[0-9]*\\>" link-target)
+ (forward-line (- (string-to-number link-target) 1)))
+ ;; a pattern like c23 means go to char 23
+ ((string-match "c\\([0-9]*\\)" link-target)
+ (goto-char (string-to-number (match-string 1 link-target))))
+ ;; Everything else means search for it. I don't know why I have to
+ ;; use goto-char here. I thought it should just go.
+ (t
+ (goto-char (re-search-forward link-target nil 'mv)))))))))
(defun nb-follow-other-frame (path)
@@ -11466,35 +13856,36 @@ We may want to open this link with a system program, e.g. if it is an ipynb or s
(interactive (list (org-element-property :path (org-element-context))))
(destructuring-bind (project fpath link-target) (nb-parse-path path)
(let* ((projects (remove nil (append (projectile-relevant-known-projects)
- (list
- (when (projectile-project-p)
- (projectile-project-root))))))
- ;; These are projects that match the project spec
- (project-candidates (-filter (lambda (p)
- (string-match (concat project "/\\'") p))
- projects))
- ;; These are projects that match the spec, and that have the file we want.
- (candidates (-filter (lambda (p)
- (file-exists-p (expand-file-name fpath p)))
- project-candidates)))
+ (list
+ (when (projectile-project-p)
+ (projectile-project-root))))))
+ ;; These are projects that match the project spec
+ (project-candidates (-filter (lambda (p)
+ (string-match (concat project "/\\'") p))
+ projects))
+ ;; These are projects that match the spec, and that have the file we want.
+ (candidates (-filter (lambda (p)
+ (file-exists-p (expand-file-name fpath p)))
+ project-candidates)))
(cond
((null project-candidates)
- (error "%s is not a known project" project))
+ (error "%s is not a known project" project))
((null candidates)
- (error "%s was not found in %s\nproject-candidates: %S\ncandidates: %s" fpath project project-candidates candidates))
+ (error "%s was not found in %s\nproject-candidates: %S\ncandidates: %s" fpath project project-candidates candidates))
;; one project, and the file exists
((and (= 1 (length candidates))
- (file-exists-p (expand-file-name fpath (car candidates))))
- (org-mark-ring-push)
- (org-open-file-with-system (expand-file-name fpath (car candidates))))
+ (file-exists-p (expand-file-name fpath (car candidates))))
+ (org-mark-ring-push)
+ (org-open-file-with-system (expand-file-name fpath (car candidates))))
;; multiple matches, select project interactively
(t
- (error "no match found"))))))
+ (error "no match found"))))))
#+END_SRC
***** COMMENT Store a project link
:PROPERTIES:
:ID: A199F5C6-456E-4C79-928F-6800D563ABC6
+:CUSTOM_ID: h:03DFA037-ED7C-4800-9FB2-7C9240B649C8
:END:
This adds a capability for using C-c l to store a link in org-mode. It creates a link that should go the position of the cursor at the time the link was stored.
@@ -11505,10 +13896,10 @@ This adds a capability for using C-c l to store a link in org-mode. It creates a
(if (or (null (buffer-file-name)) (not (projectile-project-p)))
nil
(let* ((root (projectile-project-root))
- (current-file (buffer-file-name))
- (project (car (last (f-split (projectile-project-root)))))
- (relpath (file-relative-name current-file root))
- (link-target (format "c%s" (point))))
+ (current-file (buffer-file-name))
+ (project (car (last (f-split (projectile-project-root)))))
+ (relpath (file-relative-name current-file root))
+ (link-target (format "c%s" (point))))
(org-store-link-props
:type "nb"
@@ -11524,6 +13915,7 @@ This adds a capability for using C-c l to store a link in org-mode. It creates a
***** COMMENT Link completion
:PROPERTIES:
:ID: E58F341D-C42D-48E0-9A4F-52311B1FFAFC
+:CUSTOM_ID: h:3099377B-60FE-438A-9460-C6BA25090C51
:END:
This makes it easy to type C-c C-l then type nb <enter> and then get to choose a project and file with completion to insert a link.
@@ -11533,11 +13925,11 @@ This makes it easy to type C-c C-l then type nb <enter> and then get to choose a
"Create a link with completion."
;; Pick a project
(let* ((project-root (projectile-completing-read
- "Project: "
- (projectile-relevant-known-projects)
- :initial-input (projectile-project-root (projectile-project-name))))
- (project (projectile-project-name project-root))
- (file (completing-read "File: " (projectile-project-files project-root))))
+ "Project: "
+ (projectile-relevant-known-projects)
+ :initial-input (projectile-project-root (projectile-project-name))))
+ (project (projectile-project-name project-root))
+ (file (completing-read "File: " (projectile-project-files project-root))))
(format "nb:%s::%s" project file)))
@@ -11551,6 +13943,7 @@ This makes it easy to type C-c C-l then type nb <enter> and then get to choose a
***** COMMENT Link face
:PROPERTIES:
:ID: B0FE7314-280B-4AE3-96C4-6BAD41C205E4
+:CUSTOM_ID: h:E303E4C0-6048-4180-BFD5-9F546FE211C4
:END:
We use a face to show if a link is valid. Valid means there is one match, red means there is no match, and orange means there is more than one project that matches. That can happen if you have multiple clones of a git repo for example.
@@ -11565,25 +13958,25 @@ If we can't find a project or file, it will be red."
;; We save it to avoid that.
(save-match-data
(let* ((parts (nb-parse-path path))
- (project (nth 0 parts))
- (fpath (nth 1 parts))
- (follow (nth 2 parts))
- (projects (append (projectile-relevant-known-projects)
- (list (projectile-project-root))))
- (project-candidates (-filter (lambda (p)
- (string-match project (or p "")))
- projects))
- ;; These are projects that match the spec, and that have the file we want.
- (candidates (-filter (lambda (p)
- (file-exists-p (expand-file-name fpath (or p ""))))
- project-candidates)))
+ (project (nth 0 parts))
+ (fpath (nth 1 parts))
+ (follow (nth 2 parts))
+ (projects (append (projectile-relevant-known-projects)
+ (list (projectile-project-root))))
+ (project-candidates (-filter (lambda (p)
+ (string-match project (or p "")))
+ projects))
+ ;; These are projects that match the spec, and that have the file we want.
+ (candidates (-filter (lambda (p)
+ (file-exists-p (expand-file-name fpath (or p ""))))
+ project-candidates)))
(cond
;; No project
((null candidates)
'(:foreground "red"))
;; one project, and the file exists
((= 1 (length candidates))
- '(:foreground "darkviolet"))
+ '(:foreground "darkviolet"))
;; Multiple projects seem to match.
((> (length candidates) 1)
'(:foreground "orange"))))))
@@ -11594,6 +13987,7 @@ If we can't find a project or file, it will be red."
***** COMMENT Tooltips for the link
:PROPERTIES:
:ID: ABAB4E52-161A-455B-92FD-9E6EE62C3016
+:CUSTOM_ID: h:A33ED4B3-A4B5-438F-9A2D-5E79F096CC8D
:END:
The links have a tooltip that tells you the path that will be opened, or helpful information about issues with the link (not found, or multiple repos).
@@ -11605,34 +13999,34 @@ The links have a tooltip that tells you the path that will be opened, or helpful
(save-excursion
(goto-char position)
(let ((path (org-element-property :path (org-element-context))))
- (destructuring-bind (project fpath follow) (nb-parse-path path)
- (let* ((projects (append (projectile-relevant-known-projects)
- (list (projectile-project-root))))
- (project-candidates (-filter (lambda (p)
- (string-match project p))
- projects))
- ;; These are projects that match the spec, and that have the file we want.
- (candidates (-filter (lambda (p)
- (file-exists-p (expand-file-name fpath p)))
- project-candidates)))
- (cond
- ((null project-candidates)
- (format "%s is not a known project." project))
+ (destructuring-bind (project fpath follow) (nb-parse-path path)
+ (let* ((projects (append (projectile-relevant-known-projects)
+ (list (projectile-project-root))))
+ (project-candidates (-filter (lambda (p)
+ (string-match project p))
+ projects))
+ ;; These are projects that match the spec, and that have the file we want.
+ (candidates (-filter (lambda (p)
+ (file-exists-p (expand-file-name fpath p)))
+ project-candidates)))
+ (cond
+ ((null project-candidates)
+ (format "%s is not a known project." project))
- ((null candidates)
- (format "%s not found in %s." fpath project))
+ ((null candidates)
+ (format "%s not found in %s." fpath project))
- ;; There is one project, and the file is in it.
- ((= 1 (length candidates))
- ;; Show the path
- (expand-file-name fpath (car candidates)))
+ ;; There is one project, and the file is in it.
+ ((= 1 (length candidates))
+ ;; Show the path
+ (expand-file-name fpath (car candidates)))
- ;; Multiple projects. We don't check for file existence
- ((> (length candidates) 1)
- (format "Multiple projects have %s: %S" fpath candidates))
+ ;; Multiple projects. We don't check for file existence
+ ((> (length candidates) 1)
+ (format "Multiple projects have %s: %S" fpath candidates))
- (t
- "Not sure what is going on with this one."))))))))
+ (t
+ "Not sure what is going on with this one."))))))))
#+END_SRC
@@ -11640,6 +14034,7 @@ The links have a tooltip that tells you the path that will be opened, or helpful
***** COMMENT Activating the link
:PROPERTIES:
:ID: 04FF49A9-2BB5-4A8C-92A9-F8F0EB752FE8
+:CUSTOM_ID: h:64E2715C-2100-4494-876C-1739A7AC5E8E
:END:
I am a big fan of image overlays on links that are images. We make that happen for notebook links here.
@@ -11653,46 +14048,46 @@ PATH is the link PATH.
BRACKETP is non-nil for bracketed links."
(destructuring-bind (project fpath link-target) (nb-parse-path path)
(if (and (string-match (org-image-file-name-regexp) fpath)
- (not (ov-at start)))
- ;; Find the image
- (let* ((projects (remove nil (append (projectile-relevant-known-projects)
- (list
- (when (projectile-project-p)
- (projectile-project-root))))))
- ;; These are projects that match the project spec
- (project-candidates (-filter (lambda (p)
- (string-match (concat project "/\\'") p))
- projects))
- ;; These are projects that match the spec, and that have the file we want.
- (candidates (-filter (lambda (p)
- (file-exists-p (expand-file-name fpath p)))
- project-candidates))
- (img-file (when (and (= 1 (length candidates))
- (file-exists-p (expand-file-name fpath (car candidates))))
- (expand-file-name fpath (car candidates)))))
- (when img-file
- (let* ((ov (make-overlay start end))
- (lnk (org-element-context))
- (parent (org-element-property :parent lnk))
- (ao (when parent (org-element-property :attr_org parent)))
- (width (when ao
- (plist-get
- (org-export-read-attribute :attr_org parent) :width)))
- (img-file (if width
- (funcall org-inline-image-resize-function img-file width)
- img-file))
- (img (create-image (or img-file )
- nil
- nil
- :width width)))
-
- (overlay-put ov 'display img)
- (overlay-put ov 'help-echo (expand-file-name fpath (car candidates)))
- (overlay-put ov 'face 'default)
- (overlay-put ov 'org-image-overlay t)
- (overlay-put ov 'modification-hooks
- (list 'org-display-inline-remove-overlay))
- (push ov org-inline-image-overlays)))))))
+ (not (ov-at start)))
+ ;; Find the image
+ (let* ((projects (remove nil (append (projectile-relevant-known-projects)
+ (list
+ (when (projectile-project-p)
+ (projectile-project-root))))))
+ ;; These are projects that match the project spec
+ (project-candidates (-filter (lambda (p)
+ (string-match (concat project "/\\'") p))
+ projects))
+ ;; These are projects that match the spec, and that have the file we want.
+ (candidates (-filter (lambda (p)
+ (file-exists-p (expand-file-name fpath p)))
+ project-candidates))
+ (img-file (when (and (= 1 (length candidates))
+ (file-exists-p (expand-file-name fpath (car candidates))))
+ (expand-file-name fpath (car candidates)))))
+ (when img-file
+ (let* ((ov (make-overlay start end))
+ (lnk (org-element-context))
+ (parent (org-element-property :parent lnk))
+ (ao (when parent (org-element-property :attr_org parent)))
+ (width (when ao
+ (plist-get
+ (org-export-read-attribute :attr_org parent) :width)))
+ (img-file (if width
+ (funcall org-inline-image-resize-function img-file width)
+ img-file))
+ (img (create-image (or img-file )
+ nil
+ nil
+ :width width)))
+
+ (overlay-put ov 'display img)
+ (overlay-put ov 'help-echo (expand-file-name fpath (car candidates)))
+ (overlay-put ov 'face 'default)
+ (overlay-put ov 'org-image-overlay t)
+ (overlay-put ov 'modification-hooks
+ (list 'org-display-inline-remove-overlay))
+ (push ov org-inline-image-overlays)))))))
#+END_SRC
@@ -11703,6 +14098,7 @@ BRACKETP is non-nil for bracketed links."
***** TODO A keymap
:PROPERTIES:
:ID: 1FB5C9EE-D345-4FBA-893D-6368570042A9
+:CUSTOM_ID: h:460406B8-3D71-40BC-8BE0-4AA87F3089D5
:END:
I often want to open a link in the Finder/Explorer or bash. We make a keymap to make that easy here.
@@ -11714,25 +14110,25 @@ We have to get the link path and then open it.
"Open the nb link at point in bash."
(interactive)
(let* ((link (org-element-context))
- (path (org-element-property :path link)))
+ (path (org-element-property :path link)))
(when (and (eq 'link (car link))
- (string= "nb" (org-element-property :type link)))
+ (string= "nb" (org-element-property :type link)))
(destructuring-bind (project fpath link-target) (nb-parse-path path)
- (let* ((projects (remove nil (append (projectile-relevant-known-projects)
- (list
- (when (projectile-project-p)
- (projectile-project-root))))))
- ;; These are projects that match the project spec
- (project-candidates (-filter (lambda (p)
- (string-match (concat project "/\\'") p))
- projects))
- ;; These are projects that match the spec, and that have the file we want.
- (candidates (-filter (lambda (p)
- (file-exists-p (expand-file-name fpath p)))
- project-candidates)))
- (if (= 1 (length candidates))
- (bash (expand-file-name (car candidates)))
- (bash (read-string "Project: " candidates))))))))
+ (let* ((projects (remove nil (append (projectile-relevant-known-projects)
+ (list
+ (when (projectile-project-p)
+ (projectile-project-root))))))
+ ;; These are projects that match the project spec
+ (project-candidates (-filter (lambda (p)
+ (string-match (concat project "/\\'") p))
+ projects))
+ ;; These are projects that match the spec, and that have the file we want.
+ (candidates (-filter (lambda (p)
+ (file-exists-p (expand-file-name fpath p)))
+ project-candidates)))
+ (if (= 1 (length candidates))
+ (bash (expand-file-name (car candidates)))
+ (bash (read-string "Project: " candidates))))))))
#+END_SRC
@@ -11743,25 +14139,25 @@ Here is a function to open the link in explorer.
"Open the nb link at point in explorer/finder."
(interactive)
(let* ((link (org-element-context))
- (path (org-element-property :path link)))
+ (path (org-element-property :path link)))
(when (and (eq 'link (car link))
- (string= "nb" (org-element-property :type link)))
+ (string= "nb" (org-element-property :type link)))
(destructuring-bind (project fpath link-target) (nb-parse-path path)
- (let* ((projects (remove nil (append (projectile-relevant-known-projects)
- (list
- (when (projectile-project-p)
- (projectile-project-root))))))
- ;; These are projects that match the project spec
- (project-candidates (-filter (lambda (p)
- (string-match (concat project "/\\'") p))
- projects))
- ;; These are projects that match the spec, and that have the file we want.
- (candidates (-filter (lambda (p)
- (file-exists-p (expand-file-name fpath p)))
- project-candidates)))
- (if (= 1 (length candidates))
- (explorer (expand-file-name (car candidates)))
- (explorer (read-string "Project: " candidates))))))))
+ (let* ((projects (remove nil (append (projectile-relevant-known-projects)
+ (list
+ (when (projectile-project-p)
+ (projectile-project-root))))))
+ ;; These are projects that match the project spec
+ (project-candidates (-filter (lambda (p)
+ (string-match (concat project "/\\'") p))
+ projects))
+ ;; These are projects that match the spec, and that have the file we want.
+ (candidates (-filter (lambda (p)
+ (file-exists-p (expand-file-name fpath p)))
+ project-candidates)))
+ (if (= 1 (length candidates))
+ (explorer (expand-file-name (car candidates)))
+ (explorer (read-string "Project: " candidates))))))))
#+END_SRC
@@ -11773,28 +14169,28 @@ This function lets you get to the file or another one using projectile.
"Open the nb link at point with projectile."
(interactive)
(let* ((link (org-element-context))
- (path (org-element-property :path link)))
+ (path (org-element-property :path link)))
(when (and (eq 'link (car link))
- (string= "nb" (org-element-property :type link)))
+ (string= "nb" (org-element-property :type link)))
(destructuring-bind (project fpath link-target) (nb-parse-path path)
- (let* ((projects (remove nil (append (projectile-relevant-known-projects)
- (list
- (when (projectile-project-p)
- (projectile-project-root))))))
- ;; These are projects that match the project spec
- (project-candidates (-filter (lambda (p)
- (string-match (concat project "/\\'") p))
- projects))
- ;; These are projects that match the spec, and that have the file we want.
- (candidates (-filter (lambda (p)
- (file-exists-p (expand-file-name fpath p)))
- project-candidates)))
- (if (= 1 (length candidates))
- (let ((default-directory (expand-file-name (car candidates))))
- (projectile-completing-read "Find file: "
+ (let* ((projects (remove nil (append (projectile-relevant-known-projects)
+ (list
+ (when (projectile-project-p)
+ (projectile-project-root))))))
+ ;; These are projects that match the project spec
+ (project-candidates (-filter (lambda (p)
+ (string-match (concat project "/\\'") p))
+ projects))
+ ;; These are projects that match the spec, and that have the file we want.
+ (candidates (-filter (lambda (p)
+ (file-exists-p (expand-file-name fpath p)))
+ project-candidates)))
+ (if (= 1 (length candidates))
+ (let ((default-directory (expand-file-name (car candidates))))
+ (projectile-completing-read "Find file: "
(projectile-project-files
- (projectile-project-root))
- :initial-input fpath))))))))
+ (projectile-project-root))
+ :initial-input fpath))))))))
#+END_SRC
@@ -11820,15 +14216,15 @@ Here is our keymap.
#+BEGIN_SRC emacs-lisp :results silent
(defvar nb-link-map (let ((map (copy-keymap org-mouse-map)))
- (define-key map (kbd "M-o") 'nb-follow-other)
- (define-key map (kbd "M-O") 'nb-follow-other-frame)
- (define-key map (kbd "M-s") 'nb-follow-sys)
- (define-key map (kbd "M-b") 'nb-link-bash)
- (define-key map (kbd "M-e") 'nb-link-explorer)
- (define-key map (kbd "M-f") 'nb-link-projectile-find-file)
- (define-key map (kbd "M-h") 'nb-hydra/body)
- (define-key map (kbd "<C-mouse-1>") 'nb-event)
- map)
+ (define-key map (kbd "M-o") 'nb-follow-other)
+ (define-key map (kbd "M-O") 'nb-follow-other-frame)
+ (define-key map (kbd "M-s") 'nb-follow-sys)
+ (define-key map (kbd "M-b") 'nb-link-bash)
+ (define-key map (kbd "M-e") 'nb-link-explorer)
+ (define-key map (kbd "M-f") 'nb-link-projectile-find-file)
+ (define-key map (kbd "M-h") 'nb-hydra/body)
+ (define-key map (kbd "<C-mouse-1>") 'nb-event)
+ map)
"Key bindings for notebook links")
#+END_SRC
@@ -11836,6 +14232,7 @@ Here is our keymap.
***** Defining the link
:PROPERTIES:
:ID: DB35E05E-FCAF-49B6-9B09-73C42A4FB54F
+:CUSTOM_ID: h:C81BA28C-9CB7-4CB0-9FC7-E101E14F3AA1
:END:
This is just the link definition.
@@ -11854,6 +14251,9 @@ This is just the link definition.
#+END_SRC
****** Example links
+:PROPERTIES:
+:CUSTOM_ID: h:12B045CB-0130-47BE-8959-CAE309DFAC7A
+:END:
nb:eeg-pitt::README.org
nb:eeg-pitt::README.org::10
@@ -11878,6 +14278,7 @@ prj:students::README.org
**** A notebook hydra
:PROPERTIES:
:ID: 6B26E4FC-C32C-4459-8FD5-9234A52C913A
+:CUSTOM_ID: h:63E14DBE-1DD3-4DE8-ACAF-55C0AFE8AE78
:END:
- Note taken on [2020-03-18 Wed 08:14] \\
Adding a shortcut to the function to clone a git repo and create a notebook.
@@ -11916,6 +14317,7 @@ _D_: open root _sb_: search bufs _n_: new notebook _y_: open with sys
**** Customs settings for scimax notebooks
:PROPERTIES:
:ID: D3A39991-54F0-4809-9036-A5D8E55B3BB7
+:CUSTOM_ID: h:F8B93A3B-BA73-45E5-B24B-9D5350577E95
:END:
#+BEGIN_SRC emacs-lisp
@@ -11924,6 +14326,9 @@ _D_: open root _sb_: search bufs _n_: new notebook _y_: open with sys
#+END_SRC
*** To use John's old ob-ipython fork
+:PROPERTIES:
+:CUSTOM_ID: h:F7DB278E-CB9B-4CB6-9E60-DE9A0605B753
+:END:
#+BEGIN_SRC emacs-lisp
;;;* For reference : to use John's old ob-ipython fork. The require may not be necessary here
@@ -11937,3 +14342,10 @@ _D_: open root _sb_: search bufs _n_: new notebook _y_: open with sys
:straight (scimax-org-babel-ipython :host github :repo "jkitchin/scimax"))
#+END_SRC
+
+
+
+
+
+
+
modified init.el
@@ -5,9 +5,9 @@
gc-cons-percentage 0.6)
(add-hook 'emacs-startup-hook
- (lambda ()
- (setq gc-cons-threshold 16777216 ; 16mb
- gc-cons-percentage 0.1)))
+ (lambda ()
+ (setq gc-cons-threshold 16777216 ; 16mb
+ gc-cons-percentage 0.1)))
;; Raising gc-cons threshold when the minibuffer is active
@@ -19,7 +19,7 @@
;; benefits.
(run-at-time
1 nil (lambda () (setq gc-cons-threshold 16777216 ; 16mb
- gc-cons-percentage 0.1) )))
+ gc-cons-percentage 0.1) )))
(add-hook 'minibuffer-setup-hook #'doom-defer-garbage-collection-h)
(add-hook 'minibuffer-exit-hook #'doom-restore-garbage-collection-h)
@@ -41,18 +41,25 @@
(straight-use-package 'use-package)
(use-package git) ;; ensure we can install from git sources
+(setq use-package-compute-statistics t)
+
+(straight-use-package 'use-package-ensure-system-package)
+
;; Base function to create the home directory
(defun sr/fun/homedir (foldername)
-"Function to extract the home directory path"
+ "Function to extract the home directory path"
(expand-file-name foldername (getenv "HOME")))
;; Emacs directory defauling to .emacs.d
(defun sr/fun/emacs-dir (foldername)
-"Function to prepend the project directory path to any folder. Starts from the home directory."
+ "Function to prepend the project directory path to any folder. Starts from the home directory."
(expand-file-name foldername (sr/fun/homedir ".emacs.d" )))
(fset 'yes-or-no-p 'y-or-n-p)
+(setq vc-follow-symlinks 't)
+;; The default value seems to be 'ask
+
(setq load-prefer-newer t)
(load (sr/fun/emacs-dir "dotemacs.el"))
Staged changes (1)
modified emacs-config.org
@@ -7687,17 +7687,7 @@ As noted in https://gitlab.com/protesilaos/modus-themes/-/issues/68
:PROPERTIES:
:ID: 1F5F41EC-6BDA-46BC-B1E6-DED28B899196
:END:
-
-*** Modus themes package
- :PROPERTIES:
- :ID: 85401D4B-CF7B-4997-BCD1-AC273FE4518E
- :END:
-
-#+BEGIN_SRC emacs-lisp
-
-#+END_SRC
-
-*** COMMENT modus operandi
+*** modus operandi
:PROPERTIES:
:ID: 4353F3D3-6528-49E2-B9A3-16F98A490FF1
:END:
@@ -7711,25 +7701,29 @@ As noted in https://gitlab.com/protesilaos/modus-themes/-/issues/68
(use-package modus-operandi-theme
:straight t
:init
+ ;; NOTE: Everything is disabled by default.
(setq modus-operandi-theme-slanted-constructs t
modus-operandi-theme-bold-constructs t
- modus-operandi-theme-visible-fringes t
+ modus-operandi-theme-fringes 'subtle ; {nil,'subtle,'intense}
modus-operandi-theme-3d-modeline t
- modus-operandi-theme-subtle-diffs t
- modus-operandi-theme-intense-standard-completions t
- ;; modus-operandi-theme-distinct-org-blocks nil
- modus-operandi-theme-rainbow-org-src-blocks t
- modus-operandi-theme-proportional-fonts t
+ modus-operandi-theme-faint-syntax nil
+ modus-operandi-theme-intense-hl-line t
+ modus-operandi-theme-intense-paren-match t
+ modus-operandi-theme-prompts 'intense ; {nil,'subtle,'intense}
+ modus-operandi-theme-completions 'opinionated ; {nil,'moderate,'opinionated}
+ modus-operandi-theme-diffs 'desaturated
+ modus-operandi-theme-org-blocks 'rainbow ; {nil,'greyscale,'rainbow}
+ modus-operandi-theme-variable-pitch-headings t
modus-operandi-theme-rainbow-headings t
modus-operandi-theme-section-headings nil
modus-operandi-theme-scale-headings t
- modus-operandi-theme-intense-standard-completions t
- ;; modus-operandi-theme-scale-1 1.05
- ;; modus-operandi-theme-scale-2 1.1
- ;; modus-operandi-theme-scale-3 1.15
- ;; modus-operandi-theme-scale-4 1.2
- ;; modus-operandi-theme-scale-5 1.3
- )
+ modus-operandi-theme-scale-1 1.05
+ modus-operandi-theme-scale-2 1.1
+ modus-operandi-theme-scale-3 1.15
+ modus-operandi-theme-scale-4 1.2
+ modus-operandi-theme-scale-5 1.3)
+
+
:config
(load-theme 'modus-operandi t))
#+END_SRC
@@ -7737,7 +7731,12 @@ As noted in https://gitlab.com/protesilaos/modus-themes/-/issues/68
#+RESULTS:
: t
*** COMMENT modus vivendi
+:PROPERTIES:
+:ID: 65FD8B91-2305-447C-B78D-0B9D93804512
+:CUSTOM_ID: h:8FAADC0D-65A6-4CDC-B50A-D397E00AC694
+:END:
+#+name: modus-vivendi
#+BEGIN_SRC emacs-lisp
(use-package modus-vivendi-theme
@@ -7745,47 +7744,41 @@ As noted in https://gitlab.com/protesilaos/modus-themes/-/issues/68
:init
(setq modus-vivendi-theme-slanted-constructs t
modus-vivendi-theme-bold-constructs t
- modus-vivendi-theme-visible-fringes t
+ modus-vivendi-theme-fringes 'intense
+ modus-vivendi-theme-intense-hl-line t
modus-vivendi-theme-3d-modeline t
- modus-vivendi-theme-subtle-diffs t
- modus-vivendi-theme-intense-standard-completions t
- ;; modus-vivendi-theme-distinct-org-blocks nil
- modus-vivendi-theme-rainbow-org-src-blocks t
+ modus-vivendi-theme-diffs 'desaturated
+ modus-vivendi-theme-org-blocks 'rainbow
modus-vivendi-theme-proportional-fonts t
modus-vivendi-theme-rainbow-headings t
modus-vivendi-theme-section-headings nil
modus-vivendi-theme-scale-headings t
- modus-vivendi-theme-intense-standard-completions t
- ;; modus-vivendi-theme-scale-1 1.05
+ modus-vivendi-theme-faint-syntax t
+ modus-vivendi-theme-intense-paren-match t
+ modus-vivendi-theme-prompts 'subtle ; {nil,'subtle,'intense}
+ modus-vivendi-theme-completions 'opinionated
+
+
+ ;; modus-vivendi-theme-scale-1 1.05
;; modus-vivendi-theme-scale-2 1.1
;; modus-vivendi-theme-scale-3 1.15
;; modus-vivendi-theme-scale-4 1.2
;; modus-vivendi-theme-scale-5 1.3
- )
+ )
:config
- (load-theme 'modus-vivendi t))
-#+END_SRC
-
+ (load-theme 'modus-vivendi t)
+;; *("is the symbol powerline-reset bound to a function")
+ (fboundp 'powerline-reset))
+;; ALternatives
+;; This will attemp to load powerline, if it is available and not loaded.
-#+BEGIN_SRC emacs-lisp
-(straight-use-package 'modus-vivendi-theme)
+;; (require 'powerline nil t ) (if (featurep 'powerline) ...)
+#+END_SRC
+*** TODO Function to update and rebuild both modus theme packages
+*** TODO COMMENT Test for switching themes
-(use-package modus-vivendi-theme
-:straight t
-:config
-(setq modus-vivendi-theme-scale-headings t)
-(setq modus-vivendi-theme-proportional-fonts t)
-(setq modus-vivendi-theme-slanted-constructs t)
-(setq modus-vivendi-theme-visible-fringes t)
-(setq modus-vivendi-theme-distinct-org-blocks t)
-(load-theme 'modus-vivendi t))
-
-;; These are placed here for ready reference
-;; (setq modus-vivendi-theme-scale-1 1.05)
-;; (setq modus-vivendi-theme-scale-2 1.1)
-;; (setq modus-vivendi-theme-scale-3 1.15)
-;; (setq modus-vivendi-theme-scale-4 1.2)
+This may be in-built into the theme
#+END_SRC
Stashes (1)
stash@{0} On master: Attempt at checkbox font change
Unpushed to gh/master (6)
546ac97 master Adds notes on modus-themes
8974893 Note on which-key which
19f2aad Adds a note and task to setup separate package installation
0095b5f Adds a note on company mode and disable global
8a24bf3 origin/master Adds alerts and sauron
1b92b4c Use super keys for bold and italics application in org files.
Unmerged into origin/master (4)
546ac97 master Adds notes on modus-themes
8974893 Note on which-key which
19f2aad Adds a note and task to setup separate package installation
0095b5f Adds a note on company mode and disable global
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment