unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#8593: mail/mail-utils.el (mail-strip-quoted-names): check all whitespace address
@ 2010-12-17 18:25 Jari Aalto
  2011-05-02 14:18 ` Stefan Monnier
  2012-04-12 19:27 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 3+ messages in thread
From: Jari Aalto @ 2010-12-17 18:25 UTC (permalink / raw)
  To: 8593

[-- Attachment #1: Type: text/plain, Size: 1121 bytes --]

Package: emacs
Version: 23.2+1-5.1
Severity: wishlist
Tags: patch

The following is optimization for the mail-strip-quoted-names: it returns
immediately if there is nothing to do. The patch is against Git:

    9344a2b 2010-12-17  Merge branch 'master' of git://git.sv.gnu.org/emacs

2010-12-17  Jari Aalto  <jari.aalto@cante.net>

	* mail/mail-utils.el (mail-strip-quoted-names): If address
	is all whitespace, return immediately with nil.
	(rmail-dont-reply-to): Add check that `naked-address' is a string.
	Needed due to change in `mail-strip-quoted-names'.

-- System Information
Debian Release: squeeze/sid
  APT Prefers testing
  APT policy: (990, testing) (500, unstable) (1, experimental)
Architecture: amd64
Kernel: Linux picasso 2.6.32-5-amd64 #1 SMP Fri Sep 17 21:50:19 UTC 2010 x86_64 GNU/Linux
Locale: LANG=en_DK.UTF-8

-- Versions of packages `emacs depends on'.
Depends:
emacs23         23.2+1-5.1      GNU Emacs is the extensible self-documenting 
emacs23-lucid   23.2+1-5.1      GNU Emacs is the extensible self-documenting 
emacs23-nox     23.2+1-5.1      GNU Emacs is the extensible self-documenting 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-mail-mail-utils.el-mail-strip-quoted-names-Return-on.patch --]
[-- Type: text/x-diff, Size: 1836 bytes --]

From 3d3737886b7f39556cddf0804521a1c44a6f81e3 Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aalto@cante.net>
Date: Fri, 17 Dec 2010 20:12:54 +0200
Subject: [PATCH] mail/mail-utils.el (mail-strip-quoted-names): Return on all whitespace
Organization: Private
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

In ` (mail-strip-quoted-names)' if address is all whitespace, return
immediately with nil. In `rmail-dont-reply-to' Add check that
`naked-address' is a string. Needed due to change in
`mail-strip-quoted-names'.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
---
 lisp/mail/mail-utils.el |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el
index a8d8451..7e87276 100644
--- a/lisp/mail/mail-utils.el
+++ b/lisp/mail/mail-utils.el
@@ -175,7 +175,10 @@ as Rmail does."
   "Delete comments and quoted strings in an address list ADDRESS.
 Also delete leading/trailing whitespace and replace FOO <BAR> with just BAR.
 Return a modified address list."
-  (if (null address)
+  (if (or (null address)
+	  (and (stringp address)
+	       ;; Effectively empty
+	       (string-match "^[[:space:]]*\\'" address)))
       nil
     (if mail-use-rfc822
 	(progn (require 'rfc822)
@@ -284,7 +287,8 @@ the comma-separated list.  The pruned list is returned."
 	      (setq cur-pos start-pos)))
 	(let* ((address (substring destinations start-pos cur-pos))
 	       (naked-address (mail-strip-quoted-names address)))
-	  (if (string-match rmail-dont-reply-to-names naked-address)
+	  (if (and (stringp naked-address)
+		   (string-match rmail-dont-reply-to-names naked-address))
 	      (setq destinations (concat (substring destinations 0 start-pos)
 				    (and cur-pos (substring destinations
 							    (1+ cur-pos))))
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#8593: mail/mail-utils.el (mail-strip-quoted-names): check all whitespace address
  2010-12-17 18:25 bug#8593: mail/mail-utils.el (mail-strip-quoted-names): check all whitespace address Jari Aalto
@ 2011-05-02 14:18 ` Stefan Monnier
  2012-04-12 19:27 ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2011-05-02 14:18 UTC (permalink / raw)
  To: Jari Aalto; +Cc: 8593

> The following is optimization for the mail-strip-quoted-names: it returns
> immediately if there is nothing to do. The patch is against Git:

What for?


        Stefan





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#8593: mail/mail-utils.el (mail-strip-quoted-names): check all whitespace address
  2010-12-17 18:25 bug#8593: mail/mail-utils.el (mail-strip-quoted-names): check all whitespace address Jari Aalto
  2011-05-02 14:18 ` Stefan Monnier
@ 2012-04-12 19:27 ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-04-12 19:27 UTC (permalink / raw)
  To: Jari Aalto; +Cc: 8593

Jari Aalto <jari.aalto@cante.net> writes:

> The following is optimization for the mail-strip-quoted-names: it returns
> immediately if there is nothing to do.

I don't quite see what's the point of this, so I'm closing the report.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-12 19:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-17 18:25 bug#8593: mail/mail-utils.el (mail-strip-quoted-names): check all whitespace address Jari Aalto
2011-05-02 14:18 ` Stefan Monnier
2012-04-12 19:27 ` Lars Magne Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).