lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev Transport links between bookmark files... Here's the code


From: mattack
Subject: lynx-dev Transport links between bookmark files... Here's the code
Date: Sun, 4 Jul 1999 23:32:04 -0700 (PDT)

I've never done this before (or even used diff much), so please inform me
about what I'm doing wrong, while hopefully not blowing my idea out of the
water..

So, basically:

When you are viewing a bookmark file, you can hit 't' to transport the
current link to another bookmark file.  I have covered the error cases
I could think of, and tried edge cases (first link, last link).  It even 
allows a lame way to very slowly reorder your links within one bookmark
file (though you must have multibookmark mode on) by selecting the same 
file...  It'll move that bookmark to the end.

I'm based upon
Lynx Version 2.8.3dev.2 (18 Jun 1999)

LYBookmark.c
/home/mattack/lynx2-8-3/src % diff LYBookmarkORIG.c LYBookmark.c
193c193
< PUBLIC void save_bookmark_link ARGS2(
---
> PUBLIC BOOLEAN save_bookmark_link ARGS3(
195c195,196
<       char *,         title)
---
>       char *,         title,
>       BOOLEAN,        allowTitleChange)
215c216
<       return;
---
>       return FALSE;
238c239
<           return;
---
>           return FALSE;
249c250
<       return;
---
>       return FALSE;
264c265
<           return;
---
>           return FALSE;
270a272,274
>   if (!allowTitleChange)
>               LYstrncpy(string_buffer, title, sizeof(string_buffer)-1);
>       else
280c284
<           return;
---
>           return FALSE;
322c326
<       return;
---
>       return FALSE;
403a408
>               return TRUE;

LYBookmark.h
/home/mattack/lynx2-8-3/src % diff LYBookmarkORIG.h LYBookmark.h
10c10
< extern void save_bookmark_link PARAMS((char *address, char *title));
---
> extern BOOLEAN save_bookmark_link PARAMS((char *address, char *title, BOOLEAN
allowTitleChange));

LYMainLoop.c
/home/mattack/lynx2-8-3/src % diff LYMainLoopORIG.c LYMainLoop.c
4484a4485,4511
>       case LYK_TAG_LINK:      /* transport or tag/untag the current link */
>               // if currently in a Bookmark file, and MultiBookmarks are enabl
ed
>               if (!strcmp(curdoc.title, BOOKMARK_TITLE) && (LYMultiBookmarks =
= TRUE))
>                                {
>                                       BOOLEAN successfulSave = FALSE;
>
>                                       if (links[curdoc.link].type != WWW_FORM_
LINK_TYPE)
>                                               {
>                                                       successfulSave = save_bo
okmark_link(links[curdoc.link].lname,
>
links[curdoc.link].hightext,FALSE);
>                                                       refresh_screen = TRUE; /
* MultiBookmark support */
>                                               }
>                                       if ((successfulSave == TRUE) && (curdoc.
bookmark != NULL))
>                                               {
>                                                       remove_bookmark_link(lin
ks[curdoc.link].anchor_number-1,
>
curdoc.bookmark);
>                                                       // MAA following lines c
opied from the IMAGE_TOGGLE code
> #ifdef SOURCE_CACHE
>                                           if (HTreparse_document()) {
>                                                               break;
>                                           }
> #endif
>                                           cmd = LYK_RELOAD;
>                                           goto new_cmd;
>                                               }
>                                       break;
>                               }
4486d4512
<       case LYK_TAG_LINK:      /* tag or untag the current link */
5262c5288
<                           save_bookmark_link(curdoc.address, curdoc.title);
---
>                           save_bookmark_link(curdoc.address, curdoc.title,TRUE
);
5312c5338
<                                              links[curdoc.link].hightext);
---
>                                              links[curdoc.link].hightext,TRUE)
;
5338c5364
<                       save_bookmark_link(curdoc.address, curdoc.title);
---
>                       save_bookmark_link(curdoc.address, curdoc.title,TRUE);


/home/mattack/lynx2-8-3/lynx_help/keystrokes % diff bookmark_helpORIG.html bookm
ark_help.html
15c15
< enabled.  The remove feature, invoked by pressing an '<em>r</em>' when
---
> enabled.  The remove feature, invoked by pressing an '<em>r</em>' while
17,19c17,23
< highlighted link.  You may set and modify the paths and names of your
< <em>Bookmark files</em>, and enable or disable multiple bookmarks, in
< the <A HREF="option_help.html">options screen.</A>
---
> highlighted link.  The transport (move link) feature, invoked by pressing
> a '<em>t</em>' while a <em>Bookmark file</em> is being displayed and
> multi-bookmark mode is enabled, will prompt you for a bookmark file
> to which to move the currently hilighted link.  You may set and modify
> the paths and names of your <em>Bookmark files</em>, and enable or
> disable multiple bookmarks, in the <A HREF="option_help.html">options
> screen.</A>

/home/mattack/lynx2-8-3/lynx_help/keystrokes % diff keystroke_helpORIG.html keys
troke_help.html
62a63,66
>                t              - While viewing a <A HREF="bookmark_help.html"
>                               >bookmark file</A> in multi-
>                                 bookmark mode, transport (move) the currently
>                                 selected link to another bookmark file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]