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

 
 

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

Submitted by:  None
Submitted on:  Thu 05 Nov 2015 11:18:35 PM UTC  
 
Category: DocumentationSeverity: 2 - Minor
Priority: 1 - LaterItem Group: Documentation
Status: InvalidAssigned to: None
Originator Name: Jonathan HolmesOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.0.2
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project Administrator
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>
Project Administrator
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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 05 Oct 2016 08:53:06 PM UTCmtmillerStatusNeed Info=>Invalid
      Open/ClosedOpen=>Closed
    Fri 17 Jun 2016 10:25:18 PM UTCmtmillerSeverity3 - Normal=>2 - Minor
      Priority5 - Normal=>1 - Later
      StatusNone=>Need Info
      Release3.8.1=>4.0.2

    Back to the top


    Powered by Savane 3.1-cleanup1