GNU bug report logs - #19566
(unload-feature 'misearch) breaks isearch

Previous Next

Package: emacs;

Reported by: Ivan Shmakov <ivan <at> siamics.net>

Date: Sun, 11 Jan 2015 11:39:02 UTC

Severity: minor

Tags: patch

Fixed in version 25.1

Done: Ivan Shmakov <ivan <at> siamics.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19566 in the body.
You can then email your comments to 19566 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19566; Package emacs. (Sun, 11 Jan 2015 11:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ivan Shmakov <ivan <at> siamics.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 11 Jan 2015 11:39:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ivan Shmakov <ivan <at> siamics.net>
To: submit <at> debbugs.gnu.org
Subject: (unload-feature 'misearch) breaks isearch 
Date: Sun, 11 Jan 2015 11:37:57 +0000
[Message part 1 (text/plain, inline)]
Package:  emacs
Severity: minor
Tags: patch

	Using unload-feature to unload misearch.el also undefines the
	autoloaded variables, which breaks isearch.el as it still uses
	them.

	Please thus consider the patch MIMEd.

	* lisp/misearch.el (multi-isearch-unload-function): New function
	to retain definitions of autoloaded variables when unloading.
	(misearch-unload-function): New alias.

-- 
FSF associate member #7257  np. The Middle Path — David Modica B6A0 230E 334A
[Message part 2 (text/diff, inline)]
--- a/lisp/misearch.el
+++ b/lisp/misearch.el
@@ -377,6 +377,25 @@
     (goto-char (if isearch-forward (point-min) (point-max)))
     (isearch-forward-regexp nil t)))
 
+(defun multi-isearch-unload-function ()
+  "Remove autoloaded variables from `unload-function-defs-list'.
+Also prevent the feature from being reloaded via `isearch-mode-hook'."
+  (remove-hook 'isearch-mode-hook 'multi-isearch-setup)
+  (let ((defs (list (car unload-function-defs-list)))
+	(auto '(multi-isearch-next-buffer-function
+		multi-isearch-next-buffer-current-function
+		multi-isearch-current-buffer
+		multi-isearch-buffer-list multi-isearch-file-list)))
+    (dolist (def (cdr unload-function-defs-list))
+      (unless (and (symbolp def)
+		   (memq def auto))
+	(push def defs)))
+    (setq unload-function-defs-list (nreverse defs))
+    ;; .
+    nil))
+
+(defalias 'misearch-unload-function 'multi-isearch-unload-function)
+
 
 (provide 'multi-isearch)
 (provide 'misearch)

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19566; Package emacs. (Sun, 11 Jan 2015 21:03:03 GMT) Full text and rfc822 format available.

Message #8 received at 19566 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Ivan Shmakov <ivan <at> siamics.net>
Cc: 19566 <at> debbugs.gnu.org
Subject: Re: bug#19566: (unload-feature 'misearch) breaks isearch
Date: Sun, 11 Jan 2015 22:44:15 +0200
> 	Using unload-feature to unload misearch.el also undefines the
> 	autoloaded variables, which breaks isearch.el as it still uses
> 	them.
>
> 	Please thus consider the patch MIMEd.
>
> 	* lisp/misearch.el (multi-isearch-unload-function): New function
> 	to retain definitions of autoloaded variables when unloading.
> 	(misearch-unload-function): New alias.

Even though I see no way to reproduce the test case which breaks isearch.el
(after unloading, isearch.el just re-loads misearch.el again), I agree that
we definitely should correctly unload them.




Reply sent to Ivan Shmakov <ivan <at> siamics.net>:
You have taken responsibility. (Fri, 23 Jan 2015 14:27:02 GMT) Full text and rfc822 format available.

Notification sent to Ivan Shmakov <ivan <at> siamics.net>:
bug acknowledged by developer. (Fri, 23 Jan 2015 14:27:03 GMT) Full text and rfc822 format available.

Message #13 received at 19566-done <at> debbugs.gnu.org (full text, mbox):

From: Ivan Shmakov <ivan <at> siamics.net>
To: 19566-done <at> debbugs.gnu.org
Subject: Re: bug#19566: unloading support for misearch 
Date: Fri, 23 Jan 2015 14:25:55 +0000
Version: 25.1

	I’ve pushed the change proposed to ‘master’ last Saturday;
	closing.

commit 0aaa5d699bf95afb152317f0788b8e2d2042f59d
CommitDate: Sat Jan 17 19:35:52 2015 +0000

    Unloading support for misearch.

    * lisp/misearch.el (multi-isearch-unload-function): New function.
    (misearch-unload-function): New alias.

    Fixes: debbugs:19566

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 21 Feb 2015 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 66 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.