Emacs Misc Bugs
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:
- Alt+x
insert-char
【Ctrl+x 8 Enter】 - type
ff08
- Alt+x
insert-char
- type
29
- Alt+x
show-paren-mode
to turn it on (if turned off, call again) - place your cursor on the opening paren.
- 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 [183] [46]) (space-mark 160 [164] [95]) (space-mark 2208 [2212] [95]) (space-mark 2336 [2340] [95]) (space-mark 3616 [3620] [95]) (space-mark 3872 [3876] [95]) (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.
Decimal | Glyph | Name or UNICODE NAME |
---|---|---|
10 | line feed | |
32 | space | |
46 | . | full stop |
95 | _ | underscore LOW LINE |
160 | NO-BREAK SPACE | |
164 | ¤ | Symbol, Currency |
2208 | invalid Unicode decimal | |
2212 | invalid Unicode decimal | |
2336 | ठ | DEVANAGARI LETTER TTHA |
2340 | त | DEVANAGARI LETTER TA |
3616 | ภ | THAI CHARACTER PHO SAMPHAO |
3620 | ฤ | THAI CHARACTER RU |
3872 | ༠ | TIBETAN DIGIT ZERO |
3876 | ༤ | TIBETAN DIGIT FOUR |
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.
https://groups.google.com/group/gnu.emacs.help/browse_frm/thread/8b78f87f8c0dc9c3#
2012-06-30 Fixed in dev branch.
Defect. global-set-key to Insert French Quotation Mark
Steps to reproduce:
- Start emacs by:
emacs -Q
. - Evaluate this:
(global-set-key (kbd "<kp-8>") "«")
. - Now, press the 8 on numerical keypad.
- 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 24.1.50.1, 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-regexp
【Q】. It'll stop dead reporting file doesn't exist.
What could possibly be the problem?
GNU Emacs 24.1.50.1 (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.
Defect: find-dired calls cmd.exe's find
this seems to be a showstopper bug.
- Start emacs
runemacs.exe -Q
- Alt+x
find-dired
. - Give a directory path. e.g.
~/web/xahlee_org/comp/
- Give the find option:
-name "*html"
- expected result: list of files in dired.
Here's what i got:
c:/Users/h3/web/xahlee_org/comp/: find . "(" -name "*html" ")" -exec ls -ld {} ";" Access denied - . File not found - -NAME ---------- AMPERSAND_HTML_ENTITIES_UNICODE_SEMANTICS.HTML … ---------- APPLE_IPAD_CENSORSHIP.HTML … ---------- ASPELL_SPELL_CHECKING.HTML … ---------- ASPELL_VOCABULARY.HTML … ---------- BLOG.HTML … ---------- YOUR_REGEX_BRAIN.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 24.1.50.1 (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 )
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:
- Start GNU Emacs 23.2 with “-Q”. (so it doesn't load any custom init files.)
- Evaluate this:
(define-key key-translation-map (kbd "M--") (kbd "─"))
(it lets you press Alt+- to insert a Unicode char “BOX DRAWINGS LIGHT HORIZONTAL” (U+2500).) - Open a new buffer.
- Type Ctrl+u 30 Alt+-. (insert the char 30 times.)
- You get this error: universal-argument-other-key: Args out of range: " ─", 0, 7
- Now, do Type Ctrl+u 30 Alt+- again. This time, no problem.
- The worst problem is this: Now, when you try to undo, emacs says “No further undo information”.
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:
- Load pretty control L mode.
(require 'pp-c-l)
(http://www.emacswiki.org/emacs/PrettyControlL) - Turn it on.
(pretty-control-l-mode 1)
- Turn on
global-whitespace-mode
- Now the Unicode char ( “·”, middle dot, #xb7) used to indicate spaces are gone.
Some other interesting findings.
- Turning off “pretty-control-l-mode” doesn't help.
- Unloading it doesn't fix it neither.
(unload-feature 'pp-c-l)
- The problem does not happen if you simply load pp-c-l but doesn't turn it on. Once turned on, the problem happens and cannot be fixed by turning off pp-c-l or unloading it.
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:
<p>some'</p>
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”
2012-04-22 this is fixed GNU Emacs 24.0.93.1.
Unicode 6 and Emacs 23.2 semi-Bug
There are these Unicode symbols
- 👌 U+1f44c OK HAND SIGN
- 👍 U+1f44d THUMBS UP SIGN
- 👎 U+1f44e THUMBS DOWN SIGN
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: Insert Unicode Character.
(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:
- Start emacs 23.2 (
emacs -Q
). - Create a file with this content: “myList”.
- Alt+x
toggle-case-fold-search
until it is disabled. - Alt+x
isearch-forward
【Ctrl+s】 and search for “mylist”. - Emacs won't find it. This is expected.
- Now, Alt+x
toggle-case-fold-search
so it is enabled. - Press Ctrl+s twice to search “mylist” again.
- Expected behavior is for emacs to find the word “myList”, but it doesn't. Calling
isearch-forward
and typing the word “mylist” again works.
GNU Emacs bug#10074: rgrep, “find: invalid predicate `-nam'”
This seems to be a bug. Steps to reproduce:
- Start GNU Emacs with -Q.
- Alt+x
rgrep
. Search for anything. - You get the following result:
-*- 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.