From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: clockreport in org-agenda-list - table misaligned if org-descriptive-links is nil Date: Sat, 11 Apr 2015 14:11:53 +0200 Message-ID: <876192sw3a.fsf@nicolasgoaziou.fr> References: <728674d5657a40168a56bc4927650df8@rintintin.hq.realize.ch.lan.rit> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YguFA-0006Pu-9X for emacs-orgmode@gnu.org; Sat, 11 Apr 2015 08:10:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YguF9-0003Th-1U for emacs-orgmode@gnu.org; Sat, 11 Apr 2015 08:10:36 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:48319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YguF8-0003RD-Ru for emacs-orgmode@gnu.org; Sat, 11 Apr 2015 08:10:34 -0400 In-Reply-To: <728674d5657a40168a56bc4927650df8@rintintin.hq.realize.ch.lan.rit> (Alain Schneble's message of "Mon, 30 Mar 2015 20:11:48 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Alain Schneble (Realize IT GmbH)" Cc: "emacs-orgmode@gnu.org" Hello, "Alain Schneble (Realize IT GmbH)" writes: > Steps to reproduce: > - if org-descriptive-links is non-nil, invoke M-x org-toggle-link-display > - org-descriptive-links is now expected to be nil > - M-x org-agenda-list > - M-x org-agenda-clockreport-mode (or short: v R) > > Observation (given that there is at least some data being shown in the clockreport): > 1) clockreport table is misaligned > 2) clockreport table contains descriptive links even though org-descriptive-links is nil > > Cause: > a) *org-agenda-list* /calls/ *org-agenda-prepare* which in turn /calls/ *org-agenda-mode* > b) *org-agenda-mode* /calls/ (add-to-invisibility-spec '(org-link)) > In contrast, *org-mode* /calls/ (if org-descriptive-links (add-to-invisibility-spec '(org-link))), hence makes adding org-link to the invisibility spec dependent on org-descriptive-links. > c) the clockreport in the agenda list is constructed in > *org-clock-get-clocktable* using a with-temp-buffer in whose context > (org-mode) is called. The clockreport table will therefore be aligned > based on the invisibility spec of org-mode which is different if > org-descriptive-links was set to nil at the time *org-agenda-list* was > called. Thanks for the report and the analysis. > Suggestions: > 1.1) Inherit org-link invisibility spec in *org-clock-get-clocktable* from the "outer" mode (i.e. org-agenda-mode): > ... > (let ((descriptive-links (org-in-invisibility-spec-p '(org-link)))) > (with-temp-buffer > (org-mode) > (if descriptive-links > (add-to-invisibility-spec '(org-link)) > (remove-from-invisibility-spec '(org-link))) > ... > ) > 1.2) ... or make the call to *add-to-invisibility-spec* in *org-agenda-mode* dependent on org-descriptive-links as already done by *org-mode* The latter sounds good. Do you want to prepare a patch for that? > Btw, is there a reason why org-descriptive-links is global and not > made buffer-local using make-variable-buffer-local after its defcustom > definition? I had expected it to be buffer-local. If it isn't buffer > local, the displayed links in different org buffers can get > inconsistent with the flag hold in the org-descriptive-links variable. If it is buffer local, we need a way to toggle it globally in all Org buffers, possibly by adding an optional argument to `org-toggle-link-display'. WDYT? Regards, -- Nicolas Goaziou