emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/greader 5d9a24442e: greader-continuous-call-function: m


From: ELPA Syncer
Subject: [elpa] externals/greader 5d9a24442e: greader-continuous-call-function: modified.
Date: Mon, 13 Nov 2023 03:58:12 -0500 (EST)

branch: externals/greader
commit 5d9a24442e531cd87f7d015f7c09f1a3bcb94832
Author: Michelangelo Rodriguez <michelangelo.rodriguez@gmail.com>
Commit: Michelangelo Rodriguez <michelangelo.rodriguez@gmail.com>

    greader-continuous-call-function: modified.
    
    In this new version I have modified the code to ensure that the point
    is not at end of buffer.
    before calling the function
    scrolling.
    This approach seems to work, or at least I can't anymore
    reproduce end-of-buffer errors.
    But I have observed some phenomena that this simple and for now effective
    solution does not explain:
    If I call the function interactively at the end of the buffer the
    "info-scroll-up" function in my emacs instance works
    very well, without generating errors.
    I tried previously to change the function
    "greader-call-function" to use "funcall-interactively"
    instead of "funcall", but the function still generated the error.
    Why this asymmetry can arise between the call with
    "funcall-interactively" and call it directly from the command-loop?
    Also, the following backtrace, obtained when the function was not
    been changed is as follows:
    Debugger entered--Lisp error: (end-of-buffer)
      #<subr scroll-up>(nil)
      ad-Advice-scroll-up(#<subr scroll-up>)
      apply(ad-Advice-scroll-up #<subr scroll-up> nil)
      scroll-up()
      #<subr Info-scroll-up>()
      ad-Advice-Info-scroll-up(#<subr Info-scroll-up>)
      apply(ad-Advice-Info-scroll-up #<subr Info-scroll-up> nil)
      Info-scroll-up()
      funcall(Info-scroll-up)
      (progn (funcall command) (greader-read))
      (if command (progn (funcall command) (greader-read)))
      (let ((command (greader-continuous-guess-function))) (if command (progn 
(funcall command) (greader-read))) t)
      (condition-case nil (let ((command (greader-continuous-guess-function))) 
(if command (progn (funcall command) (greader-read))) t) ((debug error) nil))
      greader-continuous-call-function()
      run-hook-with-args-until-success(greader-continuous-call-function)
      greader--call-before-finish-functions()
      (if (greader--call-before-finish-functions) nil 
(greader-read-asynchronous ". end"))
      (progn (set (make-local-variable 'greader-backend-action) 
#'greader--default-action) (greader-set-greader-keymap) (if 
(greader--call-before-finish-functions) nil (greader-read-asynchronous ". 
end")))
      (if chunk (progn (setq chunk 
(greader--call-functions-after-get-of-sentence chunk)) (if (string-suffix-p 
".." chunk) (setq chunk (concat chunk "."))) (greader-set-reading-keymap) (set 
(make-local-variable 'greader-backend-action) #'greader-next-action) 
(greader-read-asynchronous chunk)) (progn (set (make-local-variable 
'greader-backend-action) #'greader--default-action) 
(greader-set-greader-keymap) (if (greader--call-before-finish-functions) nil 
(greader-read-asynchronous ". end"))))
      (let ((chunk (funcall greader-read-chunk-of-text))) (if chunk (progn 
(setq chunk (greader--call-functions-after-get-of-sentence chunk)) (if 
(string-suffix-p ".." chunk) (setq chunk (concat chunk "."))) 
(greader-set-reading-keymap) (set (make-local-variable 'greader-backend-action) 
#'greader-next-action) (greader-read-asynchronous chunk)) (progn (set 
(make-local-variable 'greader-backend-action) #'greader--default-action) 
(greader-set-greader-keymap) (if (greader--call-before-finish- [...]
      greader-read()
      greader-next-action(#<process greader-backend> "finished\n")
      funcall(greader-next-action #<process greader-backend> "finished\n")
      greader-action(#<process greader-backend> "finished\n")
    It could be that the function's bizarre behavior
    Does "info-scroll-up" depend on whether it is advised?
    In any case, for now we have a working version.
    I will continue to investigate this fascinating problem.
---
 greader.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/greader.el b/greader.el
index 3faf3fae02..00f0e44246 100644
--- a/greader.el
+++ b/greader.el
@@ -1556,6 +1556,9 @@ the reading process, returning nil in such cases."
         ;; Check if a valid command is returned.
         (when command
           ;; Calls the function returned by greader-continuous-guess-function.
+;; We check that the point is not at the end of the buffer.
+         (when (eobp)
+           (goto-char (- (point-max) 1)))
           (funcall command)
           (greader-read))
         t)  ; Returns t if no error occurs.



reply via email to

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