Previously M-x mark-defun and friends wouldn't work properly, and would
highlight something at the top of the buffer. This adds a regexp for top-level
functions so the defun functions should work as expected, and also adds a
regexp for extracting their name so which-function-mode should work now too.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
60,030 ms | x64 debian > MLIR.Examples/standalone::test.toy |
Event Timeline
llvm/utils/emacs/llvm-mode.el | ||
---|---|---|
111 | Whoops. Also found we need to handle trailing attributes like nounwind etc., since defun-prompt-regexp needs to match right up to the first { |
llvm/utils/emacs/llvm-mode.el | ||
---|---|---|
111 | Does this still need to be fixed. Don't see any codes for matching {. |
llvm/utils/emacs/llvm-mode.el | ||
---|---|---|
111 | This is fixed, IIUC emacs automatically looks between top-level { braces for defuns, but by default they have to be in column 0. So defun-prompt-regexp skips over those characters so that { is then the first character, e.g. see the definition for bash: https://github.com/emacs-mirror/emacs/blob/7b30e11b2ac5cd360db7ee8b6aed07bd918b93a2/lisp/progmodes/sh-script.el#L1531C1-L1537 |
Slightly buggy.
Fails on something like:
You need .+ -> .* within the parens. I.e no variables is acceptable.