vermiculus / sx.el

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

Easy way to unhide questions? #281

Open kaushalmodi opened 9 years ago

kaushalmodi commented 9 years ago

Is there an easier way to unhide questions?

I hid a question by mistake and then I had to remove ~/.emacs.d/.sx/hidden-questions.el and restart emacs to fix that.

Malabarba commented 9 years ago

Good point. What interface could we use for unhiding a question? @vermiculus

kaushalmodi commented 9 years ago

Can you use completing-read to display the list of already hidden questions? When user hits RET on the selected question, that one gets unhidden.

vermiculus commented 9 years ago

I think using completing-read is be a good idea, but it require storing extra information in the file (which I'd really like to avoid, personally -- this file can blow up).

The 'most pure' option is to allow popping a question off this list and re-inserting it into the question list data structure we have. This would effectively 'undo' the last hide, but having the ability to pick-and-choose which question you want to unhide is very appealing.

In addition to the simple pop/repaint solution, there might be room for hiding/unhiding a question from the question/answer view. This might be useful if we ever decide to maintain an organized index of questions -- but that time has not yet come :)

kaushalmodi commented 9 years ago

How about moving the hidden questions to an ''sx-hidden-tab' tab. When user hits the 'h' key on a question in that tab, the question becomes unhidden once again and shows up when the user switches to the All Questions tab.

On Mon, Apr 20, 2015, 6:19 PM Sean Allred notifications@github.com wrote:

I think using completing-read is be a good idea, but it require storing extra information in the file (which I'd really like to avoid, personally -- this file can blow up).

The 'most pure' option is to allow popping a question off this list and re-inserting it into the question list data structure we have. This would effectively 'undo' the last hide, but having the ability to pick-and-choose which question you want to unhide is very appealing.

In addition to the simple pop/repaint solution, there might be room for hiding/unhiding a question from the question/answer view. This might be useful if we ever decide to maintain an organized index of questions -- but that time has not yet come :)

Reply to this email directly or view it on GitHub https://github.com/vermiculus/sx.el/issues/281#issuecomment-94582472.

Malabarba commented 9 years ago

The hidden-tab suggestion would be awesome, but I personally won't have the time to do that. =/ If anyone would like to try, it's actually quite easy to define a new tab (see the sx-tab file) and the sx-question-list-mode (which is used by the tabs) is very well documented.

completing-read is trivial to implement, but asking for the quesiton number is sort of irrelevant (and I don't think we should store strings either).

Finally, poping a question off the hidden-list is easy too. The only issue is that they are stored in the list ordered by ID, not by most-recently-hidden. So the user might have to pop quite a few in order to get back the latest one he hid.