bugGNU Octave - Bugs: bug #46383, Documentation for using up/down...

 
 

bug #46383: Documentation for using up/down arrows for history in emacs incorrect

Submitter:  None
Submitted:  Thu 05 Nov 2015 11:18:35 PM UTC
   
 
Category:  Documentation Severity:  2 - Minor
Priority:  1 - Later Item Group:  Documentation
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Jonathan Holmes Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.0.2
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 05 Oct 2016 08:53:06 PM UTC, comment #2: 

The emacs-related sections have been removed from the Octave manual, closing as invalid now that the docs do not reference emacs at all.

Mike Miller <mtmiller>
Group Member
Fri 17 Jun 2016 10:25:18 PM UTC, comment #1: 

I am also not an emacs user, but I can deduce what the difference is between "comint-previous-input" and "comint-previous-matching-input-from-input".

Personally I prefer the arrow keys to scroll through the history unconditionally, not matching what I have already typed, but I do recognize that Octave's default readline configuration is to scroll through previous matches.

Does anyone who does use emacs care enough to patch the docs to suggest one or the other set of comint functions? Or maybe both with a description of the differences?

Mike Miller <mtmiller>
Group Member
Thu 05 Nov 2015 11:18:35 PM UTC, original submission:  

The documentation on this page:

https://www.gnu.org/software/octave/doc/interpreter/Running-Octave-from-Within-Emacs.html#Running-Octave-from-Within-Emacs

says that to make the up/down arrows behave as in the shell, one should add the following code to .emacs:

(add-hook 'inferior-octave-mode-hook
          (lambda ()
            (turn-on-font-lock)
            (define-key inferior-octave-mode-map [up]
              'comint-previous-input)
            (define-key inferior-octave-mode-map [down]
              'comint-next-input)))

This does not create behavior that one would expect in the shell; in the shell, the up arrow will search for a command that matches what you have already typed in, while in emacs with this code, you will cycle through all commands regardless of what you have typed in.

I am using Octave 3.8.1 and Emacs 24.3.1.

I know absolutely nothing of Emacs Lisp, but I looked up the comint-next-input and comint-previous-input commands and found that the following seemed to match the behavior in the shell:

(add-hook 'inferior-octave-mode-hook
          (lambda ()
            (turn-on-font-lock)
            (define-key inferior-octave-mode-map [up]
              'comint-previous-matching-input-from-input)
            (define-key inferior-octave-mode-map [down]
              'comint-next-matching-input-from-input)))

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-10-05 mtmiller StatusNeed Info Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2016-06-17 mtmiller Severity3 - Normal 2 - Minor
        Priority5 - Normal 1 - Later
        StatusNone Need Info
        Release3.8.1 4.0.2

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code