bug#30091: 25.3; Trying to go to non-existent info file puts the cursor in *info* buffer, not mini buffer

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#30091: 25.3; Trying to go to non-existent info file puts the cursor in *info* buffer, not mini buffer

Tim Landscheidt
(Under Fedora 26 and X, also with master,) to reproduce:

- "emacs -Q",
- C-h i for *info* buffer,
- g for "Go to node:",
- (does-not-exist) RET.

Result:

- Mini buffer says: "Info file does-not-exist does not
  exist",
- then switches back to "Go to node: (does-not-exist)",
- but cursor is put in *info* buffer, thus requiring to C-x
  o to reenter mini buffer to correct (or abort).

Expected result:

- The cursor should be in the mini buffer, not in *info*.



Reply | Threaded
Open this post in threaded view
|

bug#30091: 25.3; Trying to go to non-existent info file puts the cursor in *info* buffer, not mini buffer

Lars Ingebrigtsen
Tim Landscheidt <[hidden email]> writes:

> (Under Fedora 26 and X, also with master,) to reproduce:
>
> - "emacs -Q",
> - C-h i for *info* buffer,
> - g for "Go to node:",
> - (does-not-exist) RET.
>
> Result:
>
> - Mini buffer says: "Info file does-not-exist does not
>   exist",
> - then switches back to "Go to node: (does-not-exist)",
> - but cursor is put in *info* buffer, thus requiring to C-x
>   o to reenter mini buffer to correct (or abort).

Utterly weird.  I've tried to debug this, and the error is in

(Info-read-node-name "Go to node: ")

If you type "foo", then point does not move to the *info* buffer.  If
you type "(foo)", then point does move to the *info* buffer.

It seems like it's this code

         (lambda (string pred action)
           (complete-with-action
            action
            (Info-build-node-completions (Info-find-file file1))
            string pred))

that somehow (when `Info-find-file' raises a user-error pops to the
*info* buffer...  somehow...

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#30091: 25.3; Trying to go to non-existent info file puts the cursor in *info* buffer, not mini buffer

Lars Ingebrigtsen
In reply to this post by Tim Landscheidt
OK, one step further.  The following pops to the *info* buffer:

(completion-table-with-context "(foo)" (lambda (string pred action) (complete-with-action action (Info-build-node-completions (Info-find-file "foo")))) nil nil nil)

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Reply | Threaded
Open this post in threaded view
|

bug#30091: 25.3; Trying to go to non-existent info file puts the cursor in *info* buffer, not mini buffer

Lars Ingebrigtsen
In reply to this post by Tim Landscheidt
OK, here's the bug:

          ;; If there is no previous Info file, go to the directory.
          (unless Info-current-file
            (Info-directory))
          (user-error "Info file %s does not exist" filename)))

Info-current-file is nil here, so it helpfully pops us back to the
*info* buffer before displaying the error.  I'm not sure what the right
fix here is...

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Reply | Threaded
Open this post in threaded view
|

bug#30091: 25.3; Trying to go to non-existent info file puts the cursor in *info* buffer, not mini buffer

Lars Ingebrigtsen
In reply to this post by Tim Landscheidt
I've now pushed a fix in Emacs 27.1.

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no