all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: kl.vanw@gmail.com
Subject: Re: opening correct source file on compile error
Date: 25 Oct 2006 04:41:38 -0700	[thread overview]
Message-ID: <1161776498.384341.215580@e3g2000cwe.googlegroups.com> (raw)
In-Reply-To: <mailman.216.1161726966.27805.help-gnu-emacs@gnu.org>


Kevin Rodgers wrote:
> kl.vanw@gmail.com wrote:
> > Kevin Rodgers wrote:
> >> Ah, it works in Emacs 22.  To make it work in older versions, use
> >> find-file-hooks (plural) instead of find-file-hook.
> >
> > Yes, I have Emacs 21.3.1. I couldn't get that to work either. Maybe I'm
> > messing up the paths. To be more explicit, the files I edit are in
> > ~/project/math/src/lib/math/ and gmake puts them in
> > ~/project/math/include/math/.
>
> Ah, you didn't mention that the src/lib and include directories had
> their own subdirectory structure, so I assumed otherwise.
>
> (add-hook 'find-file-hooks
>   	  (lambda ()
>   	    (let ((alternate-file
> 		   (replace-regexp-in-string "/include/"
> 					     "/src/lib/"
> 					     buffer-file-name
> 					     t ; fixedcase
> 					     t))) ; literal
>   	      (when (and (not (equal buffer-file-name alternate-file))
>   			 (file-exists-p alternate-file))
>   		(find-alternate-file alternate-file)))))
> 

That worked. You rock. Thanks.

  parent reply	other threads:[~2006-10-25 11:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-18 16:08 opening correct source file on compile error kl.vanw
2006-10-19 16:14 ` Kevin Rodgers
     [not found] ` <mailman.98.1161274520.2130.help-gnu-emacs@gnu.org>
2006-10-20 14:00   ` kl.vanw
2006-10-23 16:15     ` Kevin Rodgers
     [not found]     ` <mailman.162.1161620177.27805.help-gnu-emacs@gnu.org>
2006-10-24 12:04       ` kl.vanw
2006-10-24 12:46         ` Burton Samograd
2006-10-24 14:10           ` kl.vanw
2006-10-24 22:31             ` Burton Samograd
2006-10-24 21:53         ` Kevin Rodgers
     [not found]         ` <mailman.216.1161726966.27805.help-gnu-emacs@gnu.org>
2006-10-25 11:41           ` kl.vanw [this message]
2006-10-23 17:29   ` Ushnish Basu
2006-10-23 20:07     ` Kevin Rodgers
     [not found]     ` <mailman.175.1161634161.27805.help-gnu-emacs@gnu.org>
2006-10-23 22:23       ` Ushnish Basu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1161776498.384341.215580@e3g2000cwe.googlegroups.com \
    --to=kl.vanw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.