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?
5 Answers
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:
- Run
runemacs.exewith no pre-existing icon in the taskbar. - Right click on the running Emacs icon in the taskbar, and click on "pin this program to taskbar."
- Close Emacs
- Shift right-click on the pinned Emacs icon on the taskbar, click on
Properties, and change the target from
emacs.exetorunemacs.exe.
- 113
- 3
- 536
- 1
- 3
- 4
-
5This should be marked as the answer! – Alec Mev May 09 '12 at 14:04
-
It works for me too, 3ks. – Eastsun Jun 23 '12 at 02:00
-
1This works. Should be the answer! – isakkarlsson Aug 21 '12 at 15:50
-
This is exactly the same as the accepted answer. – harrymc Oct 14 '12 at 14:41
-
3No it's not. The accepted answer assumes the user has pinned emacs from an open instance. Another way of pinning emacs is to drag the exe out of the folder and 'set' it into the taskbar. This method of pinning will not work. The accepted answer only specifies the user pin it, not how to pin it. – falcojr Oct 15 '12 at 18:59
-
This worked for me in Windows 8. Thanks! – joon Apr 13 '13 at 21:39
-
This worked for me, but why? Isn't changing the pin target to runemacs.exe creating a shortcut that's identical to simply pinning runemacs.exe in the first place? Or is there some hidden state information about the window that will appear that's different from a normal shortcut? – schodge May 14 '15 at 19:53
-
Worked for me on Windows 10, but I too don't understand why. – szx Feb 19 '17 at 14:49
-
@schodge, pinned shortcuts may also contain the filename/path of the main process when the application as it was running as well as the executable that launches the application. When there is a window whose main process matches either then assumes it is associated with that pinned item. There's a command line tool mkshortcut for creating shortcuts where you can specify each of these: https://portableapps.com/node/31515, author also has code online here: https://github.com/danielkza/mkshortcut – Sam Hasler Jun 22 '17 at 15:20
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
- 455,459
- 31
- 526
- 924
-
4This will not work. If you do as suggested and click on the pinned icon, the **second** icon will appear that will stand for emacs.exe. Windows 7 taskbar maps applications to icons in taskbar by comparing app executable names with icon's "executable path". So pinning emacs.exe and changing executable path to "runemacs.exe" is same as pinning "runemacs.exe" :( – grigoryvp Mar 24 '11 at 11:42
-
-
1
-
Also, i have checked bug#8268 discussion. Where is only one person here that pretends that pinning runemacs.exe allows to start emacs from taskbar without additional console windows or taskbar icons. For rest of people this is not working. I can suggest that person in question uses non-standard windows 7 version (beta/checked build/modified kernel) or have non-standard OS modifications. – grigoryvp Mar 28 '11 at 08:12
-
Or that person has done something else that he forgot, or is simply mistaken. – harrymc Mar 28 '11 at 08:26
-
So i can conclude this: no one uses emacs on Windows 7 so this is a bug and authors are discussing right now how to fix it. Seems they also don't have a Windows 7 to try :). Anyway, thanks for pointing me this discussion. – grigoryvp Mar 28 '11 at 12:11
-
Thanks. The problem is always these 2 executables, which simply has no chance of working with the Win7 taskbar. They will need to unify them both into one. – harrymc Mar 28 '11 at 12:24
-
1This doesn't work properly on Windows 10 either, without additional console windows or taskbar icons. – Svein Fidjestøl Sep 09 '15 at 07:56
-
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...
- 455,459
- 31
- 526
- 924
-
Unfortunately, this will **not** work for latest windows 7 and emacs (23.3.1.). I just pinned emacs.exe to taskbar and runemacs.exe to start menu and started emacs via start menu shortcut - where is **two** emacs icons on my taksbar :(. One pinned and on started from start menu. And where is no way to pin the one actually started - it ignores right click :( – grigoryvp Mar 21 '11 at 08:50
-
Try maybe using [EmacsClient](http://www.emacswiki.org/emacs/EmacsClient). See this [tip](http://www.emacswiki.org/emacs/EmacsClient#toc4). – harrymc Mar 21 '11 at 11:50
-
How can EmacsClient help me to interact with taskbar? O_O Sure thing i can open documents via it utilizing emacs running in server mode - but the taskbar icon problems remains in taskbar :(. – grigoryvp Mar 21 '11 at 12:11
-
Seems like Win7 doesn't support at all the splitting of Emacs into 2 programs. Have you looked into alternative forks, like [XEmacs](http://www.xemacs.org/)? – harrymc Mar 21 '11 at 12:35
-
Yes, but it seems to be outdated and near-dead right now. Last update is the beginning of 2009, it don't even know that Windows 7 exists :(. – grigoryvp Mar 21 '11 at 12:43
-
Yes, XEmacs doesn't get good reviews. Other possibilities are (1) [ntemacs](http://ntemacs.sourceforge.net/), defined as "Emacs compiled as a native w32 application", last release january 2011. (2) [ErgoEmacs](http://ergoemacs.org/), last release november 2010. This [article](http://xahlee.org/emacs/which_emacs.html) recommends ErgoEmacs. – harrymc Mar 21 '11 at 13:44
-
I have checked them - both have right-click menu so i can pin "spawned" executable to taskbar and "launcher" to start menu. But this is not a very good workaround since it still prevents me from starting emacs by clicking on my taskbar - it starts with console window. – grigoryvp Mar 23 '11 at 11:50
-
Strange, ntemacs was supposedly written to fix this same problem. You might try to get in touch with the developer. – harrymc Mar 23 '11 at 12:32
-
Runemacs fixes the console problem. But runemacs is different executable, so pinning it to takbar and clicking on it will bring a second taskbar icon that will stand for emacs.exe – grigoryvp Mar 24 '11 at 11:39
-
-
I still maintain that ntemacs was supposed to fix this same problem. Your only hope is probably to get in touch with the developer, or get the sources and do it yourself. – harrymc Mar 28 '11 at 08:27
-
@harrymc Yes, i can fix this myself, but this will require a uge amount of time since it's no clean instructions available on building emacs under Windows :(. – grigoryvp Mar 29 '11 at 09:14
-
1One would need to combine runemacs.exe and emacs.exe into one executable (which was the announced intention of ntemacs when starting his project). – harrymc Mar 29 '11 at 09:25
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"
- Exit any running emacs instances.
- Unpin any
emacsorrunemacs - 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" - Delete any shortcuts with emacs in their name:
runemacs,Emacs,emacs,Emacs (2), etc.
Next: Get a new taskbar Icon
- Now navigate to the binary of your emacs installation. (not a link)
- Click to launch emacs directly from the large binary executable of
runemacs.exe. - Now, you can right-click on the icon on the task bar and select
Pin to taskbar - Exit emacs
Finally: Tweak the icon properties
This part was a discovery for me:

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