2

I often used rectangular commmands, for exampe C-x r r. Yesterday, I installed a new version of Emacs (GNU Emacs 24.4.1, modified version with ESS). When I try to copy with C-x r r I get this message:
non-character input-event

I have no idea why this happened and what that means. I would be very happy if somebody could give me some advice what kind of changes I have to do to get back the ability to use rectangular commands.

giordano
  • 2,954
  • 7
  • 35
  • 57
  • 2
    Use C-x SPC to enter rectangle-mark-mode, might be of some help if you're just using kill/yank – Dave F Feb 10 '15 at 12:57
  • @DaveF, the `C-x r` family of commands should still work. giordano, you may have some old byte-compiled code hanging around from your previous version of Emacs. See if [this](http://stackoverflow.com/questions/1217180/how-do-i-byte-compile-everything-in-my-emacs-d-directory) helps. – ChrisGPT was on strike Feb 10 '15 at 13:34
  • @Dave F thanks Dave. I didn't know about this. – giordano Feb 10 '15 at 13:47
  • @Chris Thanks for your help. This is a new computer, so I don't have a previous installation. Nevertheless, I tried what is suggest on the link but nothing changed. – giordano Feb 10 '15 at 13:53
  • 1
    Is that key bound to the correct function? Try `C-h k C-x r r` to make sure. I think it should be set to `copy-rectangle-to-register`. – ChrisGPT was on strike Feb 10 '15 at 14:23
  • @Chris It shows me information like: *C-x r r runs the command copy-rectangle-to-register, which is an interactive compiled Lisp function in `register.el'. It is bound to C-x r r. (copy-rectangle-to-register REGISTER START END &optional DELETE-FLAG)*, etc.. I suppose this should be ok. – giordano Feb 11 '15 at 21:09
  • @giordano, yep, that looks right. My next suggestion would be to install a regular, non ESS-modified version of GNU Emacs. Installing ESS later should be relatively straightforward, especially if you use a package repository like [MELPA](http://melpa.org/). (I can tell you that it works very well on Linux, but based on the ESS Emacs link you sent I suspect you're on Windows or OSX.) If you'd like, I can provide some more details about this in an answer. Which OS are you on? – ChrisGPT was on strike Feb 11 '15 at 21:15
  • I would also suggest starting emacs with -q and seeing if you get the same error. If you don't, then you know it is something in your init. – Tim X Feb 14 '15 at 04:08
  • @Tim Thanks. Whart means starting emacs with -q? Starting Emacs on DOS with >emacs -q? I did that I didn't get any error messages. – giordano Feb 14 '15 at 21:50
  • @Chris Thanks for your suggestions. I work with Windows 8. It is strange. I use Goulet's Emacs ESS since many years and I never had problems. But maybe during the installation of Emacs ESS something went wrong or the new version is different. In fact, when I compare the old (24.3) with the new (24.4) the folders of Emacs are different. AS soon it is possible I will try to reinstall Emacs. It would be nice if you would provide more detaisl in an answerdf. – giordano Feb 14 '15 at 22:01
  • I installed the new version 24.5 of Goulet's emacs but I got the error ""ShellExecute failed". So, I decided to reinstall the old version 24.3 and it works (no error and C-x r r works). – giordano Aug 31 '15 at 20:05

3 Answers3

1

If you start emacs with

emacs -q

and then try some of the rectagular edit commands and you don't get an error, then you know the problem is being caused by something in your emacs init configuration.

If this is the case, you can start tracking it down by going through your init files and commenting out bits. A good approach is to comment out the last half of your init, restart emacs with -q, try the command again. If the error is still there, then you know it is being caused by something in the first half of your config which was not commented out. If the error does not occur, then you know it was being caused by something in the last half of your init file which you have commented out.

You then continue this process, commenting and uncommenting your init file and restarting with -q until you find the line in your init file which is causing the error.

Tim X
  • 4,158
  • 1
  • 20
  • 26
1

Tim's answer suggesting that you make sure this isn't a problem with your init file is a good one. Try that first, since it's less work and less of a change to your existing workflow.

I suspect that this is an issue with the modified Emacs that you have installed. I recommend installing non-modified Emacs and installing ESS afterwards:

  1. Install GNU Emacs. GNU now provides official Windows binaries that you can just unzip and use directly. If memory serves, you should launch Emacs using runemacs.exe in the wbin/ directory.

    At the time of writing the latest release is version 24.4.

  2. Add a third-party package repository. Since version 24, Emacs has had a built-in package manager called package.el. Out of the box, the only active package repository is GNU ELPA, but there are several others.

    Add one that includes ESS, e.g. MELPA or MELPA stable. For MELPA you should include something like

    (require 'package)
    (add-to-list 'package-archives
                 '("melpa" . "http://melpa.org/packages/") t)
    (package-initialize)
    

    in your configuration. The MELPA getting started page is worth reading.

  3. Install ESS using package.el. There are a few ways to do this, but the easiest is likely to run M-x package-list-packages, search the resulting package list buffer for ess, mark ess (and any other packages you wish you install) for installation with i, then install the marked packages with x.

This works beautifully on Linux, and most of the packages that I use install and work fine on Windows. Unfortunately I haven't tried installing ESS on Windows, so I can't specifically comment on that.

If you like the package.el approach there are lots of other topics you may want to read up on. I suggest making very good friends with use-package as soon as possible.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
  • Thanks. This will be my reference as soon I will have major problems with Emacs/ESS. – giordano Aug 31 '15 at 20:06
  • I installed original emacs 25.1 and got the same problem (emacs-non-character-input-event-when-using-rectangular-commands). I found out that this problem started with version 24.4 for both, original and Goulet's emacs. Currently I use Windows 10, previously Windows 7 and 8. It appears that this problem happens only for rectangular copying but not for all other options (killing, yanking, deleting). – giordano Jul 26 '17 at 15:19
0

The solution is explained here.

After the second r something like an alias should be typed, for example, a or any other letter (case sensitive) or figure. In the former version of emacs this was not necessary and after second r I had to type RETURN. Here is an example how to do:

C-x r r a
C-x r i a
giordano
  • 2,954
  • 7
  • 35
  • 57