[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Add a new tool-bar item in emacs

From: hrmadhu
Subject: Add a new tool-bar item in emacs
Date: 9 Jun 2006 08:29:41 -0700
User-agent: G2/0.2

    I'm using GNU Emacs (powerpc-apple-darwin8.5.0) of
2006-03-22 on G5.local from
    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
    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.

code in .emacs:

(defun compile-if-latex-or-bibtex-file ()
  (setq thefilename
        ( file-name-sans-versions buffer-file-name) )
  (if (and (equal (file-name-extension thefilename) "tex")
(file-regular-p thefilename))
          (shell-command (concat "pdflatex -interaction=nonstopmode
-dEmbedAllFonts=true " thefilename " & ")) () ) ) )
  (if (and (equal (file-name-extension thefilename) ".bib")
(file-regular-p thefilename))
          (shell-command (concat "bibtex " thefilename " & ")) () ) ))
(tool-bar-add-item  "texshop" '(compile-if-latex-or-bibtex-file)  nil
:help "Run pdflatex" )

reply via email to

[Prev in Thread] Current Thread [Next in Thread]