all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Run shell command from latex?
@ 2008-04-09 19:11 saneman
  2008-04-09 20:09 ` David Hansen
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: saneman @ 2008-04-09 19:11 UTC (permalink / raw)
  To: help-gnu-emacs

I am using auctex for latex. I would like to configure Alt-1 to run a 
shell script compiles a .tex file and a few other things I have made.

It this possible?


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

* Re: Run shell command from latex?
  2008-04-09 19:11 Run shell command from latex? saneman
@ 2008-04-09 20:09 ` David Hansen
       [not found] ` <mailman.10212.1207772610.18990.help-gnu-emacs@gnu.org>
  2008-04-09 21:50 ` Peter Dyballa
  2 siblings, 0 replies; 9+ messages in thread
From: David Hansen @ 2008-04-09 20:09 UTC (permalink / raw)
  To: help-gnu-emacs

On Wed, 09 Apr 2008 21:11:32 +0200 saneman wrote:

> I am using auctex for latex. I would like to configure Alt-1 to run a
> shell script compiles a .tex file and a few other things I have made.
>
> It this possible?

How about writing a Makefile and use M-x compile?  BTW M-! aka
`shell-command' works everywhere.

David





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

* Re: Run shell command from latex?
       [not found] ` <mailman.10212.1207772610.18990.help-gnu-emacs@gnu.org>
@ 2008-04-09 20:39   ` saneman
  2008-04-10  6:48     ` David Hansen
  0 siblings, 1 reply; 9+ messages in thread
From: saneman @ 2008-04-09 20:39 UTC (permalink / raw)
  To: help-gnu-emacs

David Hansen wrote:
> On Wed, 09 Apr 2008 21:11:32 +0200 saneman wrote:
> 
>> I am using auctex for latex. I would like to configure Alt-1 to run a
>> shell script compiles a .tex file and a few other things I have made.
>>
>> It this possible?
> 
> How about writing a Makefile and use M-x compile?  BTW M-! aka
> `shell-command' works everywhere.
> 
> David
> 
> 
> 

I know but I don't want to type 'make' each time. Instead I would like 
to define a short key in my .emacs file that executes the script.

Something like:

(global-set-key "\C-r" 'myscript)


Now each time I press C-r the 'myscript' gets executed. Is that possible 
somehow?


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

* Re: Run shell command from latex?
  2008-04-09 19:11 Run shell command from latex? saneman
  2008-04-09 20:09 ` David Hansen
       [not found] ` <mailman.10212.1207772610.18990.help-gnu-emacs@gnu.org>
@ 2008-04-09 21:50 ` Peter Dyballa
  2 siblings, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2008-04-09 21:50 UTC (permalink / raw)
  To: saneman; +Cc: help-gnu-emacs


Am 09.04.2008 um 21:11 schrieb saneman:
> It this possible?


Why not? Define that shell script as another TeX command, and you're  
done, presumingly. You know that can use buffer-local variables that  
tell AUCTeX which TeX command to use?

BTW, which of the two words "from" or "for" is the one you meant to  
use? I mean, they mean quite different things!

--
Greetings

   Pete

America believes in education: the average professor earns more money  
in a year than a professional athlete earns in a whole week.
				– Evan Esar








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

* Re: Run shell command from latex?
  2008-04-09 20:39   ` saneman
@ 2008-04-10  6:48     ` David Hansen
  2008-04-10  8:04       ` David Hansen
  2008-04-10 13:53       ` Joel J. Adamson
  0 siblings, 2 replies; 9+ messages in thread
From: David Hansen @ 2008-04-10  6:48 UTC (permalink / raw)
  To: help-gnu-emacs

On Wed, 09 Apr 2008 22:39:03 +0200 saneman wrote:

