[R] RGui: windows-record and command history

Martin Maechler maechler at stat.math.ethz.ch
Thu Mar 23 17:58:50 CET 2006


>>>>> "Martin" == Martin Maechler <maechler at stat.math.ethz.ch>
>>>>>     on Thu, 23 Mar 2006 15:04:23 +0100 writes:

>>>>> "Duncan" == Duncan Murdoch <murdoch at stats.uwo.ca>
>>>>>     on Thu, 23 Mar 2006 08:48:52 -0500 writes:

    Duncan> On 3/23/2006 7:35 AM, Thomas Steiner wrote:

    Martin> ............

    >>> b) Scrolling up in RGui (windows 2000) to see past commands is nice,
    >>> but: Is it possible to type eg "wi" and the "arrow up" and see the
    >>> last command that started with "wi" (like windows()). I know this
    >>> feature from Matlab (Uops, one of the forbidden words here? ;) ) and
    >>> it's nice to have it.

    Duncan> We have things like that on platforms that use the
    Duncan> readline library for input, but Rgui doesn't. 

    Martin> Also note that ESS (Emacs Speaks Statistics) has exactly 
    Martin> this feature on all platforms ! 

uuhm... "exactly" (using the [up] arrow key) only if you use our
(recommended but not default) emacs setting below; otherwise, you have
to use 'C-c M-r' instead of the up arrow

 (eval-after-load
   "comint"
   '(progn
      (setq comint-scroll-to-bottom-on-output 'others) ; not current
      ;;=default: (setq comint-scroll-to-bottom-on-input nil)
      (setq comint-scroll-show-maximum-output t) ;;; this is the key
      (define-key comint-mode-map [up]
        'comint-previous-matching-input-from-input)
      (define-key comint-mode-map [down]
        'comint-next-matching-input-from-input)

      (define-key comint-mode-map "\C-a" 'comint-bol)))

[for the non-emacs experts: the above is "emacs-lisp" language;
 you have to add it to your <home-directory>/.emacs or a
 site-wide emacs initialiation file {such as 'site-start.el'}.

Martin Maechler, ETH Zurich

    Duncan> It would be nice, but it's a fair bit of work to
    Duncan> implement properly and it's not on my todo list.

    Duncan> Duncan Murdoch




More information about the R-help mailing list