Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6053261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:01:13+00:00 2026-05-23T08:01:13+00:00

I want any paths under t/… to be rewritten to n/… instead, for find-file

  • 0

I want any paths under t/... to be rewritten to n/... instead, for find-file in general (or just as initiated by next-error). I want it to be impossible for me to open the t/... version.

Motivation: I’ve been rsyncing a codebase from NFS (where I edit) to /tmp, so my build is faster (bjam, which is quite slow). I want to force emacs to open the NFS version instead of the /tmp version ALWAYS. I imagine there’s some kind of find-file hook that may be able to do this. Any suggestions? Tramp probably doesn’t do this.

I’d be just as happy to have my compile buffer paths rewritten instead.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:01:14+00:00Added an answer on May 23, 2026 at 8:01 am

    For the compilation, you can use the variable compilation-finish-functions, with something like this:

    (add-hook 'compilation-finish-functions 'my-change-tmp-to-nfs)
    (defun my-change-tmp-to-nfs (buffer &optional stat)
      "change tmp to nfs"
      (interactive "b")
      (save-excursion
        (set-buffer buffer)
        (goto-char (point-min))
        (let ((buffer-read-only nil))
          (while (re-search-forward "/tmp/" nil t)
            (replace-match "/nfs/")))))
    

    Now, you’ll probably need to update the regex for the "/tmp/", and the replacement. Read up on Regexp Search. You could also get fancy and actually check to see that the path you created with the substitution actually exists…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to check whether any Zip file is present on a specified path.
I have xml file under ASSETS dir (com.android.project\assets\xml\file.xml). I want to call a (following)
I want to start a command prompt but don't want any output from it.
I'm making a model in CodeIgniter and I don't want any of the functions
Basically I have a single page on my site that I want any php
I've created a WPF UserControl which contains a Button. I now want any consumer
Although I am using mySQL (for now), I dont want any DB specific SQL.
I have a Rails 3 app that lets users enter comments. I want any
I want to replace any latin / accented characters with their basic alphabet letters
I want to remove any numbers from the end of a string, for example:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.