all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Tomasz Zbrożek" <scianagoryczy@wp.pl>
Cc: 5235@emacsbugs.donarmstrong.com
Subject: bug#5235: 23.1; Unibyte keyboard input problem
Date: Sat, 26 Dec 2009 23:24:47 +0200	[thread overview]
Message-ID: <833a2x5syo.fsf@gnu.org> (raw)
In-Reply-To: <200912262019.38898.scianagoryczy@wp.pl>

> From: Tomasz Zbrożek <scianagoryczy@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)







  reply	other threads:[~2009-12-26 21:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-26 19:19 bug#5235: 23.1; Unibyte keyboard input problem Tomasz Zbrożek
2009-12-26 21:24 ` Eli Zaretskii [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-12-27 13:30 Tomasz Zbrożek
2009-12-27 20:07 ` Eli Zaretskii
2009-12-29 15:48   ` Stefan Monnier
2009-12-26 17:03 Tomasz Zbrożek
2009-12-26 17:52 ` Eli Zaretskii
2009-12-16 21:17 Tomasz Zbrożek
2009-12-17 16:47 ` Jason Rumney
2009-12-17 19:25   ` Tomasz Zbrożek
2009-12-24  3:40     ` Stefan Monnier
2009-12-24 15:21       ` Jason Rumney
2009-12-24 19:27         ` Eli Zaretskii
2009-12-25 11:03         ` Tomasz Zbrożek
2009-12-25 11:23           ` Jason Rumney
2009-12-25 11:43             ` Tomasz Zbrożek
2009-12-26 12:45             ` Tomasz Zbrożek
2009-12-26 14:30               ` Eli Zaretskii
2009-12-25 20:42           ` Eli Zaretskii
2009-12-29 15:43         ` Stefan Monnier
2010-02-26 20:42 ` Tomasz Zbrożek
2010-02-26 23:42   ` Eli Zaretskii
2020-09-14 13:59 ` Lars Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=833a2x5syo.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=5235@debbugs.gnu.org \
    --cc=5235@emacsbugs.donarmstrong.com \
    --cc=scianagoryczy@wp.pl \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.