Taking a look at the 'Build Log' I get with a foo.tex test file, it seems Gummi actually compiles .foo.tex.swp, which is hidden on Unix due to the leading ., and which has extension .swp not .tex. So TeX is showing you the correct information. For example, with demo file
\documentclass{article}
\begin{document}
Hello world
\end{document}
saved as foo.tex I get log
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
\write18 enabled.
entering extended mode
(/home/joseph/Desktop/.foo.tex.swp
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h
ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma
rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian,
kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk,
polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s
lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian,
welsh, loaded.
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/size10.clo))
(/tmp/.foo.tex.aux) [1{/usr/local/texlive/2012/texmf-var/fonts/map/pdftex/updma
p/pdftex.map}] (/tmp/.foo.tex.aux) )</usr/local/texlive/2012/texmf-dist/fonts/t
ype1/public/amsfonts/cm/cmr10.pfb>
Output written on /tmp/.foo.tex.pdf (1 page, 11541 bytes).
SyncTeX written on /tmp/.foo.tex.synctex.gz.
Transcript written on /tmp/.foo.tex.log.
I'm afraid I don't have a solution (other than 'use a different editor'), as there does not seem to be a Gummi setting to alter this behaviour.
The edited question asks for a 'flexible' approach based on Herbert's code. With the restriction that this assumes a simple case (the file name contains only a single . to separate the extension, except if it starts .where Gummi is in use):
\makeatletter
\begingroup
\def\@jobname#1.#2\q@nil{%
\ifx\relax#1\relax
\expandafter\expandafter\expandafter\@@jobname
\else
\expandafter\@@@jobname
\fi
\jobname\q@nil
}
\def\@@jobname.#1.#2\q@nil{#1}
\def\@@@jobname#1\q@nil{#1}
\xdef\jobname{\expandafter\@jobname\jobname.\q@nil}
\endgroup
\makeatother
.in the file name? Do we need to cope with a hidden file which is not one created by Gummi? – Joseph Wright Aug 30 '12 at 18:48.texor start with.or the source have the.swpextension. – Fran Aug 30 '12 at 19:00