From 9c3c0d5d711ff5636fc32b4ba502ce4f6747e046 Mon Sep 17 00:00:00 2001 From: Marc Coquand Date: Fri, 29 Nov 2024 16:11:08 +0200 Subject: . --- home/dots/.emacs | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'home/dots') diff --git a/home/dots/.emacs b/home/dots/.emacs index 7f3dee4..6640f7a 100644 --- a/home/dots/.emacs +++ b/home/dots/.emacs @@ -808,6 +808,10 @@ (ido-decorations '(" " " " " " " , ..." " [" "] " " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]"))) +(use-package completion + :custom + (completion-styles '(substring basic partial-completion emacs22))) + (use-package calendar :defer t :bind @@ -1000,8 +1004,40 @@ :custom (org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id)) +(use-package bookmark + :after (org org-id) + :init + (defun handle-org-bookmark (bookmark) + "Handle bookmarks which have Org links." + (org-link-open-from-string (alist-get 'org-link bookmark))) + + (defun bookmark-org-link-to-here () + "Bookmark the org link that `org-store-link' would make." + (interactive) + (when-let ((link (substring-no-properties (org-store-link nil)))) + `(,(when (string-match org-link-bracket-re link) + (match-string-no-properties 2 link)) + (org-link . ,link) + (handler . handle-org-bookmark) + (position . ,(point)) + ,@(when buffer-file-name + `((filename . ,(abbreviate-file-name buffer-file-name))))))) + + (defun use-org-link-for-bookmarks () + "Configure bookmarks to current buffer to use Org links." + (interactive) + (setq-local bookmark-make-record-function #'bookmark-org-link-to-here)) + :hook + ((org-mode . use-org-link-for-bookmarks))) + (use-package ol :after (org-compat org-macs org-fold) + :init + ;; Allows creating keyboard macros in the text + ;; + (org-link-set-parameters + "kbd" + :follow (lambda (kmacro) (kmacro-call-macro nil t nil (kbd kmacro)))) :bind (("C-c l" . org-store-link))) @@ -1091,9 +1127,6 @@ (use-package autorevert :diminish auto-revert-mode) -(use-package org-agenda - :demand t) - (use-package appt :after (org-agenda dbus) :demand t -- cgit v1.2.3