emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
       [not found]     ` <87r42vlavi.fsf@geodiff-mac3.ulb.ac.be>
@ 2014-06-11 15:50       ` Bastien
       [not found]       ` <87ha3rxx79.fsf@bzg.ath.cx>
  1 sibling, 0 replies; 20+ messages in thread
From: Bastien @ 2014-06-11 15:50 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: 17746, David Griffiths

Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:

> David Griffiths <dogriffiths@gmail.com> writes:
>> Debugger entered--Lisp error: (error "`recenter'ing a window that does
>> not display current-buffer.")
>> recenter((4))
>> org-overview()
>
> So that's a duplicate of #17724. It is fixed in org-mode (upstream) master
> branch. The easy fix is to use emacs-24 branch :)
>
> (otherwise just remove that call to recenter in org-overview).

PS: The change about throwing an error when recentering a window
that does not display the current buffer breaks ~37 tests in Org
master branch, even with this fix.  I need to digg this further.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
       [not found]       ` <87ha3rxx79.fsf@bzg.ath.cx>
@ 2014-06-11 16:09         ` Nicolas Richard
  2014-06-11 16:25           ` Bastien
  2014-06-11 16:29         ` Eli Zaretskii
                           ` (2 subsequent siblings)
  3 siblings, 1 reply; 20+ messages in thread
From: Nicolas Richard @ 2014-06-11 16:09 UTC (permalink / raw)
  To: Bastien; +Cc: Nicolas Richard, 17746, David Griffiths

Bastien <bzg@altern.org> writes:
> PS: The change about throwing an error when recentering a window
> that does not display the current buffer breaks ~37 tests in Org
> master branch, even with this fix.  I need to digg this further.

For me, fixing also org-fix-ellipsis-at-bol made all tests run as
expected.

-- 
Nico.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
  2014-06-11 16:09         ` Nicolas Richard
@ 2014-06-11 16:25           ` Bastien
  2014-06-11 19:11             ` Nicolas Richard
  0 siblings, 1 reply; 20+ messages in thread
From: Bastien @ 2014-06-11 16:25 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: 17746, David Griffiths

Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:

> Bastien <bzg@altern.org> writes:
>> PS: The change about throwing an error when recentering a window
>> that does not display the current buffer breaks ~37 tests in Org
>> master branch, even with this fix.  I need to digg this further.
>
> For me, fixing also org-fix-ellipsis-at-bol made all tests run as
> expected.

What do you mean by "fixing"?  Removing it entirely?

-- 
 Bastien

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
       [not found]       ` <87ha3rxx79.fsf@bzg.ath.cx>
  2014-06-11 16:09         ` Nicolas Richard
@ 2014-06-11 16:29         ` Eli Zaretskii
  2014-06-11 18:15           ` Stefan Monnier
  2014-06-12  1:15         ` bug#17746: " Daimrod
       [not found]         ` <87ppifudvd.fsf@tanger.home>
  3 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2014-06-11 16:29 UTC (permalink / raw)
  To: Bastien; +Cc: theonewiththeevillook, 17746, dogriffiths

> From: Bastien <bzg@altern.org>
> Date: Wed, 11 Jun 2014 17:50:02 +0200
> Cc: 17746@debbugs.gnu.org, David Griffiths <dogriffiths@gmail.com>
> 
> PS: The change about throwing an error when recentering a window
> that does not display the current buffer breaks ~37 tests in Org
> master branch, even with this fix.  I need to digg this further.

