Subject: Re: viper-tests.el fails in master

From: [email-masked] (Phillip Lord)
Date: Thu, 26 May 2016 22:38:23 +0100

Paul Eggert <[email-masked]> writes:

> Phillip, I just now merged emacs-25 into master and fixed all the merge
> conflicts that were easy, but one problem remains: viper-tests, which you
> recently introduced to emacs-25, fails in the new master. Could you please
> look into this? I don't offhand know what viper-tests is supposed to do and
> don't know how to interpret the test failures. Thanks.

They are "do this, do that" keyboard macros. Hard to explain what they
do other than "this is how viper is supposed to behave".

Anyway, I think that the tests are working -- that is, they are picking
up a real bug, caused independently by 088acab3 which was from Stefan.
I've attached a fix. Stefan, can you check I have this right?

> (Is there any way to fix the test so that it outputs ordinary text when it
> fails?)

>   #[nil "\301 \210\30!\207" [before-buffer toggle-viper-mode switch-

You mean this bit? To be honest I am not sure where that bit of trace is
coming from.

Phil

>From 76409ca9daf72b697db9c1983aa322a365bfc066 Mon Sep 17 00:00:00 2001
From: Phillip Lord <[email-masked]>
Date: Thu, 26 May 2016 22:18:32 +0100
Subject: [PATCH] Fix broken viper deactivation

* lisp/emulation/viper.el (viper--deactivate-advice-list): Destructure
  args to advice-remove.
  (viper--advice-add): Use cons not list.
Addresses bug#23625
---
 lisp/emulation/viper.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index a0bba9a..1ee1464 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -647,10 +647,14 @@ viper--advice-list
 
 (defun viper--advice-add (function where advice)
   (advice-add function where advice)
-  (push (list function advice) viper--advice-list))
+  (push (cons function advice) viper--advice-list))
 
 (defun viper--deactivate-advice-list ()
-  (mapc #'advice-remove viper--advice-list)
+  (mapc (lambda (n)
+          (advice-remove
+           (car n)
+           (cdr n)))
+        viper--advice-list)
   (setq viper--advice-list nil))
 
 (defun viper-go-away ()
-- 
2.8.3