GNU bug report logs - #8463
24.0.50; [PATCH] Direct Edit in *Occur* Buffer

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Sun, 10 Apr 2011 08:16:02 UTC

Severity: wishlist

Tags: patch

Found in version 24.0.50

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


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

From: Leo <sdl.web <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Chong Yidong <cyd <at> stupidchicken.com>, 8463 <at> debbugs.gnu.org,
	Richard Stallman <rms <at> gnu.org>,
	"Andrew W. Nosenko" <andrew.w.nosenko <at> gmail.com>
Subject: Re: bug#8463: 24.0.50; [PATCH] Direct Edit in *Occur* Buffer
Date: Thu, 09 Jun 2011 12:47:00 +0800
On 2011-06-02 07:03 +0800, Glenn Morris wrote:
> 2. After C-x C-q, If I delete some text in the occur buffer, then use
> "undo", when I reach the point at which there is no more to undo, I get:
> "Wrong type argument: markerp, nil" rather than "No further undo information".
>
> Debugger entered--Lisp error: (wrong-type-argument markerp nil)
>   marker-buffer(nil)
>   occur-after-change-function(1 40 39)
>   primitive-undo(1 ((nil font-lock-face underline 1 . 40) (t 0 . 0)))
>   undo-more(1)
>   undo(nil)
>   call-interactively(undo nil nil)

This can be fixed with:

diff --git a/lisp/replace.el b/lisp/replace.el
index 0578ed09..fc2db2ec 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -882,11 +882,11 @@ (define-derived-mode occur-edit-mode occur-mode "Occur-Edit"
 
 (defun occur-after-change-function (beg end length)
   (save-excursion
-    (goto-char beg)
     (let* ((m (get-text-property (line-beginning-position) 'occur-target))
 	   (buf (marker-buffer m))
 	   (col (current-column)))
       (when (= length 0)
+	(goto-char beg)
 	;; Apply occur-target property to inserted (e.g. yanked) text.
 	(put-text-property beg end 'occur-target m)
 	;; Did we insert a newline?  Occur Edit mode can't create new

The cause:

When switching major-mode (in this case occur-edit-mode), an undo entry
containing text-property only change is added due to this line in
occur-mode:

(add-hook 'change-major-mode-hook 'font-lock-defontify nil t)

That line seems useless due to change made in revid 22063400b. If no one
objects, I intend to also remove it.

Leo




This bug report was last modified 13 years and 329 days ago.

Previous Next


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