Subject: bug#62239: patch feedback

From: H.-J. Heitländer <[email-masked]>
Date: Mon, 27 Mar 2023 08:27:48 +0000

Hi there,

Michael Heerdegen developed a patch for the problem.

Feedback: apply patch - not quite successfull

When trying to apply the patch

M-diff-mode

open patch-file

M-n

C-c C-a

I get "Hunk seriously messed up"

If I understand diff correctly, the patch aims for line 2204 = 
"(add-hook 'change-major-mode-hook..."

In my version of doc-view.el that line: "(add-hook 
'change-major-mode-hook..." is contained in line 2207.

That is probably the reason for "Hunk seriously messed up"

... So what I did is: I changed the source code of view-doc.el manually 
and not via the delevered patch. Then I tested it and ...
TADA!!! Success!!! It works.

Thanks for the effort

Heiner
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index b14655fb274..00240ebf08d 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -2204,7 +2204,9 @@ doc-view-mode
     (add-hook 'change-major-mode-hook
 	      (lambda ()
 		(doc-view-kill-proc)
-		(remove-overlays (point-min) (point-max) 'doc-view t))
+		(remove-overlays (point-min) (point-max) 'doc-view t)
+                (remove-function (local 'revert-buffer-function)
+                                 #'doc-view--revert-buffer))
 	      nil t)
     (add-hook 'clone-indirect-buffer-hook #'doc-view-clone-buffer-hook nil t)
     (add-hook 'kill-buffer-hook #'doc-view-kill-proc nil t)