diff options
| author | Stephen Leake | 2015-09-15 14:40:49 -0500 |
|---|---|---|
| committer | Stephen Leake | 2015-09-15 14:44:46 -0500 |
| commit | 711a8eecd5f8abb46dbe6bafe10071ec0e58d85f (patch) | |
| tree | 7b9c40b950be3fc6b03476f39dd201b12a1cd906 /test | |
| parent | b6a792bc623afacea9702f7ec3a35a56013f6c71 (diff) | |
| download | emacs-711a8eecd5f8abb46dbe6bafe10071ec0e58d85f.tar.gz emacs-711a8eecd5f8abb46dbe6bafe10071ec0e58d85f.zip | |
Fix a bug in elisp--xref-find-definitions related to cl-generic defaults
* lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions): Fix bug
with cl-generic defaults.
(elisp--xref-find-references): Add doc string.
* test/automated/elisp-mode-tests.el (xref-elisp-generic-*): Improve
tests to find bug.
Diffstat (limited to 'test')
| -rw-r--r-- | test/automated/elisp-mode-tests.el | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/test/automated/elisp-mode-tests.el b/test/automated/elisp-mode-tests.el index 7886b557141..2f6675a2804 100644 --- a/test/automated/elisp-mode-tests.el +++ b/test/automated/elisp-mode-tests.el | |||
| @@ -258,7 +258,7 @@ to (xref-elisp-test-descr-to-target xref)." | |||
| 258 | (cl-defstruct (xref-elisp-root-type) | 258 | (cl-defstruct (xref-elisp-root-type) |
| 259 | slot-1) | 259 | slot-1) |
| 260 | 260 | ||
| 261 | (cl-defgeneric xref-elisp-generic-no-methods () | 261 | (cl-defgeneric xref-elisp-generic-no-methods (arg1 arg2) |
| 262 | "doc string generic no-methods" | 262 | "doc string generic no-methods" |
| 263 | ;; No default implementation, no methods, but fboundp is true for | 263 | ;; No default implementation, no methods, but fboundp is true for |
| 264 | ;; this symbol; it calls cl-no-applicable-method | 264 | ;; this symbol; it calls cl-no-applicable-method |
| @@ -269,44 +269,44 @@ to (xref-elisp-test-descr-to-target xref)." | |||
| 269 | ;; causes the batch mode test to fail; the symbol shows up as | 269 | ;; causes the batch mode test to fail; the symbol shows up as |
| 270 | ;; ‘this’. It passes in interactive tests, so I haven't been able to | 270 | ;; ‘this’. It passes in interactive tests, so I haven't been able to |
| 271 | ;; track down the problem. | 271 | ;; track down the problem. |
| 272 | (cl-defmethod xref-elisp-generic-no-default ((this xref-elisp-root-type)) | 272 | (cl-defmethod xref-elisp-generic-no-default ((this xref-elisp-root-type) arg2) |
| 273 | "doc string generic no-default xref-elisp-root-type" | 273 | "doc string generic no-default xref-elisp-root-type" |
| 274 | "non-default for no-default") | 274 | "non-default for no-default") |
| 275 | 275 | ||
| 276 | ;; defgeneric after defmethod in file to ensure the fallback search | 276 | ;; defgeneric after defmethod in file to ensure the fallback search |
| 277 | ;; method of just looking for the function name will fail. | 277 | ;; method of just looking for the function name will fail. |
| 278 | (cl-defgeneric xref-elisp-generic-no-default () | 278 | (cl-defgeneric xref-elisp-generic-no-default (arg1 arg2) |
| 279 | "doc string generic no-default generic" | 279 | "doc string generic no-default generic" |
| 280 | ;; No default implementation; this function calls the cl-generic | 280 | ;; No default implementation; this function calls the cl-generic |
| 281 | ;; dispatching code. | 281 | ;; dispatching code. |
| 282 | ) | 282 | ) |
| 283 | 283 | ||
| 284 | (cl-defgeneric xref-elisp-generic-co-located-default () | 284 | (cl-defgeneric xref-elisp-generic-co-located-default (arg1 arg2) |
| 285 | "doc string generic co-located-default" | 285 | "doc string generic co-located-default" |
| 286 | "co-located default") | 286 | "co-located default") |
| 287 | 287 | ||
| 288 | (cl-defmethod xref-elisp-generic-co-located-default ((this xref-elisp-root-type)) | 288 | (cl-defmethod xref-elisp-generic-co-located-default ((this xref-elisp-root-type) arg2) |
| 289 | "doc string generic co-located-default xref-elisp-root-type" | 289 | "doc string generic co-located-default xref-elisp-root-type" |
| 290 | "non-default for co-located-default") | 290 | "non-default for co-located-default") |
| 291 | 291 | ||
| 292 | (cl-defgeneric xref-elisp-generic-separate-default () | 292 | (cl-defgeneric xref-elisp-generic-separate-default (arg1 arg2) |
| 293 | "doc string generic separate-default" | 293 | "doc string generic separate-default" |
| 294 | ;; default implementation provided separately | 294 | ;; default implementation provided separately |
| 295 | ) | 295 | ) |
| 296 | 296 | ||
| 297 | (cl-defmethod xref-elisp-generic-separate-default () | 297 | (cl-defmethod xref-elisp-generic-separate-default (arg1 arg2) |
| 298 | "doc string generic separate-default default" | 298 | "doc string generic separate-default default" |
| 299 | "separate default") | 299 | "separate default") |
| 300 | 300 | ||
| 301 | (cl-defmethod xref-elisp-generic-separate-default ((this xref-elisp-root-type)) | 301 | (cl-defmethod xref-elisp-generic-separate-default ((this xref-elisp-root-type) arg2) |
| 302 | "doc string generic separate-default xref-elisp-root-type" | 302 | "doc string generic separate-default xref-elisp-root-type" |
| 303 | "non-default for separate-default") | 303 | "non-default for separate-default") |
| 304 | 304 | ||
| 305 | (cl-defmethod xref-elisp-generic-implicit-generic () | 305 | (cl-defmethod xref-elisp-generic-implicit-generic (arg1 arg2) |
| 306 | "doc string generic implicit-generic default" | 306 | "doc string generic implicit-generic default" |
| 307 | "default for implicit generic") | 307 | "default for implicit generic") |
| 308 | 308 | ||
| 309 | (cl-defmethod xref-elisp-generic-implicit-generic ((this xref-elisp-root-type)) | 309 | (cl-defmethod xref-elisp-generic-implicit-generic ((this xref-elisp-root-type) arg2) |
| 310 | "doc string generic implicit-generic xref-elisp-root-type" | 310 | "doc string generic implicit-generic xref-elisp-root-type" |
| 311 | "non-default for implicit generic") | 311 | "non-default for implicit generic") |
| 312 | 312 | ||
| @@ -327,9 +327,9 @@ to (xref-elisp-test-descr-to-target xref)." | |||
| 327 | (xref-make-elisp-location | 327 | (xref-make-elisp-location |
| 328 | 'xref-elisp-generic-no-default 'cl-defgeneric | 328 | 'xref-elisp-generic-no-default 'cl-defgeneric |
| 329 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) | 329 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) |
| 330 | (xref-make "(cl-defmethod xref-elisp-generic-no-default ((this xref-elisp-root-type)))" | 330 | (xref-make "(cl-defmethod xref-elisp-generic-no-default ((this xref-elisp-root-type) arg2))" |
| 331 | (xref-make-elisp-location | 331 | (xref-make-elisp-location |
| 332 | '(xref-elisp-generic-no-default xref-elisp-root-type) 'cl-defmethod | 332 | '(xref-elisp-generic-no-default xref-elisp-root-type t) 'cl-defmethod |
| 333 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) | 333 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) |
| 334 | )) | 334 | )) |
| 335 | 335 | ||
| @@ -340,9 +340,9 @@ to (xref-elisp-test-descr-to-target xref)." | |||
| 340 | (xref-make-elisp-location | 340 | (xref-make-elisp-location |
| 341 | 'xref-elisp-generic-co-located-default 'cl-defgeneric | 341 | 'xref-elisp-generic-co-located-default 'cl-defgeneric |
| 342 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) | 342 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) |
| 343 | (xref-make "(cl-defmethod xref-elisp-generic-co-located-default ((this xref-elisp-root-type)))" | 343 | (xref-make "(cl-defmethod xref-elisp-generic-co-located-default ((this xref-elisp-root-type) arg2))" |
| 344 | (xref-make-elisp-location | 344 | (xref-make-elisp-location |
| 345 | '(xref-elisp-generic-co-located-default xref-elisp-root-type) 'cl-defmethod | 345 | '(xref-elisp-generic-co-located-default xref-elisp-root-type t) 'cl-defmethod |
| 346 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) | 346 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) |
| 347 | )) | 347 | )) |
| 348 | 348 | ||
| @@ -353,26 +353,26 @@ to (xref-elisp-test-descr-to-target xref)." | |||
| 353 | (xref-make-elisp-location | 353 | (xref-make-elisp-location |
| 354 | 'xref-elisp-generic-separate-default 'cl-defgeneric | 354 | 'xref-elisp-generic-separate-default 'cl-defgeneric |
| 355 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) | 355 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) |
| 356 | (xref-make "(cl-defmethod xref-elisp-generic-separate-default ())" | 356 | (xref-make "(cl-defmethod xref-elisp-generic-separate-default (arg1 arg2))" |
| 357 | (xref-make-elisp-location | 357 | (xref-make-elisp-location |
| 358 | '(xref-elisp-generic-separate-default) 'cl-defmethod | 358 | '(xref-elisp-generic-separate-default t t) 'cl-defmethod |
| 359 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) | 359 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) |
| 360 | (xref-make "(cl-defmethod xref-elisp-generic-separate-default ((this xref-elisp-root-type)))" | 360 | (xref-make "(cl-defmethod xref-elisp-generic-separate-default ((this xref-elisp-root-type) arg2))" |
| 361 | (xref-make-elisp-location | 361 | (xref-make-elisp-location |
| 362 | '(xref-elisp-generic-separate-default xref-elisp-root-type) 'cl-defmethod | 362 | '(xref-elisp-generic-separate-default xref-elisp-root-type t) 'cl-defmethod |
| 363 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) | 363 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) |
| 364 | )) | 364 | )) |
| 365 | 365 | ||
| 366 | (xref-elisp-deftest find-defs-defgeneric-implicit-generic | 366 | (xref-elisp-deftest find-defs-defgeneric-implicit-generic |
| 367 | (elisp--xref-find-definitions 'xref-elisp-generic-implicit-generic) | 367 | (elisp--xref-find-definitions 'xref-elisp-generic-implicit-generic) |
| 368 | (list | 368 | (list |
| 369 | (xref-make "(cl-defmethod xref-elisp-generic-implicit-generic ())" | 369 | (xref-make "(cl-defmethod xref-elisp-generic-implicit-generic (arg1 arg2))" |
| 370 | (xref-make-elisp-location | 370 | (xref-make-elisp-location |
| 371 | '(xref-elisp-generic-implicit-generic) 'cl-defmethod | 371 | '(xref-elisp-generic-implicit-generic t t) 'cl-defmethod |
| 372 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) | 372 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) |
| 373 | (xref-make "(cl-defmethod xref-elisp-generic-implicit-generic ((this xref-elisp-root-type)))" | 373 | (xref-make "(cl-defmethod xref-elisp-generic-implicit-generic ((this xref-elisp-root-type) arg2))" |
| 374 | (xref-make-elisp-location | 374 | (xref-make-elisp-location |
| 375 | '(xref-elisp-generic-implicit-generic xref-elisp-root-type) 'cl-defmethod | 375 | '(xref-elisp-generic-implicit-generic xref-elisp-root-type t) 'cl-defmethod |
| 376 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) | 376 | (expand-file-name "elisp-mode-tests.el" emacs-test-dir))) |
| 377 | )) | 377 | )) |
| 378 | 378 | ||