unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Emacs 28 trigger after-change-major-mode-hook inside mini buffer
@ 2022-08-21 12:22 Jakub T. Jankiewicz
  2022-08-21 12:29 ` Eli Zaretskii
  2022-08-21 14:22 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 6+ messages in thread
From: Jakub T. Jankiewicz @ 2022-08-21 12:22 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,

I have this in my .emacs file, which break interactive function in Emacs 28.

```lisp
(defun new-line-and-indent-fix ()
  (interactive)
  (newline)
  (indent-for-tab-command))

(defun after-major-mode ()
  (if (memql major-mode '(yaml-mode
                          python-mode
                          nxml-mode
                          lisp-interaction-mode))
      (electric-indent-mode -1))
  (if (not (memql major-mode
                  '(fundamental-mode
                    erc-mode
                    text-mode
                    eshell-mode
                    shell-mode
                    inferior-js-mode
                    nodejs-repl-mode
                    change-log-mode
                    comint-mode
                    lisp-interaction-mode
                    inferior-scheme-mode
                    sql-mode)))
      (progn
        (local-set-key (kbd "RET")
                       'new-line-and-indent-fix))))

(add-hook 'after-change-major-mode-hook 'after-major-mode)
```

I don't remember why exactly I used this code, somehow the auto indent was
not working for me.

When I run interactive function it trigger new-line-and-indent-fix inside
minibuffer which means that after-change-major-mode-hook is triggered inside
mini buffer. Was this change documented?

So to fix the problem I need to know: what type of major mode does the mini
buffer now have in Emacs 28? So I can filter out that major mode.

I'm using:
GNU Emacs 28.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.34, cairo
version 1.17.6) of 2022-07-15

Thanks,
Jakub

--
Jakub T. Jankiewicz, Senior Front-End Developer
https://jcubic.pl/me



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-21 14:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-21 12:22 Emacs 28 trigger after-change-major-mode-hook inside mini buffer Jakub T. Jankiewicz
2022-08-21 12:29 ` Eli Zaretskii
2022-08-21 14:20   ` Jakub T. Jankiewicz
2022-08-21 14:37     ` Eli Zaretskii
2022-08-21 14:49     ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-08-21 14:22 ` Stefan Monnier via Users list for the GNU Emacs text editor

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).