From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: Re: [patch] vc-annotate-toggle-annotation-visibility, almost Date: Sun, 04 Nov 2007 10:43:28 +0100 Message-ID: <878x5emjlr.fsf@ambire.localdomain> References: <87zlxu4x3o.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1194169497 24276 80.91.229.12 (4 Nov 2007 09:44:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 Nov 2007 09:44:57 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 04 10:45:00 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ioc2M-0000H7-Sq for ged-emacs-devel@m.gmane.org; Sun, 04 Nov 2007 10:44:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ioc2C-0002ZW-Hr for ged-emacs-devel@m.gmane.org; Sun, 04 Nov 2007 04:44:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ioc26-0002W6-LT for emacs-devel@gnu.org; Sun, 04 Nov 2007 04:44:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ioc23-0002Rm-2v for emacs-devel@gnu.org; Sun, 04 Nov 2007 04:44:41 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ioc22-0002Rf-OG for emacs-devel@gnu.org; Sun, 04 Nov 2007 04:44:38 -0500 Original-Received: from ppp-180-39.21-151.libero.it ([151.21.39.180] helo=ambire.localdomain) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ioc22-0000ud-16 for emacs-devel@gnu.org; Sun, 04 Nov 2007 04:44:38 -0500 Original-Received: from ttn by ambire.localdomain with local (Exim 4.63) (envelope-from ) id 1Ioc0u-0002hS-IQ; Sun, 04 Nov 2007 10:43:28 +0100 In-Reply-To: (Stefan Monnier's message of "Sat, 03 Nov 2007 23:13:29 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:82490 Archived-At: () Stefan Monnier () Sat, 03 Nov 2007 23:13:29 -0400 > "almost" because i don't see any change w/ `redisplay' > in `vc-annotate-toggle-annotation-visibility'; use of > `force-mode-line-update' is suboptimal. still investigating. Use of force-mode-line-update doesn't seem particularly bad to me (assuming it works). prior to `redisplay' being available, i would agree. but not now. that `redisplay' doesn't is bug that should be fixed, IMO. > You can use the mode-specific menu to alter the time-span of the used > colors. See variable `vc-annotate-menu-elements' for customizing the > menu items." > + (setq buffer-invisibility-spec nil) > (set (make-local-variable 'truncate-lines) t) > (set (make-local-variable 'font-lock-defaults) > '(vc-annotate-font-lock-keywords t)) > (view-mode 1)) the default buffer-invisibility-spec value is `t', so when vc-annotate-get-time-set-line-props sets the text property `invisible' to a non-nil value, the result is that the buffer is initially displayed w/ invisible annotations. (you would need to toggle it once to see them.) thanks for pointing this out. upon review, i think there is a better way: ;; Frob buffer-invisibility-spec so that if it is originally a naked t, ;; it will become a list, to avoid initial annotations being invisible. (add-to-invisibility-spec 'foo) (remove-from-invisibility-spec 'foo) > + (when (get-text-property (point) 'invisible) > + (goto-char (next-single-property-change (point) 'invisible))) What is this for? effect "edge-triggered intangible". however, it's not necessary (and in fact somtimes leaves point one further than expected). removed. We could additionally put commands to print the (invisible) annotation in the echo-area, and also add a `help-echo' property to the whole buffer so as to get tooltips that display the (invisible) annotation. yes, but that's outside the scope of this patch. thi