Say thanks to Stefan for flagging all those bugs ;-)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
  2014-06-11 16:29         ` Eli Zaretskii
@ 2014-06-11 18:15           ` Stefan Monnier
  2014-06-11 18:38             ` Eli Zaretskii
  0 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2014-06-11 18:15 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Bastien, theonewiththeevillook, 17746, dogriffiths

> Say thanks to Stefan for flagging all those bugs ;-)

Now that I think about it, I should make `car' signal an error every
100th call, as well.  Would flag many bugs (with some false positives,
of course, but what's a few false positives among friends?)!


        Stefan

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
  2014-06-11 18:15           ` Stefan Monnier
@ 2014-06-11 18:38             ` Eli Zaretskii
  0 siblings, 0 replies; 20+ messages in thread
From: Eli Zaretskii @ 2014-06-11 18:38 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: bzg, theonewiththeevillook, 17746, dogriffiths

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Bastien <bzg@altern.org>, theonewiththeevillook@yahoo.fr,
>  17746@debbugs.gnu.org, dogriffiths@gmail.com
> Date: Wed, 11 Jun 2014 14:15:08 -0400
> 
> > Say thanks to Stefan for flagging all those bugs ;-)
> 
> Now that I think about it, I should make `car' signal an error every
> 100th call, as well.  Would flag many bugs (with some false positives,
> of course, but what's a few false positives among friends?)!

Not just 'car', 'cdr' as well, I'd say.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
  2014-06-11 16:25           ` Bastien
@ 2014-06-11 19:11             ` Nicolas Richard
  0 siblings, 0 replies; 20+ messages in thread
From: Nicolas Richard @ 2014-06-11 19:11 UTC (permalink / raw)
  To: Bastien; +Cc: Nicolas Richard, 17746, David Griffiths

Bastien <bzg@altern.org> writes:

> Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:
>
>> Bastien <bzg@altern.org> writes:
>>> PS: The change about throwing an error when recentering a window
>>> that does not display the current buffer breaks ~37 tests in Org
>>> master branch, even with this fix.  I need to digg this further.
>>
>> For me, fixing also org-fix-ellipsis-at-bol made all tests run as
>> expected.
>
> What do you mean by "fixing"?  Removing it entirely?

Yes, I admit, I did : (defsubst org-fix-ellipsis-at-bol () nil)
But I must have done something wrong or misread the results because now
I see some other failures. Moreover, the backtrace that I get from "make
test" seems incomplete and it's not obvious to me where the recenter
call is made.

OTOH I hope that wrapping every call to recenter in a
(when (eq (current-buffer) (window-buffer))
   (recenter ...))
would fix the tests, no ?

-- 
Nico.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746:  bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
       [not found]       ` <87ha3rxx79.fsf@bzg.ath.cx>
  2014-06-11 16:09         ` Nicolas Richard
  2014-06-11 16:29         ` Eli Zaretskii
@ 2014-06-12  1:15         ` Daimrod
       [not found]         ` <87ppifudvd.fsf@tanger.home>
  3 siblings, 0 replies; 20+ messages in thread
From: Daimrod @ 2014-06-12  1:15 UTC (permalink / raw)
  To: Bastien; +Cc: Nicolas Richard, 17746, David Griffiths

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

Bastien <bzg@altern.org> writes:

> Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:
>
>> David Griffiths <dogriffiths@gmail.com> writes:
>>> Debugger entered--Lisp error: (error "`recenter'ing a window that does
>>> not display current-buffer.")
>>> recenter((4))
>>> org-overview()
>>
>> So that's a duplicate of #17724. It is fixed in org-mode (upstream) master
>> branch. The easy fix is to use emacs-24 branch :)
>>
>> (otherwise just remove that call to recenter in org-overview).
>
> PS: The change about throwing an error when recentering a window
> that does not display the current buffer breaks ~37 tests in Org
> master branch, even with this fix.  I need to digg this further.

Err, what's the rational behind this change?

In the meantime I've a simple fix (quickly tested for `org-agenda' which
was also broken).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-org-recenter-as-a-wrapper-around-recenter.patch --]
[-- Type: text/x-diff, Size: 9699 bytes --]

From 659bc5072253967ee2737f668c8ac035a4b8aa32 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= <gregoire.jadi@gmail.com>
Date: Thu, 12 Jun 2014 10:14:16 +0900
Subject: [PATCH] Use `org-recenter' as a wrapper around `recenter'

* lisp/org.el (org-recenter): New function that behaves exactly like
`recenter' except that it sets the `current-buffer' to the buffer
displayed by the selected window.

