all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nash Steve <nash11228@gmail.com>
To: Thien-Thi Nguyen <ttn@gnuvola.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to recompile single file or rerun single compilation command in compilation mode ?
Date: Thu, 8 Mar 2012 13:21:40 -0500	[thread overview]
Message-ID: <CAHBqO5KGV3YDxH82X3P1Sx4aE1nUWz4_ojxV=ULbbPUC2YzXXA@mail.gmail.com> (raw)
In-Reply-To: <87zkbrfpth.fsf@gnuvola.org>

[-- Attachment #1: Type: text/plain, Size: 686 bytes --]

It works great!
Thanks very much!

On Thu, Mar 8, 2012 at 3:40 AM, Thien-Thi Nguyen <ttn@gnuvola.org> wrote:

> The previous code fails if COMMAND starts with a relative directory.
> This version is more robust in that regard:
>
> (defun compilation-compile-with-current-line (dir)
>  "Extract the current line as a command and execute it in DIR."
>  (interactive "DExecute command in directory: ")
>  (let ((command (substring-no-properties (thing-at-point 'line) 0 -1)))
>    ;; Do it this way instead of using "cd DIR; COMMAND"
>    ;; to avoid outrageous prefixing on repeated invocations.
>     (let ((default-directory (file-name-as-directory dir)))
>      (compile command))))
>

[-- Attachment #2: Type: text/html, Size: 1026 bytes --]

      reply	other threads:[~2012-03-08 18:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-06 19:54 How to recompile single file or rerun single compilation command in compilation mode ? Nash Steve
2012-03-06 23:10 ` Peter Dyballa
2012-03-07 15:44   ` Nash Steve
2012-03-07 18:21     ` Peter Dyballa
2012-03-08  8:01     ` Thien-Thi Nguyen
2012-03-08  8:40       ` Thien-Thi Nguyen
2012-03-08 18:21         ` Nash Steve [this message]

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='CAHBqO5KGV3YDxH82X3P1Sx4aE1nUWz4_ojxV=ULbbPUC2YzXXA@mail.gmail.com' \
    --to=nash11228@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=ttn@gnuvola.org \
    /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.