Subject: bug#28774: Master, emacs-26: Can't add text property to built-in function name.

From: Ilya Khaprov <[email-masked]>
Date: Tue, 10 Oct 2017 07:57:04 +0000

Hi

After commit :3db388b0bf the following stopped working:

(global-set-key
 "\M-x"
 (lambda ()
   (interactive)
   (call-interactively
    (intern
     (ido-completing-read
      "M-x "
      (all-completions "" obarray 'commandp))))))

This package no longer works too: https://github.com/DarwinAwardWinner/ido-completing-read-plus

Example error message:
Error in post-command-hook (ido-exhibit): (error "Attempt to modify read-only object" "rename-buffer")

On the surface it looks like if I try to complete function defined in C (i.e, built-in),
I get this error because the symbol/name is read only.

Call chain like this :
ido-completions
put-text-property
add_text_properties_1
validate_inerval_range
create_root_interval
CHECK_IMPURE
pure_write_error

I still reproduce it on

emacs-26 - 5d51403ceb
master      - 6abff55b55

Temporary fixed with ido-name override:

(defun ido-name (item)
  ;; Return file name for current item, whether in a normal list
  ;; or a merged work directory list.
  (concat (if (consp item) (car item) item)))

Thanks,
Ilya