emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] Re: moving in the agenda view is slow: solved!


From: Rainer Stengele
Subject: [Orgmode] Re: moving in the agenda view is slow: solved!
Date: Wed, 01 Dec 2010 16:11:09 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.17) Gecko/20080914 Lightning/0.8 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666

Am 29.11.2010 17:15, schrieb Sébastien Vauban:
> Hi Rainer,
> 
> Rainer Stengele wrote:
>> after disabling the showing of the outline path in agenda views:
>>
>> line-move                                                     430         
>> 0.1890000000  0.0004395348
>> line-move-1                                                   430         
>> 0.1730000000  0.0004023255
>> org-agenda-previous-line                                      214         
>> 0.1560000000  0.0007289719
>> org-agenda-next-line                                          216         
>> 0.095         0.0004398148
>> next-line                                                     216         
>> 0.048         0.0002222222
>> org-agenda-do-context-action                                  430         
>> 0.047         0.0001093023
>> org-detach-overlay                                            431         
>> 0.015         3.48...e-005
>> org-unhighlight                                               431         
>> 0.015         3.48...e-005
>> line-move-partial                                             430         
>> 0.0           0.0
>> org-agenda-post-command-hook                                  431         
>> 0.0           0.0
>> org-get-at-bol                                                430         
>> 0.0           0.0
>>
>> scrolling with "n" and "p" runs smoothly now! Sigh! That means the slowness
>> is connected to my .emacs and org settings!? I'am afraid I have to go
>> through all the settings and find the culprit.
> 
> What do you exactly mean by: "disabling the showing of the outline path in 
> agenda
> views"?
> 
> Best regards,
>   Seb
> 
Hi Sebastian

I meant setting org-agenda-show-outline-path to nil.

-----------------------------------------------------

Now the more intersting news.
Reading through my .emacs I found and removed the 2 reasons for the slowness!

1. smooth-scolling.el (from http://www.emacswiki.org/emacs/SmoothScrolling)

The file includes this:

#+BEGIN_SRC emacs-lisp
(defadvice previous-line (after smooth-scroll-down
                            (&optional arg try-vscroll)
                            activate)
  "Scroll down smoothly if cursor is within `smooth-scroll-margin'
lines of the top of the window."
  (and
   ;; Only scroll down if there is buffer above the start of the window.
   (> (window-start) (buffer-end -1))
   (let ((lines-from-window-top
          (smooth-scroll-lines-from-window-top)))
     (and
      ;; Only scroll down if we're within the top margin
      (<= lines-from-window-top smooth-scroll-margin)
      ;; Only scroll down if we're in the top half of the window
      (<= lines-from-window-top
          ;; N.B. `window-height' includes modeline, so if it returned 21,
          ;; that would mean exactly 10 lines in the top half and 10 in
          ;; the bottom.  22 (or any even number) means there's one in the
          ;; middle.  In both cases the following expression will
          ;; yield 10:
          (/ (1- (window-height)) 2))
      (save-excursion
        (scroll-down
              (1+ (- smooth-scroll-margin lines-from-window-top))))))))

(defadvice next-line (after smooth-scroll-up
                            (&optional arg try-vscroll)
                            activate)
  "Scroll up smoothly if cursor is within `smooth-scroll-margin'
lines of the bottom of the window."
  (and
   ;; Only scroll up if there is buffer below the end of the window.
   (< (window-end) (buffer-end 1))
   (let ((lines-from-window-bottom
          (smooth-scroll-lines-from-window-bottom)))
     (and
      ;; Only scroll up if we're within the bottom margin
      (<= lines-from-window-bottom smooth-scroll-margin)
      ;; Only scroll up if we're in the bottom half of the window.
      (<= lines-from-window-bottom
          ;; See above notes on `window-height'.
          (/ (1- (window-height)) 2))
      (save-excursion
        (scroll-up
         (1+ (- smooth-scroll-margin lines-from-window-bottom))))))))
;;;_ + provide
(provide 'smooth-scrolling)
#+END_SRC

2. (add-hook 'org-agenda-mode-hook 'hl-line-mode)
-----------------------------------------------------

Switching off both features brings back immediate scrolling.

I do miss the features of smooth-scrolling and hl-line but it is not worth the
performance penalty.

Thanks to all for considering and helping.
What a relieve to be able to again scroll fast in the agenda ...

Best,

Rainer




reply via email to

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