From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!not-for-mail
From: "David Chappaz" <david.chappaz@free.fr>
Newsgroups: gmane.emacs.help
Subject: RE: shell-command causes problems with absolute/relative paths in TAGS
Date: Fri, 6 Jan 2012 13:04:57 -0000
Message-ID: <9287FF55897A4EED8EA883DC00F98BAC@EUROPE.ROOT.PRI>
References: <20120102223315.3E60F1810C9@neo.msri.org><408087A3D7BE475B884C0F93CE2298C7@us.oracle.com><AA798C0D220E44E5B798734A70C4CF93@EUROPE.ROOT.PRI><20120105054142.GA10149@hysteria.proulx.com><9C2570562E2A4B7BBDA61F564FCFC83F@EUROPE.ROOT.PRI><20120105222030.GA22189@hysteria.proulx.com><1CA9A2C2C5544CAAA163A0962C5C95F4@EUROPE.ROOT.PRI>
	<83pqexnjrk.fsf@gnu.org>
NNTP-Posting-Host: lo.gmane.org
Mime-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: dough.gmane.org 1325855124 1702 80.91.229.12 (6 Jan 2012 13:05:24 GMT)
X-Complaints-To: usenet@dough.gmane.org
NNTP-Posting-Date: Fri, 6 Jan 2012 13:05:24 +0000 (UTC)
To: <help-gnu-emacs@gnu.org>
Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 06 14:05:16 2012
Return-path: <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org>
Envelope-to: geh-help-gnu-emacs@m.gmane.org
Original-Received: from lists.gnu.org ([140.186.70.17])
	by lo.gmane.org with esmtp (Exim 4.69)
	(envelope-from <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org>)
	id 1Rj9Tv-0001WK-OY
	for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Jan 2012 14:05:15 +0100
Original-Received: from localhost ([::1]:37225 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org>)
	id 1Rj9Tv-0006su-8I
	for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Jan 2012 08:05:15 -0500
Original-Received: from eggs.gnu.org ([140.186.70.92]:56267)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <david.chappaz@free.fr>) id 1Rj9Tq-0006sp-I8
	for help-gnu-emacs@gnu.org; Fri, 06 Jan 2012 08:05:11 -0500
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <david.chappaz@free.fr>) id 1Rj9To-0005xI-Kn
	for help-gnu-emacs@gnu.org; Fri, 06 Jan 2012 08:05:10 -0500
Original-Received: from cluster-d.mailcontrol.com ([85.115.60.190]:52883)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <david.chappaz@free.fr>) id 1Rj9To-0005wh-Dd
	for help-gnu-emacs@gnu.org; Fri, 06 Jan 2012 08:05:08 -0500
Original-Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68])
	by rly13d.srv.mailcontrol.com (MailControl) with ESMTP id
	q06D53Q1010910
	for <help-gnu-emacs@gnu.org>; Fri, 6 Jan 2012 13:05:03 GMT
Original-Received: from DC04PC01 ([10.103.11.129]) by cameurexb01.EUROPE.ROOT.PRI with
	Microsoft SMTPSVC(6.0.3790.4675); Fri, 6 Jan 2012 13:05:03 +0000
X-Mailer: Microsoft Office Outlook 11
In-reply-to: <83pqexnjrk.fsf@gnu.org>
Thread-Index: AczMaAF0Pp5FTe8ARu+kwbOvlQcF5AACMBYA
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
X-OriginalArrivalTime: 06 Jan 2012 13:05:03.0569 (UTC)
	FILETIME=[CDF67C10:01CCCC73]
X-Scanned-By: MailControl 7.6.5 (www.mailcontrol.com) on 10.68.0.123
X-detected-operating-system: by eggs.gnu.org: Windows 98 (1)
X-Received-From: 85.115.60.190
X-BeenThere: help-gnu-emacs@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/help-gnu-emacs>,
	<mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/help-gnu-emacs>
List-Post: <mailto:help-gnu-emacs@gnu.org>
List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/help-gnu-emacs>,
	<mailto:help-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org
Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org
Xref: news.gmane.org gmane.emacs.help:83371
Archived-At: <http://permalink.gmane.org/gmane.emacs.help/83371>


Eli Zaretskii wrote
> > If, before doing M-x shell, I evaluate
> > (setq explicit-cmdproxy.exe-args  '("/q"))
> > to prevent shell commands from being echoed, then suddenly the TAGS file
> > is generated properly, with relative filenames.
> 
> I see no such variable in Emacs. 

The variable name depends on which shell you use. By default, only
explicit-bash-args and explicit-sh-args are defined in emacs.
On windows, cmdproxy.exe is the default shell, hence the variable name.

> Also, originally you talked about "M-x shell-command", not "M-x shell".
> Which one is it?

Sorry about the confusion.I'll try to summarise.

With M-x shell-command, the behaviour is always incorrect.
With M-x shell, the behaviour is sometimes correct, sometimes not (more on
that below), depending on cosmetic changes (like explicit-cmdproxy.exe-args)
which should not have any influence (I think).
 
> FWIW, I cannot reproduce this on MS-Windows with Emacs 23.3.  I don't
> have Exuberant CTags, but using the etags program provided with
> Emacs.  I get relative file names with either method.

I need to parse languages which etags doesn't know, which is why I'm using
exuberant ctags.

But I did notice that the behaviour is fine with the vanilla etags provided
with emacs. Therefore, you will have to use exuberant ctags to reproduce the
problem. You can download binaries from
http://prdownloads.sourceforge.net/ctags/ctags58.zip. No install is
required, just copy the .exe in the test directory.

Also, we can't exclude the fact that the problem is in exuberant ctags
itself, but for now I just don't understand at all what's happening.

> Can you reproduce the problem in "emacs -Q"?  If not, there's some
> customization of yours that causes this, or maybe it is a problem with
> Exuberant on Windows.

Yes, same problem with --no-init-file

In fact, after a little debugging, I've devised the following experiment for
you to reproduce (with --no-init-file)

1/ From a freshly opened emacs if do M-x shell followed by:

ctags -e -L filelist.txt

or even

"C:/Program Files/Emacs/emacs-23.3/bin/cmdproxy.exe" /C "ctags -e -L
filelist.txt"

then everything is fine.

2/ Now from e.g. a scratch buffer, I evaluate

(progn
   (cd "C:/test/")
   (call-process-region (point) (point) "C:/Program
Files/Emacs/emacs-23.3/bin/cmdproxy.exe" nil (current-buffer) nil "-c"
"ctags -e -L filelist.txt"))

which is more or less what M-x shell-command would do... then the result is
incorrect.

3/ Worse, if you kill the original shell buffer created in 1/, and repeat
the same operation as in 1/... then the result is incorrect.

So it really looks like something is happening in call-process-region...