Emacs Misc Bugs

By Xah Lee. Date: . Last updated: .

This page is a misc collection of emacs defects i found and have blogged about. Most of these have been reported to FSF too.

Emacs Mismatch Chinese/Western Parenthesis

noticed today, if you have a pair of parens, and the first one is Chinese paren, and the second a western paren, emacs will match and highlight them.

steps to reproduce:

  1. Alt+x insert-charCtrl+x 8 Enter
  2. type ff08
  3. Alt+x insert-char
  4. type 29
  5. Alt+x show-paren-mode to turn it on (if turned off, call again)
  6. place your cursor on the opening paren.
  7. you'll see that they are highlighted as a matching pair.

bug or feature?

(M-x report-emacs-bug)

comment at https://plus.google.com/113859563190964307534/posts/VVZrDoxBZnF

Emacs Bug: global-linum-mode Freeze Emacs on Big Image Files

Emacs Bug: global-linum-mode Freeze Emacs on Big Image Files

Emacs 24 Windows bug: “ShellExecute failed: Not enough storage is available to process this command.” and “Spawning child process, resource temporarily unavailable”

i started to get this strange error from emacs 24.2 on Windows:

browse-url-default-windows-browser: ShellExecute failed: Not enough storage is available to process this command.

almost randomly. Sometimes, closing a browser tab or refreshing a browser page solves this, or sometimes re-open emacs buffer, or open some folder on desktop…. Hard to trace out a exact reproduction steps.

thanks to [Rory Yorke https://plus.google.com/b/113859563190964307534/109423063062104364559/posts]. He gave the following info:

I experience similar behaviour on Windows 7 64-bit, with no chance of running out of memory or disk space; I assumed it was this: http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html (see message http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00180.html in thread).

Check out the links above. It's very informative.

This bug is crippling. I started to get “Spawning child process, resource temporarily unavailable” error i think in emacs 24. But in emacs 24.2, i started to get “ShellExecute failed…” very frequently. This is a major problem. Because i frequently launch external app from emacs (e.g. to Windows folder viewer (Explorer), or viewing image, or preview HTML in browser). According to his bug report, it also happens whenever you call shell such as diff-backup.

One possible work-around is to create a file shortcut to emacs binary, then, in the shortcut, open Properties, click the tap “Compatibility”, then set it to Windows XP or other mode. Launch emacs thru this file shortcut. Right now i'm doing this. We'll see if that works.

If you also have this problem, Alt+x report-emacs-bug to send them a bug report. The emacs dev is tired of me, i think. So, you do it!

Emacs bug: whitespace-mode wrong char codes in config file

in whitespace-mode, there's this default value for “whitespace-display-mappings”:

;; GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601) of 2012-08-28 on MARVIN
;; default value of “whitespace-display-mappings”

