summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Nicolas Petton2021-02-24 21:02:52 +0100
committerGravatar Nicolas Petton2021-02-24 21:04:49 +0100
commit3eb25846d4cd10f448889b7f08ea7eeee40ec698 (patch)
tree0d0be6d79f32b3afd5eb80534e6018dc6e5c0af5
parentf25c89adc8abc61f7184b29ef628dd0c534a5dac (diff)
downloadnroam-3eb25846d4cd10f448889b7f08ea7eeee40ec698.tar.gz
nroam-3eb25846d4cd10f448889b7f08ea7eeee40ec698.zip
Better headline when no linked reference
* nroam.el (nroam--insert-backlinks-heading): Display "No linked reference" there is no backlink.
-rw-r--r--nroam.el8
1 files 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."