unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58712: Incorrect vtable edges recognizing
@ 2022-10-22  7:21 lamppilutti--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-11-24 20:01 ` Stefan Kangas
  0 siblings, 1 reply; 4+ messages in thread
From: lamppilutti--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-10-22  7:21 UTC (permalink / raw)
  To: 58712


[-- Attachment #1.1: Type: text/plain, Size: 317 bytes --]

Functions `vtable-beginning-of-table' and `vtable-beginning-of-table' recognize
edges incorrectly. Because of this `vtable-narrow-current-column',
`vtable-widen-current-column', `vtable-sort-by-current-column' and
`vtable-header-line-sort' remove all text before and after the table.
There is small patch to fix this.

[-- Attachment #1.2: Type: text/html, Size: 430 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-vtable-edges-recognizing.patch --]
[-- Type: text/x-patch; name=0001-Fix-vtable-edges-recognizing.patch, Size: 1333 bytes --]

From e9d4afecf512b4b7317b5cae93348c1346bf02d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A4mppi=20L=C3=BCtti?= <lamppilutti@protonmail.com>
Date: Sat, 22 Oct 2022 07:58:46 +0300
Subject: [PATCH] Fix vtable edges recognizing

* Fix `vtable-beginning-of-table' returns point-min, if point is on
  table or on one position before.

* Fix `vtable-end-of-table' returns point-max, if point is on table.
---
 lisp/emacs-lisp/vtable.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/vtable.el b/lisp/emacs-lisp/vtable.el
index de8503a1cb..20f88ed33a 100644
--- a/lisp/emacs-lisp/vtable.el
+++ b/lisp/emacs-lisp/vtable.el
@@ -240,13 +240,14 @@ See info node `(vtable)Top' for vtable documentation."

 (defun vtable-beginning-of-table ()
   "Go to the start of the current table."
-  (if (text-property-search-backward 'vtable (vtable-current-table))
+  (if (or (text-property-search-backward 'vtable (vtable-current-table) #'eq)
+          (get-text-property (point) 'vtable))
       (point)
     (goto-char (point-min))))

 (defun vtable-end-of-table ()
   "Go to the end of the current table."
-  (if (text-property-search-forward 'vtable (vtable-current-table))
+  (if (text-property-search-forward 'vtable (vtable-current-table) #'eq)
       (point)
     (goto-char (point-max))))

--
2.38.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-07 20:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-22  7:21 bug#58712: Incorrect vtable edges recognizing lamppilutti--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-24 20:01 ` Stefan Kangas
2022-11-25 13:08   ` bug#58712: Ответ: " lamppilutti--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-07 20:27     ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).