emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: recentf: "Select coding system" on quit]


From: Kenichi Handa
Subject: Re: address@hidden: recentf: "Select coding system" on quit]
Date: Thu, 21 Apr 2005 14:37:12 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

In article <address@hidden>, Richard Stallman <address@hidden> writes:

> Would you please DTRT and ack?

> ------- Start of forwarded message -------
> To: address@hidden
> From: David Reitter <address@hidden>
> Date: Sun, 17 Apr 2005 10:29:34 +0100
> Subject: recentf: "Select coding system" on quit
[...]
> The recentf library asks the user "Select coding system" upon quitting 
> emacs what coding system to use when one of the recent files is one 
> with non-ascii characters, instead of non-interactively (i.e. 
> automatically) choosing a safe coding system such as utf-8.

> This is generated by mule-cmds.el, possibly 
> select-safe-coding-system-interactively or something like that.

I think the attached patch will fix the problem.  Shall I
install it?

The code:

   (if (coding-system-p 'utf-8-emacs) ...)

is for emacs-unicode.

---
Ken'ichi HANDA
address@hidden


2005-04-21  Kenichi Handa  <address@hidden>

        * recentf.el (recentf-save-file-coding-system): New variable.
        (recentf-save-list): Encode the file by
        recentf-save-file-coding-system and add coding: tag.

        * international/mule-cmds.el: Add autoload for widget-value in
        eval-when-compile

*** recentf.el  25 Mar 2005 10:37:27 +0900      1.35
--- recentf.el  21 Apr 2005 14:23:21 +0900      
***************
*** 1137,1142 ****
--- 1137,1148 ----
    ";;; Automatically generated by `recentf' on %s.\n"
    "Header to be written into the `recentf-save-file'.")
  
+ (defconst recentf-save-file-coding-system
+   (if (coding-system-p 'utf-8-emacs)
+       'utf-8-emacs
+     'emacs-mule)
+   "Coding system of the file `recentf-save-file'.")
+ 
  (defun recentf-save-list ()
    "Save the recent list.
  Write data into the file specified by `recentf-save-file'."
***************
*** 1144,1152 ****
--- 1150,1162 ----
    (condition-case error
        (with-temp-buffer
        (erase-buffer)
+       (set-buffer-file-coding-system recentf-save-file-coding-system)
        (insert (format recentf-save-file-header (current-time-string)))
        (recentf-dump-variable 'recentf-list recentf-max-saved-items)
        (recentf-dump-variable 'recentf-filter-changer-state)
+       (insert ";;; Local Variables:\n"
+               (format ";;; coding: %s\n" recentf-save-file-coding-system)
+               ";;; End:\n")
        (write-file (expand-file-name recentf-save-file))
        nil)
      (error




reply via email to

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