[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: win32 emacs 22.1 crashes in longlines mode + outline minor mode
From: |
martin rudalics |
Subject: |
Re: win32 emacs 22.1 crashes in longlines mode + outline minor mode |
Date: |
Wed, 14 Nov 2007 10:03:29 +0100 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
> 1. Open text file
>
> 2.
>
> M-x longlines-mode
>
> M-x longlines-show-hard-newlines
At the time I'm here the buffer is already modified since modification
hooks are not inhibited in `longlines-show-hard-newlines', thus calling
`longlines-after-change-function' which subsequently causes to run
`longlines-post-command-function' which runs `longlines-show-region' a
second time _without_ saving the buffer-modified state though, ...
The attached patch should handle this.
*** longlines.el.~1.40.~ Fri Nov 2 09:54:54 2007
--- longlines.el Wed Nov 14 09:42:18 2007
***************
*** 220,226 ****
(let* ((pmin (min beg end))
(pmax (max beg end))
(pos (text-property-not-all pmin pmax 'hard nil))
! (inhibit-read-only t))
(while pos
(put-text-property pos (1+ pos) 'display
(copy-sequence longlines-show-effect))
--- 220,227 ----
(let* ((pmin (min beg end))
(pmax (max beg end))
(pos (text-property-not-all pmin pmax 'hard nil))
! (inhibit-read-only t)
! (inhibit-modification-hooks t))
(while pos
(put-text-property pos (1+ pos) 'display
(copy-sequence longlines-show-effect))
***************
*** 230,239 ****
"Make hard newlines invisible again."
(interactive)
(setq longlines-showing nil)
! (let ((pos (text-property-not-all (point-min) (point-max) 'hard nil)))
(while pos
(remove-text-properties pos (1+ pos) '(display))
! (setq pos (text-property-not-all (1+ pos) (point-max) 'hard nil)))))
;; Wrapping the paragraphs.
--- 231,245 ----
"Make hard newlines invisible again."
(interactive)
(setq longlines-showing nil)
! (let ((pos (text-property-not-all (point-min) (point-max) 'hard nil))
! (buffer-undo-list t)
! (mod (buffer-modified-p))
! (inhibit-read-only t)
! (inhibit-modification-hooks t))
(while pos
(remove-text-properties pos (1+ pos) '(display))
! (setq pos (text-property-not-all (1+ pos) (point-max) 'hard nil)))
! (set-buffer-modified-p mod)))
;; Wrapping the paragraphs.