Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [point]

is the location where most editing commands take effect, which is by default indicated by the cursor in the selected window. Emacs remembers the last location of the point for each buffer and when a buffer is activated, Emacs returns the cursor to the last known point.

1
vote
1answer
32 views

Update point using mouse

I have been trying to add a custom keyboard command that will find a functions definition using S-mouse1. The issue is that I need two mouse clicks for this to work. The first click is to move ...
1
vote
0answers
45 views

How to delete a long region by setting a mark and then searching for the location of the end of the region?

I have a long document. I placed two unique identifiers, in the form of short strings of printable English letter, in two positions in the document. The identifiers are far apart. My task is to delete ...
0
votes
1answer
47 views

Inconsistent point in an elisp program and in a visible non-focused process buffer

I am able to collect output data from a process, but I don't understand the coordination of point and process-mark. In particular, the visible cursor in a non-selected window visiting the buffer does ...
0
votes
1answer
32 views

Is arbitrary buffer position at the beginning of a line?

What's the simplest way to check whether a given point value p is at the beginning of some line or not? Is there anything simpler than (save-excursion (goto-char p) (= p (point-at-bol))) or (member (...
4
votes
0answers
44 views

Point belongs to window - mark belongs to buffer

In Emacs the point belongs to a window: this allows a buffer to be displayed in two different windows at the same time. The mark belongs however to the buffer. Conceptually the mark and a point ...
0
votes
0answers
44 views

Function acts differently when I call it by M-x and when I call it by load-file/library

I've got this function: (defun move-pointer () (interactive) (let ((enable-recursive-minibuffers t)) (read-string "Go to the main buffer, Move cursor where you like. Come back in the ...
1
vote
5answers
128 views

Replacing buffer content without losing point

I looking into extending atomic-chrome to work with text areas that can be modified from the server side, such as site providing collaborative LaTeX editing. The plugin provides updates containing the ...
5
votes
1answer
117 views

(progn (scroll-up 1) (goto-char 0)) is different from (scroll-up 1) then (goto-char 0)

