diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-22 13:21:41 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-22 13:21:41 -0200 |
commit | 69f081af1461fb70858a29f7426a758ecc10bafe (patch) | |
tree | a96f9f959d36a4215a45847e210d61059ff76284 | |
parent | 1fbab001d18fc73f14e235106c910131e16433e9 (diff) |
Viewing and visiting doesn't work on inbox.
-rw-r--r-- | sx-interaction.el | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sx-interaction.el b/sx-interaction.el index 181632e..619f259 100644 --- a/sx-interaction.el +++ b/sx-interaction.el @@ -119,15 +119,14 @@ Interactively, this is specified with a prefix argument. If DATA is a question, also mark it as read." (interactive (list (sx--data-here) current-prefix-arg)) (sx-assoc-let data - (let ((link - (when (stringp .link) - (funcall (if copy-as-kill #'kill-new #'browse-url) - .link)))) + (if (not (stringp .link)) + (sx-message "Nothing to visit here.") + (funcall (if copy-as-kill #'kill-new #'browse-url) .link) (when (and (called-interactively-p 'any) copy-as-kill) - (message "Copied: %S" link))) - (when (and .title (not copy-as-kill)) - (sx-question--mark-read data) - (sx--maybe-update-display)))) + (message "Copied: %S" .link)) + (when (and .title (not copy-as-kill)) + (sx-question--mark-read data) + (sx--maybe-update-display))))) (defun sx-open-link (link) "Visit element given by LINK inside Emacs. @@ -157,9 +156,11 @@ question, an answer, or an inbox_item. This is meant for interactive use. In lisp code, use object-specific functions such as `sx-display-question' and the likes." - (interactive (list (sx--data-here) t)) + (interactive (list (sx--data-here))) (sx-assoc-let data (cond + (.notification_type + (sx-message "Viewing notifications is not yet implemented")) (.item_type (sx-open-link .link)) (.answer_id (sx-display-question |