Re: Manipulating keymaps

Dr Rainer Woitok <[email protected]> Tue, 16 Jun 2026 14:42:27 +0200
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
John,

On Tuesday, 2026-06-16 07:04:44 -0400, you wrote:

> Dr Rainer Woitok <[email protected]> writes:
> 
> >
> > That's exactly what I was looking for!  But it only worked for the first
> > Perl programme I opened.   After opening  another Perl programme  in the
> > same frame, again running "C-h k M-q" informed me that this key now runs
> > "prog-fill-reindent-defun" :-(
> >
> > What am I missing?
> >

Oops, I forgot to mention what I added to my "init.el" file before I got
these mixed results:

   (bind-key* "M-q" #'fill-region)

Why doesn't that work?

> 
> Hard to say, I've had no such problems with bind-key. I personally use
> bind-key through the use-package library. Try to bind your command by
> placing
> 
> (use-package emacs
>   :bind*
>   ("M-q " . your-defun))
> 
> in your init.el, and then evaluate or restart emacs.

This cut it!   Phew :-)   But I'm still far away from understanding why.
Later I will read `(info-display-manual 'use-package)´ to see whether or
not it will enlighten me.

Thanks a lot!

Sincerely,
  Rainer