help-gnu-emacs
[Top][All Lists]
Advanced

[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

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 via email to

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