Project

General

Profile

Actions

Bug #528

closed

Several ruby-mode.el improvements

Added by nex3 (Natalie Weizenbaum) over 15 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
Backport:
[ruby-core:18424]

Description

=begin
Here are a few improvements to ruby-mode.el (and the other Ruby Elisp code). I'm putting them all in this one issue, because they're built sequentially, and I don't think the later ones will apply well without the earlier ones. The patches are as follows:

  1. Improve the performance of here-doc highlighting. I noticed that, after my previous patches (r18150), editing Ruby was becoming noticeably sluggish. This was because every time a character was typed, every line in the document would be checked to see if it had a here-doc that ended on the current line. The current version only runs the check if a string is active, and then only at the beginning of the string.

  2. I was making these modifications in a fork of the git mirror of the Ruby repos, so Subversion keyword-substitution wasn't active and the use of $Revision$ in ruby-mode.el caused the whole thing to crash. This patch causes the mode to behave gracefully if this is the case.

  3. If a variable was named "next_foo", the "next" was highlighted as though it were a keyword. This was because >, meaning "end of word", was used in the keyword regexp. This patch uses _>, meaning "end of symbol", instead.

  4. Whenever several words had to be ORed in a regexp, they were simply |ed together. Elisp has a function, regexp-opt, which takes a list of words and ORs them together in an optimized way, so this patch makes use of that.

  5. Tabs -> spaces. Almost all elisp code uses spaces exclusively, spaces are produced by Emacs auto-indentation, and some of the ruby-mode code already uses spaces, so this patch switches all of the code to spaces.

The patches were produced using git's format-patch, so they've got embedded commit messages. They should work fine with patch -p1 as well.
=end


Files

Actions #1

Updated by ko1 (Koichi Sasada) over 15 years ago

  • Assignee set to matz (Yukihiro Matsumoto)

=begin

=end

Actions #2

Updated by nex3 (Natalie Weizenbaum) over 15 years ago

=begin
Looks like these patches are broken. I've fixed the issue (and some additional stuff) in my Git repo (http://github.com/nex3/ruby); feel free to draw the patches from there however you want. If you want me to work up more patch files, let me know.
=end

Actions #3

Updated by matz (Yukihiro Matsumoto) over 15 years ago

=begin
Hi,

In message "Re: [ruby-core:18470] [Bug #528] Several ruby-mode.el improvements"
on Sun, 7 Sep 2008 04:27:52 +0900, Nathan Weizenbaum writes:

|Looks like these patches are broken. I've fixed the issue (and some additional stuff) in my Git repo (http://github.com/nex3/ruby); feel free to draw the patches from there however you want. If you want me to work up more patch files, let me know.

Since I am no git expert, could you re-attach the right patches?
I'd love to merge them.

						matz.

=end

Updated by nex3 (Natalie Weizenbaum) over 15 years ago

=begin
Sure, here are two more patches that should work with patch -p1. Patch 6 fixes the variable-name bug that was breaking the original patches, and patch 7 sets case-fold-search locally rather than globally (another issue introduced by my changes in r18150, I'm afraid).
=end

Actions #5

Updated by matz (Yukihiro Matsumoto) over 15 years ago

=begin
Hi,

In message "Re: [ruby-core:18475] [Bug #528] Several ruby-mode.el improvements"
on Sun, 7 Sep 2008 06:31:57 +0900, Nathan Weizenbaum writes:

|File 0006--misc-ruby-mode.el-fix-a-variable-name-error.patch added
|File 0007--misc-emacs-mode.el-don-t-set-case-fold-search-glo.patch added
|
|Sure, here are two more patches that should work with patch -p1. Patch 6 fixes the variable-name bug that was breaking the original patches, and patch 7 sets case-fold-search locally rather than globally (another issue introduced by my changes in r18150, I'm afraid).

Could you tell us which patches should we apply? Is it ok to apply
those 7 patches in line, replacing no.6 and no.7 replaced by new ones?

						matz.

=end

Actions #6

Updated by nex3 (Natalie Weizenbaum) over 15 years ago

=begin
Applying each of the patches in order from 1 to 7 should work fine. The links to patches 6 and 7 at the top and on my previous post are actually the same, so it doesn't matter which one you use.
=end

Actions #7

Updated by matz (Yukihiro Matsumoto) over 15 years ago

=begin
Hi,

In message "Re: [ruby-core:18477] [Bug #528] Several ruby-mode.el improvements"
on Sun, 7 Sep 2008 06:55:17 +0900, Nathan Weizenbaum writes:

|Applying each of the patches in order from 1 to 7 should work fine. The links to patches 6 and 7 at the top and on my previous post are actually the same, so it doesn't matter which one you use.

OK, thanks. I will apply the patches soon.

						matz.

=end

Actions #8

Updated by matz (Yukihiro Matsumoto) over 15 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r19202.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0