Commit 223b60da5494

Vincent Demeester <vincent@sbr.pm>
2025-01-14 16:59:43
tools/emacs: remove comment code from config-org.el
It's in the history anyway. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent ed6c4a2
Changed files (1)
tools
emacs
tools/emacs/config/config-org.el
@@ -456,406 +456,6 @@ file which do not already have one."
   :bind (:map org-mode-map
               ("C-M-y" . org-rich-yank)))
 
-;; (use-package org
-;;   ;; :ensure org-plus-contrib ;; load from the package instead of internal
-;;   :mode (("\\.org$" . org-mode)
-;;          ("\\.org.draft$" . org-mode))
-;;   :commands (org-agenda org-capture)
-;;   :bind (("C-c o l" . org-store-link)
-;;          ("C-c o r r" . org-refile)
-;;          ("C-c o a a" . org-agenda)
-;;          ("C-c o a r" . my/reload-org-agenda-files)
-;;          ("C-c o s" . org-sort)
-;;          ("<f12>" . org-agenda)
-;;          ("C-c o c" . org-capture)
-;;          ;; Skeletons
-;;          ("C-c o i p" . vde/org-project)
-;;          ("C-c o i n" . vde/org-www-post))
-;;   :config
-;;   (define-skeleton vde/org-project
-;;     "new org-mode project"
-;;     nil
-;;     > "#+TITLE: " (skeleton-read "Title: ") \n
-;;     > "#+FILETAGS: " (skeleton-read "Tags: ") \n
-;;     > "#+CATEGORY: " (skeleton-read "Category: ") \n
-;;     > _ \n
-;;     > _ \n)
-;;   (define-auto-insert '("/projects/.*\\.org\\'" . "projects org files") [vde/org-project])
-;;   (define-skeleton vde/org-www-post
-;;     "new www post"
-;;     nil
-;;     > "#+title: " (skeleton-read "Title: ") \n
-;;     > "#+date: " (format-time-string "<%Y-%m-%d %a>") \n
-;;     > "#+filetags: " (skeleton-read "Tags: ") \n
-;;     > "#+setupfile: " (skeleton-read "Template (default ../templates/2022.org): ") \n
-;;     > _ \n
-;;     > "* Introduction"
-;;     )
-;;   (define-auto-insert '("/content/.*\\.org\\'" . "blog post org files") [vde/org-www-post])
-;;   (define-auto-insert '("/content/.*\\.draft\\'" . "blog post draft files") [vde/org-www-post])
-;;   ;; Org Babel configurations
-;;   (when (file-exists-p org-babel-library-file)
-;;     (org-babel-lob-ingest org-babel-library-file))
-;;   (setq org-tag-alist '(("linux") ("nixos") ("emacs") ("org")
-;;                         ("openshift") ("redhat") ("tektoncd") ("kubernetes") ("knative" ) ("docker")
-;;                         ("docs") ("code") ("review")
-;;                         (:startgroup . nil)
-;;                         ("#home" . ?h) ("#work" . ?w) ("#errand" . ?e) ("#health" . ?l)
-;;                         (:endgroup . nil)
-;;                         (:startgroup . nil)
-;;                         ("#link" . ?i) ("#read" . ?r) ("#project" . ?p)
-;;                         (:endgroup . nil))
-;;         org-enforce-todo-dependencies t
-;;         org-outline-path-complete-in-steps nil
-;;         org-columns-default-format "%80ITEM(Task) %TODO %3PRIORITY %10Effort(Effort){:} %10CLOCKSUM"
-;;         org-fontify-whole-heading-line t
-;;         org-pretty-entities t
-;;         org-ellipsis " ⤵"
-;;         org-archive-location (concat org-completed-dir "/%s::datetree/")
-;;         org-use-property-inheritance t
-;;         org-priority 67
-;;         org-priority-faces '((?A . "#ff2600")
-;;                              (?B . "#ff5900")
-;;                              (?C . "#ff9200")
-;;                              (?D . "#747474"))
-;;         org-global-properties (quote (("EFFORT_ALL" . "0:15 0:30 0:45 1:00 2:00 3:00 4:00 5:00 6:00 0:00")
-;;                                       ("STYLE_ALL" . "habit")))
-;;         org-blank-before-new-entry '((heading . t)
-;;                                      (plain-list-item . nil))
-;;         org-insert-heading-respect-content t
-;;         org-yank-adjusted-subtrees t
-;;         org-image-actual-width nil
-;;         org-startup-with-inline-images nil
-;;         org-catch-invisible-edits 'error
-;;         ;; Put theses into a minor mode
-;;         org-indent-indentation-per-level 1
-;;         org-cycle-separator-lines 1
-;;         org-adapt-indentation nil
-;;         org-hide-leading-stars t
-;;         org-hide-emphasis-markers nil
-;;         org-link-file-path-type 'relative)
-;;   (setcar (nthcdr 4 org-emphasis-regexp-components) 10)
-;;   :hook (org-mode . vde/org-mode-hook))
-;; 
-;; (defun vde/org-mode-hook ()
-;;   "Org-mode hook"
-;;   (setq show-trailing-whitespace t)
-;;   (when (not (eq major-mode 'org-agenda-mode))
-;;     (setq fill-column 90)
-;;     (auto-revert-mode)
-;;     (auto-fill-mode)
-;;     (org-indent-mode)
-;;     (add-hook 'before-save-hook #'save-and-update-includes nil 'make-it-local)))
-;; (use-package org-agenda
-;;   :after org
-;;   :commands (org-agenda)
-;;   :bind (("C-c o a a" . org-agenda)
-;;          ("<f12>" . org-agenda)
-;;          ("C-c o r a" . org-agenda-refile))
-;;   :config
-;;   (use-package org-super-agenda
-;;     :config (org-super-agenda-mode))
-;;   (setq org-agenda-span 'day
-;;         org-agenda-start-on-weekday 1
-;;         org-agenda-include-diary t
-;;         org-agenda-window-setup 'current-window
-;;         org-agenda-skip-scheduled-if-done nil
-;;         org-agenda-compact-blocks t
-;;         org-agenda-sticky t
-;;         org-super-agenda-header-separator ""
-;;         org-agenda-custom-commands
-;;         `(("l" "Links"
-;;            tags "+#link")
-;;           ("w" "Agenda"
-;;            ((agenda "")
-;;             (tags-todo "-goals-incubate-inbox+TODO=\"STARTED\""
-;;                        ((org-agenda-overriding-header "Ongoing")))
-;;             (tags-todo "-goals-incubate-inbox+TODO=\"NEXT\""
-;;                        ((org-agenda-overriding-header "Next"))))
-;;            ((org-super-agenda-groups
-;;              '((:name "Important" :priority "A")
-;;                (:name "Scheduled" :time-grid t)
-;;                (:habit t))))
-;;            (org-agenda-list)))))
-
-
-;; (use-package org-clock
-;;   :after org
-;;   :commands (org-clock-in org-clock-out org-clock-goto)
-;;   :config
-;;   ;; Setup hooks for clock persistance
-;;   (org-clock-persistence-insinuate)
-;;   (setq org-clock-clocked-in-display nil
-;;         ;; Show lot of clocking history so it's easy to pick items off the C-F11 list
-;;         org-clock-history-length 23
-;;         ;; Change tasks to STARTED when clocking in
-;;         org-clock-in-switch-to-state 'vde/clock-in-to-started
-;;         ;; Clock out when moving task to a done state
-;;         org-clock-out-when-done t
-;;         ;; Save the running clock and all clock history when exiting Emacs, load it on startup
-;;         org-clock-persist t)
-;;   (use-package find-lisp)
-;;   (defun vde/is-project-p ()
-;;     "Any task with a todo keyword subtask"
-;;     (save-restriction
-;;       (widen)
-;;       (let ((has-subtask)
-;;             (subtree-end (save-excursion (org-end-of-subtree t)))
-;;             (is-a-task (member (nth 2 (org-heading-components)) org-todo-keywords-1)))
-;;         (save-excursion
-;;           (forward-line 1)
-;;           (while (and (not has-subtask)
-;;                       (< (point) subtree-end)
-;;                       (re-search-forward "^\*+ " subtree-end t))
-;;             (when (member (org-get-todo-state) org-todo-keywords-1)
-;;               (setq has-subtask t))))
-;;         (and is-a-task has-subtask))))
-;; 
-;;   (defun vde/is-project-subtree-p ()
-;;     "Any task with a todo keyword that is in a project subtree.
-;; Callers of this function already widen the buffer view."
-;;     (let ((task (save-excursion (org-back-to-heading 'invisible-ok)
-;;                                 (point))))
-;;       (save-excursion
-;;         (vde/find-project-task)
-;;         (if (equal (point) task)
-;;             nil
-;;           t))))
-;; 
-;;   (defun vde/find-project-task ()
-;;     "Move point to the parent (project) task if any"
-;;     (save-restriction
-;;       (widen)
-;;       (let ((parent-task (save-excursion (org-back-to-heading 'invisible-ok) (point))))
-;;         (while (org-up-heading-safe)
-;;           (when (member (nth 2 (org-heading-components)) org-todo-keywords-1)
-;;             (setq parent-task (point))))
-;;         (goto-char parent-task)
-;;         parent-task)))
-;; 
-;;   (defun vde/is-task-p ()
-;;     "Any task with a todo keyword and no subtask"
-;;     (save-restriction
-;;       (widen)
-;;       (let ((has-subtask)
-;;             (subtree-end (save-excursion (org-end-of-subtree t)))
-;;             (is-a-task (member (nth 2 (org-heading-components)) org-todo-keywords-1)))
-;;         (save-excursion
-;;           (forward-line 1)
-;;           (while (and (not has-subtask)
-;;                       (< (point) subtree-end)
-;;                       (re-search-forward "^\*+ " subtree-end t))
-;;             (when (member (org-get-todo-state) org-todo-keywords-1)
-;;               (setq has-subtask t))))
-;;         (and is-a-task (not has-subtask)))))
-;; 
-;;   (defun vde/is-subproject-p ()
-;;     "Any task which is a subtask of another project"
-;;     (let ((is-subproject)
-;;           (is-a-task (member (nth 2 (org-heading-components)) org-todo-keywords-1)))
-;;       (save-excursion
-;;         (while (and (not is-subproject) (org-up-heading-safe))
-;;           (when (member (nth 2 (org-heading-components)) org-todo-keywords-1)
-;;             (setq is-subproject t))))
-;;       (and is-a-task is-subproject)))
-;; 
-;;   (defun vde/clock-in-to-started (kw)
-;;     "Switch a task from TODO to STARTED when clocking in.
-;; Skips capture tasks, projects, and subprojects.
-;; Switch projects and subprojects from STARTED back to TODO"
-;;     (when (not (and (boundp 'org-capture-mode) org-capture-mode))
-;;       (cond
-;;        ((and (member (org-get-todo-state) (list "TODO" "NEXT"))
-;;              (vde/is-task-p))
-;;         "STARTED")
-;;        ((and (member (org-get-todo-state) (list "STARTED"))
-;;              (vde/is-project-p))
-;;         "TODO"))))
-;;   :bind (("<f11>" . org-clock-goto)))
-;; (use-package org-habit
-;;   :after (org)
-;;   :config
-;;   (setq org-habit-show-habits-only-for-today nil
-;;         org-habit-graph-column 80))
-;; (use-package org-src
-;;   :after (org)
-;;   :config
-;;   (setq org-src-fontify-natively t
-;;         org-src-tab-acts-natively t
-;;         org-src-window-setup 'current-window
-;;         org-edit-src-content-indentation 0))
-;; (use-package org
-;;   :defer 2
-;;   :config
-;;   (defun vde/tangle-all-notes ()
-;;     "Produce files from my notes folder.
-;; This function will attempt to tangle all org files from `org-notes-dir'. The
-;; assumption is that those will generate configuration file (in `~/src/home'),
-;; and thus keeping the configuration source up-to-date"
-;;     (mapc (lambda (x) (org-babel-tangle-file x))
-;;           (ignore-errors
-;;             (append (directory-files-recursively org-notes-dir "\.org$")
-;;                     (directory-files-recursively src-home-dir "\.org$"))))))
-;; (use-package org-journal
-;;   :commands (org-journal-new-entry org-capture)
-;;   :after org
-;;   :bind
-;;   (("C-c n j" . org-journal-new-entry)
-;;    ("C-c o j" . org-journal-new-entry))
-;;   :config
-;;   (defun org-journal-find-location ()
-;;     "Go to the beginning of the today's journal file.
-;; 
-;; This can be used for an org-capture template to create an entry in the journal."
-;;     ;; Open today's journal, but specify a non-nil prefix argument in order to
-;;     ;; inhibit inserting the heading; org-capture will insert the heading.
-;;     (org-journal-new-entry t)
-;;     ;; Position point on the journal's top-level heading so that org-capture
-;;     ;; will add the new entry as a child entry.
-;;     (widen)
-;;     (goto-char (point-min))
-;;     (org-show-entry))
-;;   (add-to-list 'org-capture-templates
-;;                `("j" "Journal"))
-;;   (add-to-list 'org-capture-templates
-;;                `("jj" "Journal entry" entry (function org-journal-find-location)
-;;                  "** %(format-time-string org-journal-time-format)%^{Title}\n%i%?"
-;;                  :empty-lines 1))
-;;   (add-to-list 'org-capture-templates
-;;                `("je" "Weekly review" entry (function org-journal-find-location)
-;;                  (file ,(expand-file-name "etc/orgmode/weekly.org" user-emacs-directory))
-;;                  :empty-lines 1 :clock-in t :clock-resume t))
-;;   :custom
-;;   (org-journal-date-prefix "* ")
-;;   (org-journal-file-header "#+TITLE: %Y-%m Journal\n\n")
-;;   (org-journal-file-format "%Y-%m.private.org")
-;;   (org-journal-file-type 'monthly)
-;;   (org-journal-dir org-private-notes-dir)
-;;   (org-journal-date-format "%A, %d %B %Y")
-;;   (org-journal-enable-agenda-integration nil))
-;; 
-;;   (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."
-;;     (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)))))
-;; )
-;; (use-package org-crypt
-;;   :after (org)
-;;   :config
-;;   (org-crypt-use-before-save-magic)
-;;   (setq org-tags-exclude-from-inheritance '("crypt")))
-;; (use-package org-attach
-;;   :after org
-;;   :config
-;;   (setq org-link-abbrev-alist '(("att" . org-attach-expand-link))))
-;; (use-package ox-publish
-;;   :after org
-;;   :commands (org-publish org-publish-all org-publish-project org-publish-current-project org-publish-current-file)
-;;   :config
-;;   (setq org-html-coding-system 'utf-8-unix))
-;; (use-package diary-lib
-;;   :after (org)
-;;   :config
-;;   (setq diary-entry-marker "diary")
-;;   (setq diary-show-holidays-flag t)
-;;   (setq diary-header-line-flag nil)
-;;   (setq diary-mail-days 3)
-;;   (setq diary-number-of-entries 3)
-;;   (setq diary-comment-start ";")
-;;   (setq diary-comment-end "")
-;;   (setq diary-date-forms
-;;         '((day "/" month "[^/0-9]")
-;;           (day "/" month "/" year "[^0-9]")
-;;           (day " *" monthname " *" year "[^0-9]")
-;;           (monthname " *" day "[^,0-9]")
-;;           (monthname " *" day ", *" year "[^0-9]")
-;;           (year "[-/]" month "[-/]" day "[^0-9]")
-;;           (dayname "\\W"))))
-;; 
-;; (use-package org
-;;   :defer t
-;;   :config
-;; 
-;;   (defvar org-capture-templates (list))
-;;   (setq org-protocol-default-template-key "l")
-;; 
-;;   ;; images
-;;   (setq org-image-actual-width nil
-;;         org-startup-with-inline-images nil)
-;; 
-;;   ;; Tasks (-> inbox)
-;; 
-;;   ;; Journal
-;; 
-;;   (add-to-list 'ispell-skip-region-alist '(":\\(PROPERTIES\\|LOGBOOK\\):" ":END:"))
-;;   (add-to-list 'ispell-skip-region-alist '("#\\+BEGIN_SRC" "#\\+END_SRC"))
-;;   (add-to-list 'ispell-skip-region-alist '("#\\+BEGIN_EXAMPLE" "#\\+END_EXAMPLE"))
-;; 
-;;   ;; org-links
-;;   ;; from http://endlessparentheses.com/use-org-mode-links-for-absolutely-anything.html
-;;   (org-link-set-parameters "tag"
-;;                            :follow #'endless/follow-tag-link)
-;;   (defun endless/follow-tag-link (tag)
-;;     "Display a list of TODO headlines with tag TAG.
-;; With prefix argument, also display headlines without a TODO keyword."
-;;     (org-tags-view (null current-prefix-arg) tag))
-;; 
-;;   (org-link-set-parameters
-;;    "org"
-;;    :complete (lambda () (+org-link-read-file "org" org-directory))
-;;    :follow   (lambda (link) (find-file (expand-file-name link org-directory)))
-;;    :face     (lambda (link)
-;;                (if (file-exists-p (expand-file-name link org-directory))
-;;                    'org-link
-;;                  'error)))
-;;   (defun +org-link-read-file (key dir)
-;;     (let ((file (read-file-name (format "%s: " (capitalize key)) dir)))
-;;       (format "%s:%s"
-;;               key
-;;               (file-relative-name file dir))))
-;;   )
-;; 
-;; (use-package org-tree-slide
-;;   :functions (org-display-inline-images
-;;               org-remove-inline-images)
-;;   :bind (:map org-mode-map
-;;               ("s-<f7>" . org-tree-slide-mode)
-;;               :map org-tree-slide-mode-map
-;;               ("<left>" . org-tree-slide-move-previous-tree)
-;;               ("<right>" . org-tree-slide-move-next-tree)
-;;               ("S-SPC" . org-tree-slide-move-previous-tree)
-;;               ("SPC" . org-tree-slide-move-next-tree))
-;;   :hook ((org-tree-slide-play . (lambda ()
-;;                                   (text-scale-increase 4)
-;;                                   (org-display-inline-images)
-;;                                   (read-only-mode 1)))
-;;          (org-tree-slide-stop . (lambda ()
-;;                                   (text-scale-increase 0)
-;;                                   (org-remove-inline-images)
-;;                                   (read-only-mode -1))))
-;;   :init (setq org-tree-slide-header t
-;;               org-tree-slide-slide-in-effect nil
-;;               org-tree-slide-heading-emphasis nil
-;;               org-tree-slide-cursor-init t
-;;               org-tree-slide-modeline-display 'outside
-;;               org-tree-slide-skip-done nil
-;;               org-tree-slide-skip-comments t
-;;               org-tree-slide-content-margin-top 1
-;;               org-tree-slide-skip-outline-level 4))
-
 ;; from https://sachachua.com/blog/2024/01/using-consult-and-org-ql-to-search-my-org-mode-agenda-files-and-sort-the-results-to-prioritize-heading-matches/
 (defun my-consult-org-ql-agenda-jump ()
   "Search agenda files with preview."