GNU bug report logs - #5751
Let ff-find-other-file search other directories (in "project"?)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Arne Schmitz <arne.schmitz@HIDDEN>; dated Sun, 21 Mar 2010 19:55:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Changed bug title to 'Let ff-find-other-file search other directories (in "project"?)' from 'Strange behaviour of ff-find-other-file' Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.
Severity set to 'wishlist' from 'normal' Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.
Removed tag(s) notabug. Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.
Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.

Message received at 5751 <at> debbugs.gnu.org:


Received: (at 5751) by debbugs.gnu.org; 26 Aug 2016 01:25:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 25 21:25:44 2016
Received: from localhost ([127.0.0.1]:40955 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bd5tw-0001ld-KZ
	for submit <at> debbugs.gnu.org; Thu, 25 Aug 2016 21:25:44 -0400
Received: from mail-it0-f45.google.com ([209.85.214.45]:38539)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>)
 id 1bd5tu-0001lL-N8; Thu, 25 Aug 2016 21:25:43 -0400
Received: by mail-it0-f45.google.com with SMTP id n128so121439239ith.1;
 Thu, 25 Aug 2016 18:25:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=H97iQOar8vpLCJdSznZalqV80YDyLKc0/l9if2u4Gr4=;
 b=B98CIcGQDWUB1lQoDsJrJR+h/QFwnqHKHYotRxUAy4VwloupM/yaVUDejqZLsNds5R
 j5sKOXNAOpiJT/zP23aPSHqipHEorV63pDwhUPWqYZ6wrzE9nzLEVy6SdemZZOJDcHC9
 LbIO9PB2Qy9N8JpiDjXQkmoab/hkSSSM+jF632Lv5WGjExuB+myjvgn+LJ0ddvxKIEQa
 v0MpBDgR075KRYZv0FA9kyWA626ICWY3F5AvwMUd26Z6Hs8yK7saFJZY7Vb/nno4urpX
 b8iEiYXaUyv4upCcafH5A1K+lT0QH0S+ymqjH/JFAhxT5da3xtG8QN2e+kjAoAQTI0F1
 ERFg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:sender:from:to:cc:subject:references:date
 :in-reply-to:message-id:user-agent:mime-version;
 bh=H97iQOar8vpLCJdSznZalqV80YDyLKc0/l9if2u4Gr4=;
 b=ZxaHNlPTEnAUUXtG+fFxoYVr5YzU15WPNGHQLACaFlRi7XcbppTuhWoZkx62CfeDfg
 zf/lVAl7lhAZYzxUm+mAMI0W9ijbRkKGXo7g3eMkRagXUeuP2uTLnkhWbuChGScNcZuq
 zPnbMyUGlcgOZoH/TeECATc4Tx+qvIf7EG7wlL9QHihVvTs0LTxS7t2hAPhJ6B6BEAOq
 Or10KFAxMnfsoIjwJRKoLTp7MGHZXn585T99Lzo9Fq+Zd7Mu2KrCsK81OjlymI2Ubq9i
 0sEo5cbuzeIbqV1R561G0QdFZAjgW2aD2ohXrlHZibl33eFq/mYc3zxx0I3zk2Eai+Uj
 zaxg==
X-Gm-Message-State: AE9vXwMxTFIfp6HXY52EPYbSddyD7TpkA73rhd/PtX7GcXrLHOF2ogDwzKDHEvlyBxRfuw==
X-Received: by 10.107.19.8 with SMTP id b8mr602270ioj.9.1472174737168;
 Thu, 25 Aug 2016 18:25:37 -0700 (PDT)
Received: from zony ([45.2.7.130])
 by smtp.googlemail.com with ESMTPSA id h63sm14942524ita.12.2016.08.25.18.25.36
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Thu, 25 Aug 2016 18:25:36 -0700 (PDT)
From: npostavs@HIDDEN
To: Andrew Hyatt <ahyatt@HIDDEN>
Subject: Re: bug#5751: Strange behaviour of ff-find-other-file
References: <7B99D88E-806D-412D-8CCD-0EDB6CDF6588@HIDDEN>
 <m2shttzdod.fsf@HIDDEN>
Date: Thu, 25 Aug 2016 21:25:54 -0400
In-Reply-To: <m2shttzdod.fsf@HIDDEN> (Andrew Hyatt's
 message of "Thu, 25 Aug 2016 00:16:02 -0400")
