From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: hrmadhu@gmail.com Newsgroups: gmane.emacs.help Subject: Re: Add a new tool-bar item in emacs Date: 9 Jun 2006 09:23:17 -0700 Organization: http://groups.google.com Message-ID: <1149870197.099932.29090@h76g2000cwa.googlegroups.com> References: <1149866981.380993.317910@y43g2000cwc.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1149871323 29060 80.91.229.2 (9 Jun 2006 16:42:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 9 Jun 2006 16:42:03 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 09 18:41:49 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fok36-0007vk-Re for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Jun 2006 18:41:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fok36-0005ZR-93 for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Jun 2006 12:41:28 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!h76g2000cwa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 49 Original-NNTP-Posting-Host: 129.25.34.53 Original-X-Trace: posting.google.com 1149870202 12280 127.0.0.1 (9 Jun 2006 16:23:22 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 9 Jun 2006 16:23:22 +0000 (UTC) In-Reply-To: <1149866981.380993.317910@y43g2000cwc.googlegroups.com> User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418 (KHTML, like Gecko) Safari/417.9.3,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: h76g2000cwa.googlegroups.com; posting-host=129.25.34.53; posting-account=ZmKyaQ0AAAADxTx9_xlhvEEqEYDzRFgA Original-Xref: shelby.stanford.edu gnu.emacs.help:139750 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35374 (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 " > 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" )