aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2025-02-27Adapt helpful--keymaps-containing for Emacs 30+Xiyue Deng
The output of helpful--keymaps-containing changed since Emacs 30.x. This patch adapts its test for newer Emacs versions.
2024-06-13Fix scan-sexps error for C-defined variablesStrawberryTea
2023-10-07Repair helpful--display-implementations test for emacs 29.1aagon
2022-12-09Use help-key-binding as face for keystrokesNacho Barrientos
2022-09-18Preserve point when finding variables defined in an open bufferWilfred Hughes
Fixes #301
2022-05-28Check for emacs version in helpful--docstring testErik Šabič
2022-05-28Fix advised function docstring testErik Šabič
2021-12-10Use lexical-binding in tests and fix crash exposed0.19Wilfred Hughes
argdesc in byte-code function objects may be an integer rather than a list, so handle that case gracefully.
2021-12-10Fix warnings on unused vars in test suiteWilfred Hughes
2021-12-10Use well-formed interactive lambdas to silence a warningWilfred Hughes
2021-12-10Fix crash on lambdas with docstringsWilfred Hughes
Spotted when debugging #278.
2021-12-10Rewrite helpful--tree-any-p as a loopWilfred Hughes
Fixes #279
2021-03-19Prevent error in helpful-variable if sexp at point can't be readDario Gjorgjevski
How to reproduce from emacs -Q in the *scratch* buffer: 0. If needed, do `(package-initialize)` and `(require 'helpful)`. 1. Type `(something some-undefined-variable|` where | represents point. (Note that there is no closing parenthesis!) 2. Call helpful-variable. This will give you an `End of file during parsing` from `helpful--variable-defined-at-point` because the sexp at point can't be read due to the missing parenthesis. This commit suppresses the error Fix #251 Close #254
2020-10-11Fix hang on autoload functions with adviceWilfred Hughes
Fixes #179. Fixes #191.
2020-02-02Disable test that fails when we byte-compileWilfred Hughes
Fixes #225
2020-01-11Add support for CL generic methodsDamien Cassou
2020-01-01Improve link creation from Info manual referencesDaniel Martín
* helpful.el (helpful--propertize-info): Follow Emacs convention for function documentation. Consider lowercase "info" and angular quotation marks in docstrings. Default to the Emacs manual if there's no manual reference (ie. see the `blink-cursor-mode' variable). * test/helpful-unit-test.el (helpful--format-docstring--info): Add new testcases for the now covered cases.
2019-11-27Fix typosDamien Cassou
Typos found with codespell.
2019-10-01Handle byte-compiled functions bound to keysWilfred Hughes
Fixes #212
2019-08-14Ensure ? in symbols isn't needlessly escapedWilfred Hughes
2019-08-14Use "and" in summariesWilfred Hughes
For example, say "ace-window is an autoloaded, interactive and compiled function" rather than comma-separating everywhere. Also simplify button logic and add a test for "an" in descriptions.
2019-08-07Fix helpful--convert-c-name callsNick Drozd
I don't know how these got mixed up, but they did.
2019-07-24Report package/emacs version for custom variablesWilfred Hughes
Fixes #207
2019-07-11Show the original value for defcustom variablesWilfred Hughes
Fixes #199
2019-05-28Do not require shut-up packageJonas Bernoulli
2019-04-07Render keyboard maros in keymap pretty viewWilfred Hughes
Fixes #202
2019-03-16Ensure backslashes in string literals are escapedWilfred Hughes
Fixes #197
2019-03-16Don't interpret "`foo'" as a symbol referenceWilfred Hughes
This requires `foo' to be handled as part of the loop in `helpful--format-command-keys' rather than a separate function. Helps with #197
2019-03-16Don't interpret command references inside doublequoted stringsWilfred Hughes
Helps with #197
2019-03-09Fix type error for unbound symbolsNick Drozd
2019-03-03Fix docstring rendering when keymap references have their own lineWilfred Hughes
Previously, we'd render "\\<foo-map>\n" as "\n", leading to an unwanted blank line in the output. See `org-capture` (on MELPA) for an example.
2019-03-03Always autoload callables if they aren't loaded0.16Wilfred Hughes
Fixes #117
2019-02-28Handle C-style names in helpful-symbolNick Drozd
In Emacs's C core, Lisp functions and variables take on slightly different names: dashes are replaced with underscores, and functions and variables are prefixed with "F" and "V" respectively. This change allows for looking up those symbols. For example, if I am looking at the source for `purecopy': DEFUN ("purecopy", Fpurecopy, Spurecopy, 1, 1, 0, doc: /* Make a copy of object OBJ in pure storage. Recursively copies contents of vectors and cons cells. Does not copy symbols. Copies strings without text properties. */) (register Lisp_Object obj) { if (NILP (Vpurify_flag)) return obj; else if (MARKERP (obj) || OVERLAYP (obj) || SYMBOLP (obj)) /* Can't purify those. */ return obj; else return purecopy (obj); } I can run `helpful-at-point' on `Vpurify_flag'. This doesn't support running C-style names through `helpful-callable' etc, but that doesn't seem like a useful feature.
2019-02-28Remove all advice before determining source of functionCeleritasCelery
Previously, we would only remove the outermost advice. This led to `helpful--primitive-p` returning the wrong answer for primitive functions with more than one active advice. Fixes #185.
2019-02-27Better source detection for functions defined by macrosWilfred Hughes
If we can't find the location but know the buffer, try expanding forms in the buffer to see if we can find the relevant function. This is largely code from elisp-def, but it wasn't in a terribly reusable form and I've copied it.
2019-02-16Fix viewing the value of inhibit-read-onlyWilfred Hughes
Fixes #189
2019-01-13Read and display symbols with spaces correctlyWilfred Hughes
Fixes #172
2019-01-13Ensure helpful--definition-buffer-opened skips when appropriateWilfred Hughes
This test depends on what buffers are currently open in the active Emacs instance, so can fail when running the test suite whilst developing.
2019-01-08Cut repeated calls to helpful--aliasesNick Drozd
helpful--aliases is expensive, so as usual we'll call it just once at the beginning of helpful-update. This sacrifices a little elegance for a significant peformance boost. Here are before and after times running (helpful-callable #'move-beginning-of-line) 50 times on my crappy little Thinkpad: Before: Elapsed time: 61.507899s (23.391894s in 148 GCs) Elapsed time: 56.855148s (24.392109s in 133 GCs) Elapsed time: 58.082409s (25.796263s in 146 GCs) After: Elapsed time: 43.519486s (17.412847s in 95 GCs) Elapsed time: 43.171007s (17.036012s in 92 GCs) Elapsed time: 44.725709s (18.705316s in 102 GCs) So the time per call goes from a little over a second to a little under a second.
2018-12-29Define our own function/variable for unit testing obsolescence dataWilfred Hughes
This ensures the tests pass across different Emacs versions (which might have more/less verbose information).
2018-12-29Add obsolescence information.Nathan Moreau
helpful.el (helpful--obsolete-info): new function. (helpful--format-alias): obsolescence info code extracted. (helpful-update): display the obsolescence info. (helpful--format-obsolete-info): new function. Closes #152.
2018-10-27Use syntax-ppss to find the outer sexpWilfred Hughes
beginning-of-defun just uses open-paren-in-column-0-is-defun-start, which fooled functions like face-attribute where the docstring contains a open paren at the start of the line. Fixes #170
2018-10-21Fix mistake in commentWilfred Hughes
2018-10-01Fix function aliases of primitive functionsWilfred Hughes
Fixes #159
2018-09-13Add support for named keyboard macrosNick Drozd
2018-08-12Clearly separate library names from absolute pathsWilfred Hughes
We need an absolute path for opening the file, but `find-function-search-for-symbol` expects a relative path for primitive functions. Using the library name allows us to avoid `find-function-C-source`, which doesn't support Rust primitives. This should fix Remacs support. See discussion in https://github.com/Wilfred/remacs/pull/800
2018-08-12Make tests less verboseWilfred Hughes
Don't bother reporting about file decompression, and use proper ERT test skipping.
2018-08-12Rename file to avoid confusion with other projects' unit tests0.13Wilfred Hughes
2018-08-02Extract source code for advised primitivesWilfred Hughes
Resolves #141
2018-08-02Add failing helpful--primitive-p testNick Drozd
The summary given by (helpful-callable 'rename-buffer) is rename-buffer is an interactive function without a source file. Needless to say, this is not correct. The problem stems from helpful--primitive-p's inability to handle advised primitive functions.