sx.el icon indicating copy to clipboard operation
sx.el copied to clipboard

(sx-ask) funcall-interactively: Text is read-only

Open shackra opened this issue 7 years ago • 15 comments

When trying to write a question (sx-ask), I cannot type nor insert tags to the question due to an unknown issue when writing anywhere in the buffer, in the *Messages* buffer I get:

funcall-interactively: Text is read-only

But whatever is going on is beyond me. This is my sx configuration:

  (use-package sx
    :defer 10)

Basically nothing.

shackra avatar Jan 28 '18 08:01 shackra

Can you provide the backtrace given when debug-on-error is on? (M-x toggle-debug-on-error)

vermiculus avatar Jan 28 '18 17:01 vermiculus

None is issued by Emacs, I toggle it and then reproduce the bug but no trace back is reported, just another message funcall-interactively: Text is read-only in Messages buffer appears and that's all.

shackra avatar Jan 28 '18 18:01 shackra

Funky. I'll see what I can find out.

This project has seen something of a renewed interest from the community, so I'm hoping to revive the codebase soon with the practices I've learned from my work on magithub. I need to be careful though to not bite off more than I can chew :-)

vermiculus avatar Jan 28 '18 18:01 vermiculus

I got same issue too. When I [M-x sx-ask] + emacs. Then sx.el popup a sx-compose-mode buffer, when I want to start typing text after Title: But it reports text is read-only. Even I toggle debug-on-error, still nothing error stack backtrack.

stardiviner avatar Feb 13 '18 16:02 stardiviner

But I typing text in the body area.

stardiviner avatar Feb 13 '18 16:02 stardiviner

@vermiculus The problem seems to exist with the definition of sx-compose--question-headers:

(defconst sx-compose--question-headers
  (concat
   #("Title: " 0 7 (intangible t read-only t rear-nonsticky t))
   "%s"
   #("\n" 0 1 (read-only t))
   #("Tags : " 0 7 (read-only t intangible t rear-nonsticky t))
   "%s"
   #("\n" 0 1 (read-only t rear-nonsticky t))
   #("________________________________________\n"
     0 41 (read-only t rear-nonsticky t intangible t
                     sx-compose-separator t))
   "\n")
  "Headers inserted when composing a new question.
Used by `sx-compose-create'.")

It seems that all of the headers have everything marked as read-only. So nothing can be typed anywhere, except in the body area. This should be fairly easy to fix by more carefully placing the read-only property.

ylluminarious avatar Jun 04 '18 20:06 ylluminarious

hi, just discovered your package and it looks great but this bug is kind of a shame is there any fix local correction?

julienJean99 avatar Nov 23 '18 14:11 julienJean99

Hello,

quite astonishing that this bug still isn't fixed. What's the use of the package if you can't ask questions? Anyway, I changed all read-only ts in sx-compose--question-headers to read-only nil and now it seems to work - almost. My first test question on stackoverflow was missing the first line of text?!??

--- sx-compose-original.el	2019-04-09 14:48:14.160052111 +0200
+++ sx-compose.el	2019-04-09 15:06:06.732226034 +0200
@@ -70,14 +70,14 @@
 
 (defconst sx-compose--question-headers
   (concat
-   #("Title: " 0 7 (intangible t read-only t rear-nonsticky t))
+   #("Title: " 0 7 (intangible t read-only nil rear-nonsticky t))
    "%s"
-   #("\n" 0 1 (read-only t))
-   #("Tags : " 0 7 (read-only t intangible t rear-nonsticky t))
+   #("\n" 0 1 (read-only nil))
+   #("Tags : " 0 7 (read-only nil intangible t rear-nonsticky t))
    "%s"
-   #("\n" 0 1 (read-only t rear-nonsticky t))
+   #("\n" 0 1 (read-only nil rear-nonsticky t))
    #("________________________________________\n"
-     0 41 (read-only t rear-nonsticky t intangible t
+     0 41 (read-only nil rear-nonsticky t intangible t
                      sx-compose-separator t))
    "\n")
   "Headers inserted when composing a new question.

ghost avatar Apr 09 '19 13:04 ghost

@Osram-Gru You might want to make this into a PR.

ylluminarious avatar Apr 09 '19 19:04 ylluminarious

quite astonishing that this bug still isn't fixed. What's the use of the package if you can't ask questions?

The 'astonishing' thing is that I haven't had much use for the SE network in the past few years and thus have not been using this package.

I bet this regression has something to do with the altered text property implementation in a recent major version break of Emacs. TBH, I don't think I've used this since Emacs 24.x.

Please open a PR and I'll review/merge as appropriate.

vermiculus avatar Apr 09 '19 22:04 vermiculus

Pull request created right now.

ghost avatar Apr 10 '19 14:04 ghost

I'm still running into this bug. Reinstalled sx from latest on MELPA. IT looks like that pull never got merged.

thor314 avatar Nov 17 '21 12:11 thor314

I sadly have not had as much time for extra-curriculars as I once had. If someone would like to revamp the PR such that it passes tests (with the understanding that it's not unlikely the tests themselves are broken), I can look at merging whatever changes make sense to folks.

vermiculus avatar Feb 06 '22 19:02 vermiculus

I still see this bug today. This never made it into the branch?;) There's no way to ask questions on SX with this package? Just asking;)

madorian avatar May 31 '23 06:05 madorian

you can use this

(defconst sx-compose--question-headers
  (concat
   #("Title:  " 0 7 (intangible t read-only t rear-nonsticky t))
   "%s"
   #("\n" 0 1 (read-only t))
   #("Tags :  " 0 7 (read-only t intangible t rear-nonsticky t))
   "%s"
   #("\n" 0 1 (read-only  t rear-nonsticky t))
   #("________________________________________\n"
     0 41 (read-only t rear-nonsticky t intangible t
                     sx-compose-separator t))
   "\n")
  "Headers inserted when composing a new question.
Used by `sx-compose-create'.")

just added a space as a work around in Tags and Title, works for me so far.

x0xntor33alx0x avatar Jun 24 '23 19:06 x0xntor33alx0x