Re: [O] [PATCH] Add info when reference to remote table is not in the file

2012-04-23 Thread Bastien
Hi Sébastien,

Sebastien Vauban wxhgmqzgw...@spammotel.com writes:

 Hi Bastien,

 Sebastien Vauban wrote:
 You can also go back to the *Messages* buffer and check from there.

 Maybe another option is to silent `org-id-update-id-locations' when called
 from `org-id-find'? Does the attached patch against master improves the
 situation for you?

 In all cases, this is already an improvement. So, I would definitely check
 this in. Thanks.

 That said, I still find we should be able to refer to tables names whose
 TBLNAME keyword could be spelled both:

 - in downcase version (#+tblname: abc) and
 - in uppercase version (#+TBLNAME: xyz).

I've now pushed a patch for this -- please confirm it works as expected.

Thanks,

-- 
 Bastien



Re: [O] [PATCH] Add info when reference to remote table is not in the file

2012-04-21 Thread Bastien


Sebastien Vauban
wxhgmqzgwmuf-genee64ty+gs+fvcfc7...@public.gmane.org writes:

 That said, I still find we should be able to refer to tables names whose
 TBLNAME keyword could be spelled both:

 - in downcase version (#+tblname: abc) and
 - in uppercase version (#+TBLNAME: xyz).

This should be doable -- please test this patch:
http://patchwork.newartisans.com/patch/1294/

-- 
 Bastien




Re: [O] [PATCH] Add info when reference to remote table is not in the file

2012-04-19 Thread Sebastien Vauban
Hi Bastien,

Bastien wrote:
 Sebastien Vauban wxhgmqzgw...@spammotel.com writes:

 (I don't like using sit-for, it's often worse than getting an error...)

 I don't like it that much either, but, here, it's the only way to see the
 message before being flooded by the Finding ID location... messages.

 You can also go back to the *Messages* buffer and check from there.

 Maybe another option is to silent `org-id-update-id-locations' when
 called from `org-id-find'?  Does the attached patch against master
 improves the situation for you?

 Thanks,

 diff --git a/lisp/org-id.el b/lisp/org-id.el
 index 55e826f..c2b3d86 100644
 --- a/lisp/org-id.el
 +++ b/lisp/org-id.el
 @@ -273,7 +273,7 @@ With optional argument MARKERP, return the position as a 
 new marker.
  (when file
(setq where (org-id-find-id-in-file id file markerp)))
  (unless where
 -  (org-id-update-id-locations)
 +  (org-id-update-id-locations nil t)
(setq file (org-id-find-id-file id))
(when file
   (setq where (org-id-find-id-in-file id file markerp
 @@ -403,7 +403,7 @@ and time is the usual three-integer representation of 
 time.
  
  ;; Storing ID locations (files)
  
 -(defun org-id-update-id-locations (optional files)
 +(defun org-id-update-id-locations (optional files silent)
Scan relevant files for IDs.
  Store the relation between files and corresponding IDs.
  This will scan all agenda files, all associated archives, and all
 @@ -441,8 +441,9 @@ When CHECK is given, prepare detailed information about 
 duplicate IDs.
   (setq files (delq 'agenda-archives (copy-sequence files
(setq nfiles (length files))
(while (setq file (pop files))
 - (message Finding ID locations (%d/%d files): %s
 -  (- nfiles (length files)) nfiles file)
 + (unless silent
 +   (message Finding ID locations (%d/%d files): %s
 +(- nfiles (length files)) nfiles file))
   (setq tfile (file-truename file))
   (when (and (file-exists-p file) (not (member tfile seen)))
 (push tfile seen)

In all cases, this is already an improvement. So, I would definitely check
this in. Thanks.

Now, regarding the flood of messages, and the 1 second wait, it still may be
useful for my case (where vc-backend messages are displayed) as you can see:

--8---cut here---start-8---
Reference `hours-spent' is not found in the current file
(1 second wait)
Running svn --non-interactive status -v columnview-estimates-ranges-bak.txt in 
foreground...
Running svn --non-interactive status -v 
columnview-estimates-ranges-bak.txt...OK = 0
Running svn --non-interactive status -v columnview-reporting-remaining-work.txt 
in foreground...
Running svn --non-interactive status -v 
columnview-reporting-remaining-work.txt...OK = 0
Running svn --non-interactive status -v org-quotes.org in foreground...
Running svn --non-interactive status -v org-quotes.org...OK = 0
OVERVIEW
Running svn --non-interactive status -v org-issues.org in foreground...
Running svn --non-interactive status -v org-issues.org...OK = 0
Duplicate ID mid:i929ov%24dpe%241%40dough%2Egmane%2Eorg, also in file 
c:/home/sva/src/worg/org-issues.org
Duplicate ID mid:4C90E885%2E7010409%40sift%2Einfo, also in file 
c:/home/sva/src/worg/org-issues.org
OVERVIEW
Running svn --non-interactive status -v org-glossary.org in foreground...
Running svn --non-interactive status -v org-glossary.org...OK = 0
Running svn --non-interactive status -v org-faq.org in foreground...
Running svn --non-interactive status -v org-faq.org...OK = 0
OVERVIEW
Running svn --non-interactive status -v org-devel.org in foreground...
Running svn --non-interactive status -v org-devel.org...OK = 0
Running svn --non-interactive status -v org-blog-articles.org in foreground...
Running svn --non-interactive status -v org-blog-articles.org...OK = 0
OVERVIEW
Running svn --non-interactive status -v index.org in foreground...
Running svn --non-interactive status -v index.org...OK = 0
Running svn --non-interactive status -v org-column-view.txt in foreground...
Running svn --non-interactive status -v org-column-view.txt...OK = 0
Running svn --non-interactive status -v columnview.txt in foreground...
Running svn --non-interactive status -v columnview.txt...OK = 0
Running svn --non-interactive status -v columnview-estimates-ranges.txt in 
foreground...
Running svn --non-interactive status -v columnview-estimates-ranges.txt...OK = 0
Running svn --non-interactive status -v 
Proposal-Writing-with-Dynamic-Blocks.txt in foreground...
Running svn --non-interactive status -v 
Proposal-Writing-with-Dynamic-Blocks.txt...OK = 0
Running svn --non-interactive status -v stumpwm.txt in foreground...
Running svn --non-interactive status -v stumpwm.txt...OK = 0
--8---cut here---end---8---

But I think the above patch is good enough for the whole community. Let's
commit it, and everybody should be perfectly happy 

Re: [O] [PATCH] Add info when reference to remote table is not in the file

2012-04-19 Thread Sebastien Vauban
Hi Bastien,

Sebastien Vauban wrote:
 You can also go back to the *Messages* buffer and check from there.

 Maybe another option is to silent `org-id-update-id-locations' when called
 from `org-id-find'? Does the attached patch against master improves the
 situation for you?

 In all cases, this is already an improvement. So, I would definitely check
 this in. Thanks.

That said, I still find we should be able to refer to tables names whose
TBLNAME keyword could be spelled both:

- in downcase version (#+tblname: abc) and
- in uppercase version (#+TBLNAME: xyz).

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] [PATCH] Add info when reference to remote table is not in the file

2012-04-19 Thread Nicolas Goaziou


Hello,

Sebastien Vauban
wxhgmqzgwmuf-genee64ty+gs+fvcfc7...@public.gmane.org writes:

 That said, I still find we should be able to refer to tables names whose
 TBLNAME keyword could be spelled both:

 - in downcase version (#+tblname: abc) and
 - in uppercase version (#+TBLNAME: xyz).

More importantly, we should also be able to refer to a table name
through the future-proof #+NAME: keyword, if possible.


Regards,

-- 
Nicolas Goaziou




Re: [O] [PATCH] Add info when reference to remote table is not in the file

2012-04-09 Thread Bastien
Hi Sébastien,

Sebastien Vauban wxhgmqzgw...@spammotel.com writes:

 (I don't like using sit-for, it's often worse than getting an error...)

 I don't like it that much either, but, here, it's the only way to see the
 message before being flooded by the Finding ID location... messages.

You can also go back to the *Messages* buffer and check from there.

Maybe another option is to silent `org-id-update-id-locations' when
called from `org-id-find'?  Does the attached patch against master
improves the situation for you?

Thanks,

diff --git a/lisp/org-id.el b/lisp/org-id.el
index 55e826f..c2b3d86 100644
--- a/lisp/org-id.el
+++ b/lisp/org-id.el
@@ -273,7 +273,7 @@ With optional argument MARKERP, return the position as a new marker.
 (when file
   (setq where (org-id-find-id-in-file id file markerp)))
 (unless where
-  (org-id-update-id-locations)
+  (org-id-update-id-locations nil t)
   (setq file (org-id-find-id-file id))
   (when file
 	(setq where (org-id-find-id-in-file id file markerp
@@ -403,7 +403,7 @@ and time is the usual three-integer representation of time.
 
 ;; Storing ID locations (files)
 
-(defun org-id-update-id-locations (optional files)
+(defun org-id-update-id-locations (optional files silent)
   Scan relevant files for IDs.
 Store the relation between files and corresponding IDs.
 This will scan all agenda files, all associated archives, and all
@@ -441,8 +441,9 @@ When CHECK is given, prepare detailed information about duplicate IDs.
 	(setq files (delq 'agenda-archives (copy-sequence files
   (setq nfiles (length files))
   (while (setq file (pop files))
-	(message Finding ID locations (%d/%d files): %s
-		 (- nfiles (length files)) nfiles file)
+	(unless silent
+	  (message Finding ID locations (%d/%d files): %s
+		   (- nfiles (length files)) nfiles file))
 	(setq tfile (file-truename file))
 	(when (and (file-exists-p file) (not (member tfile seen)))
 	  (push tfile seen)



-- 
 Bastien


Re: [O] [PATCH] Add info when reference to remote table is not in the file

2012-04-06 Thread Bastien
Hi Sébastien,

thanks for the patch.

I wonder if we should trigger an error instead -- why a message?

(I don't like using sit-for, it's often worse than getting an error...)

About the patch itself, thanks for the effort in adding a ChangeLog,
it's close to perfect: just think of starting sentences with a uppercase
letter, and of *including* the emacs ChangeLog in the patch.   See other
commit messages in the git log for reference.

Thanks!

-- 
 Bastien



Re: [O] [PATCH] Add info when reference to remote table is not in the file

2012-04-06 Thread Sebastien Vauban
Hi Bastien,

Bastien wrote:
 thanks for the patch.

 I wonder if we should trigger an error instead -- why a message?

Because it's not an error... When a reference (I guess it always must be an
ID, then) is not found locally, Org will search for it in external known
files.

The problem is you see hundreds of messages Finding ID location..., and you
don't know which reference Org is trying to find...

When you have multiple tables, with multiple references, this is a nightmare
to find which was is wrong.

Just use `TBLNAME' instead of `tblname' for the referenced table (or the
inverse, if you apply the patch you sent me a couple of days ago), and you'll
understand that it's good to know what Org is searching for.

 (I don't like using sit-for, it's often worse than getting an error...)

I don't like it that much either, but, here, it's the only way to see the
message before being flooded by the Finding ID location... messages.

Best regards,
  Seb

-- 
Sebastien Vauban




[O] [PATCH] Add info when reference to remote table is not in the file

2012-04-05 Thread Sebastien Vauban
2012-04-05  Sebastien Vauban  wxhgmqzgw...@spammotel.com

* org-table.el (org-table-get-remote-range): when a reference to a
  remote table is not found locally, display a message for 1 second,
  then go on searching within all known locations

From 432a57390d8a103d440017664b8a594de61281a4 Mon Sep 17 00:00:00 2001
From: Sebastien Vauban s...@mygooglest.com
Date: Thu, 5 Apr 2012 15:58:27 +0200
Subject: [PATCH] Add info when reference to remote table is not in the file

---
 lisp/org-table.el |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index ae12cee..c336f89 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -4735,6 +4735,8 @@ list of the fields in the rectangle .
 (concat ^[ \t]*#\\+TBLNAME:[ \t]* (regexp-quote name-or-id) 
[ \t]*$)
 nil t)
(setq buffer (current-buffer) loc (match-beginning 0))
+ (message Reference `%s' is not found in the current file 
name-or-id)
+ (sit-for 1)
  (setq id-loc (org-id-find name-or-id 'marker))
  (unless (and id-loc (markerp id-loc))
(error Can't find remote table \%s\ name-or-id))
-- 
1.7.9

Best regards,
  Seb

-- 
Sebastien Vauban