GNU bug report logs - #5235
23.1; Unibyte keyboard input problem

Previous Next

Package: emacs;

Reported by: Tomasz Zbrożek <scianagoryczy <at> wp.pl>

Date: Wed, 16 Dec 2009 21:25:05 UTC

Severity: normal

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #62 received at 5235 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tomasz Zbrożek <scianagoryczy <at> wp.pl>
Cc: 5235 <at> debbugs.gnu.org
Subject: Re: bug#5235: 23.1; Unibyte keyboard input problem
Date: Sat, 26 Dec 2009 23:24:47 +0200
> From: Tomasz Zbrożek <scianagoryczy <at> wp.pl>
> Date: Sat, 26 Dec 2009 20:19:38 +0100
> 
> >So does this mean using latin-2 solves your original problem as well?
> >That is, are you able to edit the source files without the annoying
> >questions from Emacs when you save the files?
> 
> No, latin-2 does not solve my problem:) I do not want to read/write file in 
> latin-2 but cp1250! 

Does the patch below give good results?

You will need to rebuild Emacs or manually load mule-cmds.elc, after
patching and compiling it.  Then set
select-safe-coding-system-respect-auto-coding to a non-nil value, and
see if the annoying question goes away while the files are saved
correctly without screwing up the cp852 characters.

Index: lisp/international/mule-cmds.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/international/mule-cmds.el,v
retrieving revision 1.386
diff -u -r1.386 mule-cmds.el
--- lisp/international/mule-cmds.el	9 Dec 2009 00:55:55 -0000	1.386
+++ lisp/international/mule-cmds.el	26 Dec 2009 21:21:17 -0000
@@ -807,6 +807,9 @@
     (set-window-configuration window-configuration)
     coding-system))
 
+(defvar select-safe-coding-system-respect-auto-coding nil
+  "If non-nil, always use coding system from coding cookies &c if possible.")
+
 (defun select-safe-coding-system (from to &optional default-coding-system
 				       accept-default-p file)
   "Ask a user to select a safe coding system from candidates.
@@ -976,7 +979,14 @@
 		(push (car elt) safe))
 	    (push (car elt) unsafe)))
 	(if safe
-	    (setq coding-system (car safe))))
+	    (setq coding-system (car safe))
+	  ;; If default-coding-system is in unsafe, and the user
+	  ;; insists, use it.
+	  (if (and select-safe-coding-system-respect-auto-coding
+		   default-coding-system
+		   (memq (caar default-coding-system) unsafe))
+	      (setq coding-system (caar default-coding-system)))))
+
 
       ;; If all the defaults failed, ask a user.
       (when (not coding-system)





This bug report was last modified 4 years and 301 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.