GNU bug report logs - #4817
unclear value type of select-safe-coding-system-accept-default-p

Previous Next

Package: emacs;

Reported by: eisinger <at> informatik.uni-muenchen.de

Date: Tue, 27 Oct 2009 23:10:07 UTC

Severity: normal

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 4817 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: eisinger <at> informatik.uni-muenchen.de
Cc: 4817 <at> debbugs.gnu.org
Subject: Re: bug#4817: unclear value type of select-safe-coding-system-accept-default-p
Date: Fri, 30 Oct 2009 22:24:41 -0400
Norbert Eisinger wrote:

> Alternative 1:
> The value of select-safe-coding-system-accept-default-p can be either nil
> or a symbol naming a coding system (e.g., mule-utf-8-unix)

No.

C-h v select-safe-coding-system-accept-default-p makes it pretty clear
to me:

   If non-nil, a function to control the behavior of coding system
   selection. The meaning is the same as the argument ACCEPT-DEFAULT-P of
   the function `select-safe-coding-system' (which see). This variable
   overrides that argument.

> The value of select-safe-coding-system-accept-default-p can be either nil
> or a one-argument function that returns either nil or a symbol naming a
> coding system.

Almost. It should be either nil or a one-argument function that
returns nil only if the coding system silently selected by
select-safe-coding-system is to be rejected. Any non-nil return value
means "accept the coding system automatically selected".

> (custom-set-variables
>  ;; ...
>  '(select-safe-coding-system-accept-default-p
>     (function (lambda (coding-system)
>       (read-coding-system (format "Coding system [%s]: " coding-system)
>                           coding-system))))
> )

Therefore this makes no sense.

> (custom-set-variables
>  ;; ...
>  '(select-safe-coding-system-accept-default-p
>     (function (lambda (coding-system) nil)))
> )

This would make sense, meaning "always reject the automatically
selected coding system", and prompt the user instead.

> However, when I cause a situation where this code is evaluated, I get
>
> select-safe-coding-system: Wrong type argument: listp, mule-utf-8-unix

The example that makes sense works for me.

If you still have a problem, please provide more details on exactly
what you are doing.



This bug report was last modified 15 years and 207 days ago.

Previous Next


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