From 14c8351e551c6c2ee30486948fdc857b5813ad52 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Wed, 26 Nov 2014 00:59:15 -0500 Subject: Default to post author if post editor is missing Fixes #100 --- sx-question-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sx-question-mode.el b/sx-question-mode.el index 70b8866..947c35d 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -271,7 +271,8 @@ DATA can represent a question or an answer." (when .last_edit_date (format sx-question-mode-last-edit-format (sx-time-since .last_edit_date) - (sx-question-mode--propertize-display-name .last_editor)))) + (sx-question-mode--propertize-display-name + (if .last_editor .last_editor .owner))))) 'sx-question-mode-date) (sx-question-mode--insert-header sx-question-mode-header-score -- cgit v1.2.3 From 31549b4e5a9e67180ad6a0d0b8b61e17274b54a2 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Wed, 26 Nov 2014 14:58:50 -0500 Subject: Use customizable deleted-user structure --- sx-question-mode.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sx-question-mode.el b/sx-question-mode.el index 947c35d..a80704c 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -103,6 +103,13 @@ If WINDOW is given, use that to display the buffer." "Face used on the question title in the question buffer." :group 'sx-question-mode-faces) +(defcustom sx-question-mode-deleted-user + '((display_name . "(deleted user)")) + "The structure used to represent a deleted account." + :type '(alist :options (display_name)) + :risky t + :group 'sx-question-mode) + (defcustom sx-question-mode-header-title "\n" "String used before the question title at the header." :type 'string @@ -272,7 +279,7 @@ DATA can represent a question or an answer." (format sx-question-mode-last-edit-format (sx-time-since .last_edit_date) (sx-question-mode--propertize-display-name - (if .last_editor .last_editor .owner))))) + (or .last_editor sx-question-mode-deleted-user))))) 'sx-question-mode-date) (sx-question-mode--insert-header sx-question-mode-header-score -- cgit v1.2.3 From 8aa2db45afa43da88269c7efa71a6def0b778fdc Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Wed, 26 Nov 2014 18:01:44 -0500 Subject: Enforce string value for display_name --- sx-question-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sx-question-mode.el b/sx-question-mode.el index a80704c..b2856e6 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -106,7 +106,7 @@ If WINDOW is given, use that to display the buffer." (defcustom sx-question-mode-deleted-user '((display_name . "(deleted user)")) "The structure used to represent a deleted account." - :type '(alist :options (display_name)) + :type '(alist :options ((display_name string)) :risky t :group 'sx-question-mode) -- cgit v1.2.3 From d0aa34258e3492ec5ac884dccb766bdb1776b36f Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Wed, 26 Nov 2014 18:12:06 -0500 Subject: Add missing ')' Staged only part of a change -- stupid mistake. --- sx-question-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sx-question-mode.el b/sx-question-mode.el index b2856e6..8f96a01 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -106,7 +106,7 @@ If WINDOW is given, use that to display the buffer." (defcustom sx-question-mode-deleted-user '((display_name . "(deleted user)")) "The structure used to represent a deleted account." - :type '(alist :options ((display_name string)) + :type '(alist :options ((display_name string))) :risky t :group 'sx-question-mode) -- cgit v1.2.3 From 9c2df708ac4dc62c34882b7978761cf1f73e063f Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Thu, 27 Nov 2014 11:05:08 -0500 Subject: Deleted-user variable is not risky --- sx-question-mode.el | 1 - 1 file changed, 1 deletion(-) diff --git a/sx-question-mode.el b/sx-question-mode.el index 8f96a01..bc7c62c 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -107,7 +107,6 @@ If WINDOW is given, use that to display the buffer." '((display_name . "(deleted user)")) "The structure used to represent a deleted account." :type '(alist :options ((display_name string))) - :risky t :group 'sx-question-mode) (defcustom sx-question-mode-header-title "\n" -- cgit v1.2.3 From 7d6110a64c3b9e6d95a2976b8423ab26fe312b2c Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Mon, 1 Dec 2014 11:14:00 +0000 Subject: Reimplement deleted-user --- sx-question-print.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sx-question-print.el b/sx-question-print.el index 0959f36..3200ead 100644 --- a/sx-question-print.el +++ b/sx-question-print.el @@ -43,6 +43,11 @@ ;;; Faces and Variables +(defcustom sx-question-mode-deleted-user + '((display_name . "(deleted user)")) + "The structure used to represent a deleted account." + :type '(alist :options ((display_name string))) + :group 'sx-question-mode) (defface sx-question-mode-header '((t :inherit font-lock-variable-name-face)) @@ -227,7 +232,8 @@ DATA can represent a question or an answer." (when .last_edit_date (format sx-question-mode-last-edit-format (sx-time-since .last_edit_date) - (sx-question-mode--propertize-display-name .last_editor)))) + (sx-question-mode--propertize-display-name + (or .last_editor sx-question-mode-deleted-user))))) 'sx-question-mode-date) (sx-question-mode--insert-header sx-question-mode-header-score -- cgit v1.2.3