[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 90875d5419 233/355: Sort backlinks from oldest t
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 90875d5419 233/355: Sort backlinks from oldest to newest |
Date: |
Sun, 26 Jun 2022 23:58:27 -0400 (EDT) |
branch: externals/denote
commit 90875d5419f27117ccd4a165dd536410e31ef541
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Sort backlinks from oldest to newest
I think we do not need a user option for this, as too many options make
it difficult to understand what is really needed to get started. Though
the 'denote-link-backlinks-sort' variable can be set to t to reverse the
order.
---
denote-link.el | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/denote-link.el b/denote-link.el
index bdb4263d92..8176ebd5a6 100644
--- a/denote-link.el
+++ b/denote-link.el
@@ -215,11 +215,17 @@ format is always [[denote:IDENTIFIER]]."
buf
`(,@denote-link-backlinks-display-buffer-action)))
+;; NOTE 2022-06-17: This is a `defvar' on purpose, like
+;; `denote-link-add-links'. Read its comment.
+(defvar denote-link-backlinks-sort nil
+ "Add REVERSE to `sort-lines' of `denote-link-backlinks' when t.")
+
(defun denote-link--prepare-backlinks (id files &optional title)
"Create backlinks' buffer for ID including FILES.
Use optional TITLE for a prettier heading."
(let ((inhibit-read-only t)
- (buf (format "*denote-backlinks to %s*" id)))
+ (buf (format "*denote-backlinks to %s*" id))
+ start)
(with-current-buffer (get-buffer-create buf)
(erase-buffer)
(special-mode)
@@ -228,11 +234,13 @@ Use optional TITLE for a prettier heading."
(heading (format "Backlinks to %S (%s)" title id))
(l (length heading)))
(insert (format "%s\n%s\n\n" heading (make-string l ?-))))
+ (setq start (point))
(mapc (lambda (f)
(insert (file-name-nondirectory f))
(make-button (point-at-bol) (point-at-eol) :type
'denote-link-find-file)
(newline))
files)
+ (sort-lines denote-link-backlinks-sort start (point))
(goto-char (point-min))
;; NOTE 2022-06-15: Technically this is not Dired. Maybe we
;; should abstract the fontification into a general purpose
- [elpa] externals/denote 7ce2f7d3e3 251/355: Use the 'denote-directory' function, not variable, (continued)
- [elpa] externals/denote 7ce2f7d3e3 251/355: Use the 'denote-directory' function, not variable, ELPA Syncer, 2022/06/27
- [elpa] externals/denote c8f3e707c2 223/355: Revise one-line descriptions, where needed, ELPA Syncer, 2022/06/27
- [elpa] externals/denote a436cdf07e 221/355: Tweak doc strings, ELPA Syncer, 2022/06/27
- [elpa] externals/denote a5940b315a 265/355: Replace needless 'let*' with 'let', ELPA Syncer, 2022/06/27
- [elpa] externals/denote 5686e86cfc 262/355: Only show valid notes in file prompt, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 3d606cbe95 272/355: Simplify completion via 'org-insert-link', ELPA Syncer, 2022/06/27
- [elpa] externals/denote f21a99775d 256/355: Improve rename prompt; only rename regular files, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 941258d8d4 263/355: Remove faulty MUSTMATCH from file prompt, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 8eb27246a5 267/355: Refine buffer-local 'denote-directory'; update doc, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 385c7e9689 287/355: Clarify use of uspecified face attribute, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 90875d5419 233/355: Sort backlinks from oldest to newest,
ELPA Syncer <=
- [elpa] externals/denote efd9d537cd 278/355: Give appropriate name to backlink button object, ELPA Syncer, 2022/06/27
- [elpa] externals/denote a062d9a351 294/355: Update link-related docs (cover buttonization), ELPA Syncer, 2022/06/27
- [elpa] externals/denote 750f8bf95c 307/355: Add FAQ about handling "last modified" scenario, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 627250dc0b 306/355: Make minor rewordings or clarifications to FAW, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 2e13b3451d 347/355: Update denote-link.el Commentary section, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 2d3a6fd8f3 327/355: Reword comment about multi-line button recognition, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 80eb7528aa 335/355: doc: Update documentation, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 0fac78ada3 338/355: Refine how link format for target is done, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 1f5077181a 326/355: Remove completed to-do about Embark, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 8182604ff3 343/355: Increase max-mini height for rename prompt, ELPA Syncer, 2022/06/27