Skip to content

Commit

Permalink
international/mule-cmds.el (select-safe-coding-system): Remove a supe…
Browse files Browse the repository at this point in the history
…rfluous condition in chekcing whether a coding system is safe or not.
  • Loading branch information
K. Handa committed Oct 13, 2013
1 parent 558dbba commit f55a6d8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lisp/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2013-10-13 Kenichi Handa <handa@gnu.org>

* international/mule-cmds.el (select-safe-coding-system): Remove a
superfluous condition in chekcing whether a coding system is safe
or not.

2013-10-11 Stefan Monnier <monnier@iro.umontreal.ca>

* progmodes/sh-script.el: Provide simpl(e|istic) completion.
Expand Down
8 changes: 6 additions & 2 deletions lisp/international/mule-cmds.el
Original file line number Diff line number Diff line change
Expand Up @@ -976,13 +976,17 @@ It is highly recommended to fix it before writing to a file."

;; Classify the defaults into safe, rejected, and unsafe.
(dolist (elt default-coding-system)
(if (or (eq (coding-system-type (car elt)) 'undecided)
(memq (cdr elt) codings))
(if (memq (cdr elt) codings)
;; This is safe. Is it acceptable?
(if (and (functionp accept-default-p)
(not (funcall accept-default-p (cdr elt))))
;; No, not acceptable.
(push (car elt) rejected)
;; Yes, acceptable.
(push (car elt) safe))
;; This is not safe.
(push (car elt) unsafe)))
;; If there are safe ones, the first one is what we want.
(if safe
(setq coding-system (car safe))))

Expand Down

0 comments on commit f55a6d8

Please sign in to comment.