Emacs, Markdown-mode, insert spaces in text links created by the C-c C-l command

The reference environment: Emacs, Markdown-mode, insert a link

This article applies to the following environment:

  • Emacs: GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019–12–03
  • Markdown Mode: markdown-mode-20200622.20
  • OS: Linux Ubuntu 20.4 LTS, Linux Fedora 32

The problem in a few words: You need to insert a link in a document written using Markdown-mode for Emacs and in the Link text you need to insert one or more spaces.

The following are the steps:

  1. Activate the command C-c C-l
  2. Insert the URL of a link and press Return
  3. Insert text link with some spaces inside it … STOP!

You could notice that the minibuffer does not accept the spaces! You also get a “ No match “ advice.

Is there a bug? Have I made an error?

None of them.

It is a deliberate behavior of the plugin.

I recently opened a New Issue in jrblevin/markdown-mode and the solution was immediate.

The official assistance service solution

If you need to insert spaces in you Link text in Markdown-mode you can use C-q followed by space.

C-q runs the command quoted-insert (found in global-map), which is an interactive compiled Lisp function.

It reads the next input character and inserts it where you are typing.

If the next input character is a space it inserts a space in the minibuffer and you’ve solved the problem.

If you want to use just the space key in your keyboard you can set minibuffer-local-completion-map configuration in your .emacs file as below:

(defun my/markdown-mode-hook ()
(define-key minibuffer-local-completion-map (kbd "SPC") 'self-insert-command))

Now you can directly digit text links with spaces inside the minibuffer.

Thank you to the jrblevin/markdown-mode Team for the solution.

Thank you for your attention.

Originally published at https://francopasut.github.io on July 5, 2020.




I am a lawyer and occasionally write about technology.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Debouncing for the Daily Product Manager

OctoGamex — Invite Contest 🎉

Backdooring Websites with just 35 bytes

SimThunder Beta 1.2


Not the Shortest Path: Convert a Directory of Satellite Images to a Cloud Optimized Geotiff (COG)

Create a Bordered Padded TextField iOS 13 & Swift 5

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Franco Pasut

Franco Pasut

I am a lawyer and occasionally write about technology.

More from Medium

The iPad and being Nomadic

Vim Editor in Linux & Commands

Reduce Huge Title Bar on Ubuntu 20.04

First Time to Meet Vim