Message-ID: <877fb4tj6l.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 5751
Cc: 5751 <at> debbugs.gnu.org, Arne Schmitz <arne.schmitz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

reopen 5751
tags 5751 - notabug
severity 5751 wishlist
retitle 5751 Let ff-find-other-file search other directories (in "project"?)
quit

Andrew Hyatt <ahyatt@HIDDEN> writes:

> Sorry for the delay in response here.  I think I understand what you are
> saying, but I think we probably would both agree this is more of a
> feature request than a bug.
>
> But I'm not sure it makes sense as a feature request - just because you
> have foo.c and foo.h, it is dangerous to think they are related just
> because they both exist as buffers.  I frequently have multiple copies
> of the same file open in different directories to work on different
> issues - it would be a bug if ff-find-other-file started flipping
> between two very different working directories.
>
> So, I'm closing this one as not a bug. 

I'm reopening, because I think this does make sense as a feature
request.  Generally foo.c and foo.h will be related if they are in the
same "project", so probably the user will want the file to be found in
this case.  I think Emacs recently got some kind of "project API" thing,
perhaps that can be used for this?





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#5751; Package emacs. Full text available.
bug closed, send any further explanations to 5751 <at> debbugs.gnu.org and Arne Schmitz <arne.schmitz@HIDDEN> Request was from Andrew Hyatt <ahyatt@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) notabug. Request was from Andrew Hyatt <ahyatt@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 5751 <at> debbugs.gnu.org:


Received: (at 5751) by debbugs.gnu.org; 25 Aug 2016 04:16:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 25 00:16:16 2016
Received: from localhost ([127.0.0.1]:39749 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bcm5P-0005z6-Fy
	for submit <at> debbugs.gnu.org; Thu, 25 Aug 2016 00:16:16 -0400
Received: from mail-qk0-f179.google.com ([209.85.220.179]:34353)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ahyatt@HIDDEN>) id 1bcm5M-0005qk-0u
 for 5751 <at> debbugs.gnu.org; Thu, 25 Aug 2016 00:16:14 -0400
Received: by mail-qk0-f179.google.com with SMTP id t7so35406057qkh.1
 for <5751 <at> debbugs.gnu.org>; Wed, 24 Aug 2016 21:16:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=cMbxJMR6rmPYDcNPPQltcdt352Wa1PwAdT9OD8d3AQw=;
 b=tswoDxa9jr1k5uZjvqpHN3EnsYFJJusCgNIM1efCqLu/fgSY4kNp7EsXfH2s5EUglx
 qEDvBpJGtocTWdoswGwrWxrhagMxk2anf1AhH6S7wFYQwX7KaJgvRBniwiQKhuaruvLf
 j3VZ/IUVoeHcg5OlUCzZPwbUPuAsky/qYuTwaF9a+Z/Lf4Id3JVmSu4YwT+U2UMTNp7z
 agPfleydHQ35XmI6FCmnxtUbv9/AyI9pG9gOxCB0mf15Io6Y7GE3CmGTRun65+utvrhJ
 5pskIb+e4MZgqpoABKhDyVOqMYgea2QgjBXT3B7iAPAom+/kgAR6TIpThpQFIbssHd+r
 Zkmw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=cMbxJMR6rmPYDcNPPQltcdt352Wa1PwAdT9OD8d3AQw=;
 b=DOYsmAxdp1adfYQt8DXZ/PQlcQMddSOjYLbMhCQwSCT4TQPv1sx/4+ztwcjo7i/ESG
 Pc0ReiCjzslEtJIpBFWr2PY8Muz9E4vzyShNBvOq1Wx8A1YMnWGoz4RLqxppwDr+R1Oz
 o5bbGgDGcS9r/xI4/IwSf2Lr/a/WPJaOdw0Bisj50o2jVcQkIklge+Jt9RnT7W8cXCCt
 dJrga8ljQvY6ZCn3fNZDY2QDgd0CCcbmF4pgitgG1YMr4a6Nk5lDwCH/kXNZYoKxQLx0
 K2vruAEQFEgLUqyyO9r9ulji4W+NYC5SEEYdtf0/Ewn2yCTWP8+maO52nNPmE3zpGNqQ
 3OPA==
