title: Why do `set shm+=s` and `cno <silent> <cr> <cr>` make Vim display a search command, when the pattern has no match in the current buffer?
body: <p>If I start Vim with a minimum of initializations:</p>
  
  <pre><code>vim -Nu NONE /path/to/a/file
  </code></pre>
  
  <p>Then execute the following 2 commands:</p>
  
  <pre><code>set shm+=s
  cno &lt;silent&gt; &lt;cr&gt; &lt;cr&gt;
  </code></pre>
  
  <p>And finally search for a pattern which has no match in the current buffer:</p>
  
  <pre><code>/pattern_with_no_match
  </code></pre>
  
  <p>Vim displays the error:</p>
  
  <pre><code>E486: Pattern not found: pattern_with_no_match
  </code></pre>
  
  <p>... which is expected. But Vim also displays a line showing the literal search command. Because of this, in total, Vim displays 2 lines + a prompt:</p>
  
  <pre><code>/pattern_with_no_match
  E486: Pattern not found: pattern_with_no_match
  Press ENTER or type command to continue
  </code></pre>
  
  <p>Instead of just one line with no prompt:</p>
  
  <pre><code>E486: Pattern not found: pattern_with_no_match
  </code></pre>
  
  <p>If I remove the <code>s</code> flag from the <code>'shortmess'</code> option:</p>
  
  <pre><code>set shm-=s
  </code></pre>
  
  <p>Or if I remove the <code>&lt;silent&gt;</code> argument in the mapping:</p>
  
  <pre><code>cno &lt;cr&gt; &lt;cr&gt;
  </code></pre>
  
  <p>Vim displays only 1 line again:</p>
  
  <pre><code>E486: Pattern not found: pattern_with_no_match
  </code></pre>
  
  <p>Adding the <code>s</code> flag to <code>'shortmess'</code> suppresses the messages such as:</p>
  
  <pre><code>search hit BOTTOM, continuing at TOP
  </code></pre>
  
  <p>And the <code>&lt;silent&gt;</code> argument passed to the <code>:cnoremap</code> command should prevent the mapping from being echoed on the command line.</p>
  
  <p>None of these settings should make Vim more verbose.
  So, why does the combination of the setting <code>set shm+=s</code> and the mapping <code>cno &lt;silent&gt; &lt;cr&gt; &lt;cr&gt;</code>, makes Vim display a search command, when the pattern has no match in the current buffer?</p>
  
  <hr>
  
  <p>It may be a known issue, because I've just found a <a href="https://github.com/google/vim-searchindex/blob/28c509b9a6704620320ef74b902c064df61b731f/plugin/searchindex.vim#L72-L73" rel="nofollow noreferrer">comment</a> inside a plugin which seems related:</p>
  
  <pre><code>" NOTE: This cannot use &lt;silent&gt; - it would break cmdline refresh in some
  " cases (e.g. multiline commands, &lt;C-R&gt;= usage).
  </code></pre>
  
  <p>But I can't find the relevant section in the help which describes it.</p>
  
  <p>There's this line in <code>:h map-&lt;silent&gt;</code>:</p>
  
  <pre><code>Using "&lt;silent&gt;" for an abbreviation is possible, but will cause redrawing of the command line to fail.
  </code></pre>
  
  <p>But it's about abbreviations not mappings. Maybe the 2 are linked though.</p>