* key binding
@ 2003-11-27 5:35 Jason
2003-11-27 6:52 ` Eli Zaretskii
[not found] ` <mailman.699.1069919563.399.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 21+ messages in thread
From: Jason @ 2003-11-27 5:35 UTC (permalink / raw)
How to bind f5 to debug command(e.g gdb) and f7 to compile command(e.g
compile)?
Thanks.
Jason
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: key binding
@ 2014-02-05 20:12 Mickey Ferguson
0 siblings, 0 replies; 21+ messages in thread
From: Mickey Ferguson @ 2014-02-05 20:12 UTC (permalink / raw)
To: Emacs Help (help-gnu-emacs@gnu.org)
Stefan Monnier wrote:
>Post by Mickey Ferguson
>(global-set-key (kbd "<escape><f3>") (lambda () (interactive)
>(compare-windows t)))
>Try
>(global-set-key [M-f3] (lambda () (interactive) (compare-windows t)))
>or
>(global-set-key [?\e f3] (lambda () (interactive) (compare-windows t)))
>The problem with your binding is that it uses the `escape' event.
>This event is normally unbound and turned (via function-key-map) into an
>ESC event (the "ASCII char 27 known as 'escape'") to which lots of
>things are bound. This mapping is because ESC is what is received in
>a text terminal when you press the `escape' key, so some code somewhere
>needs to "unify" the ESC char (from the tty) and the `escape' event
>(from the GUI library).
Thanks, Stefan. The latter suggestion worked. And since my problem is
now solved, I'm happy! :-) And thanks also for the great explanation of
what was wrong with my original attempt. A lot of stuff I didn't know.
^ permalink raw reply [flat|nested] 21+ messages in thread
* key binding
@ 2014-02-04 22:18 Mickey Ferguson
2014-02-05 1:53 ` Stefan Monnier
0 siblings, 1 reply; 21+ messages in thread
From: Mickey Ferguson @ 2014-02-04 22:18 UTC (permalink / raw)
To: Emacs Help (help-gnu-emacs@gnu.org)
I want to bind the key sequence Esc-F3 (or Alt-F3) to the function I have defined that will compare windows, ignoring whitespace. The lambda that I've defined works fine. I found the following lisp line of code that will make this key mapping:
(global-set-key (kbd "<escape><f3>") (lambda () (interactive)
(compare-windows t)))
Unfortunately, it has the side effect of killing the other Esc-<something> types of commands. For example, I frequently use Esc-> and Esc-< to move to the end of beginning of a buffer, and they no longer work. I've confirmed that this one line is the culprit by commenting out the command, keeping the rest of my initialization intact, and all is well. So can anyone else suggest how I can safely map the Esc-F3 (Alt-F3) key combination? Replies to Mickey (dot) Ferguson (at) CassidianCommunications (dot) com.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: key binding
2014-02-04 22:18 Mickey Ferguson
@ 2014-02-05 1:53 ` Stefan Monnier
0 siblings, 0 replies; 21+ messages in thread
From: Stefan Monnier @ 2014-02-05 1:53 UTC (permalink / raw)
To: help-gnu-emacs
> (global-set-key (kbd "<escape><f3>") (lambda () (interactive)
> (compare-windows t)))
Try
(global-set-key [M-f3] (lambda () (interactive) (compare-windows t)))
or
(global-set-key [?\e f3] (lambda () (interactive) (compare-windows t)))
The problem with your binding is that it uses the `escape' event.
This event is normally unbound and turned (via function-key-map) into an
ESC event (the "ASCII char 27 known as 'escape'") to which lots of
things are bound. This mapping is because ESC is what is received in
a text terminal when you press the `escape' key, so some code somewhere
needs to "unify" the ESC char (from the tty) and the `escape' event
(from the GUI library).
Stefan
^ permalink raw reply [flat|nested] 21+ messages in thread
* Key binding
@ 2002-11-24 21:22 Florian Lindner
2002-11-25 9:48 ` Kai Großjohann
0 siblings, 1 reply; 21+ messages in thread
From: Florian Lindner @ 2002-11-24 21:22 UTC (permalink / raw)
Hi!
I try to bind the shell-command function to the C-c v key (in pascal-mode)
The command should execute a file after compilation.
(define-key pascal-mode-map "\C-c\v" '(shell-command
(file-name-sans-extension (buffer-file-name))))
But this somehow don't work...
Thx,
Florian
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Key binding
2002-11-24 21:22 Key binding Florian Lindner
@ 2002-11-25 9:48 ` Kai Großjohann
2002-11-25 17:18 ` Florian Lindner
0 siblings, 1 reply; 21+ messages in thread
From: Kai Großjohann @ 2002-11-25 9:48 UTC (permalink / raw)
Florian Lindner <Florian.Lindner@xgm.de> writes:
> (define-key pascal-mode-map "\C-c\v" '(shell-command
> (file-name-sans-extension (buffer-file-name))))
(defun fl-execute-current-buffer ()
"doc string here"
(interactive)
(shell-command (file-name-sans-extension (buffer-file-name))))
(define-key pascal-mode-map (kbd "C-c v") 'fl-execute-current-buffer)
kai
--
~/.signature is: umop ap!sdn (Frank Nobis)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Key binding
2002-11-25 9:48 ` Kai Großjohann
@ 2002-11-25 17:18 ` Florian Lindner
2002-11-25 17:47 ` Kai Großjohann
2002-11-25 17:51 ` Kevin Rodgers
0 siblings, 2 replies; 21+ messages in thread
From: Florian Lindner @ 2002-11-25 17:18 UTC (permalink / raw)
Kai Großjohann wrote:
> Florian Lindner <Florian.Lindner@xgm.de> writes:
>
>> (define-key pascal-mode-map "\C-c\v" '(shell-command
>> (file-name-sans-extension (buffer-file-name))))
>
> (defun fl-execute-current-buffer ()
> "doc string here"
> (interactive)
> (shell-command (file-name-sans-extension (buffer-file-name))))
> (define-key pascal-mode-map (kbd "C-c v") 'fl-execute-current-buffer)
Thanks,
it's not really working.
That's how it looks like now:
(add-hook 'pascal-mode-hook
(lambda()
[..]
(defun fl-execute-current-buffer ()
"Executes the compiled file"
(interactive)
(shell-command (file-name-sans-extension buffer-file-name)))
(define-key pascal-mode-map (kbd "C-c v") 'fl-execute-current-buffer)))
I've I execute this it just displays in the minibuffer:
Filename: Runtime error 201 at 0x0805C0DA
(some more hex codes)
Filename is the output my program gives right before it is waiting for
input.
If I just execute the program in a bash shell it works ok, I can enter
something.
A weird problem also apperas if I try to execute the program in the shell
mode (M-x shell), it scrolling thousands of lines with withspaces down.
Everything works on a normal shell.
Any ideas?
Thanks,
Florian
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Key binding
2002-11-25 17:18 ` Florian Lindner
@ 2002-11-25 17:47 ` Kai Großjohann
2002-11-25 21:48 ` Florian Lindner
2002-11-25 17:51 ` Kevin Rodgers
1 sibling, 1 reply; 21+ messages in thread
From: Kai Großjohann @ 2002-11-25 17:47 UTC (permalink / raw)
Florian Lindner <Florian.Lindner@xgm.de> writes:
> That's how it looks like now:
>
> (add-hook 'pascal-mode-hook
> (lambda()
> [..]
> (defun fl-execute-current-buffer ()
> "Executes the compiled file"
> (interactive)
> (shell-command (file-name-sans-extension buffer-file-name)))
> (define-key pascal-mode-map (kbd "C-c v") 'fl-execute-current-buffer)))
I meant:
(require 'pascal) ; or is it pascal-mode?
(defun ...)
(define-key ...)
Without a mode hook.
> I've I execute this it just displays in the minibuffer:
>
> Filename: Runtime error 201 at 0x0805C0DA
> (some more hex codes)
>
> Filename is the output my program gives right before it is waiting for
> input.
> If I just execute the program in a bash shell it works ok, I can enter
> something.
> A weird problem also apperas if I try to execute the program in the shell
> mode (M-x shell), it scrolling thousands of lines with withspaces down.
> Everything works on a normal shell.
Maybe that's because with M-x shell-command RET (also known as M-!)
you can't interact with the program.
Try M-x comint-run RET.
kai
--
~/.signature is: umop ap!sdn (Frank Nobis)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Key binding
2002-11-25 17:47 ` Kai Großjohann
@ 2002-11-25 21:48 ` Florian Lindner
0 siblings, 0 replies; 21+ messages in thread
From: Florian Lindner @ 2002-11-25 21:48 UTC (permalink / raw)
Kai Großjohann wrote:
> Florian Lindner <Florian.Lindner@xgm.de> writes:
>
>> That's how it looks like now:
>>
>> (add-hook 'pascal-mode-hook
>> (lambda()
>> [..]
>> (defun fl-execute-current-buffer ()
>> "Executes the compiled file"
>> (interactive)
>> (shell-command (file-name-sans-extension
>> buffer-file-name)))
>> (define-key pascal-mode-map (kbd "C-c v")
>> 'fl-execute-current-buffer)))
>
> I meant:
>
> (require 'pascal) ; or is it pascal-mode?
> (defun ...)
> (define-key ...)
I'm using pascal-mode
>
> Without a mode hook.
>
>> I've I execute this it just displays in the minibuffer:
>>
>> Filename: Runtime error 201 at 0x0805C0DA
>> (some more hex codes)
>>
>> Filename is the output my program gives right before it is waiting for
>> input.
>> If I just execute the program in a bash shell it works ok, I can enter
>> something.
>> A weird problem also apperas if I try to execute the program in the shell
>> mode (M-x shell), it scrolling thousands of lines with withspaces down.
>> Everything works on a normal shell.
>
> Maybe that's because with M-x shell-command RET (also known as M-!)
> you can't interact with the program.
>
> Try M-x comint-run RET.
comint-run has the same problem. Scrolling down thousands of blank lines.
term works.
But two more questions:
1) If the programs exits and I try to close the buffer (C-c 1) emacs just
says "current buffer has no process" or "minibuffer not active" I can close
the buffer via the menu, but not with C-c 1
2) How can I make the term buffer split the screen and not to take the
entire screen?
Thanks,
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Key binding
2002-11-25 17:18 ` Florian Lindner
2002-11-25 17:47 ` Kai Großjohann
@ 2002-11-25 17:51 ` Kevin Rodgers
2002-11-25 21:49 ` Florian Lindner
1 sibling, 1 reply; 21+ messages in thread
From: Kevin Rodgers @ 2002-11-25 17:51 UTC (permalink / raw)
Florian Lindner wrote:
> it's not really working.
> That's how it looks like now:
>
> (add-hook 'pascal-mode-hook
> (lambda()
> [..]
> (defun fl-execute-current-buffer ()
> "Executes the compiled file"
> (interactive)
> (shell-command (file-name-sans-extension buffer-file-name)))
> (define-key pascal-mode-map (kbd "C-c v") 'fl-execute-current-buffer)))
>
>
> I've I execute this it just displays in the minibuffer:
>
> Filename: Runtime error 201 at 0x0805C0DA
> (some more hex codes)
>
> Filename is the output my program gives right before it is waiting for
> input.
> If I just execute the program in a bash shell it works ok, I can enter
> something.
I believe `shell-command' executes the COMMAND with standard input bound to
/dev/null. Try `comint-run' instead.
> A weird problem also apperas if I try to execute the program in the shell
> mode (M-x shell), it scrolling thousands of lines with withspaces down.
> Everything works on a normal shell.
> Any ideas?
Perhaps your program assumes that it is connected to a terminal. You could
try using `term' (instead of `comint-run' or `shell-command').
--
<a href="mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Key binding
2002-11-25 17:51 ` Kevin Rodgers
@ 2002-11-25 21:49 ` Florian Lindner
2002-11-25 22:51 ` Kevin Rodgers
0 siblings, 1 reply; 21+ messages in thread
From: Florian Lindner @ 2002-11-25 21:49 UTC (permalink / raw)
Kevin Rodgers wrote:
> Florian Lindner wrote:
>
>> it's not really working.
>> That's how it looks like now:
>>
>> (add-hook 'pascal-mode-hook
>> (lambda()
>> [..]
>> (defun fl-execute-current-buffer ()
>> "Executes the compiled file"
>> (interactive)
>> (shell-command (file-name-sans-extension
>> buffer-file-name)))
>> (define-key pascal-mode-map (kbd "C-c v")
>> 'fl-execute-current-buffer)))
>>
>>
>> I've I execute this it just displays in the minibuffer:
>>
>> Filename: Runtime error 201 at 0x0805C0DA
>> (some more hex codes)
>>
>> Filename is the output my program gives right before it is waiting for
>> input.
>> If I just execute the program in a bash shell it works ok, I can enter
>> something.
>
>
> I believe `shell-command' executes the COMMAND with standard input bound
> to
> /dev/null. Try `comint-run' instead.
comint-run has the same problem. Scrolling down thousands of blank lines.
>> A weird problem also apperas if I try to execute the program in the shell
>> mode (M-x shell), it scrolling thousands of lines with withspaces down.
>> Everything works on a normal shell.
>> Any ideas?
>
>
> Perhaps your program assumes that it is connected to a terminal. You
> could try using `term' (instead of `comint-run' or `shell-command').
term works, Thanks.
But two more questions:
1) If the programs exits and I try to close the buffer (C-c 1) emacs just
says "current buffer has no process" or "minibuffer not active" I can close
the buffer via the menu, but not with C-c 1
2) How can I make the term buffer split the screen and not to take the
entire screen?
Thanks,
Florian
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Key binding
2002-11-25 21:49 ` Florian Lindner
@ 2002-11-25 22:51 ` Kevin Rodgers
2002-11-25 23:04 ` fabrice bauzac
2002-11-26 16:25 ` Florian Lindner
0 siblings, 2 replies; 21+ messages in thread
From: Kevin Rodgers @ 2002-11-25 22:51 UTC (permalink / raw)
Florian Lindner wrote:
> 2) How can I make the term buffer split the screen and not to take the
> entire screen?
C-x 2
--
<a href="mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Key binding
2002-11-25 22:51 ` Kevin Rodgers
@ 2002-11-25 23:04 ` fabrice bauzac
2002-11-26 16:25 ` Florian Lindner
1 sibling, 0 replies; 21+ messages in thread
From: fabrice bauzac @ 2002-11-25 23:04 UTC (permalink / raw)
> Florian Lindner wrote:
> >2) How can I make the term buffer split the screen and not to take the
> >entire screen?
Maybe C-c 2 ?
--
fabrice bauzac
Software should be free. http://www.gnu.org/philosophy/why-free.html
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Key binding
2002-11-25 22:51 ` Kevin Rodgers
2002-11-25 23:04 ` fabrice bauzac
@ 2002-11-26 16:25 ` Florian Lindner
2002-11-26 16:32 ` Kester Clegg
1 sibling, 1 reply; 21+ messages in thread
From: Florian Lindner @ 2002-11-26 16:25 UTC (permalink / raw)
Kevin Rodgers wrote:
> Florian Lindner wrote:
>
>> 2) How can I make the term buffer split the screen and not to take the
>> entire screen?
>
>
> C-x 2
split-window-vertically just splits the window and uses both parts for the
current window.
I want that the new windows takes about the half of the current window, like
the compile function.
Thx,
Florian
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Key binding
2002-11-26 16:25 ` Florian Lindner
@ 2002-11-26 16:32 ` Kester Clegg
2002-11-26 17:45 ` Kai Großjohann
0 siblings, 1 reply; 21+ messages in thread
From: Kester Clegg @ 2002-11-26 16:32 UTC (permalink / raw)
Florian Lindner <Florian.Lindner@xgm.de> writes:
> > C-x 2
>
> split-window-vertically just splits the window and uses both parts for the
> current window.
> I want that the new windows takes about the half of the current window, like
> the compile function.
Do you mean you want the second window to be smaller than C-x 2 gives
you?
Define your own function and call it:
(defun littleSplit ()
"Split in two unequal windows"
(interactive)
(split-window nil 52 nil))
--
************************************************************************
Kester Clegg Dept. of Computer Science,
Research Assistant (UTC) University of York,
Tel (01904) 43 27 49 email: kester at cs.york.ac.uk
************************************************************************
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Key binding
2002-11-26 16:32 ` Kester Clegg
@ 2002-11-26 17:45 ` Kai Großjohann
0 siblings, 0 replies; 21+ messages in thread
From: Kai Großjohann @ 2002-11-26 17:45 UTC (permalink / raw)
Kester Clegg <kester@cs.york.ac.uk> writes:
> Florian Lindner <Florian.Lindner@xgm.de> writes:
>
>> > C-x 2
>>
>> split-window-vertically just splits the window and uses both parts for the
>> current window.
>> I want that the new windows takes about the half of the current window, like
>> the compile function.
>
> Do you mean you want the second window to be smaller than C-x 2 gives
> you?
I think he means that C-x 2 produces two windows with the same
content. But he wants different content in one window.
I think C-x 2 M-x term RET will do that. Starts term in one of the
two windows, the other is left alone (displaying the scratch buffer,
or whatever).
kai
--
~/.signature is: umop ap!sdn (Frank Nobis)
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2014-02-05 20:12 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-27 5:35 key binding Jason
2003-11-27 6:52 ` Eli Zaretskii
[not found] ` <mailman.699.1069919563.399.help-gnu-emacs@gnu.org>
2003-11-27 7:43 ` Jason
2003-11-27 14:23 ` Eli Zaretskii
[not found] ` <mailman.726.1069946597.399.help-gnu-emacs@gnu.org>
2003-11-28 0:27 ` Jason
2003-11-28 3:53 ` leo
-- strict thread matches above, loose matches on Subject: below --
2014-02-05 20:12 Mickey Ferguson
2014-02-04 22:18 Mickey Ferguson
2014-02-05 1:53 ` Stefan Monnier
2002-11-24 21:22 Key binding Florian Lindner
2002-11-25 9:48 ` Kai Großjohann
2002-11-25 17:18 ` Florian Lindner
2002-11-25 17:47 ` Kai Großjohann
2002-11-25 21:48 ` Florian Lindner
2002-11-25 17:51 ` Kevin Rodgers
2002-11-25 21:49 ` Florian Lindner
2002-11-25 22:51 ` Kevin Rodgers
2002-11-25 23:04 ` fabrice bauzac
2002-11-26 16:25 ` Florian Lindner
2002-11-26 16:32 ` Kester Clegg
2002-11-26 17:45 ` Kai Großjohann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).