bugGNU Zile (Zile is Lossy Emacs) - Bugs: bug #33906, \C-q\C-h inserts a ^G into the...

 
 

bug #33906: \C-q\C-h inserts a ^G into the current buffer

Submitted by:  Gary V. Vaughan <gary>
Submitted on:  Sun 31 Jul 2011 01:03:54 PM UTC  
 
Category: CSeverity: 3 - Normal
Status: FixedAssigned to: None
Open/Closed: ClosedRelease: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 02 Aug 2011 04:56:43 PM UTC, comment #5:

Your fix for 3 only works by a fluke. Consider what happens when you type

C-q HOME

The following bytes are received:

ESC O F

The ESC is inserted by quoted-insert; the other two happen to be bound to self-insert-command, and so DTRT.

My fix also only works by a fluke, as it receives at most two characters (it stops as soon as it gets a non-ESC). It also had a horrible pointer error in it.

I've committed an updated fix which also simplifies the code somewhat by removing the idea of getkey "modes" now that there are only different delays.

Reuben Thomas <rrt>
Project Administrator
Tue 02 Aug 2011 07:50:25 AM UTC, comment #4:

Regarding your points below:

1. Works for me now (even on Terminal.app!), except I think you left some debug code in the tree, since when I press C-qC-h, I actually see: `inserting code 8^H` unless I remember to redirect std err.

2. Works too (subject to the debug error above).

3. Ugh, this looks like an unnecessary kludge to me. The real problem is that when curses keypad mode is on, `get_char` returns key codes outside the ASCII range which can't be quote inserted directly. So, why not port the equivalent (and much simpler) fix I made in the Lua branch for #33910 instead of all this extra code, which simply turns off keypad mode for the duration of GETKEY_UNFILTERED `get_char` calls? v2.4.0alpha1-141-g0447a4f

I'm leaving the issue open in the hope you'll back out a60ebae in favor of a port of the lua patch above...

Gary V. Vaughan <gary>
Project Administrator
Mon 01 Aug 2011 07:41:33 PM UTC, comment #3:

I've fixed the C branch for quoted insertion of multi-character key codes with commit a60ebae.

That means that parts 2 & 3 of my previous comment are fixed; please confirm that part 1 is not a Zile bug (if indeed it's not!), and close this issue.

Reuben Thomas <rrt>
Project Administrator
Mon 01 Aug 2011 06:37:55 PM UTC, comment #2:

I think there are 3 different bugs here:

1. C-q C-h works fine for me, so I suspect Terminal.

2. ESC is just displayed differently from in Emacs. I have fixed this in make_char_printable on the C branch.

3. Multi-character keycodes such as HOME are not handled correctly. I think I have a way to do it: when getkey is called with GETKEY_UNFILTERED, instead of simply returning the first code received, record all the codes received, and then return a string rather than a single character. In Lua this can be achieved by having getkey (GETKEY_UNFILTERED) return a string rather than a keycode; in C Lua I need to add a new API. I'll let you know when I've implemented it in C, and you can then crib the code for Lua if you like.

Reuben Thomas <rrt>
Project Administrator
Sun 31 Jul 2011 09:33:38 PM UTC, comment #1:

I was slightly confused between opening emacs, installed C Zile, locally built master C Zile and lua Zile behaviour;

- Escape sort of works, but inserting \033 is not the same as Emacs which inserts ^[.
- HOME, END, PGUP and PGDOWN bleep and then insert a single character (probably the last character of their termcap for that key press).

Gary V. Vaughan <gary>
Project Administrator
Sun 31 Jul 2011 01:03:54 PM UTC, original submission:

Quoted insert of the other control characters is fine, so it's curious that \C-q\C-h inserts the wrong character.

Note that some of the non-ascii characters also behave strangely: arrow keys insert ^B^C^D^E, as do shifted arrows, while escape works (inserting \033) and HOME, END, PGUP and PGDOWN insert sensible looking escape sequences.

Gary V. Vaughan <gary>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

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 rrt (Posted a comment)
  • -unavailable- added by gary (Submitted the item)
  •  

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

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 11 Aug 2011 11:09:40 AM UTCrrtStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Summary\\C-q\\C-h inserts a ^G into the current buffer=>\C-q\C-h inserts a ^G into the current buffer
    Tue 02 Aug 2011 04:56:43 PM UTCrrtSummary\\C-q\\C-h inserts a ^G into the current buffer=>\C-q\C-h inserts a ^G into the current buffer
    Tue 02 Aug 2011 07:50:25 AM UTCgarySummary\\C-q\\C-h inserts a ^G into the current buffer=>\C-q\C-h inserts a ^G into the current buffer
    Mon 01 Aug 2011 07:41:33 PM UTCrrtSummary\\C-q\\C-h inserts a ^G into the current buffer=>\C-q\C-h inserts a ^G into the current buffer
    Mon 01 Aug 2011 06:37:55 PM UTCrrtSummary\\C-q\\C-h inserts a ^G into the current buffer=>\C-q\C-h inserts a ^G into the current buffer
    Sun 31 Jul 2011 09:33:38 PM UTCgarySummary\\C-q\\C-h inserts a ^G into the current buffer=>\C-q\C-h inserts a ^G into the current buffer

    Back to the top


    Powered by Savane 3.1-cleanup1