diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-06-07 18:34:20 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-06-07 18:34:20 +0200 |
commit | 17ed9a803987d7441c64ee1a205322d99766b1da (patch) | |
tree | ea954b4b8b735115caed3ea8bbce17315ae33b18 /doc/lispref/commands.texi | |
parent | 00a0226ba53598bbe71d12d877121fdcb194e2c9 (diff) | |
download | emacs-17ed9a803987d7441c64ee1a205322d99766b1da.tar.gz emacs-17ed9a803987d7441c64ee1a205322d99766b1da.tar.bz2 emacs-17ed9a803987d7441c64ee1a205322d99766b1da.zip |
Allow posn-col-row to return data on a per-window basis
* doc/lispref/commands.texi (Accessing Mouse): Document it.
* lisp/subr.el (posn-col-row): Extend to use window data.
Diffstat (limited to 'doc/lispref/commands.texi')
-rw-r--r-- | doc/lispref/commands.texi | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 6c60216796c..0a82bba3bc7 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -2615,7 +2615,7 @@ POSITION is assumed to lie in a window text area." @end example @end defun -@defun posn-col-row position +@defun posn-col-row position &optional use-window This function returns a cons cell @w{@code{(@var{col} . @var{row})}}, containing the estimated column and row corresponding to buffer position described by @var{position}. The return value is given in @@ -2623,7 +2623,11 @@ units of the frame's default character width and default line height (including spacing), as computed from the @var{x} and @var{y} values corresponding to @var{position}. (So, if the actual characters have non-default sizes, the actual row and column may differ from these -computed values.) +computed values.) If the optional @var{window} argument is +non-@code{nil}, use the default character width in the window +indicated by @var{position} instead of the frame. (This makes a +difference if that window is showing a buffer with a non-default +zooming level, for instance.) Note that @var{row} is counted from the top of the text area. If the window given by @var{position} possesses a header line (@pxref{Header |