Subject: bug#25764: closed (Re: bug#25764: 26.0.50; Make some usability improvements to sieve-script management)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 08 Jul 2019 17:56:02 +0000

Your bug report

#25764: 26.0.50; Make some usability improvements to sieve-script management

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
25764: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25764
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#25764: 26.0.50; Make some usability improvements to sieve-script management
From: Eric Abrahamsen <[email-masked]>
To: Lars Ingebrigtsen <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Mon, 08 Jul 2019 10:55:22 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

On 06/25/19 01:03 AM, Lars Ingebrigtsen wrote:
> Eric Abrahamsen <[email-masked]> writes:
>
>> The attached patch makes some usability improvements to the sieve script
>> management files: exposing more user commands in menus and help, and
>> using the buffer-modified mark to give the user a better sense of what's
>> going on.
>
> I think the patch looks good; please apply.

Done, thanks!

Subject: 26.0.50; Make some usability improvements to sieve-script management
From: Eric Abrahamsen <[email-masked]>
To: [email-masked]
Date: Thu, 16 Feb 2017 13:13:41 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

The attached patch makes some usability improvements to the sieve script
management files: exposing more user commands in menus and help, and
using the buffer-modified mark to give the user a better sense of what's
going on.

>From e7c62b1bb8212034cba5502a7dec2c2786f4159f Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <[email-masked]>
Date: Thu, 16 Feb 2017 12:57:53 -0800
Subject: [PATCH] Small improvements to sieve script usability

* lisp/net/sieve-mode.el (sieve-mode-menu): Add
  `sieve-upload-and-kill' to the mode menu.

* lisp/net/sieve.el (sieve-manage-mode-menu): Add `sieve-manage-quit'
  to the mode menu.
  (sieve-help): Mention quitting in mode help.
  (sieve-manage-mode): Directly derive from special-mode.
  (sieve-edit-script): Start off with unmodified buffer.
  (sieve-upload): Set buffer unmodified after successful upload.

Changes are aimed at 1) increasing discoverability of commands and 2)
using buffer modification to help users understand what's happening.
---
 lisp/net/sieve-mode.el |  1 +
 lisp/net/sieve.el      | 22 ++++++++++++----------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/lisp/net/sieve-mode.el b/lisp/net/sieve-mode.el
index 87bb3a245b..cc5fb389e2 100644
--- a/lisp/net/sieve-mode.el
+++ b/lisp/net/sieve-mode.el
@@ -158,6 +158,7 @@ sieve-mode-map
   "Sieve Menu."
   '("Sieve"
     ["Upload script" sieve-upload t]
+    ["Upload script and kill" sieve-upload-and-kill t]
     ["Manage scripts on server" sieve-manage t]))
 
 ;; Code for Sieve editing mode.
diff --git a/lisp/net/sieve.el b/lisp/net/sieve.el
index 665a0a8e15..46cea316e3 100644
--- a/lisp/net/sieve.el
+++ b/lisp/net/sieve.el
@@ -137,16 +137,15 @@ sieve-manage-mode-map
   '("Manage Sieve"
     ["Edit script" sieve-edit-script t]
     ["Activate script" sieve-activate t]
-    ["Deactivate script" sieve-deactivate t]))
+    ["Deactivate script" sieve-deactivate t]
+    ["Quit and close connection" sieve-manage-quit t]))
 
-(define-derived-mode sieve-manage-mode fundamental-mode "Sieve-manage"
+(define-derived-mode sieve-manage-mode special-mode "Sieve-manage"
   "Mode used for sieve script management."
   (buffer-disable-undo (current-buffer))
   (setq truncate-lines t)
   (easy-menu-add sieve-manage-mode-menu sieve-manage-mode-map))
 
-(put 'sieve-manage-mode 'mode-class 'special)
-
 ;; Commands used in sieve-manage mode:
 
 (defun sieve-manage-quit ()
@@ -215,6 +214,7 @@ sieve-edit-script
     (sieve-mode)
     (setq sieve-buffer-script-name name)
     (goto-char (point-min))
+    (set-buffer-modified-p nil)
     (message
      (substitute-command-keys
       "Press \\[sieve-upload] to upload script to server."))))
@@ -257,7 +257,7 @@ sieve-help
       ;; would need minor-mode for log-edit-mode
       (describe-function 'sieve-mode)
     (message "%s" (substitute-command-keys
-	      "`\\[sieve-edit-script]':edit `\\[sieve-activate]':activate `\\[sieve-deactivate]':deactivate `\\[sieve-remove]':remove"))))
+	      "`\\[sieve-edit-script]':edit `\\[sieve-activate]':activate `\\[sieve-deactivate]':deactivate `\\[sieve-remove]':remove `\\[sieve-manage-quit]':quit"))))
 
 ;; Create buffer:
 
@@ -350,11 +350,13 @@ sieve-upload
       (with-current-buffer (get-buffer sieve-buffer)
 	(setq err (sieve-manage-putscript
                    (or name sieve-buffer-script-name (buffer-name))
-                   script sieve-manage-buffer))
-	(if (sieve-manage-ok-p err)
-	    (message (substitute-command-keys
-		      "Sieve upload done.  Use \\[sieve-manage] to manage scripts."))
-	  (message "Sieve upload failed: %s" (nth 2 err)))))))
+                   script sieve-manage-buffer)))
+      (if (sieve-manage-ok-p err)
+          (progn
+            (message (substitute-command-keys
+                      "Sieve upload done.  Use \\[sieve-manage] to manage scripts."))
+            (set-buffer-modified-p nil))
+        (message "Sieve upload failed: %s" (nth 2 err))))))
 
 ;;;###autoload
 (defun sieve-upload-and-bury (&optional name)
-- 
2.11.1

In GNU Emacs 26.0.50.26 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.7)
 of 2017-02-14 built on clem
Repository revision: 71b90192dab8de9825904faaabbaf9548d3db2ab
Windowing system distributor 'The X.Org Foundation', version 11.0.11901000