emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: Serious performace problems on Windows XP with new(!) GNU Emacs


From: martin rudalics
Subject: Re: Fwd: Serious performace problems on Windows XP with new(!) GNU Emacs v22 (both patched and unpatched EmacsW32 were tried)
Date: Fri, 20 Oct 2006 10:33:56 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> In fact I realized this problem when I wanted to switch from "old" v22
> EmacsW32 to the newest one, but after installing the new one, it
> seemed not to start properly (=it hanged for long time, and I killed
> it in that state). Finally I realized that I had desktop saving in my
> .emacs, and the most problematic file (what consumes ~5 minutes from
> whitespace) was opened when I killed old Emacs before switching to the
> new one... Later I could identify that the problem is connected to
> whitespace in fact (and not to desktop-save or the mode associated to
> the problematic file -- as I first thought). If I don't use whitespace
> OR set whitespace-global-mode to nil, everything seems to be OK.

I don't yet understand whether the whitespace timer, the overlays, or
the repeated invocations of `format' affect this.  Maybe there's also
some strange interaction with another component like font-locking.
Anyway, try the attached patch and tell me whether it improves things.
*** whitespace.el.~1.46.~       Mon Aug 21 14:35:24 2006
--- whitespace.el       Fri Oct 20 10:05:36 2006
***************
*** 425,431 ****
        (progn
          (whitespace-check-buffer-list (buffer-name) buffer-file-name)
          (whitespace-tickle-timer)
!         (whitespace-unhighlight-the-space)
          (if whitespace-auto-cleanup
              (if buffer-read-only
                  (if (not quiet)
--- 425,431 ----
        (progn
          (whitespace-check-buffer-list (buffer-name) buffer-file-name)
          (whitespace-tickle-timer)
!         (remove-overlays nil nil 'face 'whitespace-highlight)
          (if whitespace-auto-cleanup
              (if buffer-read-only
                  (if (not quiet)
***************
*** 648,664 ****

  (defun whitespace-buffer-search (regexp)
    "Search for any given whitespace REGEXP."
!   (let ((whitespace-retval ""))
      (save-excursion
        (goto-char (point-min))
        (while (re-search-forward regexp nil t)
!       (progn
!         (setq whitespace-retval (format "%s %s" whitespace-retval
!                                       (match-beginning 0)))
        (whitespace-highlight-the-space (match-beginning 0) (match-end 0))))
!       (if (equal "" whitespace-retval)
!         nil
!       whitespace-retval))))

  (defun whitespace-buffer-cleanup (regexp newregexp)
    "Search for any given whitespace REGEXP and replace it with the NEWREGEXP."
--- 648,661 ----

  (defun whitespace-buffer-search (regexp)
    "Search for any given whitespace REGEXP."
!   (let (whitespace-retval)
      (save-excursion
        (goto-char (point-min))
        (while (re-search-forward regexp nil t)
!       (setq whitespace-retval (cons (match-beginning 0) whitespace-retval))
        (whitespace-highlight-the-space (match-beginning 0) (match-end 0))))
!     (when whitespace-retval
!       (format " %s" whitespace-retval))))

  (defun whitespace-buffer-cleanup (regexp newregexp)
    "Search for any given whitespace REGEXP and replace it with the NEWREGEXP."
***************
*** 713,719 ****
    "Highlight the current line, unhighlighting a previously jumped to line."
    (if whitespace-display-spaces-in-color
        (let ((ol (whitespace-make-overlay b e)))
!       (push ol whitespace-highlighted-space)
        (whitespace-overlay-put ol 'face 'whitespace-highlight))))
  ;;  (add-hook 'pre-command-hook 'whitespace-unhighlight-the-space))

--- 710,716 ----
    "Highlight the current line, unhighlighting a previously jumped to line."
    (if whitespace-display-spaces-in-color
        (let ((ol (whitespace-make-overlay b e)))
! ;;;   (push ol whitespace-highlighted-space)
        (whitespace-overlay-put ol 'face 'whitespace-highlight))))
  ;;  (add-hook 'pre-command-hook 'whitespace-unhighlight-the-space))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]