issue10: bookmark user-titles in find-url completions

Priority: bug Status: done-cbb
Messages
msg16 (view) Author: retroj Date: 2008-09-19.15:57:21
User-set bookmark titles do not show up in the completions for find-url. 
Instead, only the original page titles are in the completions list.
msg42 (view) Author: retroj Date: 2008-09-21.04:29:26
I just pushed a partial fix to the long-standing problem of not being
able to use user-set bookmark titles in the read-url completion.  There
is however a small catch.  You can only complete on either history or
bookmarks, but not both at the same time.  Therefore, put into your rc
one of the following:

   url_completion_use_bookmarks = false;
   url_completion_use_history = true;

  *or*

   url_completion_use_bookmarks = true;
   url_completion_use_history = false;

  We hope that this limitation will be short-lived, because the Mozilla
source includes a note about the need for a particular flag called
QUERY_TYPE_UNIFIED to be implemented.  This is the flag that conkeror
depends upon in order to do completion on history and bookmarks at the
same time.

  Here is a toggle command and binding you can put in your rc:

function url_completion_toggle (I) {
    if (url_completion_use_bookmarks) {
        url_completion_use_bookmarks = false;
        url_completion_use_history = true;
    } else {
        url_completion_use_bookmarks = true;
        url_completion_use_history = false;
    }
}
interactive("url-completion-toggle",
            "toggle between bookmark and history completion",
            url_completion_toggle);
define_key(content_buffer_normal_keymap, "C-c t", "url-completion-toggle");
msg70 (view) Author: dkettler Date: 2008-09-26.03:08:02
The code below defines a more extensive set of keystrokes for choosing completion types.  Perhaps it will
be useful to someone.


/* Completion type changer */
// todo: on the fly in minibuffer

define_variable("set_completion_keys",
    {w: [true,  false, false],
     b: [false, true,  false],
     h: [false, false, true ],
     a: [true,  false, true ],
     i: [true,  false, true ],
     d: [true,  true,  false]},
    "Keys to define in set_completion_keymap to get certain combinations " +
    "of completions.  Each key has a corresponding vector with three " +
    "boolean values corresponding to webjumps, bookmarks and history.");

// Note: when QUERY_TYPE_UNIFIED works, change to: a: [true, true, true]


function set_completion(type) {
    var c = set_completion_keys[type];
    if (c == undefined)
        throw new Error("invalid completion key: " + type);
    url_completion_use_webjumps  = c[0];
    url_completion_use_bookmarks = c[1];
    url_completion_use_history   = c[2];
}

function show_completion(minibuffer) {
    var ids = ["Completion:"];
    url_completion_use_webjumps  && ids.push("webjumps");
    url_completion_use_bookmarks && ids.push("bookmarks");
    url_completion_use_history   && ids.push("history");
    minibuffer.show(ids.join(" "));
}

/* Set completion type according to the last keystroke in the key sequence. */
interactive("set-completion", null, function (I) {
    set_completion(I.key_sequence.pop());
    show_completion(I.minibuffer);
});

interactive("show-completion", null, function (I) {
    show_completion(I.minibuffer);
});

define_keymap("set_completion_keymap");
define_key(default_base_keymap, "C-l", set_completion_keymap);
for (let k in set_completion_keys)
    define_key(set_completion_keymap, k, "set-completion");
define_key(set_completion_keymap, "S", "show-completion");
msg403 (view) Author: retroj Date: 2009-08-27.01:12:54
For reference https://bugzilla.mozilla.org/show_bug.cgi?id=378798
History
Date User Action Args
2010-02-27 02:49:36retrojsetstatus: in-progress -> done-cbb
2009-08-27 01:12:54retrojsetmessages: + msg403
2008-09-26 03:08:03dkettlersetmessages: + msg70
2008-09-21 04:29:26retrojsetstatus: unread -> in-progress
messages: + msg42
2008-09-19 16:00:19retrojsettitle: bookmark user-titles -> bookmark user-titles in find-url completions
2008-09-19 15:57:21retrojcreate