Removing a space placed after a linebreak at the end of \lstinline

listings has problems if the end of a breakable inline listing is at the end of the line. See e.g. also listings package introduces unnecessary linebreaks.

You can try breakatwhitespace:

\documentclass[10pt,a5paper]{book}
\usepackage{listings}
\lstset{breaklines=true,breakatwhitespace,
        basicstyle=\ttfamily,alsoletter=\\\{\}\*\[\]\-}
\lstMakeShortInline=
%\setlength{\emergencystretch}{35pt}

\begin{document}

Blah blah blah, standard text to highlight that usually the line breaks are normal and no space follows them. The actual issue is highlighted in the next paragraph.

OK. My name is Eddie. This is my first question. =How quick= will it be answered? Only time will tell. Seriously though, it would be nice to get an answer within about 3 and a half minutes.

\end{document}

Or load microtype

\documentclass[10pt,a5paper]{book}
\usepackage{listings,microtype}
\lstset{breaklines=true,
        basicstyle=\ttfamily,alsoletter=\\\{\}\*\[\]\-}
\lstMakeShortInline=
%\setlength{\emergencystretch}{35pt}

\begin{document}

Blah blah blah, standard text to highlight that usually the line breaks are normal and no space follows them. The actual issue is highlighted in the next paragraph.

OK. My name is Eddie. This is my first question. =How quick= will it be answered? Only time will tell. Seriously though, it would be nice to get an answer within about 3 and a half minutes.

\end{document}

But none will imho handle every case, so you will have to check visually if everything is okay.


As a workaround if you have a document you just need to get out then you can do

enter image description here

\documentclass[10pt,a5paper]{book}
\usepackage{listings}
\lstset{breaklines=true,basicstyle=\ttfamily,alsoletter=\\\{\}\*\[\]\-}
\lstMakeShortInline=
\setlength{\emergencystretch}{35pt}

%\showoutput
\begin{document}

Blah blah blah, standard text to highlight that usually the line breaks are normal and no space follows them. The actual issue is highlighted in the next paragraph.

OK. My name is Eddie. This is my first question. =How quick=\linebreak[2] will it be answered? Only time will tell. Seriously though, it would be nice to get an answer within about 3 and a half minutes.

\end{document}

but I'm missing something at present I don't see why the space isn't dropped if for example you use \linebreak[0] I may add to this answer later. It's not related to the short = processing, you get the same from \lstinline|How quick|

Ah listings is adding a break point at the end of the text (which explains the behaviour at least) if you know that you don't want that inline listing ti break you could use \leavevmode\hbox{=How quick#} rather than using the \linebreak as above but if you do want to allow it to break but not at the end, it seems some re-arrangement of the listings internals would be required.


I suggest using minted instead (requires to run LaTeX with the -shell-escape option and to install pygmentize):

\documentclass[10pt,a5paper]{book}
\usepackage{minted}
\usemintedstyle{bw}

\begin{document}

Blah blah blah, standard text to highlight that usually
the line breaks are normal and no space follows them.
The actual issue is highlighted in the next paragraph.

OK. My name is Eddie. This is my first
question. \mintinline{tex}=How quick= will it be answered?
Only time will tell. Seriously though,
it would be nice to get an answer within
about 3 and a half minutes.

\end{document}

enter image description here