summaryrefslogtreecommitdiff
path: root/test/automated/ruby-mode-tests.el
Commit message (Collapse)AuthorAgeFilesLines
* Rename all test files to reflect source layout.Phillip Lord2015-11-241-713/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * CONTRIBUTE,Makefile.in,configure.ac: Update to reflect test directory moves. * test/file-organisation.org: New file. * test/automated/Makefile.in test/automated/data/decompress/foo.gz test/automated/data/epg/pubkey.asc test/automated/data/epg/seckey.asc test/automated/data/files-bug18141.el.gz test/automated/data/flymake/test.c test/automated/data/flymake/test.pl test/automated/data/package/archive-contents test/automated/data/package/key.pub test/automated/data/package/key.sec test/automated/data/package/multi-file-0.2.3.tar test/automated/data/package/multi-file-readme.txt test/automated/data/package/newer-versions/archive-contents test/automated/data/package/newer-versions/new-pkg-1.0.el test/automated/data/package/newer-versions/simple-single-1.4.el test/automated/data/package/package-test-server.py test/automated/data/package/signed/archive-contents test/automated/data/package/signed/archive-contents.sig test/automated/data/package/signed/signed-bad-1.0.el test/automated/data/package/signed/signed-bad-1.0.el.sig test/automated/data/package/signed/signed-good-1.0.el test/automated/data/package/signed/signed-good-1.0.el.sig test/automated/data/package/simple-depend-1.0.el test/automated/data/package/simple-single-1.3.el test/automated/data/package/simple-single-readme.txt test/automated/data/package/simple-two-depend-1.1.el test/automated/abbrev-tests.el test/automated/auto-revert-tests.el test/automated/calc-tests.el test/automated/icalendar-tests.el test/automated/character-fold-tests.el test/automated/comint-testsuite.el test/automated/descr-text-test.el test/automated/electric-tests.el test/automated/cl-generic-tests.el test/automated/cl-lib-tests.el test/automated/eieio-test-methodinvoke.el test/automated/eieio-test-persist.el test/automated/eieio-tests.el test/automated/ert-tests.el test/automated/ert-x-tests.el test/automated/generator-tests.el test/automated/let-alist.el test/automated/map-tests.el test/automated/advice-tests.el test/automated/package-test.el test/automated/pcase-tests.el test/automated/regexp-tests.el test/automated/seq-tests.el test/automated/subr-x-tests.el test/automated/tabulated-list-test.el test/automated/thunk-tests.el test/automated/timer-tests.el test/automated/epg-tests.el test/automated/eshell.el test/automated/faces-tests.el test/automated/file-notify-tests.el test/automated/auth-source-tests.el test/automated/gnus-tests.el test/automated/message-mode-tests.el test/automated/help-fns.el test/automated/imenu-test.el test/automated/info-xref.el test/automated/mule-util.el test/automated/isearch-tests.el test/automated/json-tests.el test/automated/bytecomp-tests.el test/automated/coding-tests.el test/automated/core-elisp-tests.el test/automated/decoder-tests.el test/automated/files.el test/automated/font-parse-tests.el test/automated/lexbind-tests.el test/automated/occur-tests.el test/automated/process-tests.el test/automated/syntax-tests.el test/automated/textprop-tests.el test/automated/undo-tests.el test/automated/man-tests.el test/automated/completion-tests.el test/automated/dbus-tests.el test/automated/newsticker-tests.el test/automated/sasl-scram-rfc-tests.el test/automated/tramp-tests.el test/automated/obarray-tests.el test/automated/compile-tests.el test/automated/elisp-mode-tests.el test/automated/f90.el test/automated/flymake-tests.el test/automated/python-tests.el test/automated/ruby-mode-tests.el test/automated/subword-tests.el test/automated/replace-tests.el test/automated/simple-test.el test/automated/sort-tests.el test/automated/subr-tests.el test/automated/reftex-tests.el test/automated/sgml-mode-tests.el test/automated/tildify-tests.el test/automated/thingatpt.el test/automated/url-future-tests.el test/automated/url-util-tests.el test/automated/add-log-tests.el test/automated/vc-bzr.el test/automated/vc-tests.el test/automated/xml-parse-tests.el test/BidiCharacterTest.txt test/biditest.el test/cedet/cedet-utests.el test/cedet/ede-tests.el test/cedet/semantic-ia-utest.el test/cedet/semantic-tests.el test/cedet/semantic-utest-c.el test/cedet/semantic-utest.el test/cedet/srecode-tests.el test/cedet/tests/test.c test/cedet/tests/test.el test/cedet/tests/test.make test/cedet/tests/testdoublens.cpp test/cedet/tests/testdoublens.hpp test/cedet/tests/testfriends.cpp test/cedet/tests/testjavacomp.java test/cedet/tests/testnsp.cpp test/cedet/tests/testpolymorph.cpp test/cedet/tests/testspp.c test/cedet/tests/testsppcomplete.c test/cedet/tests/testsppreplace.c test/cedet/tests/testsppreplaced.c test/cedet/tests/testsubclass.cpp test/cedet/tests/testsubclass.hh test/cedet/tests/testtypedefs.cpp test/cedet/tests/testvarnames.c test/etags/CTAGS.good test/etags/ETAGS.good_1 test/etags/ETAGS.good_2 test/etags/ETAGS.good_3 test/etags/ETAGS.good_4 test/etags/ETAGS.good_5 test/etags/ETAGS.good_6 test/etags/a-src/empty.zz test/etags/a-src/empty.zz.gz test/etags/ada-src/2ataspri.adb test/etags/ada-src/2ataspri.ads test/etags/ada-src/etags-test-for.ada test/etags/ada-src/waroquiers.ada test/etags/c-src/a/b/b.c test/etags/c-src/abbrev.c test/etags/c-src/c.c test/etags/c-src/dostorture.c test/etags/c-src/emacs/src/gmalloc.c test/etags/c-src/emacs/src/keyboard.c test/etags/c-src/emacs/src/lisp.h test/etags/c-src/emacs/src/regex.h test/etags/c-src/etags.c test/etags/c-src/exit.c test/etags/c-src/exit.strange_suffix test/etags/c-src/fail.c test/etags/c-src/getopt.h test/etags/c-src/h.h test/etags/c-src/machsyscalls.c test/etags/c-src/machsyscalls.h test/etags/c-src/sysdep.h test/etags/c-src/tab.c test/etags/c-src/torture.c test/etags/cp-src/MDiagArray2.h test/etags/cp-src/Range.h test/etags/cp-src/burton.cpp test/etags/cp-src/c.C test/etags/cp-src/clheir.cpp.gz test/etags/cp-src/clheir.hpp test/etags/cp-src/conway.cpp test/etags/cp-src/conway.hpp test/etags/cp-src/fail.C test/etags/cp-src/functions.cpp test/etags/cp-src/screen.cpp test/etags/cp-src/screen.hpp test/etags/cp-src/x.cc test/etags/el-src/TAGTEST.EL test/etags/el-src/emacs/lisp/progmodes/etags.el test/etags/erl-src/gs_dialog.erl test/etags/f-src/entry.for test/etags/f-src/entry.strange.gz test/etags/f-src/entry.strange_suffix test/etags/forth-src/test-forth.fth test/etags/html-src/algrthms.html test/etags/html-src/index.shtml test/etags/html-src/software.html test/etags/html-src/softwarelibero.html test/etags/lua-src/allegro.lua test/etags/objc-src/PackInsp.h test/etags/objc-src/PackInsp.m test/etags/objc-src/Subprocess.h test/etags/objc-src/Subprocess.m test/etags/objcpp-src/SimpleCalc.H test/etags/objcpp-src/SimpleCalc.M test/etags/pas-src/common.pas test/etags/perl-src/htlmify-cystic test/etags/perl-src/kai-test.pl test/etags/perl-src/yagrip.pl test/etags/php-src/lce_functions.php test/etags/php-src/ptest.php test/etags/php-src/sendmail.php test/etags/prol-src/natded.prolog test/etags/prol-src/ordsets.prolog test/etags/ps-src/rfc1245.ps test/etags/pyt-src/server.py test/etags/tex-src/gzip.texi test/etags/tex-src/nonewline.tex test/etags/tex-src/testenv.tex test/etags/tex-src/texinfo.tex test/etags/y-src/atest.y test/etags/y-src/cccp.c test/etags/y-src/cccp.y test/etags/y-src/parse.c test/etags/y-src/parse.y test/indent/css-mode.css test/indent/js-indent-init-dynamic.js test/indent/js-indent-init-t.js test/indent/js-jsx.js test/indent/js.js test/indent/latex-mode.tex test/indent/modula2.mod test/indent/nxml.xml test/indent/octave.m test/indent/pascal.pas test/indent/perl.perl test/indent/prolog.prolog test/indent/ps-mode.ps test/indent/ruby.rb test/indent/scheme.scm test/indent/scss-mode.scss test/indent/sgml-mode-attribute.html test/indent/shell.rc test/indent/shell.sh test/redisplay-testsuite.el test/rmailmm.el test/automated/buffer-tests.el test/automated/cmds-tests.el test/automated/data-tests.el test/automated/finalizer-tests.el test/automated/fns-tests.el test/automated/inotify-test.el test/automated/keymap-tests.el test/automated/print-tests.el test/automated/libxml-tests.el test/automated/zlib-tests.el: Files Moved.
* Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | Run admin/update-copyright.
* * test/automated/ruby-mode-test.el (ruby-assert-face): Fix typo in previousGlenn Morris2014-05-281-1/+1
|
* * lisp/font-lock.el (font-lock-flush, font-lock-ensure): New functions.Stefan Monnier2014-05-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (font-lock-fontify-buffer): Mark interactive-only. (font-lock-multiline, font-lock-fontified, font-lock-set-defaults): Make buffer-local. (font-lock-specified-p): Remove redundant boundp check. (font-lock-flush-function, font-lock-ensure-function): New vars. (font-lock-turn-on-thing-lock): Set them. (font-lock-default-fontify-buffer): Obey font-lock-dont-widen. (font-lock-after-change-function): Make `old-len' optional. (font-lock-set-defaults): Remove redundant `set' of font-lock-defaults. Call font-lock-flush, just in case. * lisp/progmodes/verilog-mode.el (verilog-preprocess): Disable workaround in recent Emacsen. * lisp/progmodes/vera-mode.el (vera-fontify-buffer): Declare obsolete. (vera-mode-map, vera-mode-menu): Remove bindings to it. * lisp/progmodes/idlw-help.el (idlwave-help-fontify): Use font-lock-ensure and with-syntax-table. * lisp/textmodes/conf-mode.el (conf-quote-normal): * lisp/progmodes/sh-script.el (sh-set-shell): * lisp/progmodes/prog-mode.el (prettify-symbols-mode): * lisp/progmodes/f90.el (f90-font-lock-n): * lisp/progmodes/cwarn.el (cwarn-mode): * lisp/nxml/nxml-mode.el (nxml-toggle-char-ref-extra-display): * lisp/progmodes/compile.el (compilation-setup, compilation--unsetup): * lisp/hi-lock.el (hi-lock-mode, hi-lock-unface-buffer) (hi-lock-set-pattern, hi-lock-set-file-patterns): Use font-lock-flush. * lisp/mail/rmail.el (rmail-variables): Set font-lock-dont-widen instead of font-lock-fontify-buffer-function and font-lock-unfontify-buffer-function. (rmail-unfontify-buffer-function, rmail-fontify-message): Use with-silent-modifications. * lisp/htmlfontify.el (hfy-force-fontification): Use jit-lock-fontify-now and font-lock-ensure. * lisp/bs.el (bs-show-in-buffer): Use font-lock-ensure. * lisp/gnus/mm-view.el (mm-display-inline-fontify): Use font-lock-ensure. * lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Use font-lock-flush. * lisp/org/org-compat.el (org-font-lock-ensure): New function. * lisp/org/ox-odt.el (org-odt-do-format-code): * lisp/org/ox-html.el (org-html-fontify-code): * lisp/org/org.el (org-fontify-like-in-org-mode): * lisp/org/org-src.el (org-src-font-lock-fontify-block): * lisp/org/org-clock.el (org-clock-get-clocktable): Use it. * lisp/org/ox-org.el (org-org-publish-to-org): Use it. Avoid using find-file from Elisp. * test/automated/ruby-mode-tests.el (ruby-assert-face): Use font-lock-ensure. (ruby-interpolation-keeps-non-quote-syntax): Use syntax-propertize.
* * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function):Dmitry Gutov2014-05-061-0/+4
| | | | | | | | | Backtrack one char if the global/char-literal var matcher hits inside a string. The next char could be the beginning of an expression expansion. * test/automated/ruby-mode-tests.el (ruby-interpolation-after-dollar-sign): New test.
* Implement user option ruby-align-chained-callsDmitry Gutov2014-01-311-0/+14
| | | | | | | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-align-chained-calls): New option. (ruby-smie-grammar): Make "." right-associative. Make its priority lower than the ternary and all binary operators. (ruby-smie-rules): Indent "(" relative to the first non-"." parent, or the first "." parent at indentation. Use `ruby-align-chained-calls' for indentation of "." tokens. * test/automated/ruby-mode-tests.el (ruby-align-chained-calls): New test. Fixes: debbugs:16593
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* * lisp/progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): NewDmitry Gutov2013-12-201-0/+51
| | | | | | | | | | | | | | | | | | option. (ruby-smie--indent-to-stmt-p): Use it. (ruby-smie-rules): Revert the logic in the handling of `when'. Expand the `begin' clause to handle `ruby-align-to-stmt-keywords'. (ruby-deep-arglist, ruby-deep-indent-paren) (ruby-deep-indent-paren-style): Update docstrings to note that the vars don't have any effect with SMIE. * test/automated/ruby-mode-tests.el: Add tests for `ruby-align-to-stmt-keywords'. * test/indent/ruby.rb: Update examples to reflect the lack of change in default indentation of `begin' blocks. Fixes: debbugs:16182
* Fix Bug#15874Dmitry Gutov2013-12-061-2/+1
| | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-mode-syntax-table): Don't modify syntax for `?'. (ruby-expr-beg): Expect that `!' will have syntax class "symbol" where appropriate already. (ruby-syntax-propertize-function): Propertize `?' and `!' at the end of method names.
* * automated/ruby-mode-tests.el (ruby-exit!-font-lock): Set expected-result.Glenn Morris2013-11-211-1/+2
|
* * test/automated/ruby-mode-tests.el:Bozhidar Batsov2013-11-201-0/+20
| | | | Add a few tests for `ruby--insert-coding-comment'.
* * test/automated/ruby-mode-tests.el:Bozhidar Batsov2013-11-201-0/+3
| | | | Add a failing test for bug #15874.
* * lisp/progmodes/ruby-mode.el (ruby-toggle-block): Don't stop atAdam Sokolnicki2013-11-171-0/+6
| | | | | | interpolation curlies. Fixes: debbugs:15914
* * lisp/progmodes/ruby-mode.el (ruby-smie--forward-token)Dmitry Gutov2013-11-041-2/+0
| | | | | | | | (ruby-smie--backward-token): Tokenize heredocs as semicolons. * test/automated/ruby-mode-tests.el: Remove outdated comment. * test/indent/ruby.rb: Add a statement on the line after heredoc.
* * lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p): Be moreDmitry Gutov2013-10-261-2/+2
| | | | | | | | | specific in what the first arg can be: a non-keyword word, string/regexp/percent literal opener, opening paren, or unary operator followed directly by word. * test/automated/ruby-mode-tests.el (ruby-toggle-block-to-brace): Fix the test, in respect to adding the space after the curly.
* * test/automated/ruby-mode-tests.el (ruby-with-temp-buffer): Move beforeStefan Monnier2013-10-101-10/+9
| | | | | | first use. (ruby-should-indent): Use indent-according-to-mode. (ruby-deftest-move-to-block): Use `declare'.
* * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent after hangingDmitry Gutov2013-10-091-2/+5
| | | | | | | | | iuwu-mod token. (ruby-smie--implicit-semi-p): Prohibit implicit semicolon after hanging iuwu-mod token. (ruby-smie--forward-token): Do not include a dot after a token in that token. (ruby-smie--backward-token): Likewise.
* * test/automated/ruby-mode-tests.el: Add tests for `ruby-forward-sexp'Dmitry Gutov2013-10-061-0/+24
| | | | | | and `ruby-backward-sexp' that fail when `ruby-use-smie' is t. * test/indent/ruby.rb: Two more failing examples.
* Quieten ruby-mode-tests.el compilationGlenn Morris2013-07-111-10/+13
| | | | | | | | | | | | | * test/automated/ruby-mode-tests.el (ruby-deftest-move-to-block): Goto point-min. (works-on-do, zero-is-noop, ok-with-three, ok-with-minus-two) (ruby-move-to-block-skips-percent-literal) (ruby-move-to-block-skips-heredoc) (ruby-move-to-block-moves-from-else-to-if) (ruby-beginning-of-defun-does-not-fold-case) (ruby-end-of-defun-skips-to-next-line-after-the-method): Replace goto-line with forward-line/goto-char. (ruby-move-to-block-does-not-fold-case): Remove unneeded end-of-buffer.
* Explictly require ert in some test/automated/*.el filesGlenn Morris2013-07-091-0/+1
| | | | | | | * automated/add-log-tests.el, automated/advice-tests.el: * automated/imenu-test.el, automated/python-tests.el: * automated/ruby-mode-tests.el, automated/xml-parse-tests.el: Explictly require ert.
* * lisp/progmodes/ruby-mode.el (ruby-move-to-block): When we're at aDmitry Gutov2013-07-031-0/+11
| | | | | | | middle of block statement initially, lower the depth. Remove FIXME comment, not longer valid. Remove middle of block statement detection, no need to do that anymore since we've been using `ruby-parse-region' here.
* * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Don'tDmitry Gutov2013-06-301-0/+3
| | | | start heredoc inside a string or comment.
* * lisp/progmodes/ruby-mode.el (ruby-syntax-before-regexp-re):Dmitry Gutov2013-06-191-0/+6
| | | | | Distinguish ternary operator tokens from slash symbol and slash char literal.
* * lisp/progmodes/ruby-mode.el (ruby-syntax-expansion-allowed-p):Dmitry Gutov2013-05-311-0/+3
| | | | Highlight expansions inside regexp literals.
* * lisp/progmodes/ruby-mode.el (ruby-syntax-expansion-allowed-p): NewDmitry Gutov2013-05-311-0/+17
| | | | | | | | | | | function, checks if expression expansion is allowed in given parse state. (ruby-syntax-propertize-expansion): Use it. (ruby-syntax-propertize-function): Bind `case-fold-search' to nil around the body. * test/automated/ruby-mode-tests.el: New tests, for percent literals and expression expansion.
* * lisp/progmodes/ruby-mode.el (ruby-expression-expansion-re): Allow toDmitry Gutov2013-05-191-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | start at point, so that expansion starting right after opening slash in a regexp is recognized. (ruby-syntax-before-regexp-re): New defvar, extracted from ruby-syntax-propertize-function. Since the value of this regexp is looked up at runtime now, we should be able to turn `ruby-syntax-methods-before-regexp' into a defcustom later. (ruby-syntax-propertize-function): Split regexp matching into two parts, for opening and closing slashes. That allows us to skip over string interpolations and support multiline regexps. Don't call `ruby-syntax-propertize-expansions', instead use another rule for them, which calls `ruby-syntax-propertize-expansion'. (ruby-syntax-propertize-expansions): Move `remove-text-properties' call to `ruby-syntax-propertize-function'. (ruby-syntax-propertize-expansion): Extracted from `ruby-syntax-propertize-expansions'. Handles one expansion. (ruby-syntax-propertize-heredoc): Explicitly call `ruby-syntax-propertize-expansions'. (ruby-syntax-propertize-percent-literal): Leave point right after the percent symbol, so that the expression expansion rule can propertize the contents. * test/automated/ruby-mode-tests.el (ruby-heredoc-highlights-interpolations) (ruby-regexp-skips-over-interpolation) (ruby-regexp-continues-till-end-when-unclosed) (ruby-regexp-can-be-multiline) (ruby-interpolation-inside-percent-literal): New tests. * test/indent/ruby.rb: Add multiline regexp example.
* * lisp/progmodes/ruby-mode.el (ruby-beginning-of-defun)Dmitry Gutov2013-04-161-0/+36
| | | | | | | | | | | | (ruby-end-of-defun, ruby-move-to-block): Bind `case-fold-search' to nil. (ruby-end-of-defun): Remove the unused arg, change the docstring to reflect that this function is only used as the value of `end-of-defun-function'. (ruby-beginning-of-defun): Remove "top-level" from the docstring, to reflect an earlier change that beginning/end-of-defun functions jump between methods in a class definition, as well as top-level functions.
* Spelling fixes.Paul Eggert2013-03-101-1/+1
|
* * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): OnlyDmitry Gutov2013-03-061-6/+11
| | | | | | propertize regexp when not inside a string. Fixes: debbugs:13885
* (ruby-add-log-current-method): Improve performance at the expenseDmitry Gutov2013-02-141-2/+4
| | | | | | | | | of accuracy. `ruby-block-contains-point' is relatively slow, so only use it for method and singleton class blocks. * test/automated/ruby-mode-tests.el (ruby-add-log-current-method-after-inner-class): Lower expectations: move point inside a method, initially.
* * lisp/progmodes/ruby-mode.el (ruby-parse-partial): Don't increaseDmitry Gutov2013-02-141-1/+18
| | | | | | | | | | | depth for unfinished percent literal. Not using it in the caller. (ruby-move-to-block): Jump over multiline literals of all types, ignoring code-looking contents inside them. * test/automated/ruby-mode-tests.el (ruby-move-to-block-skips-percent-literal): Add depth-affecting bits inside the examples. (ruby-move-to-block-skips-heredoc): New test.
* * lisp/progmodes/ruby-mode.el (ruby-move-to-block): ImproveDmitry Gutov2013-02-131-0/+18
| | | | | | | | | | | | | performance. Instead of recalculating indentation fully for each line, sum up indentation depth based only on visited lines. (ruby-parse-partial): Increase the depth after "do" even when END is right after it. (ruby-parse-partial): When END is in the middle of a percent literal, increase the depth if the delimiter chars belong to the paren syntax class. * test/automated/ruby-mode-tests.el (ruby-move-to-block-skips-percent-literal): New test.
* * progmodes/ruby-mode.el (ruby-move-to-block): Work with (maybeDmitry Gutov2013-01-281-3/+4
| | | | | | | | temporarily) broken indentation. * automated/ruby-mode-tests.el (ruby-block-test-example): Break indentation of the do block opener and add a line inside it. * automated/ruby-mode-tests.el (works-on-do, ok-with-three): Adjust line numbers.
* * automated/ruby-mode-tests.elDmitry Gutov2013-01-281-0/+12
| | | | (ruby-indent-spread-args-in-parens): New test.
* Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.caPaul Eggert2013-01-021-1/+1
|\
| * Update copyright notices for 2013.Paul Eggert2013-01-011-1/+1
| |
* | Merge from emacs-24; up to 2012-12-03T21:07:47Z!eggert@cs.ucla.eduGlenn Morris2012-12-271-0/+13
|\ \ | |/
| * * lisp/progmodes/ruby-mode.el (ruby-indent-beg-re): Only allow "class",Dmitry Gutov2012-12-261-0/+13
| | | | | | | | | | | | | | | | "module" and "def" to have indentation before them. Regression from 2012-09-07T04:15:56Z!dgutov@yandex.ru (see the new test). * test/automated/ruby-mode-tests.el (ruby-indent-after-block-in-continued-expression): New test.
* | * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function):Dmitry Gutov2012-12-141-39/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract `ruby-syntax-propertize-expansions'. (ruby-syntax-propertize-expansions): Only change syntax on certain string delimiters, to punctuation. This way the common functions like forward-word and thing-at-point still work. (ruby-match-expression-expansion): Improve readability. (ruby-block-contains-point): New function. (ruby-add-log-current-method): Handle several edge cases. * test/automated/ruby-mode-tests.el Rename one interpolation test; add three more. (ruby-with-temp-buffer): New macro, use it where appropriate. (ruby-add-log-current-method-examples): Use "_" for target point. Add four tests for ruby-add-log-current-method.
* | * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function):Dmitry Gutov2012-12-141-1/+21
| | | | | | | | | | | | | | | | | | | | Extract `ruby-syntax-propertize-expansions'. (ruby-syntax-propertize-expansions): Only change syntax on certain string delimiters, to punctuation. This way the common functions like forward-word and thing-at-point still work. * test/automated/ruby-mode-tests.el Rename one interpolation test; add three more.
* | Fix for bad test in ruby-mode-tests.el.Chong Yidong2012-12-021-10/+12
| | | | | | | | | | * automated/ruby-mode-tests.el (ruby-add-log-current-method-examples): Don't use loop macro, to allow automated testing to work.
* | * lisp/progmodes/ruby-mode.elDmitry Gutov2012-11-141-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (ruby-syntax-propertize-function): After everything else, search for expansions in string literals, mark their insides as whitespace syntax and save match data for font-lock. (ruby-font-lock-keywords): Highlight just the 2nd group from expression expansion matches. (ruby-match-expression-expansion): Use the match data saved to the text property in ruby-syntax-propertize-function. * test/automated/ruby-mode-tests.el Change direct font-lock face references to var references. (ruby-interpolation-suppresses-syntax-inside): New test. (ruby-interpolation-inside-percent-literal-with-paren): New failing test.
* | * lisp/progmodes/ruby-mode.el (ruby-expr-beg): Make heredoc detectionDmitry Gutov2012-11-141-1/+14
| | | | | | | | | | | | | | | | more strict. Add docstring. * test/automated/ruby-mode-tests.el (ruby-indent-singleton-class): Pass. (ruby-indent-inside-heredoc-after-operator) (ruby-indent-inside-heredoc-after-space): New tests.
* | * lisp/progmodes/ruby-mode.el (ruby-move-to-block): Looks for a blockDmitry Gutov2012-11-131-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | start/end keyword a bit harder. Works with different values of N. Add more comments. (ruby-end-of-block): Update accordingly. * test/automated/ruby-mode-tests.el (ruby-heredoc-font-lock) (ruby-singleton-class-no-heredoc-font-lock) (ruby-add-log-current-method-examples): New tests. (ruby-test-string): Extract from ruby-should-indent-buffer. (ruby-deftest-move-to-block): New macro. Add several move-to-block tests.
* | * lisp/progmodes/ruby-mode.el (ruby-add-log-current-method): Print theDmitry Gutov2012-11-131-5/+27
| | | | | | | | | | | | | | | | | | period before class method names, not after. Remove handling of one impossible case. Add comments. * test/automated/ruby-mode-tests.el (ruby-add-log-current-method-examples): New test. (ruby-test-string): Extract from ruby-should-indent-buffer.
* | * lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): NeverDmitry Gutov2012-11-131-0/+8
|/ | | | | | | font-lock the beginning of singleton class as heredoc. * test/automated/ruby-mode-tests.el (ruby-heredoc-font-lock) (ruby-singleton-class-no-heredoc-font-lock): New tests.
* * lisp/progmodes/ruby-mode.el (ruby-move-to-block): When movingDmitry Gutov2012-11-121-2/+2
| | | | | | | backward, always stop at indentation. Reverts the change from 2012-08-12T22:06:56Z!monnier@iro.umontreal.ca. Fixes: debbugs:12851
* * lisp/progmodes/ruby-mode.el (ruby-brace-to-do-end): Don't add extraDmitry Gutov2012-09-191-6/+10
| | | | | | whitespace after "end". (ruby-do-end-to-brace): Collapse block to one line if it fits within fill-column.
* * lisp/progmodes/ruby-mode.el (ruby-toggle-block): Guess the current block,Dmitry Gutov2012-09-091-10/+15
| | | | | | | | | | | | not just expect to be at its beginning. Adjust callees. Succeed when do-end block has no space before the pipe character. (ruby-brace-to-do-end): When the original block is one-liner, convert to multiline. Reindent the result. * test/automated/ruby-mode-tests.el: (ruby-toggle-block-to-multiline): New test. (ruby-should-indent-buffer, ruby-toggle-block-to-do-end) (ruby-toggle-block-to-brace): Use buffer-string.
* * lisp/progmodes/ruby-mode.el (ruby-match-expression-expansion): OnlyDmitry Gutov2012-09-081-3/+5
| | | | fail when reached LIMIT.