Debugger Entered-lisp Error Error Non-hex Digit Used For Unicode Escape
Unicode escape Date: Sat, 9 May 2009 13:28:03 +0100 It's the line (setq default-directory "C:\Users\Charles") thats causing the problem. (cd "C:\Users\Charles") raised the same error too. 2009/5/9 Charlie Turner
: > Hello, > > Running Windows Vista 64 bit, service pack 1 > GNU Emacs 22.2.1 (i386-mingw-nt6.0.6001) > > I get the above error message in my *Messages* buffer on startup. Here > is the version I get when I run "runemacs.exe --debug-init": > > Debugger entered--Lisp error: (error "Non-hex digit used for Unicode escape") > eval-buffer(#"C:\Users\Charles") raised the same error > too. You have to escape backslashes in strings like this: (cd "C:\\Users\\Charles") See (info "(emacs) Init Syntax") for some more hints. Regards, Anselm -- Anselm Helbig mailto:anselm.helbig+news2009@xxxxxxxxxxxxxx Thread at a glance: Previous Message by Date: New dedicated frame for emacsclient session I'm using Emacs 22 and I want all emacsclient editing sessions to open a new frame for the file. Then, after "C-x #", the frame should be automatically closed. I pretty quickly came up with this: (setq server-window 'tl/server-new-frame) (defun tl/server-new-frame (buffer) (let ((pop-up-frames t)) (set-window-dedicated-p (get-buffer-window (pop-to-buffer buffer)) t))) And it actually https://lists.gnu.org/archive/html/help-gnu-emacs/2009-05/msg00145.html works. I'm still a newbie with Emacs Lisp so I'd like to ask from the more experienced programmers around here if my code has some corner cases which makes it fail in some situations. I noticed that Emacswiki has totally different solution: http://www.emacswiki.org/emacs/EmacsClient#toc14 Next Message by Date: Re: remote file editing over ssh with emacs 22.3.1 on Windows On Sat, May 09 2009, Chris Withers wrote: > http://osdir.com/ml/help-gnu-emacs-gnu/2009-05/msg00173.html Does Tramp have its own mailing list anywhere? http://dir.gmane.org/gmane.emacs.tramp http://lists.gnu.org/archive/html/tramp-devel/ http://savannah.gnu.org/projects/tramp Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/ Previous Message by Thread: Re: error: Non-hex digit used for Unicode escape It's the line (setq default-directory "C:\Users\Charles") thats causing the problem. (cd "C:\Users\Charles") raised the same error too. 2009/5/9 Charlie Turner
In emacs lisp string, you can have Unicode characters directly (➢ for example: "I ♥ 😸"), or, you can represent Unicode char by the following syntax: "\uxxxx" http://ergoemacs.org/emacs/elisp_unicode_representation_in_string.html → A Unicode char. xxxx must be 4 hexadecimal digits, representing the char's codepoint http://hyperpolyglot.org/text-mode-editors in hex. You need to pad it with 0 if the codepoint is less than 4 hex digits. "\U00xxxxxx" → A Unicode char. xxxxxx must be 6 hexadecimal digits, representing the char's codepoint in hex. You need to pad it with 0 if the codepoint is less than 6 hex digits. Note: the syntax debugger entered-lisp is a bit ugly. Which one to use depends on whether the Unicode is in the range of 0 to 4 hex digits. (Each Unicode char is given a integer id, called its “codepoint”. 〔➤see Unicode Basics: What's Character Set, Character Encoding, UTF-8?〕) ;; examples of Unicode char representation in string ;; lower case “a” (search-forward "\u0061" ) ;; ♥ BLACK HEART SUIT codepoint 9829, #x2665 (search-forward "\u2665" ) ;; debugger entered-lisp error 😸 GRINNING CAT FACE WITH SMILING EYES codepoint 128568, #x1f638 (search-forward "\U0001f638" ) ;; ♥ 😸 in the above example, the letter a's Unicode hex is just “61”, so you need to pad it with “00”. in the above example, the grinning cat 😸's codepoint in hex is 5 digits. So, you need to use the "\U00xxxxxx" form, and because it's less than 6 digits, so you need to pad it with “0”, resulting “000” there. Note: you can find a Unicode char's codepoint by calling describe-char. 〔➤see Emacs: Unicode Tutorial〕 Why is Encoded Unicode Char Useful? The use of encoded representation is useful when you want to represent non-printable chars, such as {RIGHT-TO-LEFT MARK, ZERO WIDTH NO-BREAK SPACE, NO-BREAK SPACE}. Example: (defun replace-BOM-mark-etc () "Query replace some invisible Unicode chars. The chars to be searched are: RIGHT-TO-LEFT MARK 8207 x200f ZERO WIDTH NO-BREAK SPACE 65279 xfeff start on cursor position to end." (interactive) (query-replace-regexp "\u200f\\|\ufeff" "")) see Unicode BOM Byte Order Mark Hack Annoying Invisible ZERO WIDTH NO-BREAK SPACE Character from Google Plus, Twitter (info "(elisp) General Escape Syntax") Emacs: Regex Tutorial Emacs: Unicode Tutorial Like it? Buy Xah Emacs Tutorial. ♥ Thanks. or, buy something from my keyboard store. ∑XAH ErgoEmacs© 2006, …, 2016
| panes | macros | ascii art | org | input methods | encodings | help dev tools: browse files | shell | grep | tags | diff | git | compile | debug | lisp interaction | syntax highlighting programming: variables | arithmetic and logic | strings | lists | dictionaries | functions | execution control | libraries and namespaces other topics: documentation | terminology | line editors | bindings in other apps startup vim emacs nano launch $ vim $ emacs $ nano open file $ vim file $ emacs file $ nano file open file on line 100 $ vim +100 file $ emacs +100 file $ nano +100 file open file on column 20 of line 100 $ vim +100 -c 'normal 20|' file $ emacs +100:20 file $ nano +100,20 file open file in read-only mode $ vim -R file $ nano -v file open multiple files $ vim file1 file2 …only first file is displayed; use :bn and :bp to change buffers; :ls to list buffers $ emacs file1 file2 …window is split into two panes; if more than two files, one of the panes is a buffer list; use C-x o to switch panes; use C-x b to switch buffers $ nano file1 file2 …only first file is displayed; use M-> and M-< to change buffers open directory $ vim dir $ emacs dir startup file ~/.vimrc ~/.emacs ~/.emacs.el ~/.emacs.d/init.el ~/.nanorc skip startup file $ vim -u NONE $ emacs -q $ nano -I text editing vim emacs emacs nano show version :version M-x emacs-version redraw display C-l M-x redraw-display insert 'x' insert mode: x x x insert by unicode point insert mode: C-v u 03c0 C-x 8 RET 03c0 RET M-x ucs-insert 03c0 RET insert by unicode name C-x 8 RET greek small letter pi RET M-x ucs-insert greek small letter pi RET get unicode point M-x describe-char cancel ESC C-g M-x keyboard-quit insert control character C-v char C-q char M-x quoted-insert char M-v insert newline C-v RET C-q C-j auto complete C-n C-p M-/ M-x hippie-expand repeat next command n times n C-u n M-x universal-argument n repeat 4 times 4 C-u M-x universal-argument repeat 16 times 16 C-u C-u font size use menu or OS C-x C-=, C-x C-- M-x text-scale-adjust exit :q C-x C-c M-x save-buffers-kill-terminal C-x save changes and exit ZZ :wq C-x C-s C-x C-c M-x save-buffer M-x save-buffers-kill-terminal discard changes and exit :q! M-x kill-emacs mode vim emacs emacs nano change mode normal to insert: a, i, o, Oback to normal: ESC M-x mode-name show mode insert, visual, select, and replace indicated on bottom line displayed on mode line M-: major-mode mode documentation C-h