all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ivan Shmakov <ivan@siamics.net>
To: 19566@debbugs.gnu.org
Subject: bug#19566: (unload-feature 'misearch) breaks isearch
Date: Sun, 11 Jan 2015 11:37:57 +0000	[thread overview]
Message-ID: <87y4p9y2cq.fsf@violet.siamics.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/diff, Size: 965 bytes --]

--- 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)
+
 \f
 (provide 'multi-isearch)
 (provide 'misearch)

             reply	other threads:[~2015-01-11 11:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-11 11:37 Ivan Shmakov [this message]
2015-01-11 20:44 ` bug#19566: (unload-feature 'misearch) breaks isearch Juri Linkov
2015-01-23 14:25 ` bug#19566: unloading support for misearch Ivan Shmakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y4p9y2cq.fsf@violet.siamics.net \
    --to=ivan@siamics.net \
    --cc=19566@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.