defunkt / gist.el

Yet another Emacs paste mode, this one for Gist.
548 stars 90 forks source link

on gist-region-or-buffer-private: invalid-slot-type gh-gist-gist id string nil #78

Closed blaenk closed 8 years ago

blaenk commented 8 years ago

Here's the backtrace as an image since it contains the bytecode which makes it tricky to copy.

backtrace

blaenk commented 8 years ago

After some searching around to figure out why the mark-inactive handler wasn't being triggered, I found this mailing list post which mentions a variable mark-even-if-inactive, whose documentation states:

If this is non-nil, Lisp programs and the Emacs user can use the mark even when it is inactive. This option affects the behavior of Transient Mark mode. When the option is non-nil, deactivation of the mark turns off region highlighting, but commands that use the mark behave as if the mark were still active.

Apparently mine was set to t (which appears to be the default?). So even though I didn't have a region selected, the command was continuing on as if there were, which is why there was no error being "thrown" and consequently the handler (which would gist the whole buffer) wasn't being run.

I was thinking of just setting mine to nil, but I hesitate to without knowing the ramifications. It seems that some packages have problems when it's set to nil, as it seems to be assumed that it's non-nil.

I'm not sure what alternative there is.

blaenk commented 8 years ago

Smartparens also seems to have problems if this is set to nil.

So I decided that setting mark-even-if-inactive is not a desirable solution, as it seems to conflict with the assumptions that many packages make. Instead, I've submitted PR #79 which changes the way that the check is made to determine if a region is active.

blaenk commented 8 years ago

Just noticed that the linked smartparens issue has long since been resolved. I think the point remains though that it could cause unforeseen problems to set this to nil. I instead recommend the fix in #79.