mirror of
https://github.com/protesilaos/denote.git
synced 2026-09-10 07:16:20 -04:00
Fix broken buttons in backlinks' buffer
Sorting them after they are inserted breaks them. Thanks to Sven Seebeck for reporting the regression in issue 16 over at the GitHub mirror: <https://github.com/protesilaos/denote/issues/16>.
This commit is contained in:
parent
f21a99775d
commit
429763c246
|
|
@ -215,17 +215,11 @@ 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))
|
||||
start)
|
||||
(buf (format "*denote-backlinks to %s*" id)))
|
||||
(with-current-buffer (get-buffer-create buf)
|
||||
(erase-buffer)
|
||||
(special-mode)
|
||||
|
|
@ -234,13 +228,11 @@ 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
|
||||
|
|
|
|||
Loading…
Reference in a new issue