bugGNU TeXmacs - Bugs: bug #30133, verbatim and code modes need...


You are not allowed to post comments on this tracker with your current authentication level.

bug #30133: verbatim and code modes need tradition TAB behaviour

Submitter:  Sam Liddicott <samjam>
Submitted:  Tue 15 Jun 2010 12:59:52 PM UTC
Category:  Typesetter Priority:  4 - Bit lower
Item Group:  Wishlist Status:  Need Info
Privacy:  Public Assigned to:  mdbenito
Originator Name:  Open/Closed:  Open
Release:  None Release:
Fixed Release:  None Fixed Release: 

Jump to the original submission

Thu 17 Jan 2013 11:47:05 AM UTC, comment #8: 

When I say tweaking the converters I mean "doing whatever it's necessary to convert the ascii tab, the corresponding unicode point, etc. to the internal encoding "<tab>" and back.

When I say "glyph" I'm using the wrong word to signify "whatever those <blah> things are called". Characters in internal encoding? As you can see I'm not quite the expert...

When I said I'd take care of the typesetting I thought I could use the path of the tree being typeset to calculate the column, as I did in scheme with (cAr (cursor-path)). Or maybe the path to the current paragraph (the parameter "ip" in
concater_rep::typeset (tree t, path ip))

Miguel de Benito <mdbenito>
Group Member
Thu 17 Jan 2013 10:47:35 AM UTC, comment #7: 

When you say tweaking the converters do you mean in ./TeXmacs/progs/convert/* or do you mean in
./src/Data/Convert/Verbatim/* or in ./src/Data/String/converter.cpp

When you say define a glyph do you mean an entry in ./src/Data/Drd/drd_std.cpp to define something like TAB like HTAB and VSPACE etc?

How will you you typeset it? My problem with the typesetter was that everything was typeset with box left=0 so nothing ever new what hoffset in the page or in the paragraph it was and so could not compute how much space to leave.

Sam Liddicott <samjam>
Group Member
Wed 16 Jan 2013 11:57:55 PM UTC, comment #6: 

See my svn commit 6129 for a partial solution: pressing "space tab" inserts a tab (expanded with spaces) of default width 8, which you can configure with

  (set-preference "editor:verbatim:tabstop" 4)

in a scheme session. This works in verbatim, code, etc. Also in prog modes. I chose "space tab" because "M-tab" is used for auto indentation in scheme. It is trivial to change this for verbatim inside text-kbd.scm.

I haven't done anything about the literal tab character. This needs tweaking the converters, defining a new texmacs "glyph" or whatever it's called and then expanding it in the typesetter. I can do the latter if someone takes care of setting up the converters to send some character like "<tab>" to TeXmacs whenever a tab is read from a file. The input from keyboard is then a simple matter of defining a keymap ("space var" (insert "<tab>")) in the desired modes.

Miguel de Benito <mdbenito>
Group Member
Mon 31 Dec 2012 12:41:57 AM UTC, comment #5: 

Hi Sam. I recently made some changes that might break what you expect of tab behaviour in verbatim/source. Please review if you have time.

Miguel de Benito <mdbenito>
Group Member
Mon 16 Jul 2012 04:48:36 PM UTC, comment #4: 

I've made the summary more accurate.

I've had many attempts to introduce the standard TAB behaviour, adding a variable width space to the next multiple of 8 characters in fixed width mode, but what I find hard is that the left-box position is always zero.

Sam Liddicott <samjam>
Group Member
Fri 18 Jun 2010 07:40:47 AM UTC, comment #3: 

I take that back, texmacs surly can; I'll work on it.

However it really ought to support a literal TAB character in the verbatim and code environments, and in the standard fashion.

Sam Liddicott <samjam>
Group Member
Thu 17 Jun 2010 02:13:27 PM UTC, comment #2: 

The bug is probably not n htab which is doing what it is designed to do.

Possible M-TAB should not be inserting htab into verbatim.

However hspace isn't the right thing either, we want to do traditional tabbing to an offset equal to the next multiple of tab-interval.

I suspect texmacs can't do this.

Sam Liddicott <samjam>
Group Member
Wed 16 Jun 2010 03:50:29 PM UTC, comment #1: 

For instance:


shows the letter a right-aligned in the code block

Sam Liddicott <samjam>
Group Member
Tue 15 Jun 2010 12:59:52 PM UTC, original submission:  

In a verbatim block (and therefore also a session), M-TAB to insert a tab inserts much more than 8 spaces and in fact right aligns the line.

Sam Liddicott <samjam>
Group Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mdbenito (Posted a comment)
  • -email is unavailable- added by samjam (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-01-16 mdbenito Priority5 - Normal 4 - Bit lower
        StatusNone Need Info
    2012-12-31 mdbenito CategoryNone Typesetter
        Item GroupNone Wishlist
        Assigned toNone mdbenito
    2012-07-16 samjam SummaryTAB character in verbatim right aligns verbatim and code modes need tradition TAB behaviour

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code