From ae3e8ee9d9f792ff8c543c249f6d26fb22ec7965 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Wed, 7 Jan 2015 20:30:34 -0200 Subject: Rename add to ensure --- sx-interaction.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sx-interaction.el') diff --git a/sx-interaction.el b/sx-interaction.el index 6ecfa38..8b72ea5 100644 --- a/sx-interaction.el +++ b/sx-interaction.el @@ -291,7 +291,7 @@ TEXT is a string. Interactively, it is read from the minibufer." ;; The api returns the new DATA. (when (> (length result) 0) (sx--add-comment-to-object - (sx--add-owner-to-object (list (cons 'display_name "(You)")) (elt result 0)) + (sx--ensure-owner-in-object (list (cons 'display_name "(You)")) (elt result 0)) (if .post_id (sx--get-post .post_type .site_par .post_id) data)) ;; Display the changes in `data'. (sx--maybe-update-display))))) @@ -345,7 +345,7 @@ OBJECT can be a question or an answer." (setcar object `(comments . [,comment])))) object) -(defun sx--add-owner-to-object (owner object) +(defun sx--ensure-owner-in-object (owner object) "Add `owner' property with value OWNER to OBJECT." (unless (cdr-safe (assq 'owner object)) (setcdr object (cons (car object) (cdr object))) -- cgit v1.2.3