* lisp/emacs-lisp/pcase.el: Fix bug#46786
Revert commit a218c98615
, but in order
to avoid the spurious warnings that this commit tried to squash,
keep track of the vars used during the match so as to add
corresponding annotations to explicitly silence the spurious warnings.
To do this, we change the VARS used in `pcase-u` (and throughout
the pcase code): they used to hold elements of the form (NAME . VAL)
and now they hold elements of the form (NAME VAL . USED).
(pcase--expand): Bind all vars instead of only those found via fgrep.
(pcase-codegen): Silence "unused var" warnings for those vars that have
already been referenced during the match itself.
(pcase--funcall, pcase--eval): Record the vars that are used.
(pcase--u1): Record the vars that are used via non-linear patterns.
* lisp/textmodes/mhtml-mode.el (mhtml-forward):
* lisp/vc/diff-mode.el (diff-goto-source): Silence newly
discovered warnings.
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-bug46786): New test.
This commit is contained in:
parent
08b11a02f4
commit
0d827c7f52
4 changed files with 45 additions and 26 deletions
|
@ -2003,7 +2003,7 @@ revision of the file otherwise."
|
|||
(if event (posn-set-point (event-end event)))
|
||||
(let ((buffer (when event (current-buffer)))
|
||||
(reverse (not (save-excursion (beginning-of-line) (looking-at "[-<]")))))
|
||||
(pcase-let ((`(,buf ,line-offset ,pos ,src ,_dst ,switched)
|
||||
(pcase-let ((`(,buf ,_line-offset ,pos ,src ,_dst ,_switched)
|
||||
(diff-find-source-location other-file reverse)))
|
||||
(pop-to-buffer buf)
|
||||
(goto-char (+ (car pos) (cdr src)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue