From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: Misc. minor compile.el issues
Date: 08 Dec 2002 02:38:55 +0100 [thread overview]
Message-ID: <5xn0nh8f2o.fsf@kfs2.cua.dk> (raw)
In-Reply-To: <E18KmSl-0005jH-00@fencepost.gnu.org>
Richard Stallman <rms@gnu.org> writes:
> The doc string for compilation-process-setup-function starts with a
> `*' identifying it as a user option. Does that really make sense?
>
> That depends on where we draw the line about what is a user option.
> The line as currently drawn includes many similar variables. For
> instance, 76 normal hooks are marked as user options, although the
> usual place for them to be set is certainly in Lisp code.
I guess there are some hooks which are typically set by users (like
the various ...-mode-hook variables), while other hook variables (like
the above ...-setup-function) rarely has any meaning as a user option.
> Perhaps we should move the line and none of these should be user
> options.
The mode hook variables should be user options, the rest probably
should not. But I'll leave that decision to you :-)
>
> Related to this, I would like the setup function to be able to
> access the buffer and/or window for the compilation process (e.g.
> to set buffer-local variables).
>
> Can we make them current while the hook runs?
Stefan pointed out that the buffer is already current when the hook
is called ... so that's ok.
>
> As a final issue, I think that although the documentation for
> compilation-process-setup-function says it is run just before the
> process is started, it makes more sense to swap the following two
> forms, to allow the setup function to control the
> compilation-window-height:
>
> (compilation-set-window-height outwin)
> (if compilation-process-setup-function
> (funcall compilation-process-setup-function))
>
> Isn't it easier to do that with the current order? Currently,
> compilation-process-setup-function could enlarge the window.
> If it is called first, what would it do to alter the height?
> Locally set compilation-window-height, perhaps?
>
The problem is that compilation-set-window-height is also called
elsewhere, and in its current form does NOT look at the buffer-local
value of compilation-window-height in the compilation buffer if it is
not the current buffer. [I've fixed that, but not committed the
change yet].
And as I pointed out above, the setup-function does not have access to the
compilation window, only the compilation buffer (the current buffer).
For my purpose, the setup function does not need access to the window
if it is called before compilation-set-window-height (which _is_
called with the compilation window as argument).
So although it's a waste to first set the window height, and then call
the setup hook which sets it again, it isn't actually possible with the
current code!
IMHO, it makes more sense to let the hook set compilation-window-height
before compilation-set-window-height is called. And as I said, there
really isn't any practical reason why we should not change the order
[i.e. doing so will not break any existing code].
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
next prev parent reply other threads:[~2002-12-08 1:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-06 0:34 Misc. minor compile.el issues Kim F. Storm
2002-12-06 16:55 ` Stefan Monnier
2002-12-06 20:15 ` Kim F. Storm
2002-12-06 20:14 ` Stefan Monnier
2002-12-07 1:49 ` Kim F. Storm
2002-12-09 15:31 ` Stefan Monnier
2002-12-07 21:26 ` Richard Stallman
2002-12-08 1:38 ` Kim F. Storm [this message]
2002-12-09 20:21 ` Richard Stallman
2002-12-10 0:51 ` Kim F. Storm
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=5xn0nh8f2o.fsf@kfs2.cua.dk \
--to=storm@cua.dk \
--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).