- Subject: Feature request: not the current buf in ^Xb
- From: Joerg Sommer <joerg@xxxxxxxxxxxx>
- Date: Thu, 11 Aug 2005 10:31:39 +0000 (UTC)
Hi John,
is it possible to exclude the current buffer from the list of buffers
offered by switch_to_buffer (key ^XB)? It is annoying to complete
everytime the name when you switch between foobar.latex and foobar.idx or
something similar.
I would submit something like that:
#v+
--- ledit.c-orig 2005-08-11 12:21:09.000000000 +0200
+++ ledit.c 2005-08-11 12:26:54.000000000 +0200
@@ -142,6 +142,28 @@
/*}}}*/
+static int open_bufflist_wo_current(char *buf) /*{{{*/
+{
+ const char* cur_buf = what_buffer();
+
+ if ((Buf_Context = MiniBuffer) == NULL) return(0);
+ Buf_Context = Buf_Context->next;
+
+ Buffer* b = Buf_Context;
+ while (b->next != NULL) {
+ if (strcmp(b->next->name, cur_buf) != 0) {
+ b->next = b->next->next;
+ free(b->next);
+ break;
+ }
+ }
+
+ Buf_List_Len = strlen(buf);
+ return next_bufflist(buf);
+}
+
+/*}}}*/
+
int bufferp(char *name) /*{{{*/
{
if (NULL == find_buffer(name)) return(0); else return(1);
@@ -1105,7 +1127,7 @@
{
char *tmp;
int n;
- complete_open = open_bufflist;
+ complete_open = open_bufflist_wo_current;
complete_next = next_bufflist;
get_last_buffer ();
#v-
This does not work, because I don't know the internal data structures,
but it is an idea.
Regards, Jörg.
--
Alles, wovor wir Angst haben müssen, ist die Angst selbst.
(Fraklin D. Roosevelt)
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2005 date index]
[2005 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]