[2903] in BarnOwl Developers
Re: Fixes to punt and filters
daemon@ATHENA.MIT.EDU (David A Benjamin)
Fri Feb 11 01:40:47 2011
Date: Fri, 11 Feb 2011 01:40:44 -0500 (EST)
From: David A Benjamin <davidben@MIT.EDU>
To: Anders Kaseorg <andersk@mit.edu>
cc: barnowl-dev@mit.edu
In-Reply-To: <alpine.DEB.2.02.1102110124120.22897@dr-wily.mit.edu>
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
---1257051904-1336377840-1297406444=:26366
Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE
LGTM
(I'm still amazed glib doesn't give us an owl_text_tr-like function to=20
replace it with...) We probably also want to kill the call in=20
owl_function_smartfilter_cc. That would leave one use of the function in=20
the logging code.
David
On Fri, 11 Feb 2011, Anders Kaseorg wrote:
> The following changes since commit ab9bf01ff80f13e2cfd06ee0a6a5e358bbb507=
27:
>
> Disable special handling of START and STOP characters (^Q and ^S) (2011-=
02-10 23:59:03 -0500)
>
> are available in the git repository at:
> git://andersk.mit.edu/barnowl.git punt
>
> Anders Kaseorg (3):
> Fix spurious error running =E2=80=98punt=E2=80=99 with no arguments
> For =E2=80=98punt=E2=80=99 with one argument, quote the filter name
> owl_function_classinstfilt: Do not turn [ '"] into .
>
> commands.c | 6 ++----
> functions.c | 4 ----
> 2 files changed, 2 insertions(+), 8 deletions(-)
>
> -- 8< --
> From 2c68a93f458221e9d6329fc89230e4ef55fa5f39 Mon Sep 17 00:00:00 2001
> From: Anders Kaseorg <andersk@mit.edu>
> Date: Fri, 11 Feb 2011 00:57:52 -0500
> Subject: [PATCH 1/3] Fix spurious error running =E2=80=98punt=E2=80=99 wi=
th no arguments
>
> Signed-off-by: Anders Kaseorg <andersk@mit.edu>
> ---
> commands.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/commands.c b/commands.c
> index 1422075..c02120b 100644
> --- a/commands.c
> +++ b/commands.c
> @@ -2470,9 +2470,7 @@ void owl_command_punt_unpunt(int argc, const char *=
const * argv, const char *buf
> fl =3D owl_global_get_puntlist(&g);
> if(argc =3D=3D 1) {
> owl_function_show_zpunts();
> - }
> -
> - if(argc =3D=3D 2) {
> + } else if(argc =3D=3D 2) {
> /* Handle :unpunt <number> */
> if(unpunt && (i=3Datoi(argv[1])) !=3D0) {
> i--; /* Accept 1-based indexing */
> --=20
> 1.7.4
>
>
> From fba2a65e9579a0c7a2206186209d9158aaec8f73 Mon Sep 17 00:00:00 2001
> From: Anders Kaseorg <andersk@mit.edu>
> Date: Fri, 11 Feb 2011 01:15:28 -0500
> Subject: [PATCH 2/3] For =E2=80=98punt=E2=80=99 with one argument, quote =
the filter name
>
> Signed-off-by: Anders Kaseorg <andersk@mit.edu>
> ---
> commands.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/commands.c b/commands.c
> index c02120b..3071171 100644
> --- a/commands.c
> +++ b/commands.c
> @@ -2483,7 +2483,7 @@ void owl_command_punt_unpunt(int argc, const char *=
const * argv, const char *buf
> owl_function_error("No such filter number: %d", i+1);
> }
> }
> - text =3D owl_sprintf("filter %s", argv[1]);
> + text =3D owl_string_build_quoted("filter %q", argv[1]);
> owl_function_punt(text, unpunt);
> owl_free(text);
> } else {
> --=20
> 1.7.4
>
>
> From 9518a859987b60867c3566157ad0a24358cd28fb Mon Sep 17 00:00:00 2001
> From: Anders Kaseorg <andersk@mit.edu>
> Date: Fri, 11 Feb 2011 01:15:58 -0500
> Subject: [PATCH 3/3] owl_function_classinstfilt: Do not turn [ '"] into .
>
> This transformation was not invertible, and narrowing to some
> instances made it impossible to narrow to other instances that map to
> the same filter name. We have already fixed most of the quoting
> problems that resulted in [ '"] getting mishandled.
>
> Signed-off-by: Anders Kaseorg <andersk@mit.edu>
> ---
> functions.c | 4 ----
> 1 files changed, 0 insertions(+), 4 deletions(-)
>
> diff --git a/functions.c b/functions.c
> index 4d2eaba..fbc2bff 100644
> --- a/functions.c
> +++ b/functions.c
> @@ -2316,10 +2316,6 @@ char *owl_function_classinstfilt(const char *c, co=
nst char *i, int related)
> filtname =3D temp;
> }
> }
> - /* turn spaces, single quotes, and double quotes into dots */
> - owl_text_tr(filtname, ' ', '.');
> - owl_text_tr(filtname, '\'', '.');
> - owl_text_tr(filtname, '"', '.');
>
> /* if it already exists then go with it. This lets users override */
> if (owl_global_get_filter(&g, filtname)) {
> --=20
> 1.7.4
>
>
---1257051904-1336377840-1297406444=:26366--