commit: Include many more files in binary-file-regexps, files.el.
13 years, 3 months
Aidan Kehoe
changeset: 5572:c17a46ac63af
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Wed Sep 21 20:07:09 2011 +0100
files: lisp/ChangeLog lisp/files.el
description:
Include many more files in binary-file-regexps, files.el.
lisp/ChangeLog addition:
2011-09-21 Aidan Kehoe <kehoea(a)parhasard.net>
* files.el (binary-file-regexps):
Update this, adding everything that maps to no-conversion or
no-conversion-multibyte in GNU's auto-mode-alist.
In particular, add PDFs, important given gnus' problem with them
of http://mid.gmane.org/m3r637lpm5.fsf@mikesoffice.com and the
associated thread, and Uwe's recent re-reporting of the same
problem.
diff -r 5273dd66a1ba -r c17a46ac63af lisp/ChangeLog
--- a/lisp/ChangeLog Wed Sep 21 19:14:15 2011 +0100
+++ b/lisp/ChangeLog Wed Sep 21 20:07:09 2011 +0100
@@ -1,3 +1,13 @@
+2011-09-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * files.el (binary-file-regexps):
+ Update this, adding everything that maps to no-conversion or
+ no-conversion-multibyte in GNU's auto-mode-alist.
+ In particular, add PDFs, important given gnus' problem with them
+ of http://mid.gmane.org/m3r637lpm5.fsf@mikesoffice.com and the
+ associated thread, and Uwe's recent re-reporting of the same
+ problem.
+
2011-09-21 Aidan Kehoe <kehoea(a)parhasard.net>
* select.el (select-convert-to-text):
diff -r 5273dd66a1ba -r c17a46ac63af lisp/files.el
--- a/lisp/files.el Wed Sep 21 19:14:15 2011 +0100
+++ b/lisp/files.el Wed Sep 21 20:07:09 2011 +0100
@@ -1672,26 +1672,18 @@
If it matches, mode MODE is selected.")
(defvar binary-file-regexps
- '("\\.\\(?:bz2\\|elc\\|g\\(if\\|z\\)\\|jp\\(eg\\|g\\)\\|png\\|t\\(ar\\|gz\\|iff\\)\\|[Zo]\\)\\'")
+ '("\\.\\(?:7[Zz]\\|ARC\\|E\\(?:AR\\|XE\\)\\|JAR\\|LZH\\|RAR\\|WAR\\|XPI\\|Z\\(?:IP\\|OO\\)\\|arc\\|bz2\\|e\\(?:ar\\|lc\\|xe\\)\\|g\\(?:if\\|z\\)\\|j\\(?:ar\\|p\\(?:e?g\\)\\)\\|l\\(?:ha\\|zh\\)\\|odt\\|p\\(?:bm\\|df\\|gm\\|n[gm]\\|pm\\)\\|sx[cdimw]\\|t\\(?:ar\\|gz\\|iff\\)\\|war\\|xpi\\|z\\(?:ip\\|oo\\)\\|[Zo]\\)\\'")
"List of regexps of filenames containing binary (non-text) data.")
-
; (eval-when-compile
; (require 'regexp-opt)
; (list
; (format "\\.\\(?:%s\\)\\'"
; (regexp-opt
-; '("tar"
-; "tgz"
-; "gz"
-; "bz2"
-; "Z"
-; "o"
-; "elc"
-; "png"
-; "gif"
-; "tiff"
-; "jpg"
-; "jpeg"))))))
+; '("7Z" "7z" "ARC" "EAR" "EXE" "JAR" "LZH" "RAR" "WAR" "XPI" "Z"
+; "ZIP" "ZOO" "arc" "bz2" "ear" "elc" "exe" "gif" "gz" "jar"
+; "jpeg" "jpg" "lha" "lzh" "o" "odt" "pbm" "pdf" "pgm" "png"
+; "pnm" "ppm" "sxc" "sxd" "sxi" "sxm" "sxw" "tar" "tgz"
+; "tiff" "war" "xpi" "zip" "zoo")))))
(defvar inhibit-first-line-modes-regexps
binary-file-regexps
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Strip extent information when passing text to external programs, select.el
13 years, 3 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1316628855 -3600
# Node ID 5273dd66a1ba89ab11a42f5297eb26efd441b301
# Parent 6c76f5b7e2e3e77d6a7c4a21507032a2adae439e
Strip extent information when passing text to external programs, select.el
lisp/ChangeLog addition:
2011-09-21 Aidan Kehoe <kehoea(a)parhasard.net>
* select.el (select-convert-to-text):
* select.el (select-convert-to-utf-8-text):
Ignore extent information in these functions, other programs can't
do anything useful with it, and it actively interferes when
copying from an ERC buffer to external programs--
#'encode-coding-string complains that the string is read-only,
which is arguably in itself a separate problem, since it allocates
a new string there's no reason for it ever to throw that error.
diff -r 6c76f5b7e2e3 -r 5273dd66a1ba lisp/ChangeLog
--- a/lisp/ChangeLog Sun Sep 11 16:05:05 2011 +0100
+++ b/lisp/ChangeLog Wed Sep 21 19:14:15 2011 +0100
@@ -1,3 +1,14 @@
+2011-09-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * select.el (select-convert-to-text):
+ * select.el (select-convert-to-utf-8-text):
+ Ignore extent information in these functions, other programs can't
+ do anything useful with it, and it actively interferes when
+ copying from an ERC buffer to external programs--
+ #'encode-coding-string complains that the string is read-only,
+ which is arguably in itself a separate problem, since it allocates
+ a new string there's no reason for it ever to throw that error.
+
2011-09-11 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (cl-defsubst-expand):
diff -r 6c76f5b7e2e3 -r 5273dd66a1ba lisp/select.el
--- a/lisp/select.el Sun Sep 11 16:05:05 2011 +0100
+++ b/lisp/select.el Wed Sep 21 19:14:15 2011 +0100
@@ -456,14 +456,14 @@
;; append handlers and buffer-kill handlers.
(defun select-convert-to-text (selection type value)
(cond ((stringp value)
- value)
+ (substring-no-properties value))
((extentp value)
(save-excursion
(set-buffer (extent-object value))
(save-restriction
(widen)
- (buffer-substring (extent-start-position value)
- (extent-end-position value)))))
+ (buffer-substring-no-properties (extent-start-position value)
+ (extent-end-position value)))))
((and (consp value)
(markerp (car value))
(markerp (cdr value)))
@@ -476,7 +476,7 @@
(error "selection is in a killed buffer")))
(save-restriction
(widen)
- (buffer-substring (car value) (cdr value)))))
+ (buffer-substring-no-properties (car value) (cdr value)))))
(t nil)))
(defun select-convert-to-timestamp (selection type value)
@@ -485,16 +485,18 @@
(defun select-convert-to-utf-8-text (selection type value)
(cond ((stringp value)
- (cons 'UTF8_STRING (encode-coding-string value 'utf-8)))
+ (cons 'UTF8_STRING (encode-coding-string
+ (substring-no-properties value) 'utf-8)))
((extentp value)
(save-excursion
(set-buffer (extent-object value))
(save-restriction
(widen)
(cons 'UTF8_STRING
- (encode-coding-string
- (buffer-substring (extent-start-position value)
- (extent-end-position value)) 'utf-8)))))
+ (encode-coding-string (buffer-substring-no-properties
+ (extent-start-position value)
+ (extent-end-position value))
+ 'utf-8)))))
((and (consp value)
(markerp (car value))
(markerp (cdr value)))
@@ -508,8 +510,8 @@
(save-restriction
(widen)
(cons 'UTF8_STRING (encode-coding-string
- (buffer-substring (car value) (cdr value))
- 'utf-8)))))
+ (buffer-substring-no-properties
+ (car value) (cdr value)) 'utf-8)))))
(t nil)))
(defun select-coerce-to-text (selection type value)
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit: Strip extent information when passing text to external programs, select.el
13 years, 3 months
Aidan Kehoe
changeset: 5571:5273dd66a1ba
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Wed Sep 21 19:14:15 2011 +0100
files: lisp/ChangeLog lisp/select.el
description:
Strip extent information when passing text to external programs, select.el
lisp/ChangeLog addition:
2011-09-21 Aidan Kehoe <kehoea(a)parhasard.net>
* select.el (select-convert-to-text):
* select.el (select-convert-to-utf-8-text):
Ignore extent information in these functions, other programs can't
do anything useful with it, and it actively interferes when
copying from an ERC buffer to external programs--
#'encode-coding-string complains that the string is read-only,
which is arguably in itself a separate problem, since it allocates
a new string there's no reason for it ever to throw that error.
diff -r 6c76f5b7e2e3 -r 5273dd66a1ba lisp/ChangeLog
--- a/lisp/ChangeLog Sun Sep 11 16:05:05 2011 +0100
+++ b/lisp/ChangeLog Wed Sep 21 19:14:15 2011 +0100
@@ -1,3 +1,14 @@
+2011-09-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * select.el (select-convert-to-text):
+ * select.el (select-convert-to-utf-8-text):
+ Ignore extent information in these functions, other programs can't
+ do anything useful with it, and it actively interferes when
+ copying from an ERC buffer to external programs--
+ #'encode-coding-string complains that the string is read-only,
+ which is arguably in itself a separate problem, since it allocates
+ a new string there's no reason for it ever to throw that error.
+
2011-09-11 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (cl-defsubst-expand):
diff -r 6c76f5b7e2e3 -r 5273dd66a1ba lisp/select.el
--- a/lisp/select.el Sun Sep 11 16:05:05 2011 +0100
+++ b/lisp/select.el Wed Sep 21 19:14:15 2011 +0100
@@ -456,14 +456,14 @@
;; append handlers and buffer-kill handlers.
(defun select-convert-to-text (selection type value)
(cond ((stringp value)
- value)
+ (substring-no-properties value))
((extentp value)
(save-excursion
(set-buffer (extent-object value))
(save-restriction
(widen)
- (buffer-substring (extent-start-position value)
- (extent-end-position value)))))
+ (buffer-substring-no-properties (extent-start-position value)
+ (extent-end-position value)))))
((and (consp value)
(markerp (car value))
(markerp (cdr value)))
@@ -476,7 +476,7 @@
(error "selection is in a killed buffer")))
(save-restriction
(widen)
- (buffer-substring (car value) (cdr value)))))
+ (buffer-substring-no-properties (car value) (cdr value)))))
(t nil)))
(defun select-convert-to-timestamp (selection type value)
@@ -485,16 +485,18 @@
(defun select-convert-to-utf-8-text (selection type value)
(cond ((stringp value)
- (cons 'UTF8_STRING (encode-coding-string value 'utf-8)))
+ (cons 'UTF8_STRING (encode-coding-string
+ (substring-no-properties value) 'utf-8)))
((extentp value)
(save-excursion
(set-buffer (extent-object value))
(save-restriction
(widen)
(cons 'UTF8_STRING
- (encode-coding-string
- (buffer-substring (extent-start-position value)
- (extent-end-position value)) 'utf-8)))))
+ (encode-coding-string (buffer-substring-no-properties
+ (extent-start-position value)
+ (extent-end-position value))
+ 'utf-8)))))
((and (consp value)
(markerp (car value))
(markerp (cdr value)))
@@ -508,8 +510,8 @@
(save-restriction
(widen)
(cons 'UTF8_STRING (encode-coding-string
- (buffer-substring (car value) (cdr value))
- 'utf-8)))))
+ (buffer-substring-no-properties
+ (car value) (cdr value)) 'utf-8)))))
(t nil)))
(defun select-coerce-to-text (selection type value)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Be more careful still in #'cl-defsubst-expand.
13 years, 3 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1315753505 -3600
# Node ID 6c76f5b7e2e3e77d6a7c4a21507032a2adae439e
# Parent d19b6e3bdf91e4e1f99857e9973c86fa2bebb40c
Be more careful still in #'cl-defsubst-expand.
lisp/ChangeLog addition:
2011-09-11 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (cl-defsubst-expand):
Be more careful still here, make sure that any references to
variables in BODY don't access those values in the enclosing scope
when that would be inappropriate.
Add some documentation of a potential reasonable approach to
avoiding the problems with our (non-Common Lisp-conformant)
#'symbol-macrolet.
diff -r d19b6e3bdf91 -r 6c76f5b7e2e3 lisp/ChangeLog
--- a/lisp/ChangeLog Sat Sep 10 13:17:29 2011 +0100
+++ b/lisp/ChangeLog Sun Sep 11 16:05:05 2011 +0100
@@ -1,3 +1,13 @@
+2011-09-11 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl-macs.el (cl-defsubst-expand):
+ Be more careful still here, make sure that any references to
+ variables in BODY don't access those values in the enclosing scope
+ when that would be inappropriate.
+ Add some documentation of a potential reasonable approach to
+ avoiding the problems with our (non-Common Lisp-conformant)
+ #'symbol-macrolet.
+
2011-09-10 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (cl-defsubst-expand):
diff -r d19b6e3bdf91 -r 6c76f5b7e2e3 lisp/cl-macs.el
--- a/lisp/cl-macs.el Sat Sep 10 13:17:29 2011 +0100
+++ b/lisp/cl-macs.el Sun Sep 11 16:05:05 2011 +0100
@@ -3238,18 +3238,25 @@
(if (or simple (cl-const-expr-p argv))
(progn
;; Avoid infinite loop on symbol macro
- ;; expansion, make sure none of the argvs
- ;; refer to the symbols in the argns.
+ ;; expansion:
(or (block find
- ;; Can't use cl-expr-contains, that
- ;; doesn't descend lambdas:
- (subst nil argn argvs :test
- #'(lambda (elt tree)
+ (subst nil argn argvs :test
+ #'(lambda (elt tree)
+ ;; Give nil if argn is
+ ;; in argvs somewhere:
(if (eq elt tree)
- (return-from find t))))
- nil)
- (push (list argn argv) symbol-macros))
- (and unsafe (list (list argn argv))))
+ (return-from find)))))
+ (let ((copy-symbol (copy-symbol argn)))
+ ;; Rename ARGN within BODY so it
+ ;; doesn't conflict with its value
+ ;; in the including scope:
+ (setq body
+ (cl-macroexpand-all
+ body `((,(eq-hash argn)
+ ,copy-symbol)))
+ argn copy-symbol)))
+ (push (list argn argv) symbol-macros)
+ (and unsafe (list (list argn argv))))
(list (list argn argv))))
argns argvs)))
`(let ,lets
@@ -3260,6 +3267,13 @@
;; bound). We don't have GNU's issue where the replacement will
;; be done when the symbol is used in a function context,
;; because we're using #'symbol-macrolet instead of #'subst.
+ ;;
+ ;; #'symbol-macrolet as specified by Common Lisp is shadowed by
+ ;; #'let, #'let* and lambda argument lists, and that would suit
+ ;; our purposes here perfectly; we could implement it in
+ ;; cl-macroexpand-all by shadowing any existing symbol macros
+ ;; when we descend let forms or arglist lambdas. Doing it
+ ;; unconditionally could well break #'loop, though.
,symbol-macros
,body)))))
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT GTK] Correct a variable name and fix the compile, menubar-gtk.c.
13 years, 3 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1316618494 -3600
# Node ID 925c8766699ec26f0af5d587dabba40a6fcbed83
# Parent a3b6a94e9867aa1587f359bf180cbe1e72a8f3d7
Correct a variable name and fix the compile, menubar-gtk.c.
src/ChangeLog.GTK addition:
2011-09-21 Aidan Kehoe <kehoea(a)parhasard.net>
* menubar-gtk.c (remove_underscores):
Oops, got a variable name wrong here; correct it, fix the compile.
diff -r a3b6a94e9867 -r 925c8766699e src/ChangeLog.GTK
--- a/src/ChangeLog.GTK Tue Sep 20 21:30:33 2011 +0100
+++ b/src/ChangeLog.GTK Wed Sep 21 16:21:34 2011 +0100
@@ -1,3 +1,8 @@
+2011-09-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * menubar-gtk.c (remove_underscores):
+ Oops, got a variable name wrong here; correct it, fix the compile.
+
2011-09-20 Aidan Kehoe <kehoea(a)parhasard.net>
* console-gtk.c (gtk_perhaps_init_unseen_key_defaults):
diff -r a3b6a94e9867 -r 925c8766699e src/menubar-gtk.c
--- a/src/menubar-gtk.c Tue Sep 20 21:30:33 2011 +0100
+++ b/src/menubar-gtk.c Wed Sep 21 16:21:34 2011 +0100
@@ -303,7 +303,7 @@
rval[j++] = name[i];
}
- if (j < temp_label_len)
+ if (j < dest_len)
{
rval[j] = '\0';
}
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT PACKAGES] Sync GNU's changes to ipa-21.5.el, leim
13 years, 3 months
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1315846767 -3600
# Node ID 7f33a75296ac97e9d0eecbb76907bf32cb43477f
# Parent a53c6d7f6ae2bfbf3c7f19ea8553501e2b30ec28
Sync GNU's changes to ipa-21.5.el, leim
leim/ChangeLog addition:
2011-06-18 Aidan Kehoe <kehoea(a)parhasard.net>
* leim-list.el: Update to reflect new input method names.
* quail/ipa-21.5.el:
Sync these changes from GNU:
2009-08-31 Juri Linkov <juri(a)jurta.org>
* quail/ipa.el ("ipa"): Set `forget-last-selection' to nil.
("ipa-x-sampa"): Set `forget-last-selection' to nil.
Set `deterministic' to nil.
("ipa"): Bind "g" to U+0261, and "tsh" to a list of "U+02A7",
"U+0074 U+0283", "U+0074 U+2040 U+0283".
("ipa-kirshenbaum", ipa-x-sampa"): Bind "g" to U+0261, and "tS"
to a list of "U+02A7", "U+0074 U+0283", "U+0074 U+2040 U+0283".
Fix comments.
2009-08-31 Juri Linkov <juri(a)jurta.org>
* quail/ipa.el ("ipa-kirshenbaum"): Rename from "kirshenbaum-ipa".
("ipa-x-sampa"): Rename from "x-sampa-ipa".
(ipa-x-sampa-implosive-submap): Rename from
x-sampa-implosive-submap.
(ipa-x-sampa-prepend-to-keymap-entry): Rename from
x-sampa-prepend-to-keymap-entry.
(ipa-x-sampa-underscore-implosive): Rename from
x-sampa-underscore-implosive.
(ipa-x-sampa-implosive-submap): Move before first use.
diff -r a53c6d7f6ae2 -r 7f33a75296ac ChangeLog
--- a/ChangeLog Sat Sep 03 14:42:12 2011 +0200
+++ b/ChangeLog Mon Sep 12 17:59:27 2011 +0100
@@ -1,3 +1,33 @@
+2011-06-18 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * leim-list.el: Update to reflect new input method names.
+
+ * quail/ipa-21.5.el:
+ Sync these changes from GNU:
+
+ 2009-08-31 Juri Linkov <juri(a)jurta.org>
+
+ * quail/ipa.el ("ipa"): Set `forget-last-selection' to nil.
+ ("ipa-x-sampa"): Set `forget-last-selection' to nil.
+ Set `deterministic' to nil.
+ ("ipa"): Bind "g" to U+0261, and "tsh" to a list of "U+02A7",
+ "U+0074 U+0283", "U+0074 U+2040 U+0283".
+ ("ipa-kirshenbaum", ipa-x-sampa"): Bind "g" to U+0261, and "tS"
+ to a list of "U+02A7", "U+0074 U+0283", "U+0074 U+2040 U+0283".
+ Fix comments.
+
+ 2009-08-31 Juri Linkov <juri(a)jurta.org>
+
+ * quail/ipa.el ("ipa-kirshenbaum"): Rename from "kirshenbaum-ipa".
+ ("ipa-x-sampa"): Rename from "x-sampa-ipa".
+ (ipa-x-sampa-implosive-submap): Rename from
+ x-sampa-implosive-submap.
+ (ipa-x-sampa-prepend-to-keymap-entry): Rename from
+ x-sampa-prepend-to-keymap-entry.
+ (ipa-x-sampa-underscore-implosive): Rename from
+ x-sampa-underscore-implosive.
+ (ipa-x-sampa-implosive-submap): Move before first use.
+
2010-09-05 Norbert Koch viteno(a)xemacs.org
* Makefile (VERSION): XEmacs package 1.32 released.
diff -r a53c6d7f6ae2 -r 7f33a75296ac leim-list.el
--- a/leim-list.el Sat Sep 03 14:42:12 2011 +0200
+++ b/leim-list.el Mon Sep 12 17:59:27 2011 +0100
@@ -422,6 +422,16 @@
"International Phonetic Alphabet, X-SAMPA ASCII transliteration."
"ipa-21.5")
(register-input-method
+ "ipa-kirshenbaum" "IPA" 'quail-use-package
+ "IPA-K"
+ "International Phonetic Alphabet, Kirshenbaum ASCII transliteration."
+ "ipa-21.5")
+ (register-input-method
+ "ipa-x-sampa" "IPA" 'quail-use-package
+ "IPA-S"
+ "International Phonetic Alphabet, X-SAMPA ASCII transliteration."
+ "ipa-21.5")
+ (register-input-method
"ipa" "IPA" 'quail-use-package
"IPA"
"International Phonetic Alphabet for English, French, German and Italian"
diff -r a53c6d7f6ae2 -r 7f33a75296ac quail/ipa-21.5.el
--- a/quail/ipa-21.5.el Sat Sep 03 14:42:12 2011 +0200
+++ b/quail/ipa-21.5.el Mon Sep 12 17:59:27 2011 +0100
@@ -1,17 +1,20 @@
-;;; quail/ipa.el -- Quail package for inputting IPA. -*- coding: utf-8 -*-
-;;;
-;; Copyright (C) 1997 Electrotechnical Laboratory, JAPAN.
-;; Copyright (C) 2006 Free Software Foundation, Inc.
+;;; ipa.el --- Quail package for inputting IPA characters -*-coding: utf-8;-*-
+
+;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+;; 2006, 2007, 2008, 2009, 2010, 2011
+;; National Institute of Advanced Industrial Science and Technology (AIST)
+;; Registration Number H14PRO021
;; Licensed to the Free Software Foundation.
+;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
;; Keywords: multilingual, input method, IPA
;; This file is part of XEmacs.
-;; XEmacs is free software; you can redistribute it and/or modify
+;; XEmacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; XEmacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,19 +22,19 @@
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with XEmacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02110-1301, USA
+;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>.
-;;; Synched up with: FSF 22.0.50.6
+;;; Synched up with: last FSF of 2009-08-31.
;; This file is ipa.el, but re-encoded to UTF-8, and greatly expanded to
;; support the common ASCII transliterations of the IPA.
+;;; Commentary:
+
;;; Code:
(require 'quail)
-(require 'cl)
+(eval-when-compile (require 'cl))
;; This file breaks with 21.4 and early 21.5. It should be merged with
;; ipa.el when 21.4 is declared obsolete.
@@ -44,7 +47,7 @@
"International Phonetic Alphabet for English, French, German and Italian
Upside-down characters are obtained by a preceding slash (/)."
- nil t nil nil nil nil nil nil nil nil t)
+ nil nil nil nil nil nil nil nil nil nil t)
(quail-define-rules
("i" ?i)
@@ -87,7 +90,7 @@
("t" ?t)
("d" ?d)
("k" ?k)
- ("g" ?g)
+ ("g" ?ɡ)
("f" ?f)
("v" ?v)
("th" ?θ)
@@ -95,6 +98,7 @@
("s" ?s)
("z" ?z)
("sh" ?ʃ)
+ ("tsh" ["ʧ" "tʃ" "t⁀ʃ"])
("zh" ?ʒ)
("3" ?ʒ)
("c," ?ç)
@@ -120,8 +124,8 @@
(":" ?ː))
(quail-define-package
- "kirshenbaum-ipa" "IPA" "IPA-K" t
- "The International Phonetic Alphabet, using Kirshenbaum ASCII translit.
+ "ipa-kirshenbaum" "IPA" "IPA-K" t
+ "The International Phonetic Alphabet, using Kirshenbaum ASCII translit.
Kirshenbaum IPA is an ASCII transliteration of the phonetic alphabet, common
in the Usenet groups `sci.lang' and `alt.usage.english'. This input method
@@ -133,13 +137,13 @@
A caveat with regard to that document; while XEmacs currently preserves
Unicode diacritics on reading and emitting them, it displays them,
-incorrectly, as separate from the modified glyphs. ")
+incorrectly, as separate from the modified glyphs.")
(quail-define-rules
+ ("g" "ɡ") ;; Voiced velar plosive U+0261
("r" "ɹ") ;; Alveolar approximant U+0279
("A" "ɑ") ;; Low back unrounded vowel U+0251
- ("B" "β") ;
- ; Voiced bilabial fricative U+03B2
+ ("B" "β") ;; Voiced bilabial fricative U+03B2
("C" "ç") ;; Voiced palatal fricative U+00E7
("D" "ð") ;; Voiced dental fricative U+00F0
("E" "ɛ") ;; Lower-mid front unrounded vowel U+025B
@@ -158,8 +162,11 @@
("R" ["ʀ" ;; Alveolar trill U+0280
"ɚ"]) ;; Rhotacised schwa U+025A
("@<r>" "ɚ") ;; Mid central rhotacised vowel U+025A
- ("S" "ʃ") ;; Voiced postalveolar fricative U+0283
- ("T" "θ") ;; Voiced dental fricative U+03B8
+ ("S" "ʃ") ;; Voiceless postalveolar fricative U+0283
+ ("tS" ["ʧ" ;; Voiceless postalveolar affricate U+02A7
+ "tʃ" ;; U+0074 U+0283
+ "t⁀ʃ"]) ;; U+0074 U+2040 U+0283
+ ("T" "θ") ;; Voiceless dental fricative U+03B8
("U" "ʊ") ;; Semi-high back rounded vowel U+028A
("V" "ʌ") ;; Low-mid back unrounded vowel U+028C
("W" "œ") ;; Low-mid front rounded vowel U+0153
@@ -218,13 +225,13 @@
("j<vel>" "ɰ") ;; Velar approximant U+0270
("g`" "ɠ") ;; Velar implosive U+0260
("k!" "ʞ") ;; Velar click U+029E
-
+
("n<lbv>" ["n⁀g"]) ;; Labio-velar nasal
("t<lbv>" ["k⁀p"]) ;; Voiceless labio-velar stop
;; "n<lbv> for "gb" WITH U+2030 CHARACTER TIE was ambiguous and
- ;; misleading. I _believe_ this is what was meant instead.
- ("d<lbv>" ["g⁀b"]) ;; Voiced labio-velar stop.
+ ;; misleading. I _believe_ this is what was meant instead.
+ ("d<lbv>" ["g⁀b"]) ;; Voiced labio-velar stop.
("w<vls>" "ʍ") ;; Voiceless labio-velar stop U+028D
("n\"" "ɴ") ;; Uvular nasal U+0274
@@ -250,36 +257,49 @@
("o-" "ɤ") ;; Upper-mid back unrounded vowel U+0264
("A." "ɒ")) ;; Lower back rounded vowel U+0252
+
+(defconst ipa-x-sampa-implosive-submap
+ '(("b_<" ?ɓ) ;; Voiced bilabial implosive U+0253
+ ("d_<" ?ɗ) ;; Voiced alveolar implosive U+0257
+ ("g_<" ?ɠ) ;; Voiced velar implosive U+0260
+ ("G\\_<" ?ʛ) ;; Voiced uvular implosive U+029B
+ ("J\\_<" ?ʄ)) ;; Voiced palatal implosive U+0284
+ "A map from the X-SAMPA for some implosive consonants to characters.
+This is used because their X-SAMPA syntax is quasi-diacritic, but the
+corresponding Unicode characters themselves don't have diacritics, they are
+separate code points. So we need to implement some extra logic that isn't
+normally provided by Quail.")
+
;; On XEmacs, with the supplied X-SAMPA data, this function is capably
-;; implemented with:
+;; implemented with:
;;
;; (list (vector (concat to-prepend quail-keymap)))
-;;
-;; Supporting GNU Emacs too makes it a good deal more complicated.
+;;
+;; Supporting GNU Emacs too makes it a good deal more complicated.
-(defun x-sampa-prepend-to-keymap-entry (to-prepend quail-keymap)
+(defun ipa-x-sampa-prepend-to-keymap-entry (to-prepend quail-keymap)
"Return QUAIL-KEYMAP with TO-PREPEND at the beginning of each result.
QUAIL-KEYMAP is a cons that satisfies `quail-map-p'; TO-PREPEND is a
-string. "
+string."
(when (consp quail-keymap) (setq quail-keymap (cdr quail-keymap)))
- (if (or (integerp quail-keymap)
+ (if (or (integerp quail-keymap)
(and (fboundp 'characterp) (characterp quail-keymap)))
(setq quail-keymap (list (string quail-keymap)))
(if (stringp quail-keymap)
(setq quail-keymap (list quail-keymap))
(assert (vectorp quail-keymap) t)
(setq quail-keymap (append quail-keymap nil))))
- (list
- (apply 'vector
- (mapcar
+ (list
+ (apply 'vector
+ (mapcar
#'(lambda (entry)
(assert (char-or-string-p entry) t)
- (format "%s%s" to-prepend
+ (format "%s%s" to-prepend
(if (integerp entry) (string entry) entry)))
quail-keymap))))
-(defun x-sampa-underscore-implosive (input-string length)
+(defun ipa-x-sampa-underscore-implosive (input-string length)
"Return keymap with IPA implosives, for INPUT-STRING, length LENGTH.
The implosive consonants in X-SAMPA are represented with more or less a
@@ -292,14 +312,14 @@
Like all `quail-defrule'-assigned functions, this will be called once for
each particular sequence of keys, the first time the user types that
-particular sequence of keys, and the result will be cached by Quail. "
+particular sequence of keys, and the result will be cached by Quail."
(let* ((input-string (substring input-string 0 (or length)))
(underscore-map (copy-tree (quail-lookup-key "_")))
(split-input (split-string input-string "_"))
(pre-underscore (car split-input))
(pre-underscore-map (quail-lookup-key pre-underscore))
- (x-sampa-submap-entry
- (assoc (format "%s<" input-string) x-sampa-implosive-submap))
+ (x-sampa-submap-entry
+ (assoc (format "%s<" input-string) ipa-x-sampa-implosive-submap))
underscore-map-entry)
(if (and (consp pre-underscore-map) (car pre-underscore-map))
(setq pre-underscore-map (car pre-underscore-map))
@@ -310,21 +330,21 @@
(cond ((null underscoring))
((eq (length underscoring) 2)
(setq underscore-map-entry (second underscoring))
- (setcdr underscoring (x-sampa-prepend-to-keymap-entry
+ (setcdr underscoring (ipa-x-sampa-prepend-to-keymap-entry
pre-underscore-map underscore-map-entry)))
((eq (length underscoring) 3)
(setq underscore-map-entry (second (third underscoring)))
- (setcdr (third underscoring)
- (x-sampa-prepend-to-keymap-entry
+ (setcdr (third underscoring)
+ (ipa-x-sampa-prepend-to-keymap-entry
pre-underscore-map underscore-map-entry)))
- (t
- (assert (null t) t
+ (t
+ (assert (null t) t
"Can't handle subtrees of this level right now."))))
(append underscore-map (list (list ?< (second x-sampa-submap-entry))))))
(quail-define-package
- "x-sampa-ipa" "IPA" "IPA-X" t
- "The International Phonetic Alphabet, using J.C. Wells' X-SAMPA.
+ "ipa-x-sampa" "IPA" "IPA-X" t
+ "The International Phonetic Alphabet, using J.C. Wells' X-SAMPA.
X-SAMPA is an ASCII transliteration of the IPA, normally used for data
exchange in environments where Unicode is not available. This input method
@@ -334,18 +354,14 @@
See http://www.phon.ucl.ac.uk/home/sampa/ipasam-x.pdf for a full definition
of the mapping. A caveat with regard to that document; while XEmacs
currently preserves Unicode diacritics on reading and emitting them, it
-displays them, incorrectly, as separate from the modified glyphs. " nil t t)
+displays them, incorrectly, as separate from the modified glyphs.")
(quail-define-rules
;; Table taken from http://en.wikipedia.org/wiki/X-SAMPA, checked with
;; http://www.phon.ucl.ac.uk/home/sampa/ipasam-x.pdf
("d`" "ɖ") ;; Voiced retroflex plosive U+0256
-
- ;; In the Wikipedia article, they list ASCII g as mapping to U+0261, LATIN
- ;; SMALL LETTER SCRIPT G. The typeset g is equally acceptable as the voiced
- ;; velar plosive, however, and we don't override the identity mapping here.
-
+ ("g" "ɡ") ;; Voiced velar plosive U+0261
("h\\" "ɦ") ;; Voiced glottal fricative U+0266
("j\\" "ʝ") ;; Voiced palatal fricative U+029D
("l`" "ɭ") ;; Retroflex lateral approximant U+026D
@@ -392,6 +408,9 @@
("R" "ʁ") ;; Voiced uvular fricative U+0281
("R\\" "ʀ") ;; Uvular trill U+0280
("S" "ʃ") ;; Voiceless postalveolar fricative U+0283
+ ("tS" ["ʧ" ;; Voiceless postalveolar affricate U+02A7
+ "tʃ" ;; U+0074 U+0283
+ "t⁀ʃ"]) ;; U+0074 U+2040 U+0283
("T" "θ") ;; Voiceless dental fricative U+03B8
("U" "ʊ") ;; Near-close near-back rounded vowel U+028A
("U\\" ["ʊ̵"]) ;; Central lax close rounded vowel, U+028A U+0335
@@ -424,11 +443,11 @@
("&" "ɶ") ;; Open front rounded vowel U+0276
("?" "ʔ") ;; Glottal stop U+0294
("?\\" "ʕ") ;; Voiced pharyngeal fricative U+0295
- ;; The undefined escape character, ignored.
+ ;; The undefined escape character, ignored.
;; Indeterminacy in French vowels, ignored.
- ;; Begin nonsegmental notation, ignored.
+ ;; Begin nonsegmental notation, ignored.
("<\\" "ʢ") ;; Voiced epiglottal fricative U+02A2
- ;; End nonsegmental notation, ignored.
+ ;; End nonsegmental notation, ignored.
(">\\" "ʡ") ;; Epiglottal plosive U+02A1
("^" "↑") ;; Upstep U+2191
("!" "↓") ;; Downstep U+2193
@@ -486,9 +505,9 @@
("_O" "̹") ;; More rounded U+0339
("_o" "̞") ;; Lowered U+031E
("_q" "̙") ;; Retracted tongue root U+0319
- ("<R>" "↗") ;; NORTH EAST ARROW; may be a bit smaller than intended.
+ ("<R>" "↗") ;; NORTH EAST ARROW; may be a bit smaller than intended.
("_R" "̌") ;; Haček, caron, rising tone. U+030C
- ;; _R_F omitted, apparently there's no corresponding Unicode entry.
+ ;; _R_F omitted, apparently there's no corresponding Unicode entry.
("_r" "̝") ;; Raised U+031D
("_T" "̋") ;; Extra high tone U+030B
("_t" "̤") ;; Breathy voice U+0324
@@ -497,27 +516,24 @@
("_X" "̆") ;; Extra-short U+0306
("_x" "̽")) ;; Mid-centralised U+033D
-(defconst x-sampa-implosive-submap
- '(("b_<" ?ɓ) ;; Voiced bilabial implosive U+0253
- ("d_<" ?ɗ) ;; Voiced alveolar implosive U+0257
- ("g_<" ?ɠ) ;; Voiced velar implosive U+0260
- ("G\\_<" ?ʛ) ;; Voiced uvular implosive U+029B
- ("J\\_<" ?ʄ)) ;; Voiced palatal implosive U+0284
- "A map from the X-SAMPA for some implosive consonants to characters.
-This is used because their X-SAMPA syntax is quasi-diacritic, but the
-corresponding Unicode characters themselves don't have diacritics, they are
-separate code points. So we need to implement some extra logic that isn't
-normally provided by Quail. ")
-
;; Putting in place rules for the implosives like for the others above
;; breaks the "_<diacritic>" rules for b, d, g, G and J a little--you need
;; to interrupt Quail before typing the underscore if you want the
;; diacritic. To avoid this, handle the input specially with the function
-;; x-sampa-underscore-implosive.
+;; ipa-x-sampa-underscore-implosive.
-(dolist (implosive-x-sampa (mapcar 'car x-sampa-implosive-submap))
+(dolist (implosive-x-sampa (mapcar 'car ipa-x-sampa-implosive-submap))
(setq implosive-x-sampa (car (split-string implosive-x-sampa "_")))
(quail-defrule (format "%s_" implosive-x-sampa)
- 'x-sampa-underscore-implosive))
+ 'ipa-x-sampa-underscore-implosive))
-(provide 'ipa)
+;; XEmacs; add the original names for the Kirshenbaum and X-SAMPA maps as
+;; aliases.
+
+(setq quail-package-alist
+ `(("x-sampa-ipa" . ,(cdr (assoc "ipa-x-sampa" quail-package-alist)))
+ ("kirshenbaum-ipa" . ,(cdr (assoc "ipa-kirshenbaum"
+ quail-package-alist)))
+ ,@quail-package-alist))
+
+;;; ipa.el ends here
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit: Be more careful still in #'cl-defsubst-expand.
13 years, 3 months
Aidan Kehoe
changeset: 5570:6c76f5b7e2e3
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sun Sep 11 16:05:05 2011 +0100
files: lisp/ChangeLog lisp/cl-macs.el
description:
Be more careful still in #'cl-defsubst-expand.
lisp/ChangeLog addition:
2011-09-11 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (cl-defsubst-expand):
Be more careful still here, make sure that any references to
variables in BODY don't access those values in the enclosing scope
when that would be inappropriate.
Add some documentation of a potential reasonable approach to
avoiding the problems with our (non-Common Lisp-conformant)
#'symbol-macrolet.
diff -r d19b6e3bdf91 -r 6c76f5b7e2e3 lisp/ChangeLog
--- a/lisp/ChangeLog Sat Sep 10 13:17:29 2011 +0100
+++ b/lisp/ChangeLog Sun Sep 11 16:05:05 2011 +0100
@@ -1,3 +1,13 @@
+2011-09-11 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl-macs.el (cl-defsubst-expand):
+ Be more careful still here, make sure that any references to
+ variables in BODY don't access those values in the enclosing scope
+ when that would be inappropriate.
+ Add some documentation of a potential reasonable approach to
+ avoiding the problems with our (non-Common Lisp-conformant)
+ #'symbol-macrolet.
+
2011-09-10 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (cl-defsubst-expand):
diff -r d19b6e3bdf91 -r 6c76f5b7e2e3 lisp/cl-macs.el
--- a/lisp/cl-macs.el Sat Sep 10 13:17:29 2011 +0100
+++ b/lisp/cl-macs.el Sun Sep 11 16:05:05 2011 +0100
@@ -3238,18 +3238,25 @@
(if (or simple (cl-const-expr-p argv))
(progn
;; Avoid infinite loop on symbol macro
- ;; expansion, make sure none of the argvs
- ;; refer to the symbols in the argns.
+ ;; expansion:
(or (block find
- ;; Can't use cl-expr-contains, that
- ;; doesn't descend lambdas:
- (subst nil argn argvs :test
- #'(lambda (elt tree)
+ (subst nil argn argvs :test
+ #'(lambda (elt tree)
+ ;; Give nil if argn is
+ ;; in argvs somewhere:
(if (eq elt tree)
- (return-from find t))))
- nil)
- (push (list argn argv) symbol-macros))
- (and unsafe (list (list argn argv))))
+ (return-from find)))))
+ (let ((copy-symbol (copy-symbol argn)))
+ ;; Rename ARGN within BODY so it
+ ;; doesn't conflict with its value
+ ;; in the including scope:
+ (setq body
+ (cl-macroexpand-all
+ body `((,(eq-hash argn)
+ ,copy-symbol)))
+ argn copy-symbol)))
+ (push (list argn argv) symbol-macros)
+ (and unsafe (list (list argn argv))))
(list (list argn argv))))
argns argvs)))
`(let ,lets
@@ -3260,6 +3267,13 @@
;; bound). We don't have GNU's issue where the replacement will
;; be done when the symbol is used in a function context,
;; because we're using #'symbol-macrolet instead of #'subst.
+ ;;
+ ;; #'symbol-macrolet as specified by Common Lisp is shadowed by
+ ;; #'let, #'let* and lambda argument lists, and that would suit
+ ;; our purposes here perfectly; we could implement it in
+ ;; cl-macroexpand-all by shadowing any existing symbol macros
+ ;; when we descend let forms or arglist lambdas. Doing it
+ ;; unconditionally could well break #'loop, though.
,symbol-macros
,body)))))
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] #'cl-defsubst-expand; avoid mutually-recursive symbol macros.
13 years, 3 months
Aidan Kehoe
Ar an deichiú lá de mí Méan Fómhair, scríobh Stephen J. Turnbull:
> [...]
OK, I’ve reproduced, and committed the below. Thank you both!
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1315657049 -3600
# Node ID d19b6e3bdf91e4e1f99857e9973c86fa2bebb40c
# Parent b039c0f018b81507efbf95589e9ad11eaae6d45f
#'cl-defsubst-expand; avoid mutually-recursive symbol macros.
lisp/ChangeLog addition:
2011-09-10 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (cl-defsubst-expand):
Change set 2a6a8da4dd7c of
http://mid.gmane.org/19966.17522.332164.615228@parhasard.net
wasn't sufficiently comprehensive, symbol macros can be mutually
rather than simply recursive, and they can equally hang. Thanks
for the bug report, Michael Sperber, and for the test case,
Stephen Turnbull.
diff -r b039c0f018b8 -r d19b6e3bdf91 lisp/ChangeLog
--- a/lisp/ChangeLog Fri Sep 09 22:50:31 2011 +0100
+++ b/lisp/ChangeLog Sat Sep 10 13:17:29 2011 +0100
@@ -1,3 +1,13 @@
+2011-09-10 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl-macs.el (cl-defsubst-expand):
+ Change set 2a6a8da4dd7c of
+ http://mid.gmane.org/19966.17522.332164.615228@parhasard.net
+ wasn't sufficiently comprehensive, symbol macros can be mutually
+ rather than simply recursive, and they can equally hang. Thanks
+ for the bug report, Michael Sperber, and for the test case,
+ Stephen Turnbull.
+
2011-09-09 Aidan Kehoe <kehoea(a)parhasard.net>
* bytecomp.el (byte-compile-from-buffer):
diff -r b039c0f018b8 -r d19b6e3bdf91 lisp/cl-macs.el
--- a/lisp/cl-macs.el Fri Sep 09 22:50:31 2011 +0100
+++ b/lisp/cl-macs.el Sat Sep 10 13:17:29 2011 +0100
@@ -3236,10 +3236,20 @@
(let* ((symbol-macros nil)
(lets (mapcan #'(lambda (argn argv)
(if (or simple (cl-const-expr-p argv))
- (progn (or (eq argn argv)
- (push (list argn argv)
- symbol-macros))
- (and unsafe (list (list argn argv))))
+ (progn
+ ;; Avoid infinite loop on symbol macro
+ ;; expansion, make sure none of the argvs
+ ;; refer to the symbols in the argns.
+ (or (block find
+ ;; Can't use cl-expr-contains, that
+ ;; doesn't descend lambdas:
+ (subst nil argn argvs :test
+ #'(lambda (elt tree)
+ (if (eq elt tree)
+ (return-from find t))))
+ nil)
+ (push (list argn argv) symbol-macros))
+ (and unsafe (list (list argn argv))))
(list (list argn argv))))
argns argvs)))
`(let ,lets
--
‘Iodine deficiency was endemic in parts of the UK until, through what has been
described as “an unplanned and accidental public health triumph”, iodine was
added to cattle feed to improve milk production in the 1930s.’
(EN Pearce, Lancet, June 2011)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit: #'cl-defsubst-expand; avoid mutually-recursive symbol macros.
13 years, 3 months
Aidan Kehoe
changeset: 5569:d19b6e3bdf91
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sat Sep 10 13:17:29 2011 +0100
files: lisp/ChangeLog lisp/cl-macs.el
description:
#'cl-defsubst-expand; avoid mutually-recursive symbol macros.
lisp/ChangeLog addition:
2011-09-10 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (cl-defsubst-expand):
Change set 2a6a8da4dd7c of
http://mid.gmane.org/19966.17522.332164.615228@parhasard.net
wasn't sufficiently comprehensive, symbol macros can be mutually
rather than simply recursive, and they can equally hang. Thanks
for the bug report, Michael Sperber, and for the test case,
Stephen Turnbull.
diff -r b039c0f018b8 -r d19b6e3bdf91 lisp/ChangeLog
--- a/lisp/ChangeLog Fri Sep 09 22:50:31 2011 +0100
+++ b/lisp/ChangeLog Sat Sep 10 13:17:29 2011 +0100
@@ -1,3 +1,13 @@
+2011-09-10 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl-macs.el (cl-defsubst-expand):
+ Change set 2a6a8da4dd7c of
+ http://mid.gmane.org/19966.17522.332164.615228@parhasard.net
+ wasn't sufficiently comprehensive, symbol macros can be mutually
+ rather than simply recursive, and they can equally hang. Thanks
+ for the bug report, Michael Sperber, and for the test case,
+ Stephen Turnbull.
+
2011-09-09 Aidan Kehoe <kehoea(a)parhasard.net>
* bytecomp.el (byte-compile-from-buffer):
diff -r b039c0f018b8 -r d19b6e3bdf91 lisp/cl-macs.el
--- a/lisp/cl-macs.el Fri Sep 09 22:50:31 2011 +0100
+++ b/lisp/cl-macs.el Sat Sep 10 13:17:29 2011 +0100
@@ -3236,10 +3236,20 @@
(let* ((symbol-macros nil)
(lets (mapcan #'(lambda (argn argv)
(if (or simple (cl-const-expr-p argv))
- (progn (or (eq argn argv)
- (push (list argn argv)
- symbol-macros))
- (and unsafe (list (list argn argv))))
+ (progn
+ ;; Avoid infinite loop on symbol macro
+ ;; expansion, make sure none of the argvs
+ ;; refer to the symbols in the argns.
+ (or (block find
+ ;; Can't use cl-expr-contains, that
+ ;; doesn't descend lambdas:
+ (subst nil argn argvs :test
+ #'(lambda (elt tree)
+ (if (eq elt tree)
+ (return-from find t))))
+ nil)
+ (push (list argn argv) symbol-macros))
+ (and unsafe (list (list argn argv))))
(list (list argn argv))))
argns argvs)))
`(let ,lets
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit: Error if byte-compiling a form hasn't wrapped byte-compile-inbuffer.
13 years, 3 months
Aidan Kehoe
changeset: 5568:b039c0f018b8
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Fri Sep 09 22:50:31 2011 +0100
files: lisp/ChangeLog lisp/bytecomp.el
description:
Error if byte-compiling a form hasn't wrapped byte-compile-inbuffer.
lisp/ChangeLog addition:
2011-09-09 Aidan Kehoe <kehoea(a)parhasard.net>
* bytecomp.el (byte-compile-from-buffer):
If compiling a form has changed the current buffer (that is, some
eval-when-compile form hasn't done save-excursion when
appropriate), error and exit; we can't guarantee we'll give useful
code in that context. See
http://mid.gmane.org/20110909110831.GD2875@acm.acm and related
discussion.
diff -r 3bc58dc9d688 -r b039c0f018b8 lisp/ChangeLog
--- a/lisp/ChangeLog Wed Sep 07 21:21:36 2011 +0100
+++ b/lisp/ChangeLog Fri Sep 09 22:50:31 2011 +0100
@@ -1,3 +1,13 @@
+2011-09-09 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * bytecomp.el (byte-compile-from-buffer):
+ If compiling a form has changed the current buffer (that is, some
+ eval-when-compile form hasn't done save-excursion when
+ appropriate), error and exit; we can't guarantee we'll give useful
+ code in that context. See
+ http://mid.gmane.org/20110909110831.GD2875@acm.acm and related
+ discussion.
+
2011-09-07 Aidan Kehoe <kehoea(a)parhasard.net>
* simple.el (transpose-subr):
diff -r 3bc58dc9d688 -r b039c0f018b8 lisp/bytecomp.el
--- a/lisp/bytecomp.el Wed Sep 07 21:21:36 2011 +0100
+++ b/lisp/bytecomp.el Fri Sep 09 22:50:31 2011 +0100
@@ -1864,7 +1864,11 @@
(looking-at ";"))
(forward-line 1))
(not (eobp)))
- (byte-compile-file-form (read byte-compile-inbuffer)))
+ (byte-compile-file-form (read byte-compile-inbuffer))
+ (or (eq byte-compile-inbuffer (current-buffer))
+ (error 'invalid-state
+ "byte compiling didn't save-excursion appropriately"
+ (current-buffer))))
;; Compile pending forms at end of file.
(byte-compile-flush-pending)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches