Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust-specific emacs compilation regexp #8747

Conversation

pnkfelix
Copy link
Member

Fix #6887

;; regexp (which is broken on a few edge cases), add our own 'rust
;; compilation error regexp and use it instead.
(defvar rustc-compilation-regexps
(let ((file "\\([^ \n]+\\)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if a filename does have a space in it?

(Note: I have no idea how this is supposed to work.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then the regexp will not match.

I was about to claim that the 'gnu regexp makes the same trade-off, but I decided to actually check that claim. Which is good, because the claim would have been false.

(The docs for the gnu regexp claim that it matches file names composed of any non-newline char, apart from some particular exceptions, and direct experimentation seems to confirm this claim, though I cannot vouch for the regexp there since it is too big for me to decode. You can see that regexp with its documentation at mirrors/emacs.)

I'll see if I can improve upon this to support spaces as well.

@pnkfelix
Copy link
Member Author

(I even tested it out; it seems to work, at least for a couple minimal of files and parent directories with embedded spaces that I threw into /tmp.)

@pnkfelix
Copy link
Member Author

(also, for anyone who wants to play around with this stuff, I left copious notes in the comments for #6887 that should explain how you can experiment interactively in the Emacs *scratch* buffer to find out how different regular-expressions behave. There is also M-x re-builder option, which was also very interesting to play with, but even with that I could not figure out a direct way to fix the original 'gnu regexp.)

bors added a commit that referenced this pull request Aug 27, 2013
@bors bors closed this Aug 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustc "file:line-num" output has become incompatible with emacs' default compilation-mode
4 participants