In any buffer, try to eval-expression the expression (scroll-up 1) and then eval (goto-char 0). The window scrolls up, then point is moved to the beginning of the buffer. Now, try eval-ing (progn (...
0
votes
0answers
41 views

How can I get my target string point/marker without moving the pointer?

Lets say I have the following LaTeX code: \ref{AAA}, \ref{BBB} ... \ref{BBB,CCC,DDD} \begin{the bibliography}{99} \bibitem{AAA} \bibitem{BBB} and I want to write a function that does: (perform-...
1
vote
5answers
368 views

Quick jump to a specific line of a file

After opening a .txt file with Emacs, when the point is at the line /folder/subfolder/file.xml:435 How can I fast jump to line 435 of the above mentioned file? What I tried: dired-at-point and ...
1
vote
1answer
53 views

is there a shell-command-at-point

This is a bit of a long shot, but I'm going to ask anyway. Kinda similar to what dired-at-point and find-file-at-point When point is inside a .txt file on a line like this ls -la /tmp/ When point ...
2
votes
2answers
54 views

Accessing the character in the line below

I am writing an Emacs Lisp function which needs to know the character directly under point in the line below, returning nil when no such character exists. I thus defined the function char-below, which ...
0
votes
1answer
60 views

Can I programmatically get access to the yanked region?

You are likely to want to do things to the text that you just yanks / pasted (wrap it in brackets etc). Is there a way to know what you just yanked? If so I would quite like select it (put the mark ...
4
votes
0answers
82 views

copy to clipboard without overwriting kill ring

I'm looking for a way to copy to clipboard from emacs without passing through the kill-ring, moving the marker or using the mouse. If I use x-select-enable-primary and x-select-enable-clipboard, I can ...
2
votes
0answers
25 views

Is it possible to select a buffer by the line at point?

I'm not entirely clear that this is a good idea... but it feels like it might be. To avoid having to think about "which buffer contains what" it might be nice to be able to select buffers by recently ...
1
vote
1answer
47 views

Keep point position between re-opening files with recentf/ido

It's hard to say what was broken in my .emacs but with new Emacs 25.1.1 after opening file from recentf point is placed at the beginning of buffer whereas with Emacs 24 it opens in last viewed ...
1
vote
1answer
29 views

How can I get the value of left top and right bottom point value of current window?

How can I get the value of left top and right bottom point value of current working window(the window currently focusing on)?
2
votes
3answers
139 views

Storing previous cursor positions

I would like the ability to go back and forth through a series of stored recent cursor positions, say up to 100 of them. Specifically, a position should be recorded when I click somewhere, or when I ...
3
votes
2answers
98 views

save-excursion does not work with `org-sort-entries`

Say we have a org buffer with content: * top-level heading some text $ # $ denote cursor ** heading 3 ** heading 2 ** heading 1 ** heading 0 Now evaluate (save-excursion (org-sort-entries ...
12
votes
3answers
4k views

Emacs point(cursor) movement lag

When running previous-line, C-p or <up> the cursor jumps up a line without any issues or lags. When running next-line, C-n or <down> the cursor properly jumps down a line, but with a ...
1
vote
1answer
59 views

Weird (point) and (point-max) values in IELM

When I open IELM and type in (point) or (point-max) in the interpreter, it always returns 710 (#o1306, #x2c6, ?ˆ) and 64292 (#o175444, #xfb24, ?ﬤ) respectively. If I eval these functions via eval-...
1
vote
1answer
258 views

Navigate cursor position history with line-based jumps

I use point-undo to jump between positions in the cursor history. However, point-undo uses every previous position of the cursor, and I often experience that what I actually want is to jump just to ...
2
votes
0answers
105 views

find-alternate-file and move point

When using find-alternate-file, to refresh the file in the current buffer, point is always moved back to the start of the file. How can I get point to be moved to where I was in the file before ...
2
votes
0answers
41 views

Are there any packages or configuration snippets for better whitespace traversal?

Whitespace traversal in Emacs is atrocious. By "traversal" I mean: Moving the point with C-<direction> Expanding a selection (with either a package or region mark) Deleting with C- or M- ...
1
vote
0answers
186 views

How to get entry text and property value in agenda? [closed]

What is the lisp function to get some entry text (excluding descendant items) for the highlighted item in the org-agenda? org-agenda-get-some-entry-text seems to be promising. I have called it like ...
2
votes
1answer
32 views

Catch invalid calc expression

Inspired by this blog I wrote a function which replaces arithmetic expressions between two $ symbols with the mathematical result inline (and deletes the $ symbols). How can I modify this such that it ...
2
votes
1answer
561 views

Help Buffer on Hover Possible?

I'm looking for something similar to Eldoc mode (hover over a function and the parameter list appears in the minibuffer), only I'd like to have a help buffer appear, as if I had just run describe-...
5
votes
1answer
316 views

Is there a hook I can use to run my function when point moves?

I'd like to add some navigation context to the modeline. I can figure out where I am just fine and give the name of my function, but I don't know how to run this every time point moves. post-command-...
3
votes
2answers
1k views

Mouse pointer between characters and the text cursor misplacement

Mouse cursor position interpretation in emacs drives me nuts. Why draw the mouse cursor in emacs window with vertical thin bar if you cannot effectively position it between characters? Selecting ...
1
vote
1answer
55 views

Unable to restore point in magit commit buffer

When I open commit buffer (pressing c c), the pointer is shown in random locations instead of showing point at beginning of buffer. This is quite annoying as I have to manually move point every time. ...
3
votes
1answer
116 views

Obtain absolute pixel position of point

I'd like to obtain the absolute pixel position of the point (i.e. the cursor, not the mouse pointer) in the current buffer in a GUI frame, to pass it onwards to an external program. I don't mind ...
3
votes
2answers
131 views

Is it possible to get the start and end points in the buffer in which text is pasted?

Like if you have a buffer containing hel! and paste in lo world after the third letter you get 4 and 11 respectively? Emacs has many state variables, are there any that could help me in this case?
4
votes
1answer
110 views

How to prevent whitespace cleanup at point?

I have hooked whitespace-cleanup to before-save-hook and there is a timer to auto save buffer every 5 seconds. When i am typing something, or coding in python, I stop once in a while and buffer ...
1
vote
5answers
98 views

Leave point in original position when C-g is pressed?

I am writing a function to select a region (say 2 lines). (defun select-some-region () (interactive) (push-mark (point) nil t) (forward-line 2)) When point is in a buffer like this |...
3
votes
1answer
59 views

Retain point in magit while staging hunk by hunk?

I am trying to stage few hunks of a file using magit. My point is on first hunk like this Now if I press s to stage this hunk, it will stage hunk and moves point back to file like this Now to stage ...
5
votes
1answer
287 views

How does previous-line/next-line “know” the column it should move to from the end of the line

When I am on a long line, beyond the end of an adjacent line, if I move up or down to the other line the point will go to end of the line, naturally. Then when I move back to the longer line, it goes ...
0
votes
2answers
486 views

How to go to end of match using search-backward-regexp?

I am trying to match a regex using this code (search-backward-regexp "\n[\t\n ]*?\n" nil "NOERROR" 1) search-backward-regexp documenation says Set point to the beginning of the match, and return ...
16
votes
4answers
1k views

What is the usefulness of `exchange-point-and-mark`?

The exchange-point-and-mark command is bound to C-x C-x, but I cannot think of any use cases that would make it deserving of such a prominent binding. How can I use the exchange-point-and-mark to ...
7
votes
1answer
753 views

How to save last place of point in a buffer?

I would like to save the last position of point in the buffer I am visiting, so to have point still there when I go back to that file. I understand I can use saveplace for this, so I added this ...
2
votes
1answer
44 views

How can I find the current line and column ignoring text composition?

I'm working on a utility that communicates with an external process using line and column positions in the current file. I have configured Haskell mode to use compose-region to display certain parts ...
2
votes
2answers
416 views

How to move point to the end of another buffer, using `with-current-buffer` and `goto-char`?

I'm trying to implement «effective append» for log buffer, e.g. if a point is at point-max position then insert text and move point to new point-max, otherwise append text and preserve point position. ...
3
votes
1answer
73 views

What is causing the letter to the right of my point to flicker?

I occasionally have the problem that the character to the right of my point starts blinking. Can anyone think of anything that could be causing this problem?
3
votes
2answers
241 views

What is the purpose of this code in `append-to-buffer`?

The append-to-buffer function's definition ends with: (dolist (window windows) (when (= (window-point window) point) (set-window-point window (point)))))))) What is the purpose of this? ...
1
vote
2answers
122 views

Undo custom command without moving the point

I would like to have a command that inserts some text at a distance, while keeping the point in place during its own execution and while being undone. To illustrate the point, consider following ...
0
votes
1answer
123 views

How to disable scroll lock when moving point

A strange behaviour happens when I move up or down the point (using the keyboard): Emacs automatically scrolls up or down whenever I pass a certain line threshold. See here: When moving down, at line ...
2
votes
1answer
260 views

How to return to previous point after `org-clock-goto`?

In org-mode, C-c C-x C-j executes org-clock-goto, jumping the cursor to the currently active or most recently used clock. After using this, I almost always want to go back to the point where I was, ...
1
vote
1answer
173 views

How to move point with mousepointer on shift-click in emacs

I want to write some functionality that fires whenever I shift-click a point in an emacs buffer. Problem is that when shift is pressed, the point is not changing when clicking. To make things more ...
2
votes
1answer
1k views

How to get buffer position given line number and column number?

I'm trying to swap the contents of a region with the text of the same width region below it. I think I should be able to atleast correctly capture the region on the next line using the code below, ...
3
votes
2answers
790 views

Why save-excursion doesn't save point position?

I have the following code: (defun test-save-excursion () (interactive) (let ((buffer "*test*") (text "Lorem Ipsum is simply dummy text Lorem Ipsum has |been the industry's standard dummy ...
6
votes
1answer
95 views

How to preserve the visual height of the cursor after an operation?

Q: How do I find the visual line number of point (so that I can restore it after an operation)? By “visual line number”, I'm referring to the number N of lines between the top of the window (or the ...