X-Gm-Message-State: AE9vXwO86wtYQwID7Mx56W+W1rJn4GIo4Mv1xeiEJDXuAj6d6HuAh62hsfv3hNgr8lDPVg==
X-Received: by 10.55.74.14 with SMTP id x14mr7546408qka.102.1472098566176;
 Wed, 24 Aug 2016 21:16:06 -0700 (PDT)
Received: from Andrews-MacBook-Pro.local (cpe-74-73-128-199.nyc.res.rr.com.
 [74.73.128.199])
 by smtp.gmail.com with ESMTPSA id d12sm6597146qkc.19.2016.08.24.21.16.03
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 24 Aug 2016 21:16:03 -0700 (PDT)
From: Andrew Hyatt <ahyatt@HIDDEN>
To: Arne Schmitz <arne.schmitz@HIDDEN>
Subject: Re: bug#5751: Strange behaviour of ff-find-other-file
References: <7B99D88E-806D-412D-8CCD-0EDB6CDF6588@HIDDEN>
Date: Thu, 25 Aug 2016 00:16:02 -0400
In-Reply-To: <7B99D88E-806D-412D-8CCD-0EDB6CDF6588@HIDDEN> (Arne Schmitz's
 message of "Sun, 21 Mar 2010 20:21:21 +0100")
Message-ID: <m2shttzdod.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (darwin)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 5751
Cc: 5751 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)


Sorry for the delay in response here.  I think I understand what you are
saying, but I think we probably would both agree this is more of a
feature request than a bug.

But I'm not sure it makes sense as a feature request - just because you
have foo.c and foo.h, it is dangerous to think they are related just
because they both exist as buffers.  I frequently have multiple copies
of the same file open in different directories to work on different
issues - it would be a bug if ff-find-other-file started flipping
between two very different working directories.

So, I'm closing this one as not a bug. 

Arne Schmitz <arne.schmitz@HIDDEN> writes:

