summaryrefslogtreecommitdiff
path: root/test/lisp/progmodes
Commit message (Collapse)AuthorAgeFilesLines
* ; cperl-mode.el: Fix border cases of inserting with elispHarald Jörg2021-08-301-6/+52
| | | | | | | | | | | | | * lisp/progmodes/cperl-mode.el (cperl-unwind-to-safe): Replace (and extend) inline comment by a docstring. Handle edge cases when inserting text with elisp (related to Bug#28962). (cperl-process-here-doc): Add syntax-type `here-doc-start'. (cperl-find-pods-heres): Make sure that the results of this function are immediately visible. * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-14343): Add test cases for "empty" here-documents and inserting at the edges of a here-document.
* (cperl-test-bug-14343): Make it work for perl-modeStefan Monnier2021-08-301-7/+7
| | | | | | | * test/lisp/progmodes/cperl-mode-tests.el (cperl--tests-heredoc-face): New const. (cperl-test-heredocs, cperl-test-bug-14343): Use it. (cperl-test-identify-no-heredoc): Remove left-over message.
* * test/lisp/progmodes/cperl-mode-tests.el: Adjust here-doc tests for perl-modeStefan Monnier2021-08-301-31/+26
| | | | | (cperl-test-identify-heredoc, cperl-test-identify-no-heredoc): Tweak tests so they can also be used for perl-mode.
* Tweak sh-script-mode indentation furtherKévin Le Gouguec2021-08-291-1/+12
| | | | | * lisp/progmodes/sh-script.el (sh-smie--default-backward-token): Allow more parentheses in a token (bug#44592).
* Fix shell-script-mode indentation of continuation linesDario Gjorgjevski2021-08-271-0/+40
| | | | | * lisp/progmodes/sh-script.el (sh-smie--default-backward-token): Fix indentation of continuation lines (bug#44592).
* Fix recently added cperl testGlenn Morris2021-08-231-2/+2
| | | | | * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-here-doc-missing-end): Fix quote regexp.
* ; cperl-mode: bugfix / rework fontification of here-docsHarald Jörg2021-08-231-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/cperl-mode.el (cperl-mode): Use `cperl-font-lock-syntactic-face-function'. (cperl-commentify): Add a docstring, eliminate unused formal parameter `noface'. (cperl-is-here-doc-p): New function to detect whether "<<" starts a here-document, factored out from `cperl-find-pods-heres'. (cperl-here-doc-functions): New variable: List of functions which allow here-documents as parameters, for use in `cperl-is-here-doc-p'. (cperl-process-here-doc): New function, factored out from `cperl-find-pods-heres'. Fixed to keep correct fontification after non-interactive (elisp) changes (Bug#14343, Bug#28962). (cperl-find-pods-heres): Extend the doc-string to describe all parameters. Don't remove text properties in recursive calls on the same line. Call `cperl-process-here-doc' when appropriate. (cperl-font-lock-syntactic-face-function): New function to highlight c-style comments as here-documents (adapted from perl-mode.el). * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-identify-heredoc): New test for the new function `cperl-is-here-doc-p'. (cperl-test-identify-no-heredoc): New test for the new function `cperl-is-here-doc-p', testing constructs which start with "<<" but are no here-documents. (cperl-test-here-doc-missing-end): New test to verify correct detection of a missing here-document delimiter. (cperl-test-bug-14343): New test to verify that inserting text into a here-document with elisp does not break fontification.
* ruby-mode imenu: Support methods with modifiersDmitry Gutov2021-08-171-0/+22
| | | | | | * lisp/progmodes/ruby-mode.el (ruby-imenu-create-index-in-block): Support methods with modifiers (visibility or otherwise) (bug#50079).
* perl-mode: fix variable fontificationTomasz Konojacki2021-08-071-0/+7
| | | | | | | * lisp/progmodes/perl-mode.el: Handle variables first to avoid conflicting with keywords. This fixes cases like "$package" (bug#49906). Copyright-paperwork-exempt: yes
* Off-by-one error in compilation rule end-column function (bug#49624)Mattias Engdegård2021-07-231-0/+27
| | | | | | | | * lisp/progmodes/compile.el (compilation-error-properties): When the end-column parameter of a compilation message rule (in compilation-error-regexp-alist[-alist]) is a function, treat its return value as if it were matched by the regexp, which is how it is documented to work, and how all other parameters work.
* ; * test/lisp/progmodes/compile-tests.el: simplify end-colMattias Engdegård2021-07-181-10/+10
| | | | | | The internal representation of columns uses half-open intervals but don't expose that in the test cases, where we want to use the same numbers as in the compilation messages.
* ; perl-mode.el: Allow newline between quote-likes and delimiterHarald Jörg2021-06-112-0/+25
| | | | | | | | | | | | * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function): Allow newline between a quote-like operator and its delimiter (Bug#22355). * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-22355): Test case for the fix. * test/lisp/progmodes/cperl-mode-resources/cperl-bug-22355.pl: Test resource for a quote-like with newline before the delimiter.
* ; perl-mode.el: Detect quote-like operator immediately after =>Harald Jörg2021-06-092-0/+39
| | | | | | | | | | | | * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function): Detect a quotelike operator immediately after a fat comma "=>" (Bug#25098) * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-25098): Test case for the bug with code from the bug report. * test/lisp/progmodes/cperl-mode-resources/cperl-bug-25098.pl: Resource file for the test.
* ; perl-mode.el: Detect regexes immediately after "|&"Harald Jörg2021-06-082-5/+35
| | | | | | | | | | | | | | * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function): Add "|&" to the list of characters after which a slash starts a regular expression (Bug#23992). * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-ppss): Correct the docstring. (cperl-test-bug-23992): New test for Bug#23992. (cperl-test-bug-42168): Adapt inline comments to the current code. * test/lisp/progmodes/cperl-mode-resources/cperl-bug-23992.pl: Resource file with example code from the bug report.
* Support old BSD find and "root dir symlink" betterDmitry Gutov2021-06-071-24/+16
| | | | | | | | | | | | | | * lisp/progmodes/grep.el (grep-compute-defaults): Add '-H' to grep-find-template (bug#48471). * lisp/cedet/semantic/symref/grep.el (semantic-symref-perform-search): Pass the root directory name without the trailing slash. * lisp/progmodes/xref.el (xref-matches-in-directory): Ditto. * test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-abs) (xref--xref-file-name-display-is-relative-to-project-root): Make tests more strict again.
* Tweak octave continuation indentationLars Ingebrigtsen2021-05-301-0/+49
| | | | | * lisp/progmodes/octave.el (octave-smie-rules): Further tweak continuation indentation (bug#17955).
* Fix filling of overlong first lines in Python doc stringsDeneb Meketa2021-05-271-0/+24
| | | | | | | * lisp/progmodes/python.el (python-fill-string): Fill overlong first lines correctly (bug#20860). Copyright-paperwork-exempt: yes
* Add a unit test to reproduce Bug#48471.Philipp Stephani2021-05-171-0/+25
| | | | | | * test/lisp/progmodes/project-tests.el (project-tests--trivial) (project-root, project-ignores): New test project type. (project-ignores): New unit test.
* Abbreviate rgrep command on MS Windows (bug#48302)Jim Porter2021-05-121-0/+69
| | | | | | | * lisp/progmodes/grep.el (grep-mode-font-lock-keywords): Adapt regexp to match MS Windows-style shell-quoting. * test/lisp/progmodes/grep-tests.el: New file.
* cperl-mode: Eliminate bad interpretation of ?foo?Harald Jörg2021-05-061-0/+27
| | | | | | | | | | * lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Delete ?? from the allowed bare regexp delimiters. (cperl-short-docs): Delete ?...? from the documentation. * test/lisp/progmodes/cperl-mode-tests.el (cperl-bug-47598): Add tests for good, bad, and ambiguous use of ? as regex delimiter (bug#47598).
* Add testsPeter Oliver2021-04-281-0/+31
| | | | | | * test/lisp/progmodes/ruby-mode-tests.el (ruby-with-temp-file): New helper. (ruby--set-encoding-when-ascii, ruby--set-encoding-when-utf8) (ruby--set-encoding-when-latin-15): Tests for the previous commit (bug#48043).
* cperl-mode: Avoid abbrev expansion in variable namesHarald Jörg2021-04-201-0/+29
| | | | | | | | * lisp/progmodes/cperl-mode.el (cperl-electric-else): Don't expand scalar variables like '$continue' as keywords. (Bug#47902) * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-hyperactive-electric-else): Verify that keywords are expanded but variable names aren't.
* ; Normalize and add missing first and last linesStefan Kangas2021-04-192-2/+2
|
* ; * test/lisp/progmodes/xref-tests.el: Add footer.Philipp Stephani2021-04-181-0/+2
|
* Factor out a helper macro to create a temporary directory.Philipp Stephani2021-04-181-34/+44
| | | | | | | | | This is a useful abstraction, and saves a few levels of indentation in the test body. * test/lisp/progmodes/project-tests.el (project-tests--with-temporary-directory): New helper macro. (project/quoted-directory): Use it.
* Add quoted filename support to 'project-find-regexp' (Bug#47799).Philipp Stephani2021-04-181-4/+27
| | | | | | | | | | This is only a band-aid; it would be better to fix xref.el to work with quoted filenames as well. * lisp/progmodes/project.el (project--find-regexp-in-files): Unquote filenames before passing them to 'xref-matches-in-files'. * test/lisp/progmodes/project-tests.el (project/quoted-directory): Also test 'project-find-regexp'.
* Extend project test so that 'project-current' works.Philipp Stephani2021-04-181-1/+8
| | | | | * test/lisp/progmodes/project-tests.el (project/quoted-directory): Verify that 'project-current' returns the right project.
* Skip a unit test that requires an external program if necessary.Philipp Stephani2021-04-181-0/+1
| | | | | | * test/lisp/progmodes/project-tests.el (project/quoted-directory): Skip if the 'find' program isn't available. The 'project-files' function uses 'find' to obtain the list of project files.
* Improve project support for quoted directory names (Bug#47799)Philipp Stephani2021-04-151-0/+44
| | | | | | | | | * lisp/progmodes/project.el (project--files-in-directory): Unquote directory name before passing it to 'find'. (project--remote-file-names): Requote local filenames if the original directory is quoted. * test/lisp/progmodes/project-tests.el (project/quoted-directory): New unit test.
* Remove redundant #' before lambda in testsStefan Kangas2021-04-041-1/+1
| | | | | | | | | | | | | | * test/lisp/electric-tests.el (save-electric-modes) (inhibit-in-mismatched-string-inside-ruby-comments) (inhibit-in-mismatched-string-inside-c-comments, js-mode-braces) (js-mode-braces-with-layout) (js-mode-braces-with-layout-and-indent, autowrapping-1) (autowrapping-2, autowrapping-3, autowrapping-4, autowrapping-5) (autowrapping-6, autowrapping-7): * test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-relative-to-project-root): * test/src/thread-tests.el (threads-signal-early) (threads-signal-main-thread): Remove redundant #' before lambda.
* ; Remove spurious comment in last commitStefan Kangas2021-04-011-3/+0
|
* Use lexical-binding in executable.el and add testsStefan Kangas2021-04-011-0/+54
| | | | | * lisp/progmodes/executable.el: Use lexical-binding. * test/lisp/progmodes/executable-tests.el: New file.
* perl-mode: Fix regexps for fontificationHarald Jörg2021-03-241-0/+19
| | | | | | | | | | * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-fontify-declarations): New test to ensure consistency between perl-mode.el and cperl-mode.el (bug#47345). * lisp/progmodes/perl-mode.el (perl-font-lock-keywords-1): pick correct capture groups for "use Pack::Age;" Fontify all components of "Pack::Age", not just "Pack" (perl-font-lock-keywords-2): Use keyword-face for declarators
* * test/lisp/progmodes/cperl-mode-tests.el: Silence warningsStefan Monnier2021-03-181-3/+6
| | | | (cperl-test-bug-47112): Actually obey the major-mode for the test.
* cperl-mode: Don't interpret y_ as start of y// function.Harald Jörg2021-03-181-0/+26
| | | | | | | | * lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Avoid treating underscores as word-terminators. * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-47112): Test case for that bug (bug#47112).
* Speed up xref rendering for matches on very long linesDmitry Gutov2021-03-083-4/+14
| | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/xref.el (xref--insert-xrefs): Cut up the current line into pieces here for multiple matches's summaries, so that xref--insert-xrefs can do less work (bug#46859). (xref--insert-xrefs): Do less work. (xref--outdated-p): Update accordingly to how the summary creation logic changed. (xref--buf-pairs-iterator): Update to the new calling convention. (xref-location-column): Effectively rename back to xref-file-location-column since the generic version is now unused. * test/lisp/progmodes/xref-tests.el (xref-matches-in-directory-finds-two-matches-on-the-same-line) (xref-matches-in-directory-finds-an-empty-line-regexp-match): Adjust to the xref-location-column change. (xref-matches-in-files-trims-summary-for-matches-on-same-line): New test. * test/lisp/progmodes/xref-resources/file1.txt: Change contents slightly to test the new xref--outdated-p code.
* Xref test improvementsDmitry Gutov2021-03-081-12/+21
| | | | | | | | * test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-abs): Fix not to rely on the default value. (xref-matches-in-files-includes-matches-from-all-the-files): New test.
* ; * test/lisp/progmodes/f90-tests.el: Remove stale comment.Stefan Kangas2021-02-261-3/+0
|
* Make unused `Buffer-menu-sort' alias obsoleteLars Ingebrigtsen2021-02-171-8/+11
| | | | | | | * lisp/buff-menu.el (Buffer-menu-sort): Make unused alias obsolete. * test/lisp/progmodes/elisp-mode-tests.el (find-defs-defalias-defun-el): Adjust test to use an alias that's not obsolete.
* cperl-mode: Improve detection of index entries for imenuHarald Jörg2021-02-172-0/+253
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/cperl-mode.el (cperl-imenu-addback): Customization variable deleted. This variable has been declared obsolete in 1998. (cperl--basic-identifier-regexp) and many other variables: defining regular expressions for basic Perl constructs. (cperl-imenu--create-perl-index): This function has been completely rewritten, keeping only some parts of the output formatting. It now recognizes a lot more package and subroutine declarations which came since Perl 5.14: Packages with a version and/or a block attached, lexical subroutines, declarations with a newline between the keyword "package" and the package name, and several more. This version also correctly separates subroutine names from attributes, does no longer support "unnamed" packages (which don't exist in Perl), and doesn't fall for false positives like stuff that looks like a declaration in a multiline string. (cperl-tags-hier-init): Eliminate call to `cperl-imenu-addback` (which actually was commented out in 1997) * test/lisp/progmodes/cperl-mode-tests.el (cperl-test--validate-regexp) and six other new tests for the new regular expressions and the index creation. * test/lisp/progmodes/cperl-mode-resources/grammar.pl: New file showcasing different syntax variations for package and sub declarations (bug#46574).
* Fix tcl-mode indentation of namespaced codeAnticrisis2021-02-081-1/+0
| | | | | | | | | * lisp/progmodes/tcl.el (tcl-calculate-indent): Fix indentation when using namespaces (bug#44834). (tcl-beginning-of-defun-function): Remove. This partially reverts cd5bb4bf3dbad8941d25823f398b595b8f0edbb9. Copyright-paperwork-exempt: yes
* ruby-syntax-propertize: Fix certain cases following ::Dmitry Gutov2021-02-021-1/+1
| | | | | | * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize): Make sure to backtrack if the "symbols with special characters" rule is aborted because of preceding colon.
* Fix fill-paragraph in asm-modeMattias M2021-01-281-0/+10
| | | | | | | | | | | * lisp/progmodes/asm-mode.el: The value of fill-prefix ought to be nil not "\t" so that fill-context-prefix can do its thing. In fact, fill-prefix does not have to be set at all becuase asm-mode derives from prog-mode and fill-prefix is set in simple.el. * test/lisp/progmodes/asm-mode-tests.el: Add relevant test (bug#41064). Copyright-paperwork-exempt: yes
* Fontify special forms and macros the sameLars Ingebrigtsen2021-01-251-1/+0
| | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp--el-match-keyword): Handle special forms and macros the same way (bug#43265). This makes things like (setq a '(if a b)) be fontified correctly (i.e., not fontified as a keyword).
* Fix macro fontification in `condition-case' handler bodiesLars Ingebrigtsen2021-01-241-1/+0
| | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp--el-non-funcall-position-p): Fontify macros in the BODY of HANDLERS in `condition-case' correctly (bug#43265).
* Tweak `condition-case' keyword highlightsLars Ingebrigtsen2021-01-241-1/+8
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp--el-non-funcall-position-p): Tweak `condition-case' position check to skip the VAR form.
* Add some elisp-mode font lock testsLars Ingebrigtsen2021-01-241-0/+51
|
* Fix two testsEli Zaretskii2021-01-161-1/+13
| | | | | | | | | | * test/lisp/progmodes/elisp-mode-tests.el (xref-elisp-test-run): Make sure file names can be compared as strings, by running them through 'file-truename'. Reported by Vin Shelton <acs@alumni.princeton.edu>. * test/lisp/emacs-lisp/bytecomp-tests.el ("warn-obsolete-hook.el") ("warn-obsolete-variable.el"): Use [^z-a] to match a newline as well. Reported by Vin Shelton <acs@alumni.princeton.edu>.
* Add a failing test for bug#44834Anticrisis2021-01-111-2/+12
| | | | | | | | | | * test/lisp/progmodes/tcl-tests.el (tcl-mode-namespace-indent-2): New, failing test (bug#44834). (tcl-mode-function-name-2): (tcl-mode-function-name-3): Fix names of the tests so that they're actually run. Copyright-paperwork-exempt: yes
* Fix some failing tests in BSD systemsDaniel Martín2021-01-061-14/+24
| | | | | | | | * test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-abs) (xref--xref-file-name-display-is-relative-to-project-root): Accommodate some older versions of BSD find (https://lists.gnu.org/archive/html/emacs-devel/2021-01/msg00156.html).