emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading UnicodeData.txt in an internal buffer


From: Kenichi Handa
Subject: Re: Loading UnicodeData.txt in an internal buffer
Date: Mon, 04 Dec 2006 10:13:18 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.91 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

In article <address@hidden>, "Juanma Barranquero" <address@hidden> writes:

> When `describe-char-unicodedata-file' is set, the Unicode Data file is
> read through `find-file-noselect', which visits the file. As a
> consequence, the file (usually UnicodeData.txt) is visible in buffer
> lists, and it is also saved/restored by desktop.el.

> However, the use of `describe-char-unicodedata-file' is an
> implementation detail of `describe-char', and there's not much point
> in loading the data in a normal buffer. The file is not going to be
> edited by the user, and if it were to, the user should `find-file' it,
> not load it as a side effect of `describe-char'.

> So I propose the following simple patch to load the file in a internal
> buffer " *Unicode Data*", via `insert-file-contents'.

I agree with that change.

---
Kenichi Handa
address@hidden

>                     /L/e/k/t/u


> Index: lisp/descr-text.el
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/lisp/descr-text.el,v
> retrieving revision 1.52
> diff -u -2 -r1.52 descr-text.el
> --- lisp/descr-text.el        1 Dec 2006 14:04:54 -0000       1.52
> +++ lisp/descr-text.el        2 Dec 2006 13:03:32 -0000
> @@ -213,9 +213,8 @@
>      (unless (file-exists-p describe-char-unicodedata-file)
>        (error "`unicodedata-file' %s not found" 
> describe-char-unicodedata-file))
> -    (with-current-buffer
> -     ;; Find file in fundamental mode to avoid, e.g. flyspell turned
> -     ;; on for .txt.  Don't use RAWFILE arg in case of DOS line endings.
> -     (let ((auto-mode-alist))
> -       (find-file-noselect describe-char-unicodedata-file))
> +    (with-current-buffer (get-buffer-create " *Unicode Data*")
> +      (when (zerop (buffer-size))
> +     ;; Don't use -literally in case of DOS line endings.
> +     (insert-file-contents describe-char-unicodedata-file))
>        (goto-char (point-min))
>        (let ((hex (format "%04X" char))


> _______________________________________________
> Emacs-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]