diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-15 18:27:33 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-15 18:27:33 -0200 |
commit | 6956c17e1e7ef2899026ad365a0acdd4ce63cb80 (patch) | |
tree | 3f396981e2e5613c968ac3fee8d91ed2d762162b | |
parent | ceaee4e85d44caad2db8adacdff2e2772bf254c0 (diff) |
user-error is "not known to be defined" in emacs 24.2
-rw-r--r-- | sx-button.el | 2 | ||||
-rw-r--r-- | sx-interaction.el | 4 | ||||
-rw-r--r-- | sx-method.el | 2 | ||||
-rw-r--r-- | sx-question-list.el | 4 | ||||
-rw-r--r-- | sx.el | 5 |
5 files changed, 11 insertions, 6 deletions
diff --git a/sx-button.el b/sx-button.el index dbadc2e..1727a3d 100644 --- a/sx-button.el +++ b/sx-button.el @@ -96,7 +96,7 @@ code-block." (interactive) (browse-url (or (get-text-property (or pos (point)) 'sx-button-url) - (user-error "No url under point: %s" (or pos (point)))))) + (sx-user-error "No url under point: %s" (or pos (point)))))) ;;; Help-echo definitions diff --git a/sx-interaction.el b/sx-interaction.el index 38520a7..7d32094 100644 --- a/sx-interaction.el +++ b/sx-interaction.el @@ -85,7 +85,7 @@ If it's not a question, or if it is read, return DATA." ;; If we found a question, we may need to check if it's read. (if (and (assoc 'title data) (null (sx-question--read-p data))) - (user-error "Question not yet read. View it before acting on it") + (sx-user-error "Question not yet read. View it before acting on it") data)) (defun sx--maybe-update-display (&optional buffer) @@ -286,7 +286,7 @@ from context at point." ;; If we ever make an "Edit" button, first arg is a marker. (when (markerp data) (setq data (sx--data-here))) (sx-assoc-let data - (when .comment_id (user-error "Editing comments is not supported yet")) + (when .comment_id (sx-user-error "Editing comments is not supported yet")) (let ((buffer (current-buffer))) (pop-to-buffer (sx-compose-create diff --git a/sx-method.el b/sx-method.el index 4575b0f..1078014 100644 --- a/sx-method.el +++ b/sx-method.el @@ -90,7 +90,7 @@ Return the entire response as a complex alist." (cond ;; 1. Need auth and warn user (interactive use) ((and method-auth (equal 'warn auth)) - (user-error + (sx-user-error "This request requires authentication. Please run `M-x sx-authenticate' and try again.")) ;; 2. Need auth to populate UI, cannot provide subset ((and method-auth auth) diff --git a/sx-question-list.el b/sx-question-list.el index f23310c..e94c689 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -331,7 +331,7 @@ Non-interactively, DATA is a question alist." (interactive (list (if (derived-mode-p 'sx-question-list-mode) (tabulated-list-get-id) - (user-error "Not in `sx-question-list-mode'")))) + (sx-user-error "Not in `sx-question-list-mode'")))) (sx-question--mark-hidden data) (when (called-interactively-p 'any) (sx-question-list-refresh 'redisplay 'noupdate))) @@ -342,7 +342,7 @@ Non-interactively, DATA is a question alist." (interactive (list (if (derived-mode-p 'sx-question-list-mode) (tabulated-list-get-id) - (user-error "Not in `sx-question-list-mode'")))) + (sx-user-error "Not in `sx-question-list-mode'")))) (sx-question--mark-read data) (sx-question-list-next 1) (when (called-interactively-p 'any) @@ -104,6 +104,11 @@ is intentionally skipped." (setq tail (cdr tail))) (setcdr tail (cons x (cdr tail))))) +(defun sx-user-error (format-string &rest args) + "Like `user-error', but prepend FORMAT-STRING with \"[sx]\". +See `format'." + (signal 'user-error (list (apply #'format (concat "[sx] " format) args)))) + (defun sx-message (format-string &rest args) "Display FORMAT-STRING as a message with ARGS. See `format'." |