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


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

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

Submitted by:  Sam Liddicott <samjam>
Submitted on:  Tue Jun 15 12:59:52 2010  
Category: TypesetterPriority: 4 - Bit lower
Item Group: WishlistStatus: Need Info
Privacy: PublicAssigned to: Miguel de Benito <mdbenito>
Originator Name: Open/Closed: Open
Release: None
Fixed Release: NoneFixed Release: 

(Jump to the original submission Jump to the original submission)

Thu Jan 17 11:47:05 2013, 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>
Project MemberIn charge of this item.
Thu Jan 17 10:47:35 2013, 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>
Project Member
Wed Jan 16 23:57:55 2013, 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>
Project MemberIn charge of this item.
Mon Dec 31 00:41:57 2012, 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>
Project MemberIn charge of this item.
Mon Jul 16 16:48:36 2012, 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>
Project Member
Fri Jun 18 07:40:47 2010, 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>
Project Member
Thu Jun 17 14:13:27 2010, 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>
Project Member
Wed Jun 16 15:50:29 2010, comment #1:

For instance:


shows the letter a right-aligned in the code block

Sam Liddicott <samjam>
Project Member
Tue Jun 15 12:59:52 2010, 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>
Project Member


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed Jan 16 23:57:55 2013mdbenitoPriority5 - Normal=>4 - Bit lower
      StatusNone=>Need Info
    Mon Dec 31 00:41:57 2012mdbenitoCategoryNone=>Typesetter
      Item GroupNone=>Wishlist
      Assigned toNone=>mdbenito
    Mon Jul 16 16:48:36 2012samjamSummaryTAB character in verbatim right aligns=>verbatim and code modes need tradition TAB behaviour

    Back to the top

    Powered by Savane 3.1-cleanup