From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Stefan Kangas <stefan@marxist.se>
Cc: 46611@debbugs.gnu.org
Subject: bug#46611: Variables grep-window-height grep-scroll-output unused since Emacs 22.1?
Date: Thu, 18 Feb 2021 08:58:04 -0500 [thread overview]
Message-ID: <jwvlfbl8oy4.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CADwFkmkJJEjEpZqgZU8YUutqN7tuMzYNAz5vAQRb6PO-5UT=eQ@mail.gmail.com> (Stefan Kangas's message of "Wed, 17 Feb 2021 21:19:59 -0800")
> *** The new variables `grep-window-height' and `grep-scroll-output' override
> the corresponding compilation mode settings, for grep commands only.
>
> But if I'm not missing something, they were never actually part of Emacs
> 22.1, due to this commit:
>
> commit ab55f76f9ca670e3f41e4cfabeb35426f6b24fb6
> Author: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Thu Mar 11 22:56:19 2004 +0000
>
> (kill-grep): Move here from compile.el
> (grep-error, grep-hit-face, grep-error-face)
> (grep-mode-font-lock-keywords): New variables.
> (grep-regexp-alist): Simplify regexp and add `binary' case.
> (grep-mode): New mode.
> (grep-process-setup): Simplify.
> [...]
> - (if grep-window-height
> - (set (make-local-variable 'compilation-window-height)
> - grep-window-height))
> - (set (make-local-variable 'compile-auto-highlight)
> - grep-auto-highlight)
> - (set (make-local-variable 'compilation-scroll-output)
> - grep-scroll-output)
>
> Stefan, do you remember any of this? Were they removed intentionally?
I think so, yes. It's because `define-compilation-mode` should take
care of them:
(defmacro define-compilation-mode (mode name doc &rest body)
"This is like `define-derived-mode' without the PARENT argument.
The parent is always `compilation-mode' and the customizable `compilation-...'
variables are also set from the name of the mode you have chosen,
by replacing the first word, e.g., `compilation-scroll-output' from
`grep-scroll-output' if that variable exists."
(let ((mode-name (replace-regexp-in-string "-mode\\'" "" (symbol-name mode))))
`(define-derived-mode ,mode compilation-mode ,name
,doc
,@(mapcar (lambda (v)
(let ((mv (intern (replace-regexp-in-string
"\\`compilation" mode-name
(symbol-name v)))))
`(if (boundp ',mv) (setq-local ,v ,mv))))
'(compilation-directory-matcher
compilation-error
compilation-error-regexp-alist
compilation-error-regexp-alist-alist
compilation-error-screen-columns
compilation-finish-functions
compilation-first-column
compilation-mode-font-lock-keywords
compilation-page-delimiter
compilation-parse-errors-filename-function
compilation-process-setup-function
compilation-scroll-output
compilation-search-path
compilation-skip-threshold
compilation-window-height))
,@body)))
-- Stefan
next prev parent reply other threads:[~2021-02-18 13:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-18 5:19 bug#46611: Variables grep-window-height grep-scroll-output unused since Emacs 22.1? Stefan Kangas
2021-02-18 13:58 ` Stefan Monnier [this message]
2021-03-04 3:02 ` Stefan Kangas
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=jwvlfbl8oy4.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=46611@debbugs.gnu.org \
--cc=stefan@marxist.se \
/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.