vermiculus / sx.el

Stack Exchange for Emacs
http://stackapps.com/q/3950
709 stars 40 forks source link

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

Open shackra opened 6 years ago

shackra commented 6 years ago

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.

vermiculus commented 6 years ago

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

shackra commented 6 years ago

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.

vermiculus commented 6 years ago

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 :-)

stardiviner commented 6 years ago

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 commented 6 years ago

But I typing text in the body area.

ylluminarious commented 6 years ago

@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.

julienJean99 commented 5 years ago

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

ghost commented 5 years ago

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.
ylluminarious commented 5 years ago

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

vermiculus commented 5 years ago

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.

ghost commented 5 years ago

Pull request created right now.

thor314 commented 2 years ago

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

vermiculus commented 2 years ago

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.

madorian commented 1 year ago

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;)

x0xntor33alx0x commented 1 year ago

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.