(org-fix-ellipsis-at-bol)
(org-optimize-window-after-visibility-change)
(org-first-headline-recenter)
* contrib/lisp/org-index.el (org-index)
(org-index--create-new-index)
(org-index--do-head)
* contrib/lisp/org-toc.el (org-toc-goto)
* lisp/org-agenda.el (org-agenda-list)
(org-agenda-redo)
(org-recenter-heading)
(org-agenda-recenter)
* lisp/org-bibtex.el (org-execute-file-search-in-bibtex)
* lisp/org-clock.el (org-clock-goto)
* lisp/org-table.el (org-table-show-reference): Use `org-recenter' instead of `recenter'.
---
 contrib/lisp/org-index.el | 12 ++++++------
 contrib/lisp/org-toc.el   |  4 ++--
 lisp/org-agenda.el        | 12 ++++++------
 lisp/org-bibtex.el        |  2 +-
 lisp/org-clock.el         |  2 +-
 lisp/org-table.el         |  4 ++--
 lisp/org.el               | 13 +++++++++----
 7 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/contrib/lisp/org-index.el b/contrib/lisp/org-index.el
index 64974eb..f77d64d 100644
--- a/contrib/lisp/org-index.el
+++ b/contrib/lisp/org-index.el
@@ -633,7 +633,7 @@ command \"head\" for reference \"237\".
       ;; simply go into table
       (goto-char org-index--below-hline)
       (show-subtree)
-      (recenter)
+      (org-recenter)
       (if what-adjusted
           (setq message-text "Nothing to search for; at index table")
         (setq message-text "At index table")))
@@ -1581,7 +1581,7 @@ retrieves the value of the count-column for reference 12.
             (org-id-goto id)
             (org-show-context)    
             (show-subtree)
-            (recenter 1)
+            (org-recenter 1)
             (setq org-index-id id)
             (if (y-or-n-p "This is your new index table. It is already set for this emacs session. Do you want to save its id to make it available for future emacs sessions too ? ")
                 (progn
@@ -1598,7 +1598,7 @@ retrieves the value of the count-column for reference 12.
         (goto-char org-index--point)
         (org-show-context)
         (show-subtree)
-        (recenter 1)
+        (org-recenter 1)
         (delete-other-windows)
         ;; show new index
         (select-window (split-window-vertically))
@@ -1606,7 +1606,7 @@ retrieves the value of the count-column for reference 12.
         (org-id-goto id)
         (org-show-context)    
         (show-subtree)
-        (recenter 1)
+        (org-recenter 1)
         (error "Please compare your existing index (upper window) and a temporary new one (lower window) to correct the previous error (\"%s\"); the explanations following the new index table should help." reason)))))
 
 
@@ -1778,12 +1778,12 @@ retrieves the value of the count-column for reference 12.
                     (pop-to-buffer buffer)
                     (goto-char point)
                     (org-reveal t)
-                    (recenter)
+                    (org-recenter)
                     (pop-to-buffer "*org-index-occur*"))
                 (org-pop-to-buffer-same-window buffer)
                 (goto-char point)
                 (org-reveal t)
-                (recenter)))
+                (org-recenter)))
           (setq message-text (format "Did not find '%s'" (or ref link))))))
     message-text))
 
