diff options
| author | John Wiegley | 2017-12-04 15:21:41 -0800 |
|---|---|---|
| committer | John Wiegley | 2017-12-04 15:21:41 -0800 |
| commit | 6470eaf3d53d2596a7cc7bbe43ec7a47f6ea70ed (patch) | |
| tree | 8acd5dcf3efb3482206715f48b2e3316692f49f7 /test | |
| parent | a2ddc1806552e1df9ff56a9d21917b91c83d3376 (diff) | |
| download | emacs-6470eaf3d53d2596a7cc7bbe43ec7a47f6ea70ed.tar.gz emacs-6470eaf3d53d2596a7cc7bbe43ec7a47f6ea70ed.zip | |
Fix an argument process problem with bind-key
Fixes https://github.com/jwiegley/use-package/issues/334
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/use-package/use-package-tests.el | 77 |
1 files changed, 76 insertions, 1 deletions
diff --git a/test/lisp/use-package/use-package-tests.el b/test/lisp/use-package/use-package-tests.el index ef6c52c583e..80bbb728675 100644 --- a/test/lisp/use-package/use-package-tests.el +++ b/test/lisp/use-package/use-package-tests.el | |||
| @@ -77,7 +77,7 @@ | |||
| 77 | (unless (looking-at "(match-expansion") | 77 | (unless (looking-at "(match-expansion") |
| 78 | (backward-up-list)) | 78 | (backward-up-list)) |
| 79 | (when (looking-at "(match-expansion") | 79 | (when (looking-at "(match-expansion") |
| 80 | (search-forward "(use-package") | 80 | (re-search-forward "(\\(use-package\\|bind-key\\)") |
| 81 | (goto-char (match-beginning 0)) | 81 | (goto-char (match-beginning 0)) |
| 82 | (let ((decl (read (current-buffer)))) | 82 | (let ((decl (read (current-buffer)))) |
| 83 | (kill-sexp) | 83 | (kill-sexp) |
| @@ -1356,6 +1356,81 @@ | |||
| 1356 | (if (fboundp 'delight) | 1356 | (if (fboundp 'delight) |
| 1357 | (delight '((foo "bar" foo))))))) | 1357 | (delight '((foo "bar" foo))))))) |
| 1358 | 1358 | ||
| 1359 | (ert-deftest use-package-test/334-1 () | ||
| 1360 | (let (foo1-map foo2-map | ||
| 1361 | bar1-func1 | ||
| 1362 | bar1-func2 | ||
| 1363 | bar2-func1 | ||
| 1364 | bar2-func2 | ||
| 1365 | bar3-func1 | ||
| 1366 | bar3-func2 | ||
| 1367 | bar4-func1 | ||
| 1368 | bar4-func2) | ||
| 1369 | (match-expansion | ||
| 1370 | (bind-keys :map foo1-map | ||
| 1371 | ("Y" . foo1) | ||
| 1372 | :prefix "y" | ||
| 1373 | :prefix-map bar1-prefix-map | ||
| 1374 | ("y" . bar1-func1) | ||
| 1375 | ("f" . bar1-func2) | ||
| 1376 | :prefix "y" | ||
| 1377 | :prefix-map bar2-prefix-map | ||
| 1378 | ("y" . bar2-func1) | ||
| 1379 | ("f" . bar2-func2) | ||
| 1380 | :map foo2-map | ||
| 1381 | ("Y" . foo2) | ||
| 1382 | :prefix "y" | ||
| 1383 | :prefix-map bar3-prefix-map | ||
| 1384 | ("y" . bar3-func1) | ||
| 1385 | ("f" . bar3-func2) | ||
| 1386 | :prefix "y" | ||
| 1387 | :prefix-map bar4-prefix-map | ||
| 1388 | ("y" . bar4-func1) | ||
| 1389 | ("f" . bar4-func2)) | ||
| 1390 | `(progn | ||
| 1391 | (bind-key "Y" #'foo1 foo1-map nil) | ||
| 1392 | (defvar bar1-prefix-map) | ||
| 1393 | (define-prefix-command 'bar1-prefix-map) | ||
| 1394 | (bind-key "y" 'bar1-prefix-map foo1-map nil) | ||
| 1395 | (bind-key "y" #'bar1-func1 bar1-prefix-map nil) | ||
| 1396 | (bind-key "f" #'bar1-func2 bar1-prefix-map nil) | ||
| 1397 | (defvar bar2-prefix-map) | ||
| 1398 | (define-prefix-command 'bar2-prefix-map) | ||
| 1399 | (bind-key "y" 'bar2-prefix-map foo1-map nil) | ||
| 1400 | (bind-key "y" #'bar2-func1 bar2-prefix-map nil) | ||
| 1401 | (bind-key "f" #'bar2-func2 bar2-prefix-map nil) | ||
| 1402 | (bind-key "Y" #'foo2 foo2-map nil) | ||
| 1403 | (defvar bar3-prefix-map) | ||
| 1404 | (define-prefix-command 'bar3-prefix-map) | ||
| 1405 | (bind-key "y" 'bar3-prefix-map foo2-map nil) | ||
| 1406 | (bind-key "y" #'bar3-func1 bar3-prefix-map nil) | ||
| 1407 | (bind-key "f" #'bar3-func2 bar3-prefix-map nil) | ||
| 1408 | (defvar bar4-prefix-map) | ||
| 1409 | (define-prefix-command 'bar4-prefix-map) | ||
| 1410 | (bind-key "y" 'bar4-prefix-map foo2-map nil) | ||
| 1411 | (bind-key "y" #'bar4-func1 bar4-prefix-map nil) | ||
| 1412 | (bind-key "f" #'bar4-func2 bar4-prefix-map nil))))) | ||
| 1413 | |||
| 1414 | (ert-deftest use-package-test/334-2 () | ||
| 1415 | (let (w3m-lnum-mode-map | ||
| 1416 | w3m-print-current-url | ||
| 1417 | w3m-lnum-print-this-url | ||
| 1418 | w3m-print-this-url) | ||
| 1419 | (match-expansion | ||
| 1420 | (bind-keys :map w3m-lnum-mode-map | ||
| 1421 | :prefix "y" | ||
| 1422 | :prefix-map w3m-y-prefix-map | ||
| 1423 | ("y" . w3m-print-current-url) | ||
| 1424 | ("f" . w3m-lnum-print-this-url) | ||
| 1425 | ("t" . w3m-print-this-url)) | ||
| 1426 | `(progn | ||
| 1427 | (defvar w3m-y-prefix-map) | ||
| 1428 | (define-prefix-command 'w3m-y-prefix-map) | ||
| 1429 | (bind-key "y" 'w3m-y-prefix-map w3m-lnum-mode-map nil) | ||
| 1430 | (bind-key "y" #'w3m-print-current-url w3m-y-prefix-map nil) | ||
| 1431 | (bind-key "f" #'w3m-lnum-print-this-url w3m-y-prefix-map nil) | ||
| 1432 | (bind-key "t" #'w3m-print-this-url w3m-y-prefix-map nil))))) | ||
| 1433 | |||
| 1359 | (ert-deftest use-package-test/506 () | 1434 | (ert-deftest use-package-test/506 () |
| 1360 | (match-expansion | 1435 | (match-expansion |
| 1361 | (use-package ess-site | 1436 | (use-package ess-site |