[ESS] How to assign function key

Martin Maechler m@ech|er @end|ng |rom @t@t@m@th@ethz@ch
Fri Feb 5 20:46:37 CET 2016


On Thu, Feb 4, 2016 at 9:21 PM, Patrick Connolly
<p_connolly using slingshot.co.nz> wrote:
> On Thu, 04-Feb-2016 at 11:57AM +0100, Martin Maechler wrote:
>
> [...]
>
> |> I think there are two (or more?) simultanous problems and we have not yet
> |> separated them:
> |>
> |> 1) 'comint-kill-output  is not defined in today's emacs, and it seems
> |>                      is *also* not defined in your initialization
> |>    at the time where you call  (global-set-key [f7] 'comint-kill-output)
> |>
> |>    but the (global-set-key [f7] ...)  syntax is otherwise correct
> |>
> |> 2) (I guess) for unfortunate emacs-design reasons the *preferred*
> |>         (define-key ess-mode-map ... ...)
> |>    syntax may have to be different from the one for global-set-key,
> |>    and so [f7] seems invalid in the (define-key .) case, but
> |>         valid in the global-set-key one.
> |>
> |> 3) I use ESS/Emacs default  where C-c C-o is bound to  comint-delete-output
> |>    which works fine.
> |>    So I wonder why you want to maintain yourself two different versions of this.
> |>    But that may have been very conscious.
>
> It was, C-c C-o involves 3 key presses.  F7 involves one.

(plus moving the hand up there and down again .... but I agree, using
F<n> keys in emacs is something I like too!)

I think you misunderstood what I meant to say:  I well understand that
you may want to abbreviate a key combination.
But I did not understand why you maintain two separate elisp functions
 ("comint-kill-output" and "ess-....")
when instead you could use the one that already comes with comint,
i.e. with emacs,
namely  comint-delete-output ... the one I found via looking up the
key binding of  C-c C-o
>
> [...]
>
> |> Alternatively (and more quickly, actually): Navigate to them in
> |> your ~/.emacs file and
> |> use C-x C-e (at their "end of function call" / "end of expression")
> |> and the result is displayed in the mini buffer (and saved in
> |> *Messages*).
>
> This is what I get in *Messages*:
>
> with (define-key ess-mode-map [f7] 'ess-comint-kill-output)
> eval: Symbol's value as variable is void: ess-mode-map
>
> with (global-set-key [f7] 'comint-kill-output)
> comint-kill-output
>
>
> So, does that mean I have to define 'comint-kill-output
> somewhere/somehow?
>
> Thanks for the help.
>
>
> --
> ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
>    ___    Patrick Connolly
>  {~._.~}                   Great minds discuss ideas
>  _( Y )_                 Average minds discuss events
> (:_~*~_:)                  Small minds discuss people
>  (_)-(_)                              ..... Eleanor Roosevelt
>
> ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
>




More information about the ESS-help mailing list