Who uses 'function as value for `auto-insert-query' may notice
problems with autoinsertation. It seems like form
`(y-or-n-p (format auto-insert-prompt desc))' breaks match data, so
forms like `(substring buffer-file-name 0 (match-beginning 0))' in
`auto-insert-alist' fails to do expected job. This patch tries to fix
this problem.
----
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/text-modes/ChangeLog,v
retrieving revision 1.159
diff -u -p -r1.159 ChangeLog
--- ChangeLog 2005/11/02 07:07:36 1.159
+++ ChangeLog 2005/12/05 09:40:21
@@ -1,3 +1,8 @@
+2005-12-05 Zajcev Evgeny <zevlg(a)yandex.ru>
+
+ * autoinsert.el (auto-insert): [fix] Recover match data in case of
+ possible breakage.
+
2005-11-02 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.90 released.
Index: autoinsert.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/text-modes/autoinsert.el,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 autoinsert.el
--- autoinsert.el 1998/01/14 06:38:01 1.1.1.1
+++ autoinsert.el 2005/12/05 09:40:21
@@ -231,8 +231,10 @@ Matches the visited file name against th
t)
(if auto-insert-query
(or (if (eq auto-insert-query 'function)
- (eq this-command 'auto-insert))
- (y-or-n-p (format auto-insert-prompt desc)))
+ (eq this-command 'auto-insert))
+ (and (y-or-n-p (format auto-insert-prompt desc))
+ (string-match cond buffer-file-name)
+ t))
t)
(mapcar
(lambda (action)
----
Thanks!
--
lg
Show replies by date