Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37756324
en ru br
Репозитории ALT
S:2.1.1.0.3.g6c0f75cca-alt1
5.1: 1.4.2.3-alt3
4.1: 1.4.2.3-alt1
4.0: 1.4.2.3-alt1
3.0: 1.4.2.1i-alt4
www.altlinux.org/Changes

Группа :: Сети/Почта
Пакет: mutt

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: mutt-1.4.2.2-vvv-quote.patch
Скачать


diff -udprP mutt-1.4.2.2.orig/globals.h mutt-1.4.2.2/globals.h
--- mutt-1.4.2.2.orig/globals.h	2002-01-03 22:57:19.000000000 +0200
+++ mutt-1.4.2.2/globals.h	2006-07-18 12:37:58.000000000 +0300
@@ -24,6 +24,8 @@ WHERE CONTEXT *Context;
 WHERE char Errorbuf[STRING];
 WHERE char AttachmentMarker[STRING];
 
+WHERE char Quotebuf[SHORT_STRING];
+
 #if defined(DL_STANDALONE) && defined(USE_DOTLOCK)
 WHERE char *MuttDotlock;
 #endif
diff -udprP mutt-1.4.2.2.orig/handler.c mutt-1.4.2.2/handler.c
--- mutt-1.4.2.2.orig/handler.c	2002-03-26 11:49:51.000000000 +0200
+++ mutt-1.4.2.2/handler.c	2006-07-18 12:37:58.000000000 +0300
@@ -92,6 +92,8 @@ static void convert_to_state(iconv_t cd,
       if (ob != bufo)
 	state_prefix_put (bufo, ob - bufo, s);
     }
+    if (Quotebuf[0] != '\0')
+      state_prefix_putc ('\n', s);
     return;
   }
 
@@ -1711,6 +1713,8 @@ void mutt_decode_attachment (BODY *b, ST
   int istext = mutt_is_text_type (b->type, b->subtype);
   iconv_t cd = (iconv_t)(-1);
 
+  Quotebuf[0] = '\0';
+
   if (istext && s->flags & M_CHARCONV)
   {
     char *charset = mutt_get_parameter ("charset", b->parameter);
diff -udprP mutt-1.4.2.2.orig/init.h mutt-1.4.2.2/init.h
--- mutt-1.4.2.2.orig/init.h	2002-07-24 11:41:29.000000000 +0300
+++ mutt-1.4.2.2/init.h	2006-07-18 12:37:58.000000000 +0300
@@ -1698,6 +1698,19 @@ struct option_t MuttVars[] = {
   ** have no effect, and if it is set to ask-yes or ask-no, you are
   ** prompted for confirmation when you try to quit.
   */
+  { "quote_empty",	DT_BOOL, R_NONE, OPTQUOTEEMPTY, 1 },
+  /*
+  ** .pp
+  ** Controls whether or not empty lines will be quoted using
+  ** ``$indent_string''.
+  */
+  { "quote_quoted",	DT_BOOL, R_NONE, OPTQUOTEQUOTED, 0 },
+  /*
+  ** .pp
+  ** Controls how quoted lines will be quoted. If set, one quote
+  ** character will be added to the end of existing prefix.  Otherwise,
+  ** quoted lines will be prepended by ``$indent_string''.
+  */
   { "quote_regexp",	DT_RX,	 R_PAGER, UL &QuoteRegexp, UL "^([ \t]*[|>:}#])+" },
   /*
   ** .pp
diff -udprP mutt-1.4.2.2.orig/mutt.h mutt-1.4.2.2/mutt.h
--- mutt-1.4.2.2.orig/mutt.h	2002-07-24 12:46:58.000000000 +0300
+++ mutt-1.4.2.2/mutt.h	2006-07-18 12:37:58.000000000 +0300
@@ -384,6 +384,8 @@ enum
   OPTPRINTDECODE,
   OPTPRINTSPLIT,
   OPTPROMPTAFTER,
+  OPTQUOTEEMPTY,
+  OPTQUOTEQUOTED,
   OPTREADONLY,
   OPTREPLYSELF,
   OPTRESOLVE,
diff -udprP mutt-1.4.2.2.orig/muttlib.c mutt-1.4.2.2/muttlib.c
--- mutt-1.4.2.2.orig/muttlib.c	2002-03-25 13:29:32.000000000 +0200
+++ mutt-1.4.2.2/muttlib.c	2006-07-18 12:37:58.000000000 +0300
@@ -1193,15 +1193,45 @@ void state_prefix_putc(char c, STATE *s)
 {
   if (s->flags & M_PENDINGPREFIX)
   {
-    state_reset_prefix(s);
-    if (s->prefix)
-      state_puts(s->prefix, s);
-  }
+    int i;
 
-  state_putc(c, s);
+    i = strlen (Quotebuf);
+    Quotebuf[i++] = c;
+    Quotebuf[i] = '\0';
+    if (i == sizeof (Quotebuf) - 1 || c == '\n')
+    {
+      char buf[2 * SHORT_STRING];
+      int j = 0, offset = 0;
+      regmatch_t pmatch[1];
 
-  if(c == '\n')
-    state_set_prefix(s);
+      state_reset_prefix (s);
+      while (regexec ((regex_t *) QuoteRegexp.rx, &Quotebuf[offset], 1, pmatch, 0) == 0)
+	offset += pmatch->rm_eo;
+
+      if (!option (OPTQUOTEEMPTY) && Quotebuf[0] == '\n')
+	strcpy (buf, Quotebuf);
+      else if (option (OPTQUOTEQUOTED) && offset)
+      {
+	for (i = 0; i < offset; i++)
+	  if (Quotebuf[i] != ' ')
+	    j = i;
+	strncpy (buf, Quotebuf, j + 1);
+	strcpy (buf + j + 1, Quotebuf + j);
+      }
+      else
+	snprintf (buf, sizeof (buf), "%s%s", s->prefix, Quotebuf);
+
+      state_puts (buf, s);
+    }
+  }
+  else
+    state_putc (c, s);
+
+  if (c == '\n')
+  {
+    state_set_prefix (s);
+    Quotebuf[0] = '\0';
+  }
 }
 
 int state_printf(STATE *s, const char *fmt, ...)
diff -udprP mutt-1.4.2.2.orig/PATCHES mutt-1.4.2.2/PATCHES
--- mutt-1.4.2.2.orig/PATCHES	2001-11-26 21:16:52.000000000 +0200
+++ mutt-1.4.2.2/PATCHES	2006-07-18 12:37:58.000000000 +0300
@@ -0,0 +1 @@
+vvv.quote
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin