APPROVE COMMIT
NOTE: This patch has been committed.
xemacs-packages/xemacs-base/ChangeLog addition:
2010-09-02 Aidan Kehoe <kehoea(a)parhasard.net>
* edmacro.el (edmacro-parse-word):
If we're handed control or meta characters in WORD, return
appropriate lists (in the canonical form) with ((control X)) or
((meta X)) instead of the character itself (which is
non-canonical).
Also, if handed an octal escape, error if it wouldn't represent a
valid character, and parse it in the same way if it does represent
a valid character.
XEmacs Packages source patch:
Diff command: cvs -q diff -Nu
Files affected: xemacs-packages/xemacs-base/edmacro.el
Index: xemacs-packages/xemacs-base/edmacro.el
===================================================================
RCS file: /cvsroot/xemacs/XEmacs/packages/xemacs-packages/xemacs-base/edmacro.el,v
retrieving revision 1.3
diff -u -r1.3 edmacro.el
--- xemacs-packages/xemacs-base/edmacro.el 27 Nov 1999 20:49:53 -0000 1.3
+++ xemacs-packages/xemacs-base/edmacro.el 2 Sep 2010 14:21:54 -0000
@@ -499,11 +499,12 @@
arg))))
(add
(cond
- ((string-match "^\\\\[0-7]+" word)
- ;; Octal value of character.
- (list
- (edmacro-int-char
- (hexl-octal-string-to-integer (substring word 1)))))
+ ((prog1 nil
+ (string-match "^\\\\[0-7]\\{1,3\\}$" word)
+ ;; Octal value of a character. If it's numerically out of
+ ;; range, allow the Lisp reader to error. If read succedds,
+ ;; we handle the actual numeric value further down.
+ (setq word (read (concat "\"" word
"\"")))))
((string-match "^<<.+>>$" word)
;; Extended command.
(nconc
@@ -547,6 +548,20 @@
;; because of the way `edmacro-format-keys' works.
(mapcar 'identity word)
(list (nconc (nreverse r1) (list (funcall conv follow)))))))
+ ((string-match "^[\x00-\x1f]$" word)
+ ;; Bug; we can't do this for \C-m, \C-j, \C-i, because
+ ;; edmacro-parse-keys, above, treats this as whitespace.
+ `((control
+ ,(intern (downcase (concat (list (+ (aref word 0) ?@))
+ nil))))))
+ ((string-match "^[\x80-\xff]$" word)
+ `((meta ,@(if (< (aref word 0) #xa0)
+ `(control ,(intern (downcase
+ (concat (list (- (aref word 0)
+ ?@)) nil))))
+ `(,(intern (downcase (concat
+ (list (- (aref word 0) #x80))
+ nil))))))))
(force-sym
;; This must be a symbol
(list (intern word)))
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghe, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-patches