From eisinger@informatik.uni-muenchen.de Tue Oct 27 16:04:02 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 27 Oct 2009 23:04:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9RN41A8007855 for ; Tue, 27 Oct 2009 16:04:02 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N2v57-0005iL-3D for bug-gnu-emacs@gnu.org; Tue, 27 Oct 2009 19:04:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N2v51-0005hl-Og for bug-gnu-emacs@gnu.org; Tue, 27 Oct 2009 19:04:00 -0400 Received: from [199.232.76.173] (port=58059 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N2v51-0005hi-M4 for bug-gnu-emacs@gnu.org; Tue, 27 Oct 2009 19:03:55 -0400 Received: from acheron.ifi.lmu.de ([129.187.214.135]:46465) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N2v50-0002oV-VG for bug-gnu-emacs@gnu.org; Tue, 27 Oct 2009 19:03:55 -0400 Received: from [10.153.74.162] (koro.pms.ifi.lmu.de [141.84.9.33]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: eisinger) by acheron.ifi.lmu.de (Postfix) with ESMTP id 5D52E94A082 for ; Wed, 28 Oct 2009 00:03:54 +0100 (CET) Message-ID: <4AE77C63.3020004@informatik.uni-muenchen.de> Date: Wed, 28 Oct 2009 00:04:03 +0100 From: Norbert Eisinger Reply-To: eisinger@informatik.uni-muenchen.de User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: unclear value type of select-safe-coding-system-accept-default-p Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) GNU Emacs Lisp Reference Manual 33.9.4 User-Chosen Coding Systems Function: select-safe-coding-system from to &optional default-coding-system accept-default-p file Quotation 1: > The optional argument accept-default-p, if non-nil, should be a > function to determine whether a coding system selected without user > interaction is acceptable. select-safe-coding-system calls this > function with one argument, the base coding system of the selected > coding system. If accept-default-p returns nil, > select-safe-coding-system rejects the silently selected coding system, > and asks the user to select a coding system from a list of possible > candidates. Quotation 2: > If the variable select-safe-coding-system-accept-default-p is non-nil, > its value overrides the value of accept-default-p. I cannot quite decide which of the following two alternatives is the problem: ========================================================================= 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) In this case the sentence in quotation 2 might need some rephrasing, such as "..., its value overrides the value returned by the function that is the actual argument for accept-default-p" ========================================================================= Alternative 2: 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. If this is what quotation 2 means (and I understood it to mean this), one of the following entries in the init file would seem to make sense: (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)))) ) or (custom-set-variables ;; ... '(select-safe-coding-system-accept-default-p (function (lambda (coding-system) nil))) ) 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 ========================================================================= Norbert Eisinger From rgm@gnu.org Fri Oct 30 19:24:43 2009 Received: (at 4817) by emacsbugs.donarmstrong.com; 31 Oct 2009 02:24:43 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-7.4 required=4.0 tests=AWL,HAS_BUG_NUMBER, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9V2OgKQ031119 for <4817@emacsbugs.donarmstrong.com>; Fri, 30 Oct 2009 19:24:43 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1N43dx-0001GI-4A; Fri, 30 Oct 2009 22:24:41 -0400 From: Glenn Morris To: eisinger@informatik.uni-muenchen.de Cc: 4817@debbugs.gnu.org Subject: Re: bug#4817: unclear value type of select-safe-coding-system-accept-default-p References: <4AE77C63.3020004@informatik.uni-muenchen.de> X-Spook: kilderkin Mafia number key AIEWS ANC Ceridian Delta Force X-Ran: ,^iw{;CF`P&[IG|bWM"b$iy'Y`3V;}AB$;6#ya{O?4M.g"m$3u User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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. From eisinger@informatik.uni-muenchen.de Sat Oct 31 11:08:20 2009 Received: (at 4817) by emacsbugs.donarmstrong.com; 31 Oct 2009 18:08:20 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.2 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from acheron.ifi.lmu.de (acheron.ifi.lmu.de [129.187.214.135]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9VI8IWO011112 for <4817@emacsbugs.donarmstrong.com>; Sat, 31 Oct 2009 11:08:19 -0700 Received: from [10.153.74.162] (koro.pms.ifi.lmu.de [141.84.9.33]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: eisinger) by acheron.ifi.lmu.de (Postfix) with ESMTP id 00FD694A0EF; Sat, 31 Oct 2009 19:08:18 +0100 (CET) Message-ID: <4AEC7D13.8010106@informatik.uni-muenchen.de> Date: Sat, 31 Oct 2009 19:08:19 +0100 From: Norbert Eisinger Reply-To: eisinger@informatik.uni-muenchen.de User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Glenn Morris CC: 4817@debbugs.gnu.org Subject: Re: bug#4817: unclear value type of select-safe-coding-system-accept-default-p References: <4AE77C63.3020004@informatik.uni-muenchen.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Glenn Morris wrote: > > 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. Yes, this is much clearer than the text in the Reference Manual. Maybe something like this could be added to the Reference Manual to say explicitly that the variable's value is a function? >> (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. Good, that's exactly what I wanted to achieve. > The example that makes sense works for me. > > If you still have a problem, please provide more details on exactly > what you are doing. I suggest to close this issue here because I am discussing related problems in a different thread (bug#4816). I reported bug#4817 separately because I considered it a mere documentation issue. Thanks for explaining select-safe-coding-system-accept-default-p, your explanations answered my questions much better than the documentation did. Norbert From rgm@gnu.org Sat Oct 31 12:44:39 2009 Received: (at 4817-done) by emacsbugs.donarmstrong.com; 31 Oct 2009 19:44:39 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-7.3 required=4.0 tests=AWL,HAS_BUG_NUMBER, X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9VJicAD021999 for <4817-done@emacsbugs.donarmstrong.com>; Sat, 31 Oct 2009 12:44:39 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1N4JsK-00077Y-Bz; Sat, 31 Oct 2009 15:44:36 -0400 From: Glenn Morris To: 4817-done@debbugs.gnu.org Subject: Re: bug#4817: unclear value type of select-safe-coding-system-accept-default-p References: <4AE77C63.3020004@informatik.uni-muenchen.de> <4AEC7D13.8010106@informatik.uni-muenchen.de> X-Spook: Verisign United Nations Blowfish Kh-11 SAPO AK-47 X-Ran: GIz0Gn%"8uI-y-Y,\G|{=*qsF/Zo&[^_ (Norbert Eisinger's message of "Sat, 31 Oct 2009 19:08:19 +0100") Message-ID: <8zmy37cpqz.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Thanks, I tweaked the manual a bit. From unknown Sat Jun 21 05:05:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 29 Nov 2009 15:24:11 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator