unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Add a new tool-bar item in emacs
@ 2006-06-09 15:29 hrmadhu
  2006-06-09 16:23 ` hrmadhu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: hrmadhu @ 2006-06-09 15:29 UTC (permalink / raw)


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" )

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

end of thread, other threads:[~2006-06-09 23:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-09 15:29 Add a new tool-bar item in emacs hrmadhu
2006-06-09 16:23 ` hrmadhu
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

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).