all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* binding a command and a parameter
@ 2007-10-13 19:09 Nikola Skoric
  2007-10-13 22:41 ` Peter Dyballa
       [not found] ` <mailman.2032.1192315305.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 14+ messages in thread
From: Nikola Skoric @ 2007-10-13 19:09 UTC (permalink / raw
  To: help-gnu-emacs

What I'd like to do is create a binding for this:
I invoke TeX-command-master, and then type in LaTeX. I suppose I
should bind a key to TeX-command-master and send LaTeX as
parameter... I tried (global-set-key "\C-cl" '(TeX-command-master
LaTeX)), but that doesn't work (sorry if I just wrote a blasphemy, I'm
still a newbie...).

-- 
"Now the storm has passed over me
I'm left to drift on a dead calm sea
And watch her forever through the cracks in the beams
Nailed across the doorways of the bedrooms of my dreams"

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: binding a command and a parameter
  2007-10-13 19:09 binding a command and a parameter Nikola Skoric
@ 2007-10-13 22:41 ` Peter Dyballa
       [not found] ` <mailman.2032.1192315305.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 14+ messages in thread
From: Peter Dyballa @ 2007-10-13 22:41 UTC (permalink / raw
  To: Nikola Skoric; +Cc: help-gnu-emacs


Am 13.10.2007 um 21:09 schrieb Nikola Skoric:

> What I'd like to do is create a binding for this:

And what do you want to achieve? I presume with AUCTeX ...

--
Greetings

   Pete

"Don't just do something, sit there."

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: binding a command and a parameter
       [not found] ` <mailman.2032.1192315305.18990.help-gnu-emacs@gnu.org>
@ 2007-10-14  9:21   ` Nikola Skoric
  2007-10-14 16:57     ` Maarten Bergvelt
  0 siblings, 1 reply; 14+ messages in thread
From: Nikola Skoric @ 2007-10-14  9:21 UTC (permalink / raw
  To: help-gnu-emacs

Dana Sun, 14 Oct 2007 00:41:37 +0200, 
Peter Dyballa <Peter_Dyballa@Web.DE> kaze:
>
> Am 13.10.2007 um 21:09 schrieb Nikola Skoric:
>
>> What I'd like to do is create a binding for this:
>
> And what do you want to achieve? I presume with AUCTeX ...

You are right. I'd like to strike C-cl instead of reaching for mouse and
clicking on that lion icon. Equivalent of clicking on the lion icon is 
striking C-c C-c and typing LaTeX RET. So I figure I could make a binding
to do that in just one keystroke?

-- 
"Now the storm has passed over me
I'm left to drift on a dead calm sea
And watch her forever through the cracks in the beams
Nailed across the doorways of the bedrooms of my dreams"

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: binding a command and a parameter
  2007-10-14  9:21   ` Nikola Skoric
@ 2007-10-14 16:57     ` Maarten Bergvelt
  2007-10-14 17:26       ` Nikola Skoric
  0 siblings, 1 reply; 14+ messages in thread
From: Maarten Bergvelt @ 2007-10-14 16:57 UTC (permalink / raw
  To: help-gnu-emacs

In article <fesn2d$f2b$1@ss408.t-com.hr>, Nikola Skoric wrote:
> Dana Sun, 14 Oct 2007 00:41:37 +0200, 
> Peter Dyballa <Peter_Dyballa@Web.DE> kaze:
>>
>> Am 13.10.2007 um 21:09 schrieb Nikola Skoric:
>>
>>> What I'd like to do is create a binding for this:
>>
>> And what do you want to achieve? I presume with AUCTeX ...
> 
> You are right. I'd like to strike C-cl instead of reaching for mouse and
> clicking on that lion icon. Equivalent of clicking on the lion icon is 
> striking C-c C-c and typing LaTeX RET. So I figure I could make a binding
> to do that in just one keystroke?

You should not need to type Latex, just hit return.
-- 
Maarten Bergvelt		

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: binding a command and a parameter
  2007-10-14 16:57     ` Maarten Bergvelt
@ 2007-10-14 17:26       ` Nikola Skoric
  2007-10-14 17:40         ` Nikola Skoric
  0 siblings, 1 reply; 14+ messages in thread
From: Nikola Skoric @ 2007-10-14 17:26 UTC (permalink / raw
  To: help-gnu-emacs

Dana Sun, 14 Oct 2007 16:57:02 +0000 (UTC), 
Maarten Bergvelt <bergv@math.uiuc.edu> kaze:
> In article <fesn2d$f2b$1@ss408.t-com.hr>, Nikola Skoric wrote:
>> Dana Sun, 14 Oct 2007 00:41:37 +0200, 
>> Peter Dyballa <Peter_Dyballa@Web.DE> kaze:
>>>
>>> Am 13.10.2007 um 21:09 schrieb Nikola Skoric:
>>>
>>>> What I'd like to do is create a binding for this:
>>>
>>> And what do you want to achieve? I presume with AUCTeX ...
>> 
>> You are right. I'd like to strike C-cl instead of reaching for mouse and
>> clicking on that lion icon. Equivalent of clicking on the lion icon is 
>> striking C-c C-c and typing LaTeX RET. So I figure I could make a binding
>> to do that in just one keystroke?
>
> You should not need to type Latex, just hit return.

That works if the last command I used was latex. But, sometimes I also use
bibtex... And, I'd really like to bind that whole combination to something.

-- 
"Now the storm has passed over me
I'm left to drift on a dead calm sea
And watch her forever through the cracks in the beams
Nailed across the doorways of the bedrooms of my dreams"

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: binding a command and a parameter
  2007-10-14 17:26       ` Nikola Skoric
@ 2007-10-14 17:40         ` Nikola Skoric
  2007-10-14 17:57           ` Joost Kremers
  0 siblings, 1 reply; 14+ messages in thread
From: Nikola Skoric @ 2007-10-14 17:40 UTC (permalink / raw
  To: help-gnu-emacs

Dana Sun, 14 Oct 2007 17:26:33 +0000 (UTC), 
Nikola Skoric <nick-news@net4u.hr> kaze:
> Dana Sun, 14 Oct 2007 16:57:02 +0000 (UTC), 
> Maarten Bergvelt <bergv@math.uiuc.edu> kaze:
>> You should not need to type Latex, just hit return.
>
> That works if the last command I used was latex. But, sometimes I also use
> bibtex... And, I'd really like to bind that whole combination to something.

Hm, no, if I don't hit return, it invokes xdvi. So, I do have to type latex.

-- 
"Now the storm has passed over me
I'm left to drift on a dead calm sea
And watch her forever through the cracks in the beams
Nailed across the doorways of the bedrooms of my dreams"

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: binding a command and a parameter
  2007-10-14 17:40         ` Nikola Skoric
@ 2007-10-14 17:57           ` Joost Kremers
  2007-10-14 19:18             ` Nikola Skoric
  0 siblings, 1 reply; 14+ messages in thread
From: Joost Kremers @ 2007-10-14 17:57 UTC (permalink / raw
  To: help-gnu-emacs

Nikola Skoric wrote:
> Dana Sun, 14 Oct 2007 17:26:33 +0000 (UTC), 
> Nikola Skoric <nick-news@net4u.hr> kaze:
>> Dana Sun, 14 Oct 2007 16:57:02 +0000 (UTC), 
>> Maarten Bergvelt <bergv@math.uiuc.edu> kaze:
>>> You should not need to type Latex, just hit return.
>>
>> That works if the last command I used was latex. But, sometimes I also use
>> bibtex... And, I'd really like to bind that whole combination to something.
>
> Hm, no, if I don't hit return, it invokes xdvi. So, I do have to type latex.

AUCTeX provides a default based on the current state of the document
compilation. the default is latex if the .tex file is newer than the dvi
file (or pdf, if you're using pdflatex), but if the dvi file is up-to-date,
the default is xdvi (or whatever viewer you've defined, or AUCTeX finds
suitable).

however, the prompt sports TAB-completion, so all you really need to type
to get latex is just `l', then hit RETURN.


-- 
Joost Kremers                                      joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: binding a command and a parameter
  2007-10-14 17:57           ` Joost Kremers
@ 2007-10-14 19:18             ` Nikola Skoric
  2007-10-14 19:54               ` Joost Kremers
  0 siblings, 1 reply; 14+ messages in thread
From: Nikola Skoric @ 2007-10-14 19:18 UTC (permalink / raw
  To: help-gnu-emacs

Dana 14 Oct 2007 17:57:08 GMT, 
Joost Kremers <joostkremers@yahoo.com> kaze:
> Nikola Skoric wrote:
>> Dana Sun, 14 Oct 2007 17:26:33 +0000 (UTC), 
>> Nikola Skoric <nick-news@net4u.hr> kaze:
>>> Dana Sun, 14 Oct 2007 16:57:02 +0000 (UTC), 
>>> Maarten Bergvelt <bergv@math.uiuc.edu> kaze:
>>>> You should not need to type Latex, just hit return.
>>>
>>> That works if the last command I used was latex. But, sometimes I also use
>>> bibtex... And, I'd really like to bind that whole combination to something.
>>
>> Hm, no, if I don't hit return, it invokes xdvi. So, I do have to type latex.
>
> AUCTeX provides a default based on the current state of the document
> compilation. the default is latex if the .tex file is newer than the dvi
> file (or pdf, if you're using pdflatex), but if the dvi file is up-to-date,
> the default is xdvi (or whatever viewer you've defined, or AUCTeX finds
> suitable).

Of course dvi file is up-to-date since I'm editing .tex file which is then
\included to .tex file I'm compiling (main fail doesn't change). So, my default
option is always view :-)

> however, the prompt sports TAB-completion, so all you really need to type
> to get latex is just `l', then hit RETURN.

Arrow up works fine to, but I'd really like to learn how to bind this kind of
commands. :-D

-- 
"Now the storm has passed over me
I'm left to drift on a dead calm sea
And watch her forever through the cracks in the beams
Nailed across the doorways of the bedrooms of my dreams"

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: binding a command and a parameter
  2007-10-14 19:18             ` Nikola Skoric
@ 2007-10-14 19:54               ` Joost Kremers
  2007-10-14 20:46                 ` Nikola Skoric
  0 siblings, 1 reply; 14+ messages in thread
From: Joost Kremers @ 2007-10-14 19:54 UTC (permalink / raw
  To: help-gnu-emacs

Nikola Skoric wrote:
> Of course dvi file is up-to-date since I'm editing .tex file which is then
> \included to .tex file I'm compiling (main fail doesn't change). So, my default
> option is always view :-)

then there is something not entirely right about your setup. my first guess
would be that you don't have a TeX-master set in your included files. if
you do, AUCTeX will know that the file you're editing is not the master
file, and will do the right thing if you compile your document. (what i
mean is, you can then type C-c C-c in your included file, the one you're
editing, and AUCTeX will know that it should actually compile the master
file; it will also know that even though the master file hasn't changed, it
must still run LaTeX on in, instead of xdvi.)

the way to do this is to include a block of Local Variables in all of your
latex files, right at the end:

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "thesis"
%%% End: 

the important part is the TeX-master variable. this tells AUCTeX that the
master file is thesis.tex, not chapter1.tex (or whatever file you're
editing).

in the master file itself, TeX-master should just be t:

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 

if you start a new .tex file, AUCTeX normally asks you want the master file
is. if you use multi-file documents, it's a very good idea to set this up
properly.

>> however, the prompt sports TAB-completion, so all you really need to type
>> to get latex is just `l', then hit RETURN.
>
> Arrow up works fine to, but I'd really like to learn how to bind this kind of
> commands. :-D

well, i guess binding a command plus interactive input to a key isn't the
most common thing to do. personally, i'd delve into the AUCTeX source a bit
and find out what lisp invocation actually runs the requisite latex command
on the file i'm editing, wrap it in a lambda form and bind that to a
key. but that requires some knowledge of lisp, of course. a quicker method
may be to use a keyboard macro: (info "(emacs)Keyboard Macros").


-- 
Joost Kremers                                      joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: binding a command and a parameter
  2007-10-14 19:54               ` Joost Kremers
@ 2007-10-14 20:46                 ` Nikola Skoric
  2007-10-14 21:11                   ` Nikola Skoric
  0 siblings, 1 reply; 14+ messages in thread
From: Nikola Skoric @ 2007-10-14 20:46 UTC (permalink / raw
  To: help-gnu-emacs

Dana 14 Oct 2007 19:54:55 GMT, 
Joost Kremers <joostkremers@yahoo.com> kaze:
> Nikola Skoric wrote:
>> Of course dvi file is up-to-date since I'm editing .tex file which is then
>> \included to .tex file I'm compiling (main fail doesn't change). So, my default
>> option is always view :-)
>
> then there is something not entirely right about your setup. my first guess
> would be that you don't have a TeX-master set in your included files. if
> you do, AUCTeX will know that the file you're editing is not the master
> file, and will do the right thing if you compile your document. (what i
> mean is, you can then type C-c C-c in your included file, the one you're
> editing, and AUCTeX will know that it should actually compile the master
> file; it will also know that even though the master file hasn't changed, it
> must still run LaTeX on in, instead of xdvi.)

Wow. I constanty forget that both latex and emacs are older than me so every
problem I have has already been solved.

> the way to do this is to include a block of Local Variables in all of your
> latex files, right at the end:
>
> %%% Local Variables: 
> %%% mode: latex
> %%% TeX-master: "thesis"
> %%% End: 

Hm. Interesting thing happens now. If I now do the C-c C-c latex thing from
main file - everything's fine. But, if I do it from included file, I get
errors. I then click the yellow triangle error icon and it opens *main_file
output* which has no errors in it. When I click that icon it usualy opens
*TeX Help* buffer and points to the line with error, but not this time...
So I just can't figure out where the error is.

>>> however, the prompt sports TAB-completion, so all you really need to type
>>> to get latex is just `l', then hit RETURN.
>>
>> Arrow up works fine to, but I'd really like to learn how to bind this kind of
>> commands. :-D
>
> well, i guess binding a command plus interactive input to a key isn't the
> most common thing to do. 

OK, fair enough :-)

-- 
"Now the storm has passed over me
I'm left to drift on a dead calm sea
And watch her forever through the cracks in the beams
Nailed across the doorways of the bedrooms of my dreams"

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: binding a command and a parameter
  2007-10-14 20:46                 ` Nikola Skoric
@ 2007-10-14 21:11                   ` Nikola Skoric
  2007-10-14 22:17                     ` Joost Kremers
  0 siblings, 1 reply; 14+ messages in thread
From: Nikola Skoric @ 2007-10-14 21:11 UTC (permalink / raw
  To: help-gnu-emacs

Dana Sun, 14 Oct 2007 20:46:06 +0000 (UTC), 
Nikola Skoric <nick-news@net4u.hr> kaze:
> Dana 14 Oct 2007 19:54:55 GMT, 
> Joost Kremers <joostkremers@yahoo.com> kaze:
>> the way to do this is to include a block of Local Variables in all of your
>> latex files, right at the end:
>>
>> %%% Local Variables: 
>> %%% mode: latex
>> %%% TeX-master: "thesis"
>> %%% End: 
>
> Hm. Interesting thing happens now. If I now do the C-c C-c latex thing from
> main file - everything's fine. But, if I do it from included file, I get
> errors. I then click the yellow triangle error icon and it opens *main_file
> output* which has no errors in it. When I click that icon it usualy opens
> *TeX Help* buffer and points to the line with error, but not this time...
> So I just can't figure out where the error is.

Ha! It works. I restarted emacs, removed two % signs from each line (so I have
just one % per line) and now it works for some unknown reason. Thank you very
much for helping me with this one, it will make my live much more easier :-)

-- 
"Now the storm has passed over me
I'm left to drift on a dead calm sea
And watch her forever through the cracks in the beams
Nailed across the doorways of the bedrooms of my dreams"

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: binding a command and a parameter
  2007-10-14 21:11                   ` Nikola Skoric
@ 2007-10-14 22:17                     ` Joost Kremers
  2007-10-14 22:25                       ` David Kastrup
  0 siblings, 1 reply; 14+ messages in thread
From: Joost Kremers @ 2007-10-14 22:17 UTC (permalink / raw
  To: help-gnu-emacs

Nikola Skoric wrote:
> Ha! It works. I restarted emacs, removed two % signs from each line (so I have
> just one % per line) and now it works for some unknown reason.

three or one percent sign shouldn't matter one bit. restarting emacs did
the trick. (i think it would have been enough to close all the files of the
project and load them again, but restarting emacs may actually be
quicker. ;-)

> Thank you very
> much for helping me with this one, it will make my live much more easier
> :-)

AUCTeX is a bit like emacs: i've been using it for quite a few years now,
and i still discover new functions.

check out TeX-fold-mode and RefTeX, for example.

-- 
Joost Kremers                                      joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: binding a command and a parameter
  2007-10-14 22:17                     ` Joost Kremers
@ 2007-10-14 22:25                       ` David Kastrup
  2007-10-15 18:37                         ` Joost Kremers
  0 siblings, 1 reply; 14+ messages in thread
From: David Kastrup @ 2007-10-14 22:25 UTC (permalink / raw
  To: help-gnu-emacs

Joost Kremers <joostkremers@yahoo.com> writes:

> AUCTeX is a bit like emacs: i've been using it for quite a few years
> now, and i still discover new functions.
>
> check out TeX-fold-mode [...]

Well, discovering new functions is not overly surprising if the
functions actually are new.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: binding a command and a parameter
  2007-10-14 22:25                       ` David Kastrup
@ 2007-10-15 18:37                         ` Joost Kremers
  0 siblings, 0 replies; 14+ messages in thread
From: Joost Kremers @ 2007-10-15 18:37 UTC (permalink / raw
  To: help-gnu-emacs

David Kastrup wrote:
> Joost Kremers <joostkremers@yahoo.com> writes:
>> check out TeX-fold-mode [...]
>
> Well, discovering new functions is not overly surprising if the
> functions actually are new.

heh, i didn't know that. well, i love it. ;-)


-- 
Joost Kremers                                      joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-10-15 18:37 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-13 19:09 binding a command and a parameter Nikola Skoric
2007-10-13 22:41 ` Peter Dyballa
     [not found] ` <mailman.2032.1192315305.18990.help-gnu-emacs@gnu.org>
2007-10-14  9:21   ` Nikola Skoric
2007-10-14 16:57     ` Maarten Bergvelt
2007-10-14 17:26       ` Nikola Skoric
2007-10-14 17:40         ` Nikola Skoric
2007-10-14 17:57           ` Joost Kremers
2007-10-14 19:18             ` Nikola Skoric
2007-10-14 19:54               ` Joost Kremers
2007-10-14 20:46                 ` Nikola Skoric
2007-10-14 21:11                   ` Nikola Skoric
2007-10-14 22:17                     ` Joost Kremers
2007-10-14 22:25                       ` David Kastrup
2007-10-15 18:37                         ` Joost Kremers

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.