Skip to content

Instantly share code, notes, and snippets.

;;; org-fold.el --- Folding of Org entries -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2020-2020 Free Software Foundation, Inc.
;;
;; Author: ???
;; Keywords: folding, invisible text
;; Homepage: https://orgmode.org
;;
;; This file is part of GNU Emacs.
;;
(setq gc-cons-threshold (* (expt 1024 3) 1)) ; 1 GB
(setq read-process-output-max (* (expt 1024 2) 1)) ; 1 MB
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
(load-theme 'dracula t)
(tool-bar-mode -1)
;; (add-to-list 'load-path "~/.emacs.d/all-the-icons")

Store files in folder structure, following my org tree structure

I usually have a huge numbers of files, related to my projects. I would like to use attach to associate the files with the proper entry, but searching them later in my Dropbox is a pain because of the way Org saves the attachments. It makes more sense for me to make attachments follow the org tree structure in the project by default (unless I change the attach folder to something else).

This can be done if we make attachment by creating a symbolic link to the attach folder in the place, according to the headline path. This way allows to keep all the file attached to the project accessible with relative paths.

@yantar92
yantar92 / featuredrawertextprop.patch
Last active September 23, 2020 06:44
Against aea1109ef
diff --git a/contrib/lisp/org-checklist.el b/contrib/lisp/org-checklist.el
index 2bc00c0b9..f50c811ab 100644
--- a/contrib/lisp/org-checklist.el
+++ b/contrib/lisp/org-checklist.el
@@ -103,7 +103,7 @@ of checkbox items"
(save-excursion
(org-narrow-to-subtree)
(org-update-checkbox-count-maybe)
- (org-show-subtree)
+ (org-fold-show-subtree)
;;; org-cycle.el --- Visibility cycling of Org entries -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2020-2020 Free Software Foundation, Inc.
;;
;; Author: ??
;; Keywords: folding, visibility cycling, invisible text
;; Homepage: https://orgmode.org
;;
;; This file is part of GNU Emacs.
;;
@yantar92
yantar92 / gist:b3ce1e265910b94e478233288636c0fd
Last active May 28, 2020 13:47
Fancy wrapping of headline text in agenda. Requires adaptive-wrap package.
;; macros from https://github.com/weirdNox/dotfiles/blob/master/config/.emacs.d/config.org#hooks
(defun nox-unquote (exp)
"Return EXP unquoted."
(declare (pure t) (side-effect-free t))
(while (memq (car-safe exp) '(quote function))
(setq exp (cadr exp)))
exp)
(defun nox-enlist (exp)
"Return EXP wrapped in a list, or as-is if already a list."
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 34179096d..463b28f47 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1359,14 +1359,14 @@ the default behavior."
(sit-for 2)
(throw 'abort nil))
(t
- (insert-before-markers "\n")
+ (insert-before-markers-and-inherit "\n")
@yantar92
yantar92 / org-no-overlay-in-drawers.el
Last active May 4, 2020 09:30
Org-mode patch to use text properties instead of overlays in drawers
;; [[file:~/Git/emacs-config/config.org][Speed up huge org files:1]]
(use-package org
:init
(defun org-flag-region (from to flag spec)
"Hide or show lines from FROM to TO, according to FLAG.
SPEC is the invisibility spec, as a symbol."
(pcase spec
('outline
(remove-overlays from to 'invisible spec)
@yantar92
yantar92 / openpgp.txt
Created October 21, 2017 06:32
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:4590073c56d47b725e9a6ce66470762a7da11d8b]
@yantar92
yantar92 / openpgp.txt
Created October 21, 2017 06:32
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:4590073c56d47b725e9a6ce66470762a7da11d8b]