all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: hrmadhu@gmail.com
Subject: Re: Add a new tool-bar item in emacs
Date: 9 Jun 2006 09:23:17 -0700	[thread overview]
Message-ID: <1149870197.099932.29090@h76g2000cwa.googlegroups.com> (raw)
In-Reply-To: <1149866981.380993.317910@y43g2000cwc.googlegroups.com>


(tool-bar-add-item  "texshop" 'compile-if-latex-or-bibtex-file
'compile-if-latex-or-bibtex-file :help "Run pdflatex" )

seems to work.
YMMV
~Madhu.

hrmadhu@gmail.com wrote:
> Hello:,
>     I'm using GNU Emacs 22.0.50.1 (powerpc-apple-darwin8.5.0) of
> 2006-03-22 on G5.local from
> http://homepage.mac.com/zenitani/emacs-e.html
>     I'm trying to add a new button to the toolbar that will call
> pdflatex when I hit it. The code I have so far is at the end of this
> email.
>     It displays the button with the appropriate icon on the toolbar,
> but when I click the button all i see in the message window is
> "tool-bar-". If I click it again, then the message buffer says "
> <tool-bar> <tool-bar> is undefined."
>     I believe this has something to do with the tool-bar-map, but I am
> sure. I could use some help with this.
> Thanks.
> ~Madhu.
>
>
> ---------------
> code in .emacs:
>
>
> (defun compile-if-latex-or-bibtex-file ()
>   (interactive)
>   (setq thefilename
> 	( file-name-sans-versions buffer-file-name) )
>   (if (and (equal (file-name-extension thefilename) "tex")
> (file-regular-p thefilename))
>       (save-window-excursion
> 	(save-excursion
> 	  (shell-command (concat "pdflatex -interaction=nonstopmode
> -dEmbedAllFonts=true " thefilename " & ")) () ) ) )
>   (if (and (equal (file-name-extension thefilename) ".bib")
> (file-regular-p thefilename))
>       (save-window-excursion
> 	(save-excursion
> 	  (shell-command (concat "bibtex " thefilename " & ")) () ) ))
> )
> (tool-bar-add-item  "texshop" '(compile-if-latex-or-bibtex-file)  nil
> :help "Run pdflatex" )

  reply	other threads:[~2006-06-09 16:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-09 15:29 Add a new tool-bar item in emacs hrmadhu
2006-06-09 16:23 ` hrmadhu [this message]
2006-06-09 18:32 ` Peter Dyballa
     [not found] ` <mailman.2806.1149877968.9609.help-gnu-emacs@gnu.org>
2006-06-09 21:53   ` David Kastrup
2006-06-09 23:13     ` Peter Dyballa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1149870197.099932.29090@h76g2000cwa.googlegroups.com \
    --to=hrmadhu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.