-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
Because now this is easier than elisp-demos-find-demo.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,10 +53,13 @@ If set, new notes are added to the first file in this list." | |
(when-let ((pos (org-find-exact-headline-in-buffer (symbol-name symbol)))) | ||
(goto-char pos) | ||
(org-end-of-meta-data) | ||
(push (string-trim | ||
(buffer-substring-no-properties | ||
(point) | ||
(org-end-of-subtree))) | ||
(push (propertize | ||
(string-trim | ||
(buffer-substring-no-properties | ||
(point) | ||
(org-end-of-subtree))) | ||
'file file | ||
'pos (marker-position pos)) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
xuchunyang
Author
Owner
|
||
results))))) | ||
(when results | ||
(string-join (nreverse results) "\n\n")))) | ||
|
@@ -165,11 +168,10 @@ If set, new notes are added to the first file in this list." | |
(defun elisp-demos-help-find-demo-at-point () | ||
"Find the demo at point." | ||
(interactive) | ||
(let ((offset (- (point) (get-text-property (point) 'start)))) | ||
(and (elisp-demos-find-demo (get-text-property (point) 'symbol)) | ||
;; Skip heading and an empty line | ||
(forward-line 2) | ||
(forward-char offset)))) | ||
(let ((file (get-text-property (point) 'file)) | ||
(pos (get-text-property (point) 'pos))) | ||
(find-file file) | ||
(goto-char pos))) | ||
|
||
(defvar elisp-demos-help-keymap | ||
(let ((map (make-sparse-keymap))) | ||
|
@@ -230,7 +232,10 @@ If set, new notes are added to the first file in this list." | |
(defun elisp-demos-for-helpful () | ||
"Find a demo for the current `helpful' buffer." | ||
(interactive) | ||
(elisp-demos-find-demo helpful--sym)) | ||
(let ((file (get-text-property (point) 'file)) | ||
(pos (get-text-property (point) 'pos))) | ||
(find-file file) | ||
(goto-char pos))) | ||
|
||
;;; * JSON | ||
|
||
|
3 comments
on commit 930ae5e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry about that! I used Org functions so that headings could have TODO keywords and tags, but maybe that's not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I see, I will try to reduce the use of features from org.el to keep elisp-demo.el lightweight.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for your thoughtfulness about older versions of Emacs and of other hardware. Sorry for the extra work!
Any reason to use
org.el
? Now, it is impossible to use this package withcompany-mode
(doc-buffer) on Windows since it will take a significant time to load. 😢