From 3eb25846d4cd10f448889b7f08ea7eeee40ec698 Mon Sep 17 00:00:00 2001 From: Nicolas Petton Date: Wed, 24 Feb 2021 21:02:52 +0100 Subject: Better headline when no linked reference * nroam.el (nroam--insert-backlinks-heading): Display "No linked reference" there is no backlink. --- nroam.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nroam.el b/nroam.el index 7c3f379..9ec003a 100644 --- a/nroam.el +++ b/nroam.el @@ -208,9 +208,11 @@ Make the region inserted by BODY read-only, and marked with (defun nroam--insert-backlinks-heading (count) "Insert the heading for the backlinks section with a COUNT." - (insert (format "* %s %s\n" - count - (nroam--pluralize count "linked reference")))) + (insert (if (= count 0) + "* No linked reference" + (format "* %s %s\n" + count + (nroam--pluralize count "linked reference"))))) (defun nroam--insert-backlink-group (group) "Insert all backlinks in GROUP." -- cgit v1.2.3-54-g00ecf