0

Copying and pasting a rectangle from the following table with C-x SPC C-x r M-w C-x r y shifts the beginning of the line to the right as shown below:

|----+----------+------+------+--------|
|    | 今本     | 偽古 | 今文  | 西周書  |
|----+----------+------+------+--------|
|  1 | 堯典     | NA   |    1 | NA     |
|  2 | 舜典     | NA   |    2 | NA     |
|  3 | 大禹謨   | 1    |   NA | NA     |
|  4 | 皋陶謨   | NA   |    3 | NA     |
|  5 | 益稷     | NA   |    4 | NA     |

indented text from pasted rectangle

Why does this happen and how do we paste rectangles so that they behave like normal text?


Result of C-u C-x =

First character:

             position: 1 of 431 (0%), column: 0
            character: 堯 (displayed as 堯) (codepoint 22575, #o54057, #x582f)
              charset: unicode (Unicode (ISO10646))
code point in charset: 0x582F
               script: han
               syntax: w    which means: word
             category: .:Base, C:2-byte han, L:Left-to-right (strong), c:Chinese, h:Korean, j:Japanese, |:line breakable
             to input: type "C-x 8 RET 582f"
          buffer code: #xE5 #xA0 #xAF
            file code: #xE5 #xA0 #xAF (encoded by coding system utf-8)
              display: by this font (glyph code)
    mac-ct:-*-STFangsong-normal-normal-normal-*-28-*-*-*-p-0-iso10646-1 (#x9C4)

Character code properties: customize what to show
  name: CJK IDEOGRAPH-582F
  general-category: Lo (Letter, Other)
  decomposition: (22575) ('堯')

There are text properties here:
  fontified            t
  line-prefix          [Show]
  wrap-prefix          [Show]

Last Character (not shown here)

             position: 426 of 431 (99%), column: 2
            character: 誓 (displayed as 誓) (codepoint 35475, #o105223, #x8a93)
              charset: unicode (Unicode (ISO10646))
code point in charset: 0x8A93
               script: han
               syntax: w    which means: word
             category: .:Base, C:2-byte han, L:Left-to-right (strong), c:Chinese, h:Korean, j:Japanese, |:line breakable
             to input: type "C-x 8 RET 8a93"
          buffer code: #xE8 #xAA #x93
            file code: #xE8 #xAA #x93 (encoded by coding system utf-8)
              display: by this font (glyph code)
    mac-ct:-*-STFangsong-normal-normal-normal-*-28-*-*-*-p-0-iso10646-1 (#x35BE)

Character code properties: customize what to show
  name: CJK IDEOGRAPH-8A93
  general-category: Lo (Letter, Other)
  decomposition: (35475) ('誓')

There are text properties here:
  fontified            t
  line-prefix          [Show]
  wrap-prefix          [Show]

Problem is fixed when I run emacs -Q

Issue not replicated with emacs -Q

  • Different fonts for the chinese and latin chars? Wide chinese chars? TAB chars instead of spaces? What does C-u C-x = tell you at various places? – Drew Jul 11 at 17:45
  • I can't replicate the behaviour in 26.2. Does it happen when you run emacs -Q ? – phils Jul 11 at 20:02
  • Answers to your questions are updated above. By the way, replacing regex ^ with something else (any other character, but not [:space:]) also fixes the problem. – Sati Jul 12 at 3:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.