summaryrefslogtreecommitdiff
path: root/home/dots
diff options
context:
space:
mode:
Diffstat (limited to 'home/dots')
-rw-r--r--home/dots/.emacs39
1 files changed, 36 insertions, 3 deletions
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
+ ;; <kbd:M-x eshell RET make RET>
+ (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