Subject: Re: bug#32555: 26.1; Async command buffer navigation bug

From: Live System User <[email-masked]>
Date: Tue, 28 Aug 2018 16:25:10 -0400

Noam Postavsky <[email-masked]> writes:

> tags 32555 + unreproducible
> quit
>
> Live System User <[email-masked]> writes:
>
>>         After an `async-shell-command' finished, I tried to
>>         navigate its buffer with the arrow-keys and got the
>>         following:
>>
>> Debugger entered--Lisp error: (wrong-type-argument processp nil)
> [...]
>>   command-execute((lambda nil (interactive) (if (comint-after-pmark-p) (comint-previous-input 1) (previous-line 1))))
>
> It looks like you've bound the arrow-keys to some command which causes
> this error.  I don't see any similar command in Emacs sources (and I
> don't get such an error in 'emacs -Q' with the normal arrow-key
> commands).

   Sorry, there was a shell-mode-hook:

(add-hook 'shell-mode-hook
          '(lambda ()
             (local-set-key [home]        ; move to beginning of line, after pro
mpt
                            'comint-bol)
             (local-set-key [up]          ; cycle backward through command histo
ry
                            '(lambda () (interactive)
                               (if (comint-after-pmark-p)
                                   (comint-previous-input 1)
                                 (previous-line 1))))
             (local-set-key [down]        ; cycle forward through command histor
y
                            '(lambda () (interactive)
                               (if (comint-after-pmark-p)
                                   (comint-next-input 1)
                                 (forward-line 1))))
             ))

    Is tnere a way to acnieve the navigation I seek?

    I've never had issues with this code before.

    Thanks.