unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Re: completing on makefile targets
Date: Thu, 12 Sep 2019 14:38:37 -0700	[thread overview]
Message-ID: <86muf96vqa.fsf@stephe-leake.org> (raw)
In-Reply-To: <jwv8sqtgva8.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 12 Sep 2019 15:41:23 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Why does let-binding `makefile-target-table' work in
>> `sal-makefile-completions-at-point', but not in `make-compile'?
>
> Because makefile-target-table is buffer-local, so the let-binding in
> `make-compile` only affects the buffer-local value of that var.

And the Makefile is current when make-compile is called, but the
minibuffer is current when completion-at-point and
sal-makefile-completions-at-point are called.

Ok, I thought it was something like that, but could not sort out the
logic.

> BTW, an alternative approach is to add a pcomplete/make function which
> will compute the completions for `make` (regardless if called
> from`make-compile` or from, say, M-!) by looking at the Makefile in the
> current directory.

Yeah, but I hate making assumptions like that; the relevant Makefile
could easily be somewhere else.

>> That requires knowing the "source" buffer while in the minibuffer; is
>> there a standard way to get that?
>
> I think you want `minibuffer-selected-window`

ok, thanks.

I'd like to get the same completion in the *compilation* buffer, but I
don't see anything in compilation-start that remembers the calling
buffer. I'll have to add a global variable, or store it in the current
project.

-- 
-- Stephe



  reply	other threads:[~2019-09-12 21:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12 18:24 completing on makefile targets Stephen Leake
2019-09-12 19:41 ` Stefan Monnier
2019-09-12 21:38   ` Stephen Leake [this message]
2019-09-12 22:26     ` Stefan Monnier
2019-09-14  0:55       ` Stephen Leake

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=86muf96vqa.fsf@stephe-leake.org \
    --to=stephen_leake@stephe-leake.org \
    --cc=emacs-devel@gnu.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).