octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #46383] Documentation for using up/down arrows


From: anonymous
Subject: [Octave-bug-tracker] [bug #46383] Documentation for using up/down arrows for history in emacs incorrect
Date: Thu, 05 Nov 2015 23:18:37 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?46383>

                 Summary: Documentation for using up/down arrows for history
in emacs incorrect
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Thu 05 Nov 2015 11:18:35 PM UTC
                Category: Documentation
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Documentation
                  Status: None
             Assigned to: None
         Originator Name: Jonathan Holmes
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.1
        Operating System: Any

    _______________________________________________________

Details:

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)))




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46383>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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