[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/orgit c91e662ace 30/76: Add completion functions
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/orgit c91e662ace 30/76: Add completion functions |
Date: |
Thu, 13 Jan 2022 13:58:45 -0500 (EST) |
branch: elpa/orgit
commit c91e662ace7e3ce992269cbf755f378bc6742511
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Add completion functions
---
orgit.el | 57 ++++++++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 44 insertions(+), 13 deletions(-)
diff --git a/orgit.el b/orgit.el
index 36b72b4579..2e1ac93e5f 100644
--- a/orgit.el
+++ b/orgit.el
@@ -27,10 +27,20 @@
;;; Commentary:
-;; This package defines several Org link types, which can be used to
-;; link to certain Magit buffers. Use the command `org-store-link'
-;; while such a buffer is current to store a link. Later you can
-;; insert it into an Org buffer using the command `org-insert-link'.
+;; This package defines the Org link types `orgit', `orgit-rev', and
+;; `orgit-log', which can be used to link to Magit status, revision,
+;; and log buffers.
+
+;; Use the command `org-store-link' in such a buffer to store a link.
+;; Later you can insert that into an Org buffer using the command
+;; `org-insert-link'.
+
+;; Alternatively you can use `org-insert-link' to insert a link
+;; without first storing it. When prompted, first enter just the
+;; link type followed by a colon and press RET. Then you are
+;; prompted again and can provide the repository with completion.
+;; The `orgit-rev' and `orgit-log' types additionally read a revision,
+;; again with completion.
;; Format
;; ------
@@ -169,9 +179,10 @@ If all of the above fails then `orgit-export' raises an
error."
;;;###autoload
(eval-after-load "org"
'(orgit-link-set-parameters "orgit"
- :store 'orgit-status-store
- :follow 'orgit-status-open
- :export 'orgit-status-export))
+ :store 'orgit-status-store
+ :follow 'orgit-status-open
+ :export 'orgit-status-export
+ :complete 'orgit-status-complete-link))
;;;###autoload
(defun orgit-status-store ()
@@ -190,14 +201,19 @@ If all of the above fails then `orgit-export' raises an
error."
(defun orgit-status-export (path desc format)
(orgit-export path desc format "status" 1))
+;;;###autoload
+(defun orgit-status-complete-link (&optional arg)
+ (concat "orgit:" (abbreviate-file-name (magit-read-repository arg))))
+
;;; Log
;;;###autoload
(eval-after-load "org"
'(orgit-link-set-parameters "orgit-log"
- :store 'orgit-log-store
- :follow 'orgit-log-open
- :export 'orgit-log-export))
+ :store 'orgit-log-store
+ :follow 'orgit-log-open
+ :export 'orgit-log-export
+ :complete 'orgit-log-complete-link))
;;;###autoload
(defun orgit-log-store ()
@@ -237,14 +253,22 @@ If all of the above fails then `orgit-export' raises an
error."
(defun orgit-log-export (path desc format)
(orgit-export path desc format "log" 2))
+;;;###autoload
+(defun orgit-log-complete-link (&optional arg)
+ (let ((default-directory (magit-read-repository arg)))
+ (format "orgit-log:%s::%s"
+ (abbreviate-file-name default-directory)
+ (magit-read-branch-or-commit "Revision"))))
+
;;; Revision
;;;###autoload
(eval-after-load "org"
'(orgit-link-set-parameters "orgit-rev"
- :store 'orgit-rev-store
- :follow 'orgit-rev-open
- :export 'orgit-rev-export))
+ :store 'orgit-rev-store
+ :follow 'orgit-rev-open
+ :export 'orgit-rev-export
+ :complete 'orgit-rev-complete-link))
;;;###autoload
(defun orgit-rev-store ()
@@ -274,6 +298,13 @@ points at the revision, if any."
(defun orgit-rev-export (path desc format)
(orgit-export path desc format "rev" 3))
+;;;###autoload
+(defun orgit-rev-complete-link (&optional arg)
+ (let ((default-directory (magit-read-repository arg)))
+ (format "orgit-rev:%s::%s"
+ (abbreviate-file-name default-directory)
+ (magit-read-branch-or-commit "Revision"))))
+
;;; Export
(defun orgit-export (path desc format gitvar idx)
- [nongnu] elpa/orgit c110371202 57/76: orgit--repository-directory: Support relative paths again, (continued)
- [nongnu] elpa/orgit c110371202 57/76: orgit--repository-directory: Support relative paths again, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit e147f05577 61/76: eval-after-load: replace string feature w/ symbol, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit 229a2ae37a 65/76: orgit-export-alist: Add git.sr.ht entry, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit 6a22c2e459 06/76: orgit-log-store: use branch name, not HEAD, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit efde657483 10/76: magit-log-export: use correct variable, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit 455dac3422 15/76: orgit-export-alist: add gitlab and remove gitorious, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit 2330a8cdb5 20/76: orgit-log-store: remove old kludges and todos, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit 718343d40d 22/76: orgit-{log, rev}-open: use -let, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit adcfef22dc 28/76: add README.md, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit d91d16903d 27/76: support relative paths when opening and exporting links, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit c91e662ace 30/76: Add completion functions,
ELPA Syncer <=
- [nongnu] elpa/orgit 022687eb02 31/76: Move note about org-magit.el to help elx-license, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit 14a4c8a245 44/76: orgit-store-reference: New option, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit 158438c540 54/76: Fix typos, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit 0bec3ea912 03/76: orgit-log-{store, open}: kludge to support version 2.1.0 of Magit, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit 0881cf9633 05/76: complete Package-Requires list, add Homepage keyword, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit 55292d377c 13/76: replace term commit with revision, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit 190aa8e3ad 17/76: bump dependencies and copyright, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit 731c5cb4f1 16/76: orgit-status-open: adapt to change to magit-status-internal, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit 44a05c55d5 07/76: orgit-rev-store: Always use commit SHA-1 hash, ELPA Syncer, 2022/01/13
- [nongnu] elpa/orgit e0859c3c71 08/76: autoload functions where necessary, ELPA Syncer, 2022/01/13