unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: david.reitter@gmail.com, emacs-devel@gnu.org
Subject: Re: [david.reitter@gmail.com: recentf: "Select coding system" on quit]
Date: Thu, 21 Apr 2005 14:37:12 +0900 (JST)	[thread overview]
Message-ID: <200504210537.OAA29195@etlken.m17n.org> (raw)
In-Reply-To: <E1DNFJN-0005VA-0Z@fencepost.gnu.org> (message from Richard Stallman on Sun, 17 Apr 2005 15:20:05 -0400)

In article <E1DNFJN-0005VA-0Z@fencepost.gnu.org>, Richard Stallman <rms@gnu.org> writes:

> Would you please DTRT and ack?

> ------- Start of forwarded message -------
> To: emacs-pretest-bug@gnu.org
> From: David Reitter <david.reitter@gmail.com>
> 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
handa@m17n.org


2005-04-21  Kenichi Handa  <handa@m17n.org>

	* 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	other threads:[~2005-04-21  5:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1DNFJN-0005VA-0Z@fencepost.gnu.org>
2005-04-21  5:37 ` Kenichi Handa [this message]
2005-04-21 19:55   ` [david.reitter@gmail.com: recentf: "Select coding system" on quit] Richard Stallman
2005-04-21 15:16 David PONCE
2005-04-21 16:50 ` Lute Kamstra
2005-04-21 17:10   ` David Ponce
2005-04-23  6:59     ` David Kastrup
2005-04-23 22:24       ` Richard Stallman
2005-04-21 17:47   ` David Kastrup
2005-04-22  0:43 ` Kenichi Handa
2005-04-22  5:30   ` David Reitter
2005-04-22  5:40     ` Kenichi Handa
2005-04-22  7:58       ` David Kastrup
2005-04-22 13:07         ` Kenichi Handa
  -- strict thread matches above, loose matches on Subject: below --
2005-04-22  8:11 David PONCE

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=200504210537.OAA29195@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=david.reitter@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).