all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Erc timestamps and buffer-invisibility-spec
@ 2015-06-24  7:34 Cédric Chépied
  2015-06-24 14:17 ` bug#20468: " Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Cédric Chépied @ 2015-06-24  7:34 UTC (permalink / raw)
  To: emacs-devel

Hi,

I'm trying to fix bug 20468 but I need a little help. The bug is that erc
timestamps are not displayed. When starting with emacs -Q and connecting to
freenode (for example) via erc I can't see timestamps. I need to call
(erc-toggle-timestamp) twice or call (erc-hide-timestamp) and then
(erc-show-timestamp). Anyway it only works respectively for existing buffers or
current buffer. I need to do this again for each new buffer.

(erc-*-timestamp) functions only set the buffer-invisibility-spec variable. It
is set by default to t. Erc timestamps have property 'invisible set to
'timestamp.

Steps:
buffer-invisibility-spec is set to t, then I call erc-hide-timestamp. It is now
set to (timestamp t). When I call erc-show-timestamp, buffer-invisibility-spec
value is now (t) and timestamps are now displayed...


It looks like when buffer-invisibility-spec is t, text with property 'invisible
set to anything non nil (here it is 'timestamp) is not displayed (as written in
doc). But when the value is (t) only text with property 'invisible equal to t is
invisible.

Is it a bug? Should the default value be (t) instead of t? Should erc timestamp
have no 'invisible property if erc-hide-timestamps is nil (but how to set the
property to all existing timestamps when user want it?)?

Regards,
-- 
Cédric Chépied
<cedric.chepied@gmail.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#20468: Erc timestamps and buffer-invisibility-spec
  2015-06-24  7:34 Erc timestamps and buffer-invisibility-spec Cédric Chépied
@ 2015-06-24 14:17 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2015-06-24 14:17 UTC (permalink / raw)
  To: Cédric Chépied; +Cc: 20468

> Is it a bug? Should the default value be (t) instead of t?

Right, now I finally see where the problem was introduced:
the ERC code always starts by calling erc-munge-invisibility-spec, so by
default, the old code ended up setting buffer-invisibility-spec to
`(t)', whereas the new code calls remove-from-invisibility-spec which
ends up not doing anything.

I'm tempted to install the patch below, since I think it makes sense to
expect that remove-from-invisibility-spec makes ELEMENT visible.


        Stefan


diff --git a/lisp/subr.el b/lisp/subr.el
index 9580109..e9a5a2a 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4172,9 +4173,10 @@ that can be added."
 
 (defun remove-from-invisibility-spec (element)
   "Remove ELEMENT from `buffer-invisibility-spec'."
-  (if (consp buffer-invisibility-spec)
-      (setq buffer-invisibility-spec
-	    (delete element buffer-invisibility-spec))))
+  (setq buffer-invisibility-spec
+        (if (consp buffer-invisibility-spec)
+	    (delete element buffer-invisibility-spec)
+          (list t))))
 \f
 ;;;; Syntax tables.
 





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-24 14:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-24  7:34 Erc timestamps and buffer-invisibility-spec Cédric Chépied
2015-06-24 14:17 ` bug#20468: " Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.