From: Lars Ingebrigtsen Date: Tue, 24 Apr 2018 15:20:15 +0000 (+0200) Subject: Doc fix for `*-*-invisibility-spec' X-Git-Tag: emacs-27.0.90~5102 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=400153f0850aff8c96b2da6768d53dc5885c3243;p=emacs.git 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). --- 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)