help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: server emacs - how to get file/line/col of previous buffer?


From: Michal
Subject: Re: server emacs - how to get file/line/col of previous buffer?
Date: Sun, 09 Mar 2008 12:44:49 +0100
User-agent: mozilla news reader

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> It's not clear to me which "from" buffer you're thinking of (there's
> the buffer from which the server processed your request, the buffer
> that was displayed in the window in which your file gets displayed, and
> probably a few more).

I mean "the buffer that was displayed in the window in which your file
gets displayed".

This is the description what I need to do:

I want to add two icon buttons: "<-" and "->" to the end of list of
buttons, that are at the top of emacs window (I am using emacs under X
of course). These two buttons will move me through the list of
locations(buffer/line/col).

What locations' list is?

I explain it on example.

1) I run emacs as usual.
2) then I do M-x server-start on it.
3) then I visit location: L1 = p1.c/23/4, where 23 is line number, and 4 is 
column number.
4) then in external terminal I do:
   emacsclient --no-wait  +10:5 p2 #. L2 = p2.c/10/5. Note: --no-wait flag
   At this point emacs put two locations on the list:
        L2        L1
   (p2.c/10/5 p1.c/23/4)
5) Now I do some editing in p2.c buffer, then some other buffers,
   but finally I end up in location: L3 = p3.c/30/5.
6) Now: emacsclient --no-wait  +20:30 p4 #. L4 = p4/20/30
   At this point my list should look like following:
       L4        L3         L2      L1
   (p4/20/30 p3.c/30/5 p2.c/10/5 p1.c/23/4)
7) Now: emacsclient --no-wait  +15:16 p5 #. L5 = p5/15/16. 
                                         #. cursor not moved away from p4/20/30 
location.
                                         #. ... so only one location is added...

       L5       L4       L3       L2         L1
   (p5/15/16 p4/20/30 p3.c/30/5 p2.c/10/5 p1.c/23/4)

8) Now I press: "<-" button, which displays L4 location.
9) Once more "<-". Displays L3 location.
10) Now "->" goes back to L4 location.
11) Now: emacsclient --no-wait  +7:3 p5 #. L6 = p5/7/3.
      L6      L4       L3       L2         L1
   (p5/7/3 p4/20/30 p3.c/30/5 p2.c/10/5 p1.c/23/4)

Note: L5 (and all follwing in they existed) is forgotten , because I was at L4, 
when emacsclient
      is invoked.

Summary: My list is modified only at emacsclient invocations. At most two 
locations are added at each invocation. But if last location at the list is the 
same as the one being displayed in emacs just at (before) emacsclient 
invocation, then only one location is added. This is the one described by 
emacsclient invocation params.

This is what I want to do.

Regards,
Michal





reply via email to

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