diff --git a/contrib/lisp/org-toc.el b/contrib/lisp/org-toc.el
index 255b79e..e06de55 100644
--- a/contrib/lisp/org-toc.el
+++ b/contrib/lisp/org-toc.el
@@ -294,8 +294,8 @@ If CYCLE is non-nil, cycle the targeted subtree in the Org window."
 	       (org-show-entry))
 	     (org-show-context)))
     (if org-toc-recenter-mode
-	(if (>= org-toc-recenter 1000) (recenter)
-	  (recenter org-toc-recenter)))
+	(if (>= org-toc-recenter 1000) (org-recenter)
+	  (org-recenter org-toc-recenter)))
     (cond ((null jump)
 	   (switch-to-buffer-other-window toc-buf))
 	  ((eq jump 'delete)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 5e056b4..02c583b 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4348,11 +4348,11 @@ items if they have an hour specification like [h]h:mm."
       (unless (and (pos-visible-in-window-p (point-min))
 		   (pos-visible-in-window-p (point-max)))
 	(goto-char (1- (point-max)))
-	(recenter -1)
+	(org-recenter -1)
 	(if (not (pos-visible-in-window-p (or start-pos 1)))
 	    (progn
 	      (goto-char (or start-pos 1))
-	      (recenter 1))))
+	      (org-recenter 1))))
       (goto-char (or start-pos 1))
       (add-text-properties (point-min) (point-max)
 			   `(org-agenda-type agenda
@@ -7329,7 +7329,7 @@ in the agenda."
     (and top-hl-filter (org-agenda-filter-top-headline-apply top-hl-filter))
     (and cols (org-called-interactively-p 'any) (org-agenda-columns))
     (org-goto-line line)
-    (recenter window-line)))
+    (org-recenter window-line)))
 
 (defvar org-global-tags-completion-table nil)
 (defvar org-agenda-filter-form nil)
@@ -8373,7 +8373,7 @@ When called with a prefix argument, include all archive files as well."
 	     (org-flag-heading nil))))	; show the next heading
     (when (outline-invisible-p)
       (show-entry))			; display invisible text
-    (recenter (/ (window-height) 2))
+    (org-recenter (/ (window-height) 2))
     (org-back-to-heading t)
     (if (re-search-forward org-complex-heading-regexp nil t)
 	(goto-char (match-beginning 4)))
@@ -8697,7 +8697,7 @@ if it was hidden in the outline."
 (defun org-recenter-heading (n)
   (save-excursion
     (org-back-to-heading)
-    (recenter n)))
+    (org-recenter n)))
 
 (defvar org-agenda-cycle-counter nil)
 (defun org-agenda-cycle-show (&optional n)
@@ -8728,7 +8728,7 @@ docstring of `org-agenda-show-1'."
   (interactive "P")
   (let ((win (selected-window)))
     (org-agenda-goto t)
-    (recenter arg)
+    (org-recenter arg)
     (select-window win)))
 
 (defun org-agenda-show-mouse (ev)
diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el
index 3efee73..8bcd04e 100644
--- a/lisp/org-bibtex.el
+++ b/lisp/org-bibtex.el
@@ -540,7 +540,7 @@ With optional argument OPTIONAL, also prompt for optional fields."
 	  (with-current-buffer b
 	    (goto-char p)
 	    (bibtex-url)))
