Accepting request 895372 from server:mail

- Add chappa-DelText.patch [boo#1182236]

OBS-URL: https://build.opensuse.org/request/show/895372
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/alpine?expand=0&rev=53
This commit is contained in:
Dominique Leuenberger 2021-06-01 08:35:44 +00:00 committed by Git OBS Bridge
commit 21af6fdd38
5 changed files with 125 additions and 1 deletions

View File

@ -5,9 +5,11 @@ provided as patches (but by the same author..). So when there is a new
release, the OOT patches on the website get updated too.
version="2.24"
for i in WrtAcc colortext fancy fillpara fromheader insertpat maildir rules; do
for i in WrtAcc colortext fancy fillpara fromheader insertpat maildir rules DelText; do
wget -O- "http://alpine.x10host.com/alpine/patches/alpine-$version/$i.patch.gz" | gzip -cd >"chappa-$i.patch";
done
These do not necessarily apply cleanly, so they also need to be
quilt-refreshed as needed.
fillpara is known to collide with DelText.

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue May 25 11:44:38 UTC 2021 - Jan Engelhardt <jengelh@inai.de>
- Add chappa-DelText.patch [boo#1182236]
-------------------------------------------------------------------
Sun May 16 15:23:42 UTC 2021 - Callum Farmer <gmbr3@opensuse.org>

View File

@ -61,6 +61,8 @@ Source615: chappa-fromheader.txt
Patch615: chappa-fromheader.patch
Source616: chappa-rules.txt
Patch616: chappa-rules.patch
Source617: chappa-DelText.txt
Patch617: chappa-DelText.patch
BuildRequires: autoconf >= 2.69
BuildRequires: krb5-devel
BuildRequires: libtool
@ -132,6 +134,7 @@ fi
%patch614 -p1
%patch615 -p1
%patch616 -p1
%patch617 -p1
#
# SuSE patches - warning fixes, etc:
#

106
chappa-DelText.patch Normal file
View File

@ -0,0 +1,106 @@
---
pico/basic.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
pico/efunc.h | 1 +
pico/search.c | 8 ++++++--
3 files changed, 57 insertions(+), 2 deletions(-)
Index: alpine-2.24/pico/basic.c
===================================================================
--- alpine-2.24.orig/pico/basic.c
+++ alpine-2.24/pico/basic.c
@@ -959,7 +959,57 @@ scrolldownline(int f, int n)
return (scrollforw (1, FALSE));
}
+/* deltext deletes from the specified position until the end of the file
+ * or until the signature (when called from Pine), whichever comes first.
+ */
+int
+deltext (f,n)
+int f,n;
+{
+ LINE *currline = curwp->w_dotp;
+ static int firsttime = 0;
+
+ if ((lastflag&CFKILL) == 0)
+ kdelete();
+
+ curwp->w_markp = curwp->w_dotp;
+ curwp->w_marko = curwp->w_doto;
+
+ while (curwp->w_dotp != curbp->b_linep){
+ if ((Pmaster)
+ && (llength(curwp->w_dotp) == 3)
+ && (lgetc(curwp->w_dotp, 0).c == '-')
+ && (lgetc(curwp->w_dotp, 1).c == '-')
+ && (lgetc(curwp->w_dotp, 2).c == ' ')){
+ if (curwp->w_dotp == currline){
+ if (curwp->w_doto)
+ curwp->w_dotp = lforw(curwp->w_dotp);
+ else
+ break;
+ }
+ else{
+ curwp->w_dotp = lback(curwp->w_dotp);
+ curwp->w_doto = llength(curwp->w_dotp);
+ break;
+ }
+ }
+ else{
+ if(lforw(curwp->w_dotp) != curbp->b_linep)
+ curwp->w_dotp = lforw(curwp->w_dotp);
+ else{
+ curwp->w_doto = llength(curwp->w_dotp);
+ break;
+ }
+ }
+ }
+ killregion(FALSE,1);
+ lastflag |= CFKILL;
+ if(firsttime == 0)
+ emlwrite("Deleted text can be recovered with the ^U command", NULL);
+ firsttime = 1;
+ return TRUE;
+}
/*
* Scroll to a position.
Index: alpine-2.24/pico/efunc.h
===================================================================
--- alpine-2.24.orig/pico/efunc.h
+++ alpine-2.24/pico/efunc.h
@@ -59,6 +59,7 @@ extern unsigned char accent(UCS, UCS);
extern unsigned char GetAccent(void);
extern int forwpage(int, int);
extern int backpage(int, int);
+extern int deltext (int, int);
extern int scrollupline(int, int);
extern int scrolldownline(int, int);
extern int scrollto(int, int);
Index: alpine-2.24/pico/search.c
===================================================================
--- alpine-2.24.orig/pico/search.c
+++ alpine-2.24/pico/search.c
@@ -73,7 +73,7 @@ EXTRAKEYS menu_srchpat[] = {
{"^O", N_("End of Para"), (CTRL|'O')},
{"^U", N_("FullJustify"), (CTRL|'U')},
{"^P", N_("Delete Para"), (CTRL|'P')},
- {NULL, NULL, 0}
+ {"^X", N_("Del End"), (CTRL|'X')},
};
#define EXACTSR_KEY 1 /* toggle an exact or approximate search */
@@ -286,7 +286,11 @@ forwsearch(int f, int n)
break;
case (CTRL|'X'):
- if(flags & SR_OPTNMEN){
+ if (flags & SR_ORIGMEN){
+ deltext(f,n);
+ FWS_RETURN(TRUE);
+ }
+ else if(flags & SR_OPTNMEN){
if (flags & SR_NOEXACT){
flags &= ~SR_NOEXACT;
flags |= SR_EXACTSR;

8
chappa-DelText.txt Normal file
View File

@ -0,0 +1,8 @@
From: http://alpine.x10host.com/alpine/info/DelText.html
Upstream: constitutes upstream source, delivered in non-tarball form
This patch allows Pico and Alpine to remove all text of the message from the
position of the cursor up to the end of the file or message. All you need to do
is to press ^W ^X. If your signature is delimited by the string "-- " (two
dashes and a space), it will not be erased by this command.