unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 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-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
[parent not found: <E1DNFJN-0005VA-0Z@fencepost.gnu.org>]

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-21 15:16 [david.reitter@gmail.com: recentf: "Select coding system" on quit] 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
     [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).