[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: completing on makefile targets
From: |
Stephen Leake |
Subject: |
Re: completing on makefile targets |
Date: |
Thu, 12 Sep 2019 14:38:37 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (windows-nt) |
Stefan Monnier <address@hidden> 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