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):
My last change worked on individual characters, not strings.
Extend it to work on multiple characters, supplied as strings.
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.4
diff -u -r1.4 edmacro.el
--- xemacs-packages/xemacs-base/edmacro.el 2 Sep 2010 14:26:06 -0000 1.4
+++ xemacs-packages/xemacs-base/edmacro.el 2 Sep 2010 20:19:06 -0000
@@ -474,7 +474,7 @@
(when (string-match "^<\\([^<>]+\\)>$" word)
(setq word (match-string 1 word))
(setq force-sym t))
- (let* ((word-to-sym '(("NUL" . ?\0)
+ (let* ((word-to-sym '(("NUL" . (control @))
("RET" . return)
("LFD" . linefeed)
("TAB" . tab)
@@ -493,10 +493,28 @@
(cdr match)
(intern arg))))))
(conv-chars (lambda (arg)
- (let ((match (assoc arg edmacro-char-to-word)))
- (if match
- (cdr (assoc (cdr match) word-to-sym))
- arg))))
+ (cond
+ ((cdr (assoc (cdr (assoc arg edmacro-char-to-word))
+ word-to-sym)))
+ ((<= ?\x00 arg ?\x1f)
+ ;; 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 (+ arg ?@))
+ nil)))))
+ ((<= ?\x80 arg ?\x9f)
+ `(meta control
+ ,(intern (downcase (concat (list (- arg ?@))
+ nil)))))
+ ((<= ?\xa0 arg ?\xff)
+ `(meta
+ ,(intern (downcase (concat (list (- arg ?\x80))
+ nil)))))
+ ;; The symbol is the canonical form. To be even
+ ;; more canonical, we should return a list of
+ ;; length one comprised of the symbol.
+ (t (intern (string arg))))))
(add
(cond
((prog1 nil
@@ -548,20 +566,6 @@
;; 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