> I know but I don't want to type 'make' each time. Instead I would like
> to define a short key in my .emacs file that executes the script.
>
> Something like:
>
> (global-set-key "\C-r" 'myscript)

(defun do-myscript ()
  (interactive)
  (shell-command "myscript"))

(global-set-key (kbd "C-r") #'do-myscript)

Anyway, compile mode is far more convenient if it understands your error
messages.  You could e.g. (global-set-key (kbd "C-c c") #'compile) if
you don't like to type M-x compile every time.

But in case of latex files it's probably a better idea to look how to
manipulate the external programs used by auctex (don't know if
compile-mode understands latexs error messages).

David





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

* Re: Run shell command from latex?
  2008-04-10  6:48     ` David Hansen
@ 2008-04-10  8:04       ` David Hansen
  2008-04-10 13:53       ` Joel J. Adamson
  1 sibling, 0 replies; 9+ messages in thread
From: David Hansen @ 2008-04-10  8:04 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, 10 Apr 2008 08:48:11 +0200 David Hansen wrote:

> (global-set-key (kbd "C-r") #'do-myscript)

Just another note: overwriting C-r is of course a very bad idea. The
C-c <letter> key bindings are reserved for the user, so use

(kbd "C-c r")

David





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

* Re: Run shell command from latex?
  2008-04-10  6:48     ` David Hansen
  2008-04-10  8:04       ` David Hansen
@ 2008-04-10 13:53       ` Joel J. Adamson
  2008-04-11 13:00         ` Nikolaj Schumacher
  1 sibling, 1 reply; 9+ messages in thread
From: Joel J. Adamson @ 2008-04-10 13:53 UTC (permalink / raw)
  To: help-gnu-emacs

David Hansen <david.hansen@gmx.net> writes:

> On Wed, 09 Apr 2008 22:39:03 +0200 saneman wrote:
>
>> I know but I don't want to type 'make' each time. Instead I would like
>> to define a short key in my .emacs file that executes the script.
>>
>> Something like:
>>
>> (global-set-key "\C-r" 'myscript)
>
> (defun do-myscript ()
>   (interactive)
>   (shell-command "myscript"))
>
> (global-set-key (kbd "C-r") #'do-myscript)
>
> Anyway, compile mode is far more convenient if it understands your error
> messages.  You could e.g. (global-set-key (kbd "C-c c") #'compile) if
> you don't like to type M-x compile every time.
>
> But in case of latex files it's probably a better idea to look how to
> manipulate the external programs used by auctex (don't know if
> compile-mode understands latexs error messages).

Yes, AUCTeX will take you straight to the first error in your text.  You
use "C-cC-c" to compile LaTeX.

As for not wanting to type "make" every time, (1) you don't: the default
compile-command comes up in the minibuffer and you hit RET; and (2) get
real: yes you can skip that extra keystroke but do you want to deal with
the crap you're going to get from skipping it?  What happens if you
change your mind about which command to run?  The designers of AUCTeX
have already done the hard work for you.

I suggest that you reorganize your project (using LaTeX commands, or
appropriate Makefile structure) and learn to use AUCTeX and "M-x
compile."

Joel

-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109
Public key: http://pgp.mit.edu

The information transmitted in this electronic communication is intended only
for the person or entity to whom it is addressed and may contain confidential
and/or privileged material. Any review, retransmission, dissemination or other
use of or taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. If you received this
information in error, please contact the Compliance HelpLine at 800-856-1983 and
properly dispose of this information.







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

* Re: Run shell command from latex?
  2008-04-10 13:53       ` Joel J. Adamson
@ 2008-04-11 13:00         ` Nikolaj Schumacher
  2008-04-11 14:41           ` Joel J. Adamson
  0 siblings, 1 reply; 9+ messages in thread
From: Nikolaj Schumacher @ 2008-04-11 13:00 UTC (permalink / raw)
  To: Joel J. Adamson; +Cc: help-gnu-emacs

jadamson@partners.org (Joel J. Adamson) wrote:

> David Hansen <david.hansen@gmx.net> writes:
>
> As for not wanting to type "make" every time, (1) you don't: the default
> compile-command comes up in the minibuffer and you hit RET; and

Ever better, bind `recompile' to a key, and you won't have to hit RET at
all.

> (2) get
> real: yes you can skip that extra keystroke but do you want to deal with
> the crap you're going to get from skipping it?  What happens if you
> change your mind about which command to run?

What should happen?  Unless you're using `compile' for "rm -rf ~/", it
doesn't strike me as the kind of command that requires you to think
twice about using it.


regards,
Nikolaj Schumacher




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

* Re: Run shell command from latex?
  2008-04-11 13:00         ` Nikolaj Schumacher
@ 2008-04-11 14:41           ` Joel J. Adamson
  0 siblings, 0 replies; 9+ messages in thread
From: Joel J. Adamson @ 2008-04-11 14:41 UTC (permalink / raw)
  To: Nikolaj Schumacher; +Cc: help-gnu-emacs

Nikolaj Schumacher <n_schumacher@web.de> writes:

> jadamson@partners.org (Joel J. Adamson) wrote:
>
>> David Hansen <david.hansen@gmx.net> writes:
>>
>> As for not wanting to type "make" every time, (1) you don't: the default
>> compile-command comes up in the minibuffer and you hit RET; and
>
> Ever better, bind `recompile' to a key, and you won't have to hit RET at
> all.
>
>> (2) get
>> real: yes you can skip that extra keystroke but do you want to deal with
>> the crap you're going to get from skipping it?  What happens if you
>> change your mind about which command to run?
>
> What should happen?  Unless you're using `compile' for "rm -rf ~/", it
> doesn't strike me as the kind of command that requires you to think
> twice about using it.

If instead of using a makefile, I've just written one piece of code and
I still want to use compilation-mode, I just want to compile it with say

gcc -o blah blah.c

then I wouldn't use the command "make," obviously.  My point was that if
OP is in that sort of situation, and he uses "make" then he will be
disappointed with the results.  I *would* rather think about it.

Joel

-- 
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA  02114
(617) 643-1432
(303) 880-3109
Public key: http://pgp.mit.edu

The information transmitted in this electronic communication is intended only
for the person or entity to whom it is addressed and may contain confidential
and/or privileged material. Any review, retransmission, dissemination or other
use of or taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. If you received this
information in error, please contact the Compliance HelpLine at 800-856-1983 and
properly dispose of this information.







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

end of thread, other threads:[~2008-04-11 14:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-09 19:11 Run shell command from latex? saneman
2008-04-09 20:09 ` David Hansen
     [not found] ` <mailman.10212.1207772610.18990.help-gnu-emacs@gnu.org>
2008-04-09 20:39   ` saneman
2008-04-10  6:48     ` David Hansen
2008-04-10  8:04       ` David Hansen
2008-04-10 13:53       ` Joel J. Adamson
2008-04-11 13:00         ` Nikolaj Schumacher
2008-04-11 14:41           ` Joel J. Adamson
2008-04-09 21:50 ` Peter Dyballa

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.