> Hi everyone!
>
> I have found a behaviour in ff-find-other-file that I would consider a
> bug. However, I am not sure if this is definitely the case, but at
> least I would say that the function's behaviour does not correspond to
> it's implementation. The documentation says:
>
> "Find the header or source file corresponding to this file."
>
> Consider the following: the header and source for a certain case are
> already being visited. Let's say the source is in
> $CWD/project-src/foo.c, and the header in $CWD/include/foo.h. If
> either ../project-src or ../include is not in the
> ff-search-directories, the appropriate switch to the source or header
> file will fail. Consider that this will also fail, if the
> corresponding file is already being visited! This is not explicitly
> demanded by the documentation, but would be useful behaviour in my
> opinion. Looking at the source for ff-find-other-file leads to these
> lines in the function ff-get-file-name:
>
>   (if (bufferp (get-file-buffer filename))
>       (setq found (buffer-file-name (get-file-buffer filename))))
>
> To my understanding this is supposed to search through the current
> buffers for the corresponding file. However, this seems to always
> fail, since the variable filename is not expanded, as get-file-buffer
> demands, and neither do I see how this is supposed to happen
> anyway. So in the least, this code is useless, or worst, broken. Since
> I like to have Emacs find the file, if there is a buffer visiting a
> file with the correct name (although it might not be unique), I
> changed the above lines to the following:
>
>   (let ((b (find-if (lambda(x) (string= (buffer-name x) filename)) (buffer-list))))
>     (if b
>         (setq found (buffer-file-name b))))
>
> Not sure, if this is the best code to achieve this, since I don't know
> Emacs-Lisp very well, and a friend helped me figure this out.
>
> Hope this helps and best regards,
>
> Arne
>
> In GNU Emacs 22.3.1 (i386-apple-darwin9.8.0, Carbon Version 1.6.0)
> of 2010-01-10 on gs674-seijiz.local
> Windowing system distributor `Apple Inc.', version 10.6.2
> configured using `configure  '--prefix=/Applications/Emacs.app/Contents/Resources' '--with-carbon' '--without-x' '--libexecdir=/Volumes/Emacs/Emacs.app/Contents/MacOS/libexec' 'CC=gcc-4.2' 'CFLAGS=-O2 -arch i386 -arch ppc7400 -DUSE_ATSUI -DUSE_MAC_TSM''
>
> Important settings:
>  value of $LC_ALL: nil
>  value of $LC_COLLATE: nil
>  value of $LC_CTYPE: nil
>  value of $LC_MESSAGES: nil
>  value of $LC_MONETARY: nil
>  value of $LC_NUMERIC: nil
>  value of $LC_TIME: nil
>  value of $LANG: nil
>  locale-coding-system: iso-latin-1
>  default-enable-multibyte-characters: t
>
> Major mode: Help
>
> Minor modes in effect:
>  show-paren-mode: t
>  server-mode: t
>  desktop-save-mode: t
>  ecb-minor-mode: t
>  tabbar-mwheel-mode: t
>  tabbar-mode: t
>  which-function-mode: t
>  mac-print-mode: t
>  tooltip-mode: t
>  tool-bar-mode: t
>  mouse-wheel-mode: t
>  menu-bar-mode: t
>  file-name-shadow-mode: t
>  global-font-lock-mode: t
>  font-lock-mode: t
>  blink-cursor-mode: t
>  unify-8859-on-encoding-mode: t
>  utf-translate-cjk-mode: t
>  auto-compression-mode: t
>  temp-buffer-resize-mode: t
>  column-number-mode: t
>  line-number-mode: t
>  transient-mark-mode: t
>  view-mode: t
>
> Recent input:
> <help-echo> <help-echo> <down-mouse-1> <drag-mouse-1> 
> <down-mouse-1> <mouse-1> C-x C-f C-a C-k / . e m <tab> 
> . d <tab> i n i <tab> <return> <wheel-down> <double-wheel-down> 
> <triple-wheel-up> <triple-wheel-up> <triple-wheel-up> 
> <triple-wheel-up> <triple-wheel-up> <triple-wheel-up> 
> <triple-wheel-up> <wheel-down> <double-wheel-down> 
> <triple-wheel-down> <triple-wheel-down> <triple-wheel-down> 
> <triple-wheel-down> <wheel-down> <double-wheel-down> 
> <triple-wheel-down> <down-mouse-1> <mouse-1> C-a C-SPC 
> <down> <down> <down> <down> <up> <down> <down> <down> 
> M-w C-h f f i n d - o <tab> <tab> <tab> <backspace> 
> C-a C-k d <backspace> f f - f i <tab> o <tab> <return> 
> C-x o C-x 1 <down> <down> <down> <down> <down> <down> 
> <down> <down> <down> <down> <down> <down> <down> <down> 
> <next> <prior> <up> <up> <up> <up> <up> <up> <up> <up> 
> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
> <down> <down> <down> <down> <down> <down> <down> <down> 
> <down> <down> <down> <down> <down> <down> <down> <down> 
> <down> <down> <down> <down> <down> <down> <down> <down> 
> <down> <down> <down> <down> <down> <down> <down> <down> 
> <down> <down> <down> <down> <down> <down> <down> <down> 
> <down> <down> <down> <down> <down> <down> <up> <up> 
> <up> <up> <up> <up> <up> <up> <down> <down> <down> 
> <down> <down> <down> <down> <down> <down> <down> <down> 
> <down> <down> <down> <up> <up> <up> <up> <up> <up> 
> <down> <down> <down> <down> <down> <down> <down> <down> 
> <down> <down> <down> <down> <right> <left> <right> 
> <right> M-x r e p o r <tab> <return>
>
> Recent messages:
> Showing all blocks ... done [3 times]
> Showing all blocks ... done [2 times]
> Loading semantic-tag-write...done
> Mark saved where search started
> Mark set
> Type C-x 4 C-o RET to restore the other window.  
> Loading eieio-opt...done
> call-interactively: End of buffer [2 times]
> Loading emacsbug...done
> Loading dabbrev...done




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#5751; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 21 Mar 2010 19:54:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 21 15:54:23 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1NtRE6-00040s-5G
	for submit <at> debbugs.gnu.org; Sun, 21 Mar 2010 15:54:22 -0400
Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <arne.schmitz@HIDDEN>) id 1NtQj5-0003oM-Rf
	for submit <at> debbugs.gnu.org; Sun, 21 Mar 2010 15:22:21 -0400
