Question: I want to set the frame title as follows:

* When the current buffer is visiting a file, show the full path name and the Emacs version.
* When the current buffer has no file, then show the buffer name and the Emacs version.

In my `init.el`, I put

```
(setq-default frame-title-format
  (concat (if (buffer-file-name) "%f" "%b") " - " (substring (emacs-version) 0 15)))

```

But here is the result:[![screenshot with the title containing a file name without the full path](https://i.stack.imgur.com/K8Vim.png)](https://i.stack.imgur.com/K8Vim.png)

Why doesn't my code print the file name with the full path?

Answer: 
Because you're setting `frame-title-format` to `"%b - GNU Emacs 26.1 "`. 

You can try the following instead

```
(setq frame-title-format
      `((buffer-file-name "%f" "%b")
        ,(format " - GNU Emacs %s" emacs-version)))

```

The following does the same but it probably does some unneeded work (that is, computing the version string) repeatedly

```
(setq frame-title-format
      (list '(buffer-file-name "%f" "%b")
            '(:eval (format " - GNU Emacs %s" emacs-version))))

```
Emacs is evaluating your expression at the time when you setq `frame-title-format`, whereas you want it to be evaluated dynamically. Try wrapping your code in `:eval` as explained at [Mode-Line-Data](https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode-Line-Data.html#Mode-Line-Data)