From 31a6a37d45dbf324f26048ce45f82213860f2ec8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 30 Jul 2022 09:32:48 +0300 Subject: [PATCH 1/3] Improve indexing of keymap variables * doc/lispref/maps.texi (Standard Keymaps): * doc/lispref/display.texi (Button Buffer Commands) (Button Properties): * doc/lispref/keymaps.texi (Translation Keymaps): Improve indexing of keymaps. (Bug#56816) --- doc/lispref/display.texi | 2 ++ doc/lispref/keymaps.texi | 1 + doc/lispref/maps.texi | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 404cf1b247a..9aed5b2d7ae 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -6941,6 +6941,7 @@ the usual Emacs @code{highlight} face. @item keymap @kindex keymap @r{(button property)} +@vindex button-map The button's keymap, defining bindings active within the button region. By default this is the usual button region keymap, stored in the variable @code{button-map}, which defines @key{RET} and @@ -7155,6 +7156,7 @@ Return @code{t} if button-type @var{type} is a subtype of @var{supertype}. These are commands and functions for locating and operating on buttons in an Emacs buffer. +@cindex buffer-button-map @code{push-button} is the command that a user uses to actually push a button, and is bound by default in the button itself to @key{RET} and to @key{mouse-2} using a local keymap in the button's overlay or diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index bda9301ffc1..4b9252f1edf 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -1599,6 +1599,7 @@ to make entries in @code{input-decode-map} beyond those that can be deduced from Termcap and Terminfo. @xref{Terminal-Specific}. @end defvar +@cindex function-key-map @defvar local-function-key-map This variable holds a keymap similar to @code{input-decode-map} except that it describes key sequences which should be translated to diff --git a/doc/lispref/maps.texi b/doc/lispref/maps.texi index 90497728a1c..d18b553dc19 100644 --- a/doc/lispref/maps.texi +++ b/doc/lispref/maps.texi @@ -125,6 +125,7 @@ setup-language-environment-map, describe-language-environment-map, menu-bar-epatch-menu, menu-bar-ediff-merge-menu, menu-bar-ediff-menu, etc. @end ignore +@cindex minibuffer-inactive-mode-map @item minibuffer-inactive-mode-map A full keymap used in the minibuffer when it is not active.@* @xref{Minibuffer Edit,, Editing in the Minibuffer, emacs, The GNU Emacs Manual}. @@ -156,6 +157,7 @@ The global keymap used for the @kbd{C-x @key{RET}} prefix key. @vindex narrow-map A sparse keymap for subcommands of the prefix @kbd{C-x n}. +@cindex prog-mode-map @item prog-mode-map The keymap used by Prog mode.@* @xref{Basic Major Modes}. @@ -171,6 +173,7 @@ for multi-buffer replacements. @xref{Search and Replace, query-replace-map}. @item search-map A sparse keymap that provides global bindings for search-related commands. +@cindex special-mode-map @item special-mode-map The keymap used by Special mode.@* @xref{Basic Major Modes}. @@ -179,6 +182,7 @@ The keymap used by Special mode.@* The global keymap used for the @kbd{C-x t} prefix key for tab-bar related commands.@* @xref{Tab Bars,,, emacs, The GNU Emacs Manual}. +@cindex tab-bar-map @item tab-bar-map The keymap defining the contents of the tab bar.@* @xref{Tab Bars,,, emacs, The GNU Emacs Manual}. From c95a34c96013aaba1cdf2166c4a1d0e2c5f3de6a Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sat, 30 Jul 2022 17:21:54 +0900 Subject: [PATCH 2/3] * src/macfont.m (macfont_open): Initialize font->space_width. (Bug#56808) --- src/macfont.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/macfont.m b/src/macfont.m index e3dab1c42e0..b30c3c9763c 100644 --- a/src/macfont.m +++ b/src/macfont.m @@ -2628,6 +2628,9 @@ macfont_open (struct frame * f, Lisp_Object entity, int pixel_size) font->pixel_size = size; font->driver = &macfont_driver; font->encoding_charset = font->repertory_charset = -1; + /* Clear font->space_width so macfont_monospace_width_multiplier may + not be confused by an uninitialized value. */ + font->space_width = 0; block_input (); From eb11dae499fc395bbf3d51883ced6244c91019cf Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 30 Jul 2022 19:34:38 +0300 Subject: [PATCH 3/3] Improve documentation of column-related functions * doc/lispref/text.texi (Primitive Indent, Columns): * src/indent.c (Fcurrent_indentation, Fmove_to_column): Document that column counting ignores invisible text. (Bug#56837) --- doc/lispref/text.texi | 7 +++++++ src/indent.c | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 6ac631ebbfc..72fb674aa5a 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -2297,6 +2297,9 @@ begins. @xref{Usual Display}. amount of horizontal scrolling. Consequently, a column value can be arbitrarily high. The first (or leftmost) column is numbered 0. They also ignore overlays and text properties, aside from invisibility. +Invisible text is considered as having zero width, unless +@code{buffer-invisibility-spec} specifies that invisible text should +be displayed as ellipsis (@pxref{Invisible Text}). @defun current-column This function returns the horizontal position of point, measured in @@ -2370,6 +2373,10 @@ This function returns the indentation of the current line, which is the horizontal position of the first nonblank character. If the contents are entirely blank, then this is the horizontal position of the end of the line. + +This function considers invisible text as having zero width, unless +@code{buffer-invisibility-spec} specifies that invisible text should +be displayed as ellipsis. @xref{Invisible Text}. @end defun @deffn Command indent-to column &optional minimum diff --git a/src/indent.c b/src/indent.c index f5a2a078b98..5e33fc2e77b 100644 --- a/src/indent.c +++ b/src/indent.c @@ -866,8 +866,10 @@ The return value is the column where the insertion ends. */) DEFUN ("current-indentation", Fcurrent_indentation, Scurrent_indentation, 0, 0, 0, doc: /* Return the indentation of the current line. -This is the horizontal position of the character -following any initial whitespace. */) +This is the horizontal position of the character following any initial +whitespace. +Text that has an invisible property is considered as having width 0, unless +`buffer-invisibility-spec' specifies that it is replaced by an ellipsis. */) (void) { ptrdiff_t posbyte; @@ -985,6 +987,9 @@ as displayed of the previous characters in the line. This function ignores line-continuation; there is no upper limit on the column number a character can have and horizontal scrolling has no effect. +Text that has an invisible property is considered as having width 0, +unless `buffer-invisibility-spec' specifies that it is replaced by +an ellipsis. If specified column is within a character, point goes after that character. If it's past end of line, point goes to end of line.