Closed leungbk closed 11 months ago
Some other unexpected behavior I noticed: after running C-c C-c
on the buffer, when the buffer is narrowed to either function, C-M-x
does not work when point
is on the first line of either define
; however, when on the second line of either function, C-M-x
works fine.
Hmm. Unlike #693, I can't seem to reproduce this, so far. For me:
I'll try with Emacs built from source, later.
Thanks for your reply!
Hmm. Unlike #693, I can't seem to reproduce this, so far. For me:
* C-M-a always moves point before the open paren of the definition.
Hmm, I can't seem to get the expected behavior; I also tried on Emacs 28.2 and 29.1 just now and saw no change. Even when manually typing out M-x beginning-of-defun
, the observed behavior looks indistinguishable from that of backward-sexp
.
* C-M-x does work on either line.
After I C-c C-c
, running narrow-to-defun
followed by C-M-x
when point
is anywhere on the first line of the second define
yields this in the *Racket REPL*
:
Welcome to Racket v8.11.1 [cs].
————— run hello.rkt —————
hello.rkt>
racket-mode-repl::10: _: wildcard not allowed as an expression
in: _
hello.rkt>
Feel free to let me know if there's any other info I can provide.
I tried again with Emacs built from source, c. couple weeks ago (GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.16.0) of 2023-12-07
). But same result: still can't reproduce. :(
FWIW I run it with ~/src/emacs/src/emacs -L ~/src/elisp/racket-mode/ -Q
and manually M-x load-file
the racket-mode.el
file.
Then I visit issue-694.rkt
file (your example above). racket-mode
is enabled automatically. I try your steps. Everything works as expected.
Even with -Q
my enabled minor modes are:
((auto-composition-mode) (auto-compression-mode)
(auto-encryption-mode) (blink-cursor-mode) (buffer-read-only)
(electric-indent-mode) (file-name-shadow-mode) (font-lock-mode)
(global-eldoc-mode) (global-font-lock-mode) (indent-tabs-mode)
(isearch-fold-quotes-mode) (line-number-mode) (menu-bar-mode)
(minibuffer-regexp-mode) (mouse-wheel-mode)
(semantic-minor-modes-format) (show-paren-mode) (tool-bar-mode)
(tooltip-mode) (transient-mark-mode))
Yours are:
((auto-composition-mode) (auto-compression-mode)
(auto-encryption-mode) (blink-cursor-mode) (buffer-read-only)
(electric-indent-mode) (file-name-shadow-mode) (font-lock-mode)
(global-eldoc-mode) (global-font-lock-mode) (gpm-mouse-mode)
(indent-tabs-mode) (isearch-fold-quotes-mode) (line-number-mode)
(menu-bar-mode) (minibuffer-regexp-mode) (mouse-wheel-mode)
(semantic-minor-modes-format) (show-paren-mode)
(straight-package-neutering-mode) (straight-use-package-mode)
(tool-bar-mode) (tooltip-mode) (transient-mark-mode))
Those are nearly identical -- if I'm eyeballing it correctly, you have gpm-mouse-mode
enabled which I don't -- so I am super stumped...
(This feels like one of those bugs that will turn out to be either amazingly subtle, or, blatantly obvious/simple in hindsight, but nothing in between.)
p.s. FWIW I build with the following on Debian 12 (e.g. no libjit ergo no native-comp):
## Clone
git clone git://git.savannah.gnu.org/emacs.git
## Deps
sudo apt install \
autoconf \
build-essential \
libgtk-3-dev \
libgnutls28-dev \
libtiff5-dev \
libgif-dev \
libjpeg-dev \
libpng-dev \
libxpm-dev \
libxml2-dev \
libncurses-dev \
texinfo
## Build
./autogen.sh
./configure
make --jobs=$(nproc)
blatantly obvious/simple in hindsight
This. I had a tentative fix for #693. I thought I had reverted that, while trying to reproduce this -- but I hadn't really.
That fix for #693 turns out to fix this, too, in a way I didn't expect.
I am so sorry for the noise!
I'll push a commit to fix both issues... but since I'm being so dumb today, I'll slow down and triple check things...
Given an
init.el
that looks likeand a Racket file
I find that when I
C-x n d
within either function and try to usebeginning-of-defun
,point
does not move where I expect it to.Package
System values
Buffer values
Racket Mode values
Minor modes
Disabled minor modes