From 400153f0850aff8c96b2da6768d53dc5885c3243 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 24 Apr 2018 17:20:15 +0200 Subject: [PATCH] Doc fix for `*-*-invisibility-spec' * lisp/subr.el (add-to-invisibility-spec) (remove-from-invisibility-spec): Make the doc string say what happens if `buffer-invisibility-spec' is an atom (bug#30171). --- lisp/subr.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index 74d4a7f427a..208535f00bb 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4328,14 +4328,23 @@ to `display-warning'." (defun add-to-invisibility-spec (element) "Add ELEMENT to `buffer-invisibility-spec'. See documentation for `buffer-invisibility-spec' for the kind of elements -that can be added." +that can be added. + +If `buffer-invisibility-spec' isn't a list before calling this +function, `buffer-invisibility-spec' will afterwards be a list +with the value `(t ELEMENT)'. This means that if text exists +with non-`t' invisibility values, that text will become visible." (if (eq buffer-invisibility-spec t) (setq buffer-invisibility-spec (list t))) (setq buffer-invisibility-spec (cons element buffer-invisibility-spec))) (defun remove-from-invisibility-spec (element) - "Remove ELEMENT from `buffer-invisibility-spec'." + "Remove ELEMENT from `buffer-invisibility-spec'. +If `buffer-invisibility-spec' isn't a list before calling this +function, it will be made into a list containing just `t' as the +only list member. This means that if text exists with non-`t' +invisibility values, that text will become visible." (setq buffer-invisibility-spec (if (consp buffer-invisibility-spec) (delete element buffer-invisibility-spec) -- 2.39.5