gui模式下emacs对鼠标的支持为啥这么奇怪

我用的doom+emacs 28.2,打开了evil。

选中的右键菜单中没有常用的粘贴 复制,选择文字的手感也很奇怪,与大部分编辑都很不一样。

我根本就没有右键菜单 :rofl:

不知道是默认不开启还是我在哪里给关掉了,不过懒得研究了。

我的 Emacs 需要按住 Ctrl 再点击。

给你看看我的鼠标事件(其实是触控板)

  69948   31.34%  mwheel-scroll                                M-<mouse-7>, M-<mouse-6>, M-<mouse-5>, M-<mouse-4>, M-<wheel-right>, M-<wheel-left>, M-<wheel-down>, M-<wheel-up>, S-<mouse-7>, S-<mouse-6>, S-<mouse-5>, S-<mouse-4>, S-<wheel-right>, S-<wheel-left>, S-<wheel-down>, S-<wheel-up>, <mouse-7>, <mouse-6>, <mouse-5>, <mouse-4>, <wheel-right>, <wheel-left>, <wheel-down>, <wheel-up>, <right-fringe> <mouse-7>, <right-fringe> <mouse-6>, <right-fringe> <mouse-5>, <right-fringe> <mouse-4>, <right-fringe> <wheel-right>, <right-fringe> <wheel-left>, <right-fringe> <wheel-down>, <right-fringe> <wheel-up>, <left-fringe> <mouse-7>, <left-fringe> <mouse-6>, <left-fringe> <mouse-5>, <left-fringe> <mouse-4>, <left-fringe> <wheel-right>, <left-fringe> <wheel-left>, <left-fringe> <wheel-down>, <left-fringe> <wheel-up>, <right-margin> <mouse-7>, <right-margin> <mouse-6>, <right-margin> <mouse-5>, <right-margin> <mouse-4>, <right-margin> <wheel-right>, <right-margin> <wheel-left>, <right-margin> <wheel-down>, <right-margin> <wheel-up>, <left-margin> <mouse-7>, <left-margin> <mouse-6>, <left-margin> <mouse-5>, <left-margin> <mouse-4>, <left-margin> <wheel-right>, <left-margin> <wheel-left>, <left-margin> <wheel-down>, <left-margin> <wheel-up>, <horizontal-scroll-bar> <mouse-7>, <horizontal-scroll-bar> <mouse-6>, <horizontal-scroll-bar> <mouse-5>, <horizontal-scroll-bar> <mouse-4>, <horizontal-scroll-bar> <wheel-right>, <horizontal-scroll-bar> <wheel-left>, <horizontal-scroll-bar> <wheel-down>, <horizontal-scroll-bar> <wheel-up>, <vertical-scroll-bar> <mouse-7>, <vertical-scroll-bar> <mouse-6>, <vertical-scroll-bar> <mouse-5>, <vertical-scroll-bar> <mouse-4>, <vertical-scroll-bar> <wheel-right>, <vertical-scroll-bar> <wheel-left>, <vertical-scroll-bar> <wheel-down>, <vertical-scroll-bar> <wheel-up>, <mode-line> <mouse-7>, <mode-line> <mouse-6>, <mode-line> <mouse-5>, <mode-line> <mouse-4>, <mode-line> <wheel-right>, <mode-line> <wheel-left>, <mode-line> <wheel-down>, <mode-line> <wheel-up>, <header-line> <mouse-7>, <header-line> <mouse-6>, <header-line> <mouse-5>, <header-line> <mouse-4>, <header-line> <wheel-right>, <header-line> <wheel-left>, <header-line> <wheel-down>, <header-line> <wheel-up>
  51612   23.12%  ignore-preserving-kill-region                <mouse-movement>

...

   5767    2.58%  mouse-drag-region                            <down-mouse-1>
   5466    2.45%  mouse-set-point                              <mouse-1>, C-M-<mouse-1>

这个菜单看起来是 lsp mode 提供的。

emacs 28.1 增加了 context-menu-mode,改善了对右键菜单的支持。

不过 emacs 一般还是推荐用键盘操作。

1 个赞

这个看起来就很正常了,但是用鼠标选中文字的手感还是很奇怪。

什么意思?zsbd

选文字的时候,总感觉怪怪的,体验跟大部分编辑器都不大一样。

就是问一下哪里不一样,能具体讲一下吗?我用 emacs 时间长了,已经没感觉了,有点好奇。

大家不都是一样的吗?网页上也是随便什么位置都可以拖拽鼠标选中,Emacs 也是啊。

只要你的拖拽起始点覆盖了起始位置字符一半以上的位置,就会选中,如果从一个字符的边缘拖拽,就会忽略起始位置的字符。

没感觉 Emacs 和系统或浏览器有什么割裂感。

我也感觉emacs的选择有些奇怪,就是在选择多行文字的时候会把整个选择区域高亮。其他编辑器一般只高亮选中的文本。

本来连选择高亮都没有的