From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#36266: 26.1; Problems with sieve-manage Date: Thu, 25 Jul 2019 11:28:08 -0700 Message-ID: <8736iuezpj.fsf@ericabrahamsen.net> References: <23815.51315.484730.915010@alice.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="103209"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 36266@debbugs.gnu.org To: hartzell@alerce.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 25 20:29:08 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hqiUG-000QiT-El for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Jul 2019 20:29:08 +0200 Original-Received: from localhost ([::1]:34782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hqiUF-00057o-FU for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Jul 2019 14:29:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35131) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hqiUC-00057i-2F for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2019 14:29:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hqiUA-0003I8-Lc for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2019 14:29:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59842) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hqiUA-0003Hv-Gl for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2019 14:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hqiUA-00085l-Cj for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2019 14:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Jul 2019 18:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36266 X-GNU-PR-Package: emacs Original-Received: via spool by 36266-submit@debbugs.gnu.org id=B36266.156407930031015 (code B ref 36266); Thu, 25 Jul 2019 18:29:02 +0000 Original-Received: (at 36266) by debbugs.gnu.org; 25 Jul 2019 18:28:20 +0000 Original-Received: from localhost ([127.0.0.1]:40430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqiTS-00084A-W4 for submit@debbugs.gnu.org; Thu, 25 Jul 2019 14:28:20 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:51046 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqiTR-00083v-2Z for 36266@debbugs.gnu.org; Thu, 25 Jul 2019 14:28:17 -0400 Original-Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 7A7E7FA097; Thu, 25 Jul 2019 18:28:10 +0000 (UTC) In-Reply-To: <23815.51315.484730.915010@alice.local> (hartzell's message of "Mon, 17 Jun 2019 10:05:55 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:163731 Archived-At: --=-=-= Content-Type: text/plain hartzell@alerce.com writes: > I asked for help with these on the `help-gnu-emacs` mailing list and > Eric suggested that I also report them as bugs so that they don't get > lost. Here is the email thread: > > https://lists.gnu.org/archive/html/help-gnu-emacs/2019-06/msg00185.html > > g. > > --- > > I've been trying to use sieve-manage in GNU Emacs 26.1 on a Mac with > dovecot-pigeonhole-0.5.6 on a FreeBSD 12 system. > > I've run into a few problems: > > 1. I can start sieve-manage, use the `f` key with the `` > line highlighted, edit a script, and use `C-c C-l` to upload it to > the server. > > The problem is that the script, on the server, is named ` script>.sieve`, which is awkward. > > But worse, if/when I restart sieve-manage it offers me two choices, > one labeled `` (which is the button to create a new > script) and one which is the existing script which was saved under > that same name. > > I've tried renaming the buffer, but the code has a preference for > `sieve-buffer-script-name`. > > Is there some way to rename the buffer? I think it's a little weird that `sieve-new-script' (which defaults to "" is a configurable option at all. IMO, there are two separate concerns: some placeholder text for the button that's used to create a new script (there's no reason to make this configurable), and the default name for a newly-created script (the new name should be prompted for on a script-by-script basis, and there's no reason to have a default at all). I've attached a simple diff which checks if your new script has the same name as `sieve-new-script' and prompts you to rename it. But I think a more sensible solution would be to remove the `sieve-new-script' option altogether. Then hard-code the "new script" button text, and always prompt for a name for a new script. > 2. If I create a script directly on the server (e.g. `ape.sieve`) then > start sieve-manage, I'm offered the chance to edit it. If I move > the highlighting to `ape.sieve` then use `f` to edit it, emacs > becomes unresponsive. I can break out of it with C-g. > > But, I've had it work once or twice. I haven't figure out how to > repeat it. > > If I look in `*sieve-manage-log*`, I can see that emacs has sent > `GETSCRIPT "ape"` and I can see the text of the script in the > response. > > I'm not sure what it's waiting for. I believe this is something to do with an infloop in `accept-process-output' that was previously preventing me from logging in to my sieve servers at all. This is just a guess, because it matches pretty closely behavior that I saw discussed in another bug report here. But this has since been cleared up for me in Emacs master, so maybe if you build a new Emacs it will start working? We hope? Eric --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=fix-sieve-script-name.diff diff --git a/lisp/net/sieve.el b/lisp/net/sieve.el index 3337998bed..4485b8c730 100644 --- a/lisp/net/sieve.el +++ b/lisp/net/sieve.el @@ -210,7 +210,11 @@ sieve-edit-script (set-buffer-modified-p nil) (error "Sieve download failed: %s" err))) (switch-to-buffer (get-buffer-create "template.siv")) - (insert sieve-template)) + (insert sieve-template) + (setq name (read-string "Name for new script: ")) + (when (string-match "\\.sieve\\'" name) + ;; The server will append .sieve to the script name. + (setq name (replace-match "" t t name)))) (sieve-mode) (setq sieve-buffer-script-name name) (goto-char (point-min)) --=-=-=--