Received: from lists.gnu.org ([199.232.76.165]:50513)
	by monty-python.gnu.org with esmtps
	(TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60)
	(envelope-from <arne.schmitz@HIDDEN>) id 1NtQj1-0006s9-9u
	for submit <at> debbugs.gnu.org; Sun, 21 Mar 2010 15:22:15 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NtQj0-0005Jv-SH
	for bug-gnu-emacs@HIDDEN; Sun, 21 Mar 2010 15:22:14 -0400
Received: from [140.186.70.92] (port=55332 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NtQiz-0005IY-3U
	for bug-gnu-emacs@HIDDEN; Sun, 21 Mar 2010 15:22:14 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL
	autolearn=unavailable version=3.3.0
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <arne.schmitz@HIDDEN>) id 1NtQiJ-0007Uu-6b
	for bug-gnu-emacs@HIDDEN; Sun, 21 Mar 2010 15:21:33 -0400
Received: from mail.gmx.net ([213.165.64.20]:46445)
	by eggs.gnu.org with smtp (Exim 4.69)
	(envelope-from <arne.schmitz@HIDDEN>) id 1NtQiI-0007UO-RE
	for bug-gnu-emacs@HIDDEN; Sun, 21 Mar 2010 15:21:31 -0400
Received: (qmail invoked by alias); 21 Mar 2010 19:21:24 -0000
Received: from xdsl-78-35-153-101.netcologne.de (EHLO [192.168.2.104])
	[78.35.153.101]
	by mail.gmx.net (mp007) with SMTP; 21 Mar 2010 20:21:24 +0100
X-Authenticated: #2146970
X-Provags-ID: V01U2FsdGVkX18WvL0bI7wW5GEzXGY7N2cQ09clNw3hsK5zpPWxzC
	zoxiJ4ux6ELEB6
From: Arne Schmitz <arne.schmitz@HIDDEN>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Subject: Strange behaviour of ff-find-other-file
Date: Sun, 21 Mar 2010 20:21:21 +0100
Message-Id: <7B99D88E-806D-412D-8CCD-0EDB6CDF6588@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Mime-Version: 1.0 (Apple Message framework v1077)
X-Mailer: Apple Mail (2.1077)
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.48999999999999999
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6,
	seldom 2.4 (older, 4)
X-Spam-Score: -3.3 (---)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sun, 21 Mar 2010 15:54:20 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.6 (----)

Hi everyone!

I have found a behaviour in ff-find-other-file that I would consider a
bug. However, I am not sure if this is definitely the case, but at
least I would say that the function's behaviour does not correspond to
it's implementation. The documentation says:

"Find the header or source file corresponding to this file."

Consider the following: the header and source for a certain case are
already being visited. Let's say the source is in
$CWD/project-src/foo.c, and the header in $CWD/include/foo.h. If
either ../project-src or ../include is not in the
ff-search-directories, the appropriate switch to the source or header
file will fail. Consider that this will also fail, if the
corresponding file is already being visited! This is not explicitly
demanded by the documentation, but would be useful behaviour in my
opinion. Looking at the source for ff-find-other-file leads to these
lines in the function ff-get-file-name:

  (if (bufferp (get-file-buffer filename))
      (setq found (buffer-file-name (get-file-buffer filename))))

To my understanding this is supposed to search through the current
buffers for the corresponding file. However, this seems to always
fail, since the variable filename is not expanded, as get-file-buffer
demands, and neither do I see how this is supposed to happen
anyway. So in the least, this code is useless, or worst, broken. Since
I like to have Emacs find the file, if there is a buffer visiting a
file with the correct name (although it might not be unique), I
changed the above lines to the following:

  (let ((b (find-if (lambda(x) (string=3D (buffer-name x) filename)) =
(buffer-list))))
    (if b
        (setq found (buffer-file-name b))))

Not sure, if this is the best code to achieve this, since I don't know
Emacs-Lisp very well, and a friend helped me figure this out.

Hope this helps and best regards,

Arne

In GNU Emacs 22.3.1 (i386-apple-darwin9.8.0, Carbon Version 1.6.0)
of 2010-01-10 on gs674-seijiz.local
Windowing system distributor `Apple Inc.', version 10.6.2
configured using `configure  =
'--prefix=3D/Applications/Emacs.app/Contents/Resources' '--with-carbon' =
'--without-x' =
'--libexecdir=3D/Volumes/Emacs/Emacs.app/Contents/MacOS/libexec' =
'CC=3Dgcc-4.2' 'CFLAGS=3D-O2 -arch i386 -arch ppc7400 -DUSE_ATSUI =
-DUSE_MAC_TSM''

