all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: cyd@stupidchicken.com, 2435@emacsbugs.donarmstrong.com
Subject: bug#2435: Bug 2435
Date: Mon, 09 Mar 2009 10:12:01 +0900	[thread overview]
Message-ID: <E1LgU2D-00013e-2T@etlken> (raw)
In-Reply-To: <jwvocwdszkq.fsf-monnier+emacsbugreports@gnu.org> (message from Stefan Monnier on Sat, 07 Mar 2009 18:07:19 -0500)

In article <jwvocwdszkq.fsf-monnier+emacsbugreports@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> AFAIK building objects is perfectly fine, yes.
>>> I wonder why you use record_unwind_protect rather than specbind, tho.
> > Don't we need record_unwind_protect for the case that quit
> > is signaled in emacs_open that is called from openp?

> specbind does the same thing (except that it's specially designed for
> the job at hand of temporarily modifying a variable).

Ah! I see.  Ok, I've just installed this change.

2009-03-09  Kenichi Handa  <handa@m17n.org>

	* charset.c (Qfile_name_handler_alist): Extern it.
	(load_charset_map_from_file): Temporarily bind
	`file-name-handler-alist' to nil while calling openp.

Index: charset.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/charset.c,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -r1.169 -r1.170
--- charset.c	4 Feb 2009 01:55:07 -0000	1.169
+++ charset.c	9 Mar 2009 01:09:23 -0000	1.170
@@ -477,6 +477,7 @@
   return n;
 }
 
+extern Lisp_Object Qfile_name_handler_alist;
 
 /* Return a mapping vector for CHARSET loaded from MAPFILE.
    Each line of MAPFILE has this form
@@ -490,7 +491,10 @@
    The returned vector has this form:
 	[ CODE1 CHAR1 CODE2 CHAR2 .... ]
    where CODE1 is a code-point or a cons of code-points specifying a
-   range.  */
+   range.
+
+   Note that this funciton uses `openp' to open MAPFILE but ignores
+   `file-name-handler-alist to avoid running any Lisp codes.  */
 
 extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object));
 
@@ -508,11 +512,14 @@
   Lisp_Object suffixes;
   struct charset_map_entries *head, *entries;
   int n_entries;
+  int count = SPECPDL_INDEX ();
 
   suffixes = Fcons (build_string (".map"),
 		    Fcons (build_string (".TXT"), Qnil));
 
+  specbind (Qfile_name_handler_alist, Qnil);
   fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil);
+  unbind_to (count, Qnil);
   if (fd < 0
       || ! (fp = fdopen (fd, "r")))
     {

---
Kenichi Handa
handa@m17n.org






      reply	other threads:[~2009-03-09  1:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87fxhvcmvf.fsf@cyd.mit.edu>
     [not found] ` <E1LePPk-0002zE-RW@etlken>
2009-03-03 16:40   ` bug#2435: Bug 2435 Chong Yidong
2009-03-04  2:16     ` Kenichi Handa
2009-03-04  4:41       ` Chong Yidong
2009-03-04  7:47         ` Kenichi Handa
2009-03-05  4:09           ` Chong Yidong
2009-03-05  6:39             ` Kenichi Handa
2009-03-05  4:42           ` Chong Yidong
2009-03-05 11:23             ` Kenichi Handa
2009-03-05 16:46               ` Stefan Monnier
2009-03-06  3:38                 ` Kenichi Handa
2009-03-06  4:11                   ` Chong Yidong
2009-03-06  4:48                     ` Kenichi Handa
2009-03-06  5:07                       ` Stefan Monnier
2009-03-06  5:21                         ` Kenichi Handa
2009-03-07  4:00                           ` Chong Yidong
2009-03-07 23:07                           ` Stefan Monnier
2009-03-09  1:12                             ` Kenichi Handa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1LgU2D-00013e-2T@etlken \
    --to=handa@m17n.org \
    --cc=2435@emacsbugs.donarmstrong.com \
    --cc=cyd@stupidchicken.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.