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: Add a new tool-bar item in emacs Date: 9 Jun 2006 08:29:41 -0700 Organization: http://groups.google.com Message-ID: <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 1149867646 15284 80.91.229.2 (9 Jun 2006 15:40:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 9 Jun 2006 15:40:46 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 09 17:40:45 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 1Foj60-0002sp-Sf for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Jun 2006 17:40:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Foj60-0007to-CD for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Jun 2006 11:40:24 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!y43g2000cwc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 40 Original-NNTP-Posting-Host: 129.25.34.53 Original-X-Trace: posting.google.com 1149866987 3198 127.0.0.1 (9 Jun 2006 15:29:47 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 9 Jun 2006 15:29:47 +0000 (UTC) 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: y43g2000cwc.googlegroups.com; posting-host=129.25.34.53; posting-account=ZmKyaQ0AAAADxTx9_xlhvEEqEYDzRFgA Original-Xref: shelby.stanford.edu gnu.emacs.help:139745 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:35371 Archived-At: 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" )