25

I have downloaded latest emacs for Windows here, but starting it on Windows 7 shows a taskbar icon that ignores right-click and so can't be pinned I have searched Google and found a lot of bug reports for emacs not supporting Windows 7 taskbar and that it's a bug fixed in version 23.1+. Current version is 23.3., but I still can't pin emacs to Windows 7 taskbar. What I'm doing wrong?

studiohack
  • 13,477
grigoryvp
  • 1,057

5 Answers5

37

I think I've found a way though I have no idea why it works...

Instead of dragging the emacs icon from the folder to the taskbar (which will duplicate icons), open 'runemacs.exe' with no pre-existing icon in the taskbar. Now right click on the icon already running in the taskbar, and pin that to the taskbar. For some reason on my PC, that stopped the duplicating of icons. Now do the shift right-click thing and change the target from emacs.exe to runemacs.exe. Now (for me at least) the Emacs icon works as expected.

If this does not work, try upgrading Emacs. For example, this did not work for 22.3 but does for 24.3.


Step-by-step instruction:

  1. Run runemacs.exe with no pre-existing icon in the taskbar.
  2. Right click on the running Emacs icon in the taskbar, and click on "pin this program to taskbar."
  3. Close Emacs
  4. Shift right-click on the pinned Emacs icon on the taskbar, click on Properties, and change the target from emacs.exe to runemacs.exe.
falcojr
  • 556
16

The Emacs bug#8268 discussion suggests :

Once you've pinned emacs.exe, edit the properties (you can use shift-right-click) and change the executable path to point to C:/this/is/your/path/to/runemacs.exe instead of C:/this/is/your/path/to/emacs.exe

harrymc
  • 498,455
3

EmacsWiki explains these problems :

When you start a program using a shortcut pinned to the taskbar, the shortcut is displayed differently while the program is running, but no new taskbar button is displayed. If you start a program that is not pinned to the taskbar, a new taskbar button is created. This is different than previous versions of Windows that always created a taskbar button for each window open.

This doesn’t work with emacs, however. To eliminate the console window, it must be started with runemacs. This means we’d have to pin runemacs.exe to the taskbar to start emacs. When it is run, however, it simply starts emacs.exe and exits. Windows will recognize that these are two different programs and will not highlight the pinned icon and will create a new button for emacs.exe.

A workaround is proposed here :

My workaround is to pin emacs.exe to the taskbar and runemacs.exe to the start menu. When I want to start Emacs I have to use the shortcut in my start menu, but once it is running I can just use its taskbar icon as normal. This works reasonably well for me because I typically start Emacs once per desktop session and then just leave it running...

harrymc
  • 498,455
0

In the waning days of 2020, this is what works reliably for me on Windows 10.

Windows 10 Emacs with Single Icon and no extra window

To solve the two persistent irritations of running emacs on windows:

  • Keep an extra, useless window opening each time emacs starts up
  • Avoid Taskbar Icon duplication

First: Cleanout anything "OLD"

  1. Exit any running emacs instances.
  2. Unpin any emacs or runemacs
  3. Open an explorer window on "%APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" On my machine: "C:\Users\XXXX\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"
  4. Delete any shortcuts with emacs in their name: runemacs, Emacs, emacs, Emacs (2), etc.

Next: Get a new taskbar Icon

  1. Now navigate to the binary of your emacs installation. (not a link)
  2. Click to launch emacs directly from the large binary executable of runemacs.exe.
  3. Now, you can right-click on the icon on the task bar and select Pin to taskbar
  4. Exit emacs

Finally: Tweak the icon properties

This part was a discovery for me: Mouse clicks to get to the Emacs Taskbar Shortcut Properties

  1. Right-click (1) on the taskbar emacs Icon.
  2. Another right-click (2) on the emacs icon that the first right click revealed.
  3. Left-click on "Properties"
  4. Make sure that the shortcut points to "runemacs.exe"

Shortcut Properties Shortcut Target to runemacs.exe

ElderDelp
  • 275
0

This is more of a work-around, but none of the other answers work for me.

Right-click runemacs.exe and pin it to the Start menu rather than the taskbar.

Synetech
  • 69,547
jfritz42
  • 101
  • 1