((space-mark 32
 (space-mark 160
 (space-mark 2208
 (space-mark 2336
 (space-mark 3616
 (space-mark 3872
 (newline-mark 10
               [36 10])
 (tab-mark 9
           [187 9]
           [92 9]))

many of the codepoints are chars from {Thai, Tibetan, Devanagari}, and including invalid Unicode codepoints. But they are not whitespaces.

DecimalGlyphName or UNICODE NAME
10line feed
46.full stop
95_underscore LOW LINE
164¤Symbol, Currency
2208invalid Unicode decimal
2212invalid Unicode decimal

Jason Rumney answers (Source groups.google.com):

It looks like a bug. Probably the file has not been updated since the internal encoding for Emacs was changed from emacs-mule to utf-8-emacs.

See also: Emacs: Show Whitespaces.

Defect. file-relative-name fail on some MS Windows Styled Path

file-relative-name doesn't work on MS Windows style path when the drive letter is capitalized.

(file-relative-name "/Users/web/xyz.html" "/Users/web/") ; returns "xyz.html"
(file-relative-name "c:/Users/web/xyz.html" "c:/Users/web/") ; returns "xyz.html"
(file-relative-name "C:/Users/web/xyz.html" "C:/Users/web/") ; returns "C:/Users/web/xyz.html"

GNU Emacs 24.1.1 (i386-mingw-nt6.1.7601) of 2012-06-10 on MARVIN

Reported to FSF: bug#11827.


Fixed in dev branch.

Defect. global-set-key to Insert French Quotation Mark

Steps to reproduce:

  1. Start emacs by: emacs -Q.
  2. Evaluate this: (global-set-key (kbd "<kp-8>") "«").
  3. Now, press the 8 on numerical keypad.
  4. Expected result: the french open quote is inserted. However, you get this error:
After 0 kbd macro iterations: Keyboard macro terminated by a command ringing the bell

Note that the following all work:

(global-set-key (kbd "<kp-8>") "「")
(global-set-key (kbd "<kp-8>") "『")
(global-set-key (kbd "<kp-8>") "〈")
(global-set-key (kbd "<kp-8>") "《")
(global-set-key (kbd "<kp-8>") "“")
(global-set-key (kbd "<kp-8>") "‘")
(global-set-key (kbd "<kp-8>") "‹")
(global-set-key (kbd "<kp-8>") "〔")

GNU Emacs 24.1.1 (i386-mingw-nt6.1.7601) of 2012-06-10 on MARVIN

Defect: url-unhex-string

The emacs functions {url-unhex-string, gnus-url-unhex-string} returns incorrect result. Example:

(require 'url-util)
;; emacs-24.1.50_2/lisp/url/url-util.el
(url-hexify-string "Gauss–Bonnet_theorem") ; returns "Gauss%E2%80%93Bonnet_theorem"

(url-unhex-string "Gauss%E2%80%93Bonnet_theorem") ; returns "Gauss\342\200\223Bonnet_theorem"

(require 'gnus-util)
;; emacs-24.1.50_2/lisp/gnus/gnus-util.el
(gnus-url-unhex-string "Gauss%E2%80%93Bonnet_theorem") ;; returns "Gauss–Bonnet_theorem"

;; correct result should be: "Gauss–Bonnet_theorem"

GNU Emacs 24.1.1 (i386-mingw-nt6.1.7601) of 2012-06-10 on MARVIN

Another issue is, why there's duplicate {url-unhex-string, gnus-url-unhex-string}?

Some discussion and temp solutions at:

Reported to FSF: bug#6252.

For browser's behavior, see: URL Percent Encoding and Unicode. For example of correct behavior in JavaScript, see: JavaScript Encode URL, Escape String.

Defect: find-dired on Filenames with Spaces

when using GNU Emacs, Alt+x find-dired, i got one of this:

  2533274790481547    2 -rwx------   1 h3       None         2994 Apr
28 20:52 xx\ saga\ of\ bsof\ 2011-07-22.html

note the backslash there.

when i move the cursor to that line and press Enter, i get:

dired-get-file-for-visit: File no longer exists; type `g' to update
dired buffer

update doesn't help. Somehow, filenames with spaces causes the problem.

The problem also happens when Alt+x dired-do-query-replace-regexpQ】. It'll stop dead reporting file doesn't exist.

What could possibly be the problem?

GNU Emacs (i386-mingw-nt6.1.7601) of 2012-04-23 on MARVIN

(if starting emacs with -Q, then another problem occur. It calls Microsoft cmd.exe's find.

Source groups.google.com

Defect: find-dired calls cmd.exe's find

this seems to be a showstopper bug.

  1. Start emacs runemacs.exe -Q
  2. Alt+x find-dired.
  3. Give a directory path. e.g. ~/web/xahlee_org/comp/
  4. Give the find option: -name "*html"
  5. expected result: list of files in dired.

Here's what i got:

  find . "(" -name "*html" ")" -exec ls -ld {} ";"
  Access denied - .
  File not found - -NAME

  ---------- BLOG.HTML

  File not found - )
  File not found - -EXEC
  File not found - LS
  File not found - -LD
  File not found - {}
  File not found - ;

  find finished at Sat Apr 28 19:46:27

each of the “…” is about n lines of file content. The n can be 4 to 10 or more. Not sure what's the pattern.

Also, my file names are mostly lowercase. Don't know why it is CAPS there.

GNU Emacs (i386-mingw-nt6.1.7601) of 2012-04-23 on MARVIN

Windows 7.

Answer: This is because emacs's is calling Windows cmd.exe's “find”. Emacs should check what it is calling.

(thanks to Yuri Khan. Source groups.google.com )

Source groups.google.com

Emacs Dired Recursive Load Error 2011-05-26

See: Emacs Dired Recursive Load Error 2011-05-26.

Emacs Bug: 【Ctrl+u】 and (key-translation-map) disables “undo”.

This seems like a bug. Steps to reproduce:

Emacs Dired Bug: Delete File List Not Visible

This seems to be a bug. Define this:

(defalias 'yes-or-no-p 'y-or-n-p)

Then, in dired, type ~ to flag backup files. Then, type x to delete them. Dired will prompt you with “Delete D [251 files] (y or n)” with a list of files to be deleted on the top pane. When you have more files to fit in a window, part of the list is not visible, and there is no way to view them. You can't page with Alt+PgDn or Alt+PgUp, can't use mouse to drag the scrollbar, scroll wheel just produce beeps. I haven't found a way to view it.

(thanks to {Eli Zaretskii, Drew Adam} for helping track down the cause. Source groups.google.com)

Compatibility Problem of whitespace-mode and pretty-control-l-mode pp-c-l.el

Steps to reproduce:

  1. Load pretty control L mode. (require 'pp-c-l) (http://www.emacswiki.org/emacs/PrettyControlL)
  2. Turn it on. (pretty-control-l-mode 1)
  3. Turn on global-whitespace-mode
  4. Now the Unicode char ( “·”, middle dot, #xb7) used to indicate spaces are gone.

Some other interesting findings.

The above are tested with pp-c-l but it happens with http://user42.tuxfamily.org/formfeed-hline/index.html too as i tested earlier.

[compatibility problem of whitespace-mode and PrettyControlL? By gnu.emacs.help. At http://groups.google.com/group/gnu.emacs.help/browse_frm/thread/12e5a1e6a8b22c14/c642875edeb7ea20 , accessed on 2012-11-14 ]

Emacs Microsoft Windows Problem: Spell Checking Slowness

Emacs cult scumbag. To spell check a file of 2.6k words, it froze emacs for 10 seconds (emacs on Windows). While in Gmail, Mozilla Thunderbird, and everywhere else it's 0.3 seconds.

sgml-delete-tag bug

discovered a bug in html-mode. If you have this:


and your cursor is at the beginning of line, then Alt+x sgml-delete-tag, it'll also delete the apostrophe.

This is “GNU Emacs 23.2.1 (i386-mingw-nt6.0.6002) of 2010-05-08 on G41R2F1”

this is fixed GNU Emacs

Unicode 6 and Emacs 23.2 semi-Bug

There are these Unicode symbols

When Alt+x describe-char on them, it doesn't give their names. Is this a bug?

Answer: That's because these chars are from Unicode version 6, released in 2010-10.

Unicode 6 added 2088 chars. I don't think there are any fonts that support them yet. However, if you do Unicode work, you can add char info to emacs so that describe-char will give you all the char's info. You need to download a text file UnicodeData.txt. For detail, see: Emacs: Unicode Tutorial.

(thanks to Jason Rumney and Klaus Straubinger. Source groups.google.com.)

See also: Unicode 6 Emoticons.

Emacs Bug: “isearch-forward” Doesn't Respect New Value of “case-fold-search” When Repeating Last Seearch

Steps to reproduce:

GNU Emacs bug#10074: rgrep, “find: invalid predicate `-nam'”

This seems to be a bug. Steps to reproduce:

-*- mode: grep; default-directory: "c:/Users/h3/web/xahlee_org/emacs/" -*-
Grep started at Thu Nov 17 00:49:37

find . "(" -path "*/SCCS" -o -path "*/RCS" -o -path "*/CVS" -o -path "*/MCVS" -o -path "*/.svn" -o -path "*/.git" -o -path "*/.hg" -o -path "*/.bzr" -o -path "*/_MTN" -o -path "*/_darcs" -o -path "*/{arch}" ")" -prune -o "(" -name ".#*" -o -name "*.o" -o -name "*~" -o -name "*.bin" -o -name "*.bak" -o -name "*.obj" -o -name "*.map" -o -name "*.ico" -o -name "*.pif" -o -name "*.lnk" -o -name "*.a" -o -name "*.ln" -o -name "*.blg" -o -name "*.bbl" -o -name "*.dll" -o -name "*.drv" -o -name "*.vxd" -o -name "*.386" -o -name "*.elc" -o -name "*.lof" -o -name "*.glo" -o -name "*.idx" -o -name "*.lot" -o -name "*.fmt" -o -name "*.tfm" -o -name "*.class" -o -name "*.fas" -o -name "*.lib" -o -name "*.mem" -o -name "*.x86f" -o -name "*.sparcf" -o -name "*.fasl" -o -name "*.ufsl" -o -name "*.fsl" -o -name "*.dxl" -o -name "*.pfsl" -o -name "*.dfsl" -o -name "*.p64fsl" -o -name "*.d64fsl" -o -name "*.dx64fsl" -o -name "*.lo" -o -name "*.la" -o -name "*.gmo" -o -name "*.mo" -o -name "*.toc" -o -name "*.aux" -o -name "*.cp" -o -name "*.fn" -o -name "*.ky" -o -name "*.pg" -o -name "*.tp" -o -name "*.vr" -o -name "*.cps" -o -name "*.fns" -o -name "*.kys" -o -name "*.pgs" -o -name "*.tps" -o -name "*.vrs" -o -name "*.pyc" -o -name "*.pyo" ")" -prune -o  -type f "(" -iname "*" -o -iname ".*" ")" -exec grep -i -n "grep" {} NUL ";"
FIND: Parameter format not correct

Grep exited abnormally with code 2 at Thu Nov 17 00:49:37

This is GNU Emacs version “GNU Emacs 23.3.1 (i386-mingw-nt6.1.7601) of 2011-03-10 on 3249CTO”.

If you are using ErgoEmacs with -Q, you get this extra info “find: invalid predicate `-nam'”, like this:

-*- mode: grep; default-directory: "c:/Users/h3/web/xahlee_org/emacs/" -*-
Grep started at Thu Nov 17 00:36:51

find . "(" -path "*/SCCS" -o -path "*/RCS" -o -path "*/CVS" -o -path "*/MCVS" -o -path "*/.svn" -o -path "*/.git" -o -path "*/.hg" -o -path "*/.bzr" -o -path "*/_MTN" -o -path "*/_darcs" -o -path "*/{arch}" ")" -prune -o "(" -name ".#*" -o -name "*.beam" -o -name "*.vee" -o -name "*.jam" -o -name "*.o" -o -name "*~" -o -name "*.bin" -o -name "*.bak" -o -name "*.obj" -o -name "*.map" -o -name "*.ico" -o -name "*.pif" -o -name "*.lnk" -o -name "*.a" -o -name "*.ln" -o -name "*.blg" -o -name "*.bbl" -o -name "*.dll" -o -name "*.drv" -o -name "*.vxd" -o -name "*.386" -o -name "*.elc" -o -name "*.lof" -o -name "*.glo" -o -name "*.idx" -o -name "*.lot" -o -name "*.fmt" -o -name "*.tfm" -o -name "*.class" -o -name "*.fas" -o -name "*.lib" -o -name "*.mem" -o -name "*.x86f" -o -name "*.sparcf" -o -name "*.fasl" -o -name "*.ufsl" -o -name "*.fsl" -o -name "*.dxl" -o -name "*.pfsl" -o -name "*.dfsl" -o -name "*.p64fsl" -o -name "*.d64fsl" -o -name "*.dx64fsl" -o -name "*.lo" -o -name "*.la" -o -name "*.gmo" -o -name "*.mo" -o -name "*.toc" -o -name "*.aux" -o -name "*.cp" -o -name "*.fn" -o -name "*.ky" -o -name "*.pg" -o -name "*.tp" -o -name "*.vr" -o -name "*.cps" -o -name "*.fns" -o -name "*.kys" -o -name "*.pgs" -o -name "*.tps" -o -name "*.vrs" -o -name "*.pyc" -o -name "*.pyo" ")" -prune -o  -type f "(" -iname "*.html" ")" -print0 | xargs -0 -e grep -i -nH -e "grep"
find: invalid predicate `-nam'

Grep finished with no matches found at Thu Nov 17 00:36:51

Seems quite a odd error. It appears that there's a typo somewhere that contains -nam instead of -name, but i wasn't able to find it anywhere so far. Note that this error occurs when starting emacs with -Q, so it rules out personal init files.


Emacs 22 Bug: Renaming to Existing File Name

There is a bug in emacs 22 (released in ) (bug#394) If you rename 2 files by exchanging their names, one of the file will be deleted. This is fixed in emacs 23.