GNU bug report logs - #74178
Handle tab stops on display so they work in variable-pitch-mode

Previous Next

Package: emacs;

Reported by: dannym <at> friendly-machines.com

Date: Sat, 2 Nov 2024 18:08:01 UTC

Severity: wishlist

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: dannym <at> friendly-machines.com
To: bug-gnu-emacs <at> gnu.org
Subject: Handle tab stops on display so they work in variable-pitch-mode
Date: Sat, 02 Nov 2024 19:06:54 +0100
[Message part 1 (text/plain, inline)]
Hello,

Right now, when using variable-pitch-mode, there's no way for the user
to make tables.  This patch adds a feature to do that.

This patch handles tab-stop-list in the display part of emacs so that
they work as expected when using variable-pitch-mode.

The unit of the values in tab-stop-list is space characters.

The reasons why those values are in space characters are:

- Works with HiDPI and LoDPI screens the same way with the same values
inside tab-stop-list.
- Works in console emacs.
- Works in graphical emacs.
- Is backward compatible.

My assumption is that existing user files either don't have any '\t'
in their buffers or they are using the (previous) high-level version
of emacs tab-stop-list (which will replace all '\t' by some spaces),
not both.  This way, emacs without the patch is forward-compatible
to emacs with the patch.

This is a version that will use tabs in the order they appear in the
tab-stop-list, (on purpose) regardless of whether the text on the
line already exceeded the respective tab stop position (because it's
still better not to use the wrong column in the table).

Each respective tab stop, in order, will be used for a respective
'\t', per line. If these fixed tab stops are used up, it will fall
back to the automatic tab stops every tab_width that emacs also
already had done before.

The list of tab stops is buffer-local--as before.

I successfully tested both console and graphical emacs.

In GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41,
cairo version 1.18.0)
System Description: Guix System

Configured using:
 'configure
 
CONFIG_SHELL=/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.1.16/bin/bash
 
SHELL=/gnu/store/3jhfhxdf6v5ms10x5zmnl166dh3yhbr1-bash-minimal-5.1.16/bin/bash
 --prefix=/gnu/store/9q1cfyj0bk0lqvx75pg9gn4isnlz2llv-emacs-pgtk-29.4
 --enable-fast-install --with-pgtk --with-cairo --with-modules
 --with-native-compilation=aot --disable-build-details'
[emacs-tab-stops-v2.patch (text/x-diff, attachment)]

This bug report was last modified 169 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.