unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [david.reitter@gmail.com: recentf: "Select coding system" on quit]
       [not found] <E1DNFJN-0005VA-0Z@fencepost.gnu.org>
@ 2005-04-21  5:37 ` Kenichi Handa
  2005-04-21 19:55   ` Richard Stallman
  0 siblings, 1 reply; 14+ messages in thread
From: Kenichi Handa @ 2005-04-21  5:37 UTC (permalink / raw)
  Cc: david.reitter, emacs-devel

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [david.reitter@gmail.com: recentf: "Select coding system" on quit]
@ 2005-04-21 15:16 David PONCE
  2005-04-21 16:50 ` Lute Kamstra
  2005-04-22  0:43 ` Kenichi Handa
  0 siblings, 2 replies; 14+ messages in thread
From: David PONCE @ 2005-04-21 15:16 UTC (permalink / raw)
  Cc: david.reitter, rms, emacs-devel

Hi,

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

Thanks for your patch. I tried it and when I compiled recentf.el
I got this message:

Compiling /home/ponce/installs/emacs/lisp/recentf.el...
File local-variables error: (error "Local variables list is not
properly terminated")
Wrote /home/ponce/installs/emacs/lisp/recentf.elc

This is because the ";;; Local Variables:\n" string confused
`hack-local-variables'!

Here is a new patch that fix that.

Sincerely,
David

Index: recentf.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/recentf.el,v
retrieving revision 1.35
diff -c -r1.35 recentf.el
*** recentf.el	23 Mar 2005 07:20:48 -0000	1.35
--- recentf.el	21 Apr 2005 15:10:52 -0000
***************
*** 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,1164 ----
    (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
+ 	 ;; Take care of not confusing `hack-local-variables'
+ 	 ";;; Local " "Variables:\n"
+ 	 (format ";;; coding: %s\n" recentf-save-file-coding-system)
+ 	 ";;; End:\n")
  	(write-file (expand-file-name recentf-save-file))
  	nil)
      (error

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [david.reitter@gmail.com: recentf: "Select coding system" on quit]
  2005-04-21 15:16 David PONCE
@ 2005-04-21 16:50 ` Lute Kamstra
  2005-04-21 17:10   ` David Ponce
  2005-04-21 17:47   ` David Kastrup
  2005-04-22  0:43 ` Kenichi Handa
  1 sibling, 2 replies; 14+ messages in thread
From: Lute Kamstra @ 2005-04-21 16:50 UTC (permalink / raw)
  Cc: david.reitter, emacs-devel, rms, handa

David PONCE <david.ponce@wanadoo.fr> writes:

>> I think the attached patch will fix the problem.  Shall I
>> install it?
>
> Thanks for your patch. I tried it and when I compiled recentf.el
> I got this message:
>
> Compiling /home/ponce/installs/emacs/lisp/recentf.el...
> File local-variables error: (error "Local variables list is not
> properly terminated")
> Wrote /home/ponce/installs/emacs/lisp/recentf.elc
>
> This is because the ";;; Local Variables:\n" string confused
> `hack-local-variables'!
>
> Here is a new patch that fix that.

Isn't inserting a ^L at the proper place the canonical solution?

Lute.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [david.reitter@gmail.com: recentf: "Select coding system" on quit]
  2005-04-21 16:50 ` Lute Kamstra
@ 2005-04-21 17:10   ` David Ponce
  2005-04-23  6:59     ` David Kastrup
  2005-04-21 17:47   ` David Kastrup
  1 sibling, 1 reply; 14+ messages in thread
From: David Ponce @ 2005-04-21 17:10 UTC (permalink / raw)
  Cc: david.reitter, handa, rms, emacs-devel

 > Isn't inserting a ^L at the proper place the canonical solution?

Yes you're right.  Following is a new patch.

Thanks!
David

Index: recentf.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/recentf.el,v
retrieving revision 1.35
diff -c -r1.35 recentf.el
*** recentf.el	23 Mar 2005 07:20:48 -0000	1.35
--- recentf.el	21 Apr 2005 17:08:50 -0000
***************
*** 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 "\n\f\n;;; Local Variables:\n"
+ 		(format ";;; coding: %s\n" recentf-save-file-coding-system)
+ 		";;; End:\n")
   	(write-file (expand-file-name recentf-save-file))
   	nil)
       (error
***************
*** 1207,1212 ****
   (provide 'recentf)

   (run-hooks 'recentf-load-hook)
!
   ;;; arch-tag: 78f1eec9-0d16-4d19-a4eb-2e4529edb62a
   ;;; recentf.el ends here
--- 1217,1222 ----
   (provide 'recentf)

   (run-hooks 'recentf-load-hook)
! \f
   ;;; arch-tag: 78f1eec9-0d16-4d19-a4eb-2e4529edb62a
   ;;; recentf.el ends here

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [david.reitter@gmail.com: recentf: "Select coding system" on quit]
  2005-04-21 16:50 ` Lute Kamstra
  2005-04-21 17:10   ` David Ponce
@ 2005-04-21 17:47   ` David Kastrup
  1 sibling, 0 replies; 14+ messages in thread
From: David Kastrup @ 2005-04-21 17:47 UTC (permalink / raw)
  Cc: david.reitter, handa, david.ponce, rms, emacs-devel

Lute Kamstra <Lute.Kamstra.lists@xs4all.nl> writes:

> David PONCE <david.ponce@wanadoo.fr> writes:
>>
>> This is because the ";;; Local Variables:\n" string confused
>> `hack-local-variables'!
>>
>> Here is a new patch that fix that.
>
> Isn't inserting a ^L at the proper place the canonical solution?

Agreed.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [david.reitter@gmail.com: recentf: "Select coding system" on quit]
  2005-04-21  5:37 ` Kenichi Handa
@ 2005-04-21 19:55   ` Richard Stallman
  0 siblings, 0 replies; 14+ messages in thread
From: Richard Stallman @ 2005-04-21 19:55 UTC (permalink / raw)
  Cc: david.reitter, emacs-devel

It looks good to me.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [david.reitter@gmail.com: recentf: "Select coding system" on quit]
  2005-04-21 15:16 David PONCE
  2005-04-21 16:50 ` Lute Kamstra
@ 2005-04-22  0:43 ` Kenichi Handa
  2005-04-22  5:30   ` David Reitter
  1 sibling, 1 reply; 14+ messages in thread
From: Kenichi Handa @ 2005-04-22  0:43 UTC (permalink / raw)
  Cc: david.reitter, rms, emacs-devel

In article <16131584.1114096593070.JavaMail.www@wwinf1101>, David PONCE <david.ponce@wanadoo.fr> writes:

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

> Thanks for your patch. I tried it and when I compiled recentf.el
> I got this message:

> Compiling /home/ponce/installs/emacs/lisp/recentf.el...
> File local-variables error: (error "Local variables list is not
> properly terminated")
> Wrote /home/ponce/installs/emacs/lisp/recentf.elc

> This is because the ";;; Local Variables:\n" string confused
> `hack-local-variables'!

> Here is a new patch that fix that.

Ah!  Thank you for the fix.  Anyway, does it work as
expected?   Shall I commit it?

---
Ken'ichi HANDA
handa@m17n.org

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [david.reitter@gmail.com: recentf: "Select coding system" on quit]
  2005-04-22  0:43 ` Kenichi Handa
@ 2005-04-22  5:30   ` David Reitter
  2005-04-22  5:40     ` Kenichi Handa
  0 siblings, 1 reply; 14+ messages in thread
From: David Reitter @ 2005-04-22  5:30 UTC (permalink / raw)
  Cc: david.ponce, rms, emacs-devel


On 22 Apr 2005, at 01:43, Kenichi Handa wrote:

> Ah!  Thank you for the fix.  Anyway, does it work as
> expected?   Shall I commit it?
>

Yes, it fixes the issue for me.
Thanks for everybody's patches!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [david.reitter@gmail.com: recentf: "Select coding system" on quit]
  2005-04-22  5:30   ` David Reitter
@ 2005-04-22  5:40     ` Kenichi Handa
  2005-04-22  7:58       ` David Kastrup
  0 siblings, 1 reply; 14+ messages in thread
From: Kenichi Handa @ 2005-04-22  5:40 UTC (permalink / raw)
  Cc: david.ponce, rms, emacs-devel

In article <139e63bed8ac36b91c33a4b51c3fe2bc@gmail.com>, David Reitter <david.reitter@gmail.com> writes:

> On 22 Apr 2005, at 01:43, Kenichi Handa wrote:

>>  Ah!  Thank you for the fix.  Anyway, does it work as
>>  expected?   Shall I commit it?

> Yes, it fixes the issue for me.

Ok, I've just installed the last version sent from David
<david.ponce@wanadoo.fr>.

---
Ken'ichi HANDA
handa@m17n.org

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [david.reitter@gmail.com: recentf: "Select coding system" on quit]
  2005-04-22  5:40     ` Kenichi Handa
@ 2005-04-22  7:58       ` David Kastrup
  2005-04-22 13:07         ` Kenichi Handa
  0 siblings, 1 reply; 14+ messages in thread
From: David Kastrup @ 2005-04-22  7:58 UTC (permalink / raw)
  Cc: David Reitter, david.ponce, rms, emacs-devel

Kenichi Handa <handa@m17n.org> writes:

> In article <139e63bed8ac36b91c33a4b51c3fe2bc@gmail.com>, David Reitter <david.reitter@gmail.com> writes:
>
>> On 22 Apr 2005, at 01:43, Kenichi Handa wrote:
>
>>>  Ah!  Thank you for the fix.  Anyway, does it work as
>>>  expected?   Shall I commit it?
>
>> Yes, it fixes the issue for me.
>
> Ok, I've just installed the last version sent from David
> <david.ponce@wanadoo.fr>.

Please, it has been pointed out already that this is not the proper
way to fix it.  It makes the source very unreadable.

Instead, you should just place a formfeed character (^L) after the
last function in the file.  Local variable sections are not detected
before such a character, and it is precisely for this purpose.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [david.reitter@gmail.com: recentf: "Select coding system" on quit]
@ 2005-04-22  8:11 David PONCE
  0 siblings, 0 replies; 14+ messages in thread
From: David PONCE @ 2005-04-22  8:11 UTC (permalink / raw)
  Cc: david.reitter, emacs-devel, rms, handa

Hi,

>>Ok, I've just installed the last version sent from David
>><david.ponce@wanadoo.fr>.
> 
> 
> Please, it has been pointed out already that this is not the proper
> way to fix it.  It makes the source very unreadable.
> 
> Instead, you should just place a formfeed character (^L) after the
> last function in the file.  Local variable sections are not detected
> before such a character, and it is precisely for this purpose.
> 

This is what my latest patch just do.
I don't know why my message with that patch hasn't been sent to the devel ML?

David

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [david.reitter@gmail.com: recentf: "Select coding system" on quit]
  2005-04-22  7:58       ` David Kastrup
@ 2005-04-22 13:07         ` Kenichi Handa
  0 siblings, 0 replies; 14+ messages in thread
From: Kenichi Handa @ 2005-04-22 13:07 UTC (permalink / raw)
  Cc: david.reitter, david.ponce, rms, emacs-devel

In article <85zmvrmedr.fsf@lola.goethe.zz>, David Kastrup <dak@gnu.org> writes:
>>  Ok, I've just installed the last version sent from David
>>  <david.ponce@wanadoo.fr>.

> Please, it has been pointed out already that this is not the proper
> way to fix it.  It makes the source very unreadable.

> Instead, you should just place a formfeed character (^L) after the
> last function in the file.  Local variable sections are not detected
> before such a character, and it is precisely for this purpose.

As David <david.ponce@wanadoo.fr> wrote, that's what I
installed.  See the attached change.

---
Ken'ichi HANDA
handa@m17n.org

Index: recentf.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/recentf.el,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -c -r1.35 -r1.36
cvs diff: conflicting specifications of output style
*** recentf.el	23 Mar 2005 07:20:48 -0000	1.35
--- recentf.el	22 Apr 2005 05:38:29 -0000	1.36
***************
*** 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 "\n\f\n;;; Local Variables:\n"
+ 		(format ";;; coding: %s\n" recentf-save-file-coding-system)
+ 		";;; End:\n")
  	(write-file (expand-file-name recentf-save-file))
  	nil)
      (error
***************
*** 1207,1212 ****
  (provide 'recentf)
  
  (run-hooks 'recentf-load-hook)
! 
  ;;; arch-tag: 78f1eec9-0d16-4d19-a4eb-2e4529edb62a
  ;;; recentf.el ends here
--- 1217,1222 ----
  (provide 'recentf)
  
  (run-hooks 'recentf-load-hook)
! \f
  ;;; arch-tag: 78f1eec9-0d16-4d19-a4eb-2e4529edb62a
  ;;; recentf.el ends here

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [david.reitter@gmail.com: recentf: "Select coding system" on quit]
  2005-04-21 17:10   ` David Ponce
@ 2005-04-23  6:59     ` David Kastrup
  2005-04-23 22:24       ` Richard Stallman
  0 siblings, 1 reply; 14+ messages in thread
From: David Kastrup @ 2005-04-23  6:59 UTC (permalink / raw)


David Ponce <david.ponce@wanadoo.fr> writes:

>> Isn't inserting a ^L at the proper place the canonical solution?

> Yes you're right.  Following is a new patch.

with headers:

> Received: from [199.232.41.67] (helo=mx20.gnu.org)
> 	by monty-python.gnu.org with esmtp (TLS-1.0:RSA_ARCFOUR_SHA:16)
> 	(Exim 4.34) id 1DP9E7-0006L8-Is
> 	for emacs-devel@gnu.org; Fri, 22 Apr 2005 21:14:31 -0400
> Received: from [193.252.22.24] (helo=smtp7.wanadoo.fr)
> 	by mx20.gnu.org with esmtp (Exim 4.34) id 1DOfBk-000611-89
> 	for emacs-devel@gnu.org; Thu, 21 Apr 2005 13:10:04 -0400

Well, small wonder I did not get to see the patch.  While everybody
else was in on the joke by being in the "Cc:" list, the poor mortals
served by emacs-devel only were foiled by mx20 refusing to talk to
monty-python for more than a day...

Is this something one should tell anybody, and if so who?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [david.reitter@gmail.com: recentf: "Select coding system" on quit]
  2005-04-23  6:59     ` David Kastrup
@ 2005-04-23 22:24       ` Richard Stallman
  0 siblings, 0 replies; 14+ messages in thread
From: Richard Stallman @ 2005-04-23 22:24 UTC (permalink / raw)
  Cc: emacs-devel

    Well, small wonder I did not get to see the patch.  While everybody
    else was in on the joke by being in the "Cc:" list, the poor mortals
    served by emacs-devel only were foiled by mx20 refusing to talk to
    monty-python for more than a day...

That's probably because they were down.  The FSF is moving offices.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-04-23 22:24 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-22  8:11 [david.reitter@gmail.com: recentf: "Select coding system" on quit] David PONCE
  -- strict thread matches above, loose matches on Subject: below --
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
     [not found] <E1DNFJN-0005VA-0Z@fencepost.gnu.org>
2005-04-21  5:37 ` Kenichi Handa
2005-04-21 19:55   ` Richard Stallman

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).