-      (recenter 0))  ; Move entry start to beginning of window
+      (org-recenter 0))  ; Move entry start to beginning of window
     ;; return t to indicate that the search is done.
     t))
 
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 3c7abd5..9323bd5 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1702,7 +1702,7 @@ With prefix arg SELECT, offer recently clocked tasks for selection."
     (org-show-entry)
     (org-back-to-heading t)
     (org-cycle-hide-drawers 'children)
-    (recenter org-clock-goto-before-context)
+    (org-recenter org-clock-goto-before-context)
     (org-reveal)
     (if recent
 	(message "No running clock, this is the most recently clocked task"))
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 8cd8f8b..8c9e667 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -3935,9 +3935,9 @@ With prefix ARG, apply the new formulas to the table."
 	(push org-table-current-begin-pos org-show-positions)
 	(let ((min (apply 'min org-show-positions))
 	      (max (apply 'max org-show-positions)))
-	  (goto-char min) (recenter 0)
+	  (goto-char min) (org-recenter 0)
 	  (goto-char max)
-	  (or (pos-visible-in-window-p max) (recenter -1))))
+	  (or (pos-visible-in-window-p max) (org-recenter -1))))
       (select-window win))))
 
 (defun org-table-force-dataline ()
diff --git a/lisp/org.el b/lisp/org.el
index 874440b..b9a81b9 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5575,7 +5575,7 @@ The following commands are available:
 		    :parents (list text-mode-abbrev-table)))
 
 (defsubst org-fix-ellipsis-at-bol ()
-  (save-excursion (goto-char (window-start)) (recenter 0)))
+  (save-excursion (goto-char (window-start)) (org-recenter 0)))
 
 (defun org-find-invisible-foreground ()
   (let ((candidates (remove
@@ -7059,8 +7059,8 @@ This function is the default value of the hook `org-cycle-hook'."
      ((eq state 'content)  nil)
      ((eq state 'all)      nil)
      ((eq state 'folded)   nil)
-     ((eq state 'children) (or (org-subtree-end-visible-p) (recenter 1)))
-     ((eq state 'subtree)  (or (org-subtree-end-visible-p) (recenter 1))))))
+     ((eq state 'children) (or (org-subtree-end-visible-p) (org-recenter 1)))
+     ((eq state 'subtree)  (or (org-subtree-end-visible-p) (org-recenter 1))))))
 
 (defun org-remove-empty-overlays-at (pos)
   "Remove outline overlays that do not contain non-white stuff."
@@ -7251,7 +7251,7 @@ Optional argument N means put the headline into the Nth line of the window."
   (goto-char (point-min))
   (when (re-search-forward (concat "^\\(" org-outline-regexp "\\)") nil t)
     (beginning-of-line)
-    (recenter (prefix-numeric-value N))))
+    (org-recenter (prefix-numeric-value N))))
 
 ;;; Saving and restoring visibility
 
@@ -23324,6 +23324,11 @@ package ox-bibtex by Taru Karttunen."
     (call-interactively 'reftex-citation)))
 
 ;;;; Functions extending outline functionality
+(defun org-recenter (&optional arg)
+  "Like `recenter' but ensure that the `current-buffer' is
+properly set."
+  (with-current-buffer (window-buffer)
+    (recenter arg)))
 
 (defun org-beginning-of-line (&optional arg)
   "Go to the beginning of the current line.  If that is invisible, continue
-- 
1.8.0.2722.gc0242e5


[-- Attachment #3: Type: text/plain, Size: 18 bytes --]


-- 
Daimrod/Greg

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* bug#17746:  bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
       [not found]         ` <87ppifudvd.fsf@tanger.home>
@ 2014-06-12  2:44           ` Stefan Monnier
  2014-06-12  4:10             ` Daimrod
  2014-06-12  8:16           ` Nicolas Richard
       [not found]           ` <878up24k6j.fsf@yahoo.fr>
  2 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2014-06-12  2:44 UTC (permalink / raw)
  To: Daimrod; +Cc: Bastien, Nicolas Richard, 17746, David Griffiths

> +(defun org-recenter (&optional arg)
> +  "Like `recenter' but ensure that the `current-buffer' is
> +properly set."
> +  (with-current-buffer (window-buffer)
> +    (recenter arg)))
 
This doesn't make much sense: in many case (window-buffer) can be
a buffer completely unrelated to Org.


        Stefan

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746:  bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
  2014-06-12  2:44           ` Stefan Monnier
@ 2014-06-12  4:10             ` Daimrod
  0 siblings, 0 replies; 20+ messages in thread
From: Daimrod @ 2014-06-12  4:10 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Bastien, Nicolas Richard, 17746, David Griffiths

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> +(defun org-recenter (&optional arg)
>> +  "Like `recenter' but ensure that the `current-buffer' is
>> +properly set."
>> +  (with-current-buffer (window-buffer)
>> +    (recenter arg)))
>  
> This doesn't make much sense: in many case (window-buffer) can be
> a buffer completely unrelated to Org.

Hmm, what was the previous behaviour of `recenter'? (i.e. before it
reports an error)

Did it just do nothing?

Best,

-- 
Daimrod/Greg

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746:  bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
       [not found]         ` <87ppifudvd.fsf@tanger.home>
  2014-06-12  2:44           ` Stefan Monnier
@ 2014-06-12  8:16           ` Nicolas Richard
       [not found]           ` <878up24k6j.fsf@yahoo.fr>
  2 siblings, 0 replies; 20+ messages in thread
From: Nicolas Richard @ 2014-06-12  8:16 UTC (permalink / raw)
  To: Daimrod; +Cc: Bastien, Nicolas Richard, 17746, David Griffiths

Daimrod <daimrod@gmail.com> writes:
>> PS: The change about throwing an error when recentering a window
>> that does not display the current buffer breaks ~37 tests in Org
>> master branch, even with this fix.  I need to digg this further.
>
> Err, what's the rational behind this change?

It is meant to catch cases where recenter acts on the wrong window.
Think of the cases where (recenter) is called from within a timer or a
process filter function.

See the discussion entitled
> comint-preoutput-filter-functions and flickering redisplay in TTY
on emacs devel.

-- 
Nico.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746:  bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
       [not found]           ` <878up24k6j.fsf@yahoo.fr>
@ 2014-06-12  8:58             ` Daimrod
       [not found]             ` <878up2ec7z.fsf@tanger.home>
  1 sibling, 0 replies; 20+ messages in thread
From: Daimrod @ 2014-06-12  8:58 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: Bastien, 17746, David Griffiths

Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:

> Daimrod <daimrod@gmail.com> writes:
>>> PS: The change about throwing an error when recentering a window
>>> that does not display the current buffer breaks ~37 tests in Org
>>> master branch, even with this fix.  I need to digg this further.
>>
>> Err, what's the rational behind this change?
>
> It is meant to catch cases where recenter acts on the wrong window.
> Think of the cases where (recenter) is called from within a timer or a
> process filter function.
>
> See the discussion entitled
>> comint-preoutput-filter-functions and flickering redisplay in TTY
> on emacs devel.

Thanks!

-- 
Daimrod/Greg

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746:  bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
       [not found]             ` <878up2ec7z.fsf@tanger.home>
@ 2014-06-12  9:27               ` Daimrod
  2014-06-12 10:06                 ` Bastien
       [not found]               ` <874mzqeaug.fsf@tanger.home>
  1 sibling, 1 reply; 20+ messages in thread
From: Daimrod @ 2014-06-12  9:27 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: Bastien, 17746, David Griffiths

Daimrod <daimrod@gmail.com> writes:

> Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:
>
>> Daimrod <daimrod@gmail.com> writes:
>>>> PS: The change about throwing an error when recentering a window
>>>> that does not display the current buffer breaks ~37 tests in Org
>>>> master branch, even with this fix.  I need to digg this further.
>>>
>>> Err, what's the rational behind this change?
>>
>> It is meant to catch cases where recenter acts on the wrong window.
>> Think of the cases where (recenter) is called from within a timer or a
>> process filter function.
>>
>> See the discussion entitled
>>> comint-preoutput-filter-functions and flickering redisplay in TTY
>> on emacs devel.
>
> Thanks!

Okay, so is there another fix than `(when (eq (current-buffer)
(window-buffer)))' or removing the call?

If not, why does it raise an error instead of doing nothing silently?

Best,

-- 
Daimrod/Greg

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746: bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
  2014-06-12  9:27               ` Daimrod
@ 2014-06-12 10:06                 ` Bastien
  2014-06-13 12:58                   ` Nicolas Richard
  0 siblings, 1 reply; 20+ messages in thread
From: Bastien @ 2014-06-12 10:06 UTC (permalink / raw)
  To: Daimrod; +Cc: Nicolas Richard, 17746, David Griffiths

I've now fixed this in the maint and master branch of Org's
repository.

Firmly waiting for warnings from the CAR and CDR random checks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746:  bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
       [not found]               ` <874mzqeaug.fsf@tanger.home>
@ 2014-06-12 10:12                 ` Daimrod
  2014-06-12 13:04                   ` Bastien
  0 siblings, 1 reply; 20+ messages in thread
From: Daimrod @ 2014-06-12 10:12 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: Bastien, 17746, David Griffiths

Daimrod <daimrod@gmail.com> writes:

> Daimrod <daimrod@gmail.com> writes:
>
>> Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:
>>
>>> Daimrod <daimrod@gmail.com> writes:
>>>>> PS: The change about throwing an error when recentering a window
>>>>> that does not display the current buffer breaks ~37 tests in Org
>>>>> master branch, even with this fix.  I need to digg this further.
>>>>
>>>> Err, what's the rational behind this change?
>>>
>>> It is meant to catch cases where recenter acts on the wrong window.
>>> Think of the cases where (recenter) is called from within a timer or a
>>> process filter function.
>>>
>>> See the discussion entitled
>>>> comint-preoutput-filter-functions and flickering redisplay in TTY
>>> on emacs devel.
>>
>> Thanks!
>
> Okay, so is there another fix than `(when (eq (current-buffer)
> (window-buffer)))' or removing the call?
>
> If not, why does it raise an error instead of doing nothing silently?

I've read the fix in org-mode and I understand that it was a silly
question. Please ignore it.

Best,

-- 
Daimrod/Greg

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746: bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
  2014-06-12 10:12                 ` Daimrod
@ 2014-06-12 13:04                   ` Bastien
  0 siblings, 0 replies; 20+ messages in thread
From: Bastien @ 2014-06-12 13:04 UTC (permalink / raw)
  To: Daimrod; +Cc: Nicolas Richard, 17746, David Griffiths

Daimrod <daimrod@gmail.com> writes:

> I've read the fix in org-mode and I understand that it was a silly
> question. Please ignore it.

Well, the whole thread gave me the guts to dive in and to find, as
often, how tiny the challenge was -- so thanks for soft-prodding!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746: bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
  2014-06-12 10:06                 ` Bastien
@ 2014-06-13 12:58                   ` Nicolas Richard
  2014-06-13 15:29                     ` Bastien
       [not found]                     ` <8761k46d56.fsf@bzg.ath.cx>
  0 siblings, 2 replies; 20+ messages in thread
From: Nicolas Richard @ 2014-06-13 12:58 UTC (permalink / raw)
  To: Bastien; +Cc: Daimrod, Nicolas Richard, 17746, David Griffiths

Bastien <bzg@gnu.org> writes:

> I've now fixed this in the maint and master branch of Org's
> repository.

Thanks for looking into it.

Perhaps this isn't the right place to ask, but I wonder how
(save-excursion (set-window-start (selected-window) (window-start)))
isn't a noop.

-- 
Nico.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746: bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
  2014-06-13 12:58                   ` Nicolas Richard
@ 2014-06-13 15:29                     ` Bastien
       [not found]                     ` <8761k46d56.fsf@bzg.ath.cx>
  1 sibling, 0 replies; 20+ messages in thread
From: Bastien @ 2014-06-13 15:29 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: Daimrod, 17746, David Griffiths

Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:

> Perhaps this isn't the right place to ask, but I wonder how
> (save-excursion (set-window-start (selected-window) (window-start)))
> isn't a noop.

Perhaps it is a noop -- The purpose of `org-fix-ellipsis-at-bol'
is to remove the ellipsis overlay that outline-mode may leave
when navigating through folded regions.  At least this was the
purpose of the original version, and using recenter did the
job.  I'll try to reproduce the original bug, see if the new
version of `org-fix-ellipsis-at-bol' does the job and if not,
why.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746: bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
       [not found]                     ` <8761k46d56.fsf@bzg.ath.cx>
@ 2014-06-14  3:28                       ` Daimrod
       [not found]                       ` <87oaxw9nlh.fsf__3876.62337529964$1402716590$gmane$org@tanger.home>
  1 sibling, 0 replies; 20+ messages in thread
From: Daimrod @ 2014-06-14  3:28 UTC (permalink / raw)
  To: Bastien; +Cc: Nicolas Richard, 17746, David Griffiths

Bastien <bzg@gnu.org> writes:

> Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:
>
>> Perhaps this isn't the right place to ask, but I wonder how
>> (save-excursion (set-window-start (selected-window) (window-start)))
>> isn't a noop.
>
> Perhaps it is a noop -- The purpose of `org-fix-ellipsis-at-bol'
> is to remove the ellipsis overlay that outline-mode may leave
> when navigating through folded regions.  At least this was the
> purpose of the original version, and using recenter did the
> job.  I'll try to reproduce the original bug, see if the new
> version of `org-fix-ellipsis-at-bol' does the job and if not,
> why.

In `org-fix-ellipsis-at-bol', the change wasn't
: (save-excursion (set-window-start (selected-window) (window-start)))

but
: (save-excursion (set-window-start (selected-window) (point-min)))

which is not a noop.

But it does the wrong thing with isearch.

When isearch is done, that is, when it has found a match and we leave
isearch with RET for example. Then it calls `isearch-done' which runs
`org-fix-ellipsis-at-bol' because it is in `isearch-mode-end-hook' (I
didn't look to find why).

Because of this, if the pattern found isn't at the top of the buffer,
then the point won't be at the pattern, but at the top of the buffer.

Best,

--
Daimrod/Greg

^ permalink raw reply	[flat|nested] 20+ messages in thread

* bug#17746: bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message
       [not found]                       ` <87oaxw9nlh.fsf__3876.62337529964$1402716590$gmane$org@tanger.home>
@ 2014-06-14  6:46                         ` Bastien
  0 siblings, 0 replies; 20+ messages in thread
From: Bastien @ 2014-06-14  6:46 UTC (permalink / raw)
  To: Daimrod; +Cc: Nicolas Richard, 17746, David Griffiths

Daimrod <daimrod@gmail.com> writes:

> In `org-fix-ellipsis-at-bol', the change wasn't
> : (save-excursion (set-window-start (selected-window) (window-start)))
>
> but
> : (save-excursion (set-window-start (selected-window) (point-min)))
>
> which is not a noop.
>
> But it does the wrong thing with isearch.

Yes, it was a silly mistake of mine.

> When isearch is done, that is, when it has found a match and we leave
> isearch with RET for example. Then it calls `isearch-done' which runs
> `org-fix-ellipsis-at-bol' because it is in `isearch-mode-end-hook' (I
> didn't look to find why).

The bug `org-fix-ellipsis-at-bol' is supposed to fix is this one:
sometimes when searching for a string and hitting RET, the beginning
of the buffer is hidden and there is a confusing "..." at the top of
the window.  With the previous version (using `recenter'), those
ellipsis were removed by recentering.  My bold and kinda superstitious
hope was that `set-window-start' would have the same effect, but I
need to double-check this.  At least we don't have the warning.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2014-06-14  6:47 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <m2ha3tdrt6.fsf@gmail.com>
     [not found] ` <837g4o1x3r.fsf@gnu.org>
     [not found]   ` <CALMze+rsDUB3seBY2LvbmSuSJouh4C4Avez9uwQWreriDgtFOw@mail.gmail.com>
     [not found]     ` <87r42vlavi.fsf@geodiff-mac3.ulb.ac.be>
2014-06-11 15:50       ` bug#17746: 24.4.50; "byte-code: `recenter'ing a window that does not display current-buffer." when composing a message Bastien
     [not found]       ` <87ha3rxx79.fsf@bzg.ath.cx>
2014-06-11 16:09         ` Nicolas Richard
2014-06-11 16:25           ` Bastien
2014-06-11 19:11             ` Nicolas Richard
2014-06-11 16:29         ` Eli Zaretskii
2014-06-11 18:15           ` Stefan Monnier
2014-06-11 18:38             ` Eli Zaretskii
2014-06-12  1:15         ` bug#17746: " Daimrod
     [not found]         ` <87ppifudvd.fsf@tanger.home>
2014-06-12  2:44           ` Stefan Monnier
2014-06-12  4:10             ` Daimrod
2014-06-12  8:16           ` Nicolas Richard
     [not found]           ` <878up24k6j.fsf@yahoo.fr>
2014-06-12  8:58             ` Daimrod
     [not found]             ` <878up2ec7z.fsf@tanger.home>
2014-06-12  9:27               ` Daimrod
2014-06-12 10:06                 ` Bastien
2014-06-13 12:58                   ` Nicolas Richard
2014-06-13 15:29                     ` Bastien
     [not found]                     ` <8761k46d56.fsf@bzg.ath.cx>
2014-06-14  3:28                       ` Daimrod
     [not found]                       ` <87oaxw9nlh.fsf__3876.62337529964$1402716590$gmane$org@tanger.home>
2014-06-14  6:46                         ` Bastien
     [not found]               ` <874mzqeaug.fsf@tanger.home>
2014-06-12 10:12                 ` Daimrod
2014-06-12 13:04                   ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).