Important settings:
 value of $LC_ALL: nil
 value of $LC_COLLATE: nil
 value of $LC_CTYPE: nil
 value of $LC_MESSAGES: nil
 value of $LC_MONETARY: nil
 value of $LC_NUMERIC: nil
 value of $LC_TIME: nil
 value of $LANG: nil
 locale-coding-system: iso-latin-1
 default-enable-multibyte-characters: t

Major mode: Help

Minor modes in effect:
 show-paren-mode: t
 server-mode: t
 desktop-save-mode: t
 ecb-minor-mode: t
 tabbar-mwheel-mode: t
 tabbar-mode: t
 which-function-mode: t
 mac-print-mode: t
 tooltip-mode: t
 tool-bar-mode: t
 mouse-wheel-mode: t
 menu-bar-mode: t
 file-name-shadow-mode: t
 global-font-lock-mode: t
 font-lock-mode: t
 blink-cursor-mode: t
 unify-8859-on-encoding-mode: t
 utf-translate-cjk-mode: t
 auto-compression-mode: t
 temp-buffer-resize-mode: t
 column-number-mode: t
 line-number-mode: t
 transient-mark-mode: t
 view-mode: t

Recent input:
<help-echo> <help-echo> <down-mouse-1> <drag-mouse-1>=20
<down-mouse-1> <mouse-1> C-x C-f C-a C-k / . e m <tab>=20
. d <tab> i n i <tab> <return> <wheel-down> <double-wheel-down>=20
<triple-wheel-up> <triple-wheel-up> <triple-wheel-up>=20
<triple-wheel-up> <triple-wheel-up> <triple-wheel-up>=20
<triple-wheel-up> <wheel-down> <double-wheel-down>=20
<triple-wheel-down> <triple-wheel-down> <triple-wheel-down>=20
<triple-wheel-down> <wheel-down> <double-wheel-down>=20
<triple-wheel-down> <down-mouse-1> <mouse-1> C-a C-SPC=20
<down> <down> <down> <down> <up> <down> <down> <down>=20
M-w C-h f f i n d - o <tab> <tab> <tab> <backspace>=20
C-a C-k d <backspace> f f - f i <tab> o <tab> <return>=20
C-x o C-x 1 <down> <down> <down> <down> <down> <down>=20
<down> <down> <down> <down> <down> <down> <down> <down>=20
<next> <prior> <up> <up> <up> <up> <up> <up> <up> <up>=20
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>=20
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>=20
<down> <down> <down> <down> <down> <down> <down> <down>=20
<down> <down> <down> <down> <down> <down> <down> <down>=20
<down> <down> <down> <down> <down> <down> <down> <down>=20
<down> <down> <down> <down> <down> <down> <down> <down>=20
<down> <down> <down> <down> <down> <down> <down> <down>=20
<down> <down> <down> <down> <down> <down> <up> <up>=20
<up> <up> <up> <up> <up> <up> <down> <down> <down>=20
<down> <down> <down> <down> <down> <down> <down> <down>=20
<down> <down> <down> <up> <up> <up> <up> <up> <up>=20
<down> <down> <down> <down> <down> <down> <down> <down>=20
<down> <down> <down> <down> <right> <left> <right>=20
<right> M-x r e p o r <tab> <return>

Recent messages:
Showing all blocks ... done [3 times]
Showing all blocks ... done [2 times]
Loading semantic-tag-write...done
Mark saved where search started
Mark set
Type C-x 4 C-o RET to restore the other window. =20
Loading eieio-opt...done
call-interactively: End of buffer [2 times]
Loading emacsbug...done
Loading dabbrev...done

--=20
Dipl.-Inform. Arne Schmitz              Phone   +49 (0)241 80-21817
Computer Graphics Group                 Mobile  +49 (0)151 29145947
RWTH Aachen University                  Fax     +49 (0)241 80-22899
Ahornstrasse 55, 52074 Aachen, Germany  http://www.rwth-graphics.de






Acknowledgement sent to Arne Schmitz <arne.schmitz@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#5751; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 26 Aug 2016 01:30:03 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.