2 回答
I got it. I went to /usr/share/emacs/26.1/lisp/progmodes
and deleted a file called cperl-mode.elc. then I went into an archinve here /usr/share/emacs/26.1/lisp/progmodes/cperl-mode.el.gz
. I edited line 1498 of cperl-mode.el to be (modify-syntax-entry ?: "." cperl-mode-syntax-table)
instead of (modify-syntax-entry ?: "_" cperl-mode-syntax-table)
. Then I byte-compiled the file and put it back in /usr/share/emacs/26.1/lisp/progmodes
.
You can also do this in your init file so you don't have to edit any files that are shipped with Emacs. If you edit files that are part of Emacs, you'll need to update them every time you install or upgrade.
(with-eval-after-load "cperl-mode"
(modify-syntax-entry ?: "." cperl-mode-syntax-table))