From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/75575 Path: news.gmane.org!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.gnus.general Subject: Re: Multiple uploads with sieve-manage-mode (unexpected behavior) Date: Mon, 03 Jan 2011 22:50:08 -0500 Message-ID: <87bp3xtjin.fsf@maru.md5i.com> References: <87fwtau0wg.fsf@maru.md5i.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1294113082 20630 80.91.229.12 (4 Jan 2011 03:51:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 Jan 2011 03:51:22 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M23926@lists.math.uh.edu Tue Jan 04 04:51:18 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PZxva-0000de-5u for ding-account@gmane.org; Tue, 04 Jan 2011 04:51:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1PZxux-00006d-7H; Mon, 03 Jan 2011 21:50:39 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1PZxuu-00006P-FM for ding@lists.math.uh.edu; Mon, 03 Jan 2011 21:50:36 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PZxuh-0006TA-5R for ding@lists.math.uh.edu; Mon, 03 Jan 2011 21:50:36 -0600 Original-Received: from md5i.com ([75.151.244.229] helo=maru.md5i.com) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1PZxua-0005LK-0l for ding@gnus.org; Tue, 04 Jan 2011 04:50:17 +0100 Original-Received: from md5i by maru.md5i.com with local (Exim 4.72) (envelope-from ) id 1PZxuS-0000GQ-G4 for ding@gnus.org; Mon, 03 Jan 2011 22:50:08 -0500 In-Reply-To: (Lars Magne Ingebrigtsen's message of "Tue, 04 Jan 2011 01:24:28 +0100") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:75575 Archived-At: --=-=-= Content-Type: text/plain Lars Magne Ingebrigtsen writes: > Michael Welsh Duggan writes: > >> Another would be to save the sieve script name in a buffer-local >> variable, and only use the buffer name if this variable is nil. > > I think that sounds like the right solution. I don't use sieve, so I > can't really test this. Could you send a patch that does this? (And do > you have FSF copyright assignment papers on file?) Patch attached. My copyright assignment existed (would have been for md5i@cs.cmu.edu), but I do not recall if it was for my current employer. I used to work for the Carnegie Mellon University Language Technologies Institute, and now I work for the Carnegie Mellon University Software Engineering Institute. If my assignment was for Carnegie Mellon University, we're fine, otherwise I need new papers. On the other hand, the patch (minus Changelog) is less than 10 lines, so it could be considered a tiny addition. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment >From c2df5ef11741398a6465c65d60cdb8a6aec8d160 Mon Sep 17 00:00:00 2001 From: Michael Welsh Duggan Date: Mon, 3 Jan 2011 22:44:00 -0500 Subject: [PATCH] Add sieve-buffer-script-name. --- lisp/ChangeLog | 8 ++++++++ lisp/sieve.el | 15 ++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 075833e..3d93dd8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2011-01-04 Michael Welsh Duggan + + * sieve.el (sieve-buffer-script-name): New variable. + (sieve-edit-script): Set sieve-buffer-script-name to the + name of the sieve script. Use substitute-command-keys. + (sieve-upload): Use sieve-buffer-script-name if set. Use + substitute-command-keys. + 2011-01-02 Lars Magne Ingebrigtsen * mm-view.el (mml-smime): Require. diff --git a/lisp/sieve.el b/lisp/sieve.el index ca181c2..2bc042e 100644 --- a/lisp/sieve.el +++ b/lisp/sieve.el @@ -1,6 +1,7 @@ ;;; sieve.el --- Utilities to manage sieve scripts -;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, +;; 2010, 2011 Free Software Foundation, Inc. ;; Author: Simon Josefsson @@ -98,6 +99,7 @@ require \"fileinto\"; (defvar sieve-manage-buffer nil) (defvar sieve-buffer-header-end nil) +(defvar sieve-buffer-script-name nil) ;; Sieve-manage mode: @@ -204,7 +206,9 @@ require \"fileinto\"; (switch-to-buffer (get-buffer-create "template.siv")) (insert sieve-template)) (sieve-mode) - (message "Press C-c C-l to upload script to server."))) + (set (make-local-variable 'sieve-buffer-script-name) name) + (message "%s" (substitute-command-keys + "Press \\[sieve-upload] to upload script to server.")))) (defmacro sieve-change-region (&rest body) "Turns off sieve-region before executing BODY, then re-enables it after. @@ -363,14 +367,15 @@ Server : " server ":" (or port "2000") " (defun sieve-upload (&optional name) (interactive) (unless name - (setq name (buffer-name))) + (setq name (or sieve-buffer-script-name (buffer-name)))) (when (or (get-buffer sieve-buffer) (call-interactively 'sieve-manage)) (let ((script (buffer-string)) err) (with-current-buffer (get-buffer sieve-buffer) (setq err (sieve-manage-putscript name script sieve-manage-buffer)) (if (sieve-manage-ok-p err) - (message (concat - "Sieve upload done. Use `C-c RET' to manage scripts.")) + (message "%s" + (substitute-command-keys + "Sieve upload done. Use \\[sieve-manage] to manage scripts.")) (message "Sieve upload failed: %s" (nth 2 err))))))) ;;;###autoload -- 1.7.2.3 --=-=-= Content-Type: text/plain -- Michael Welsh Duggan (md5i@md5i.com) --=-=-=--