summaryrefslogtreecommitdiff
path: root/lisp/international
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-05-11 01:22:35 +0000
committerRichard M. Stallman <rms@gnu.org>1998-05-11 01:22:35 +0000
commite73ce3b5be42e51157c9d530e0ec1b0d2e31ddce (patch)
treeee20b7cdec8207770942394db3b6b778c173062f /lisp/international
parent0c92bce265961b89578e5179f45780bad456908c (diff)
downloademacs-e73ce3b5be42e51157c9d530e0ec1b0d2e31ddce.tar.gz
(last-coding-system-specified): New var.
(select-safe-coding-system): Set var if user specifies a coding system.
Diffstat (limited to 'lisp/international')
-rw-r--r--lisp/international/mule-cmds.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 305bf256a61..cf80099e437 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -303,6 +303,13 @@ CHARSETS is a list of character sets."
(sort codings (function (lambda (x y) (> (car x) (car y))))))
)))
+(defvar last-coding-system-specified nil
+ "Most recent coding system explicitly specified by the user when asked.
+This variable is set whenever Emacs asks the user which coding system
+to use in order to write a file. If you set it to nil explicitly,
+then call `write-region', then afterward this variable will be non-nil
+only if the user was explicitly asked and specified a coding system.")
+
(defun select-safe-coding-system (from to &optional default-coding-system)
"Ask a user to select a safe coding system from candidates.
The candidates of coding systems which can safely encode a text
@@ -364,7 +371,7 @@ Please select one from the following safe coding systems:\n"
(format "Select coding system (default %s): "
(car safe-coding-systems))
safe-names nil t nil nil (car (car safe-names)))))
- (intern name))
+ (setq last-coding-system-specified (intern name)))
(kill-buffer "*Warning*"))))))
(setq select-safe-coding-system-function 'select-safe-coding-system)