From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: Defaults for set-variable Date: Mon, 31 Oct 2005 11:22:59 -0800 Message-ID: References: <87br1o5f6s.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1130786729 1435 80.91.229.2 (31 Oct 2005 19:25:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 31 Oct 2005 19:25:29 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 31 20:25:19 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EWfGS-0001jF-66 for ged-emacs-devel@m.gmane.org; Mon, 31 Oct 2005 20:24:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EWfGR-0002YC-GH for ged-emacs-devel@m.gmane.org; Mon, 31 Oct 2005 14:24:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EWfFL-00027J-UC for emacs-devel@gnu.org; Mon, 31 Oct 2005 14:23:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EWfFJ-000266-UR for emacs-devel@gnu.org; Mon, 31 Oct 2005 14:23:07 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EWfFJ-00025s-LT for emacs-devel@gnu.org; Mon, 31 Oct 2005 14:23:05 -0500 Original-Received: from [148.87.122.32] (helo=rgminet03.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EWfFJ-0001Th-IZ for emacs-devel@gnu.org; Mon, 31 Oct 2005 14:23:05 -0500 Original-Received: from rgmsgw301.us.oracle.com (rgmsgw301.us.oracle.com [138.1.186.50]) by rgminet03.oracle.com (Switch-3.1.6/Switch-3.1.7) with ESMTP id j9VJN0uS028952 for ; Mon, 31 Oct 2005 12:23:00 -0700 Original-Received: from rgmsgw301.us.oracle.com (localhost [127.0.0.1]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id j9VJN0Nl012421 for ; Mon, 31 Oct 2005 12:23:00 -0700 Original-Received: from dradamslap (dradams-lap.us.oracle.com [130.35.177.126]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id j9VJMxSx012401 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Mon, 31 Oct 2005 12:22:59 -0700 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <87br1o5f6s.fsf@jurta.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:45191 Archived-At: I want to fix a bug in `set-variable' related to its default values. It uses `read-variable' to read the name of a user variable (a variable for which `user-variable-p' returns non-nil). But there is one case where `set-variable' doesn't follow this requirement: when a non-user variable name happens to be under point, it picks it up from the buffer as a default value, and if the user types RET, it accepts a non-user variable as a variable name argument of `set-variable'. The first hunk in the following patch fixes this by testing the name of the default variable by `user-variable-p'. The behavior before the fix was inconsistent, but it was sometimes useful (a "feature"?). The fix makes sense, but it's too bad to lose a command that sets a non user-option variable. (One could even use completion to get the variable name: `C-h v foo TAB RET'; `M-x set-variable RET RET'.) It's convenient to have a command to do this, as a shortcut for M-: `(setq ...)' - with `C-u' local option and no eval of value. Any chance of having a separate command, which works for any variable? What's a bit unfortunate is that the name `set-variable' is already taken (it really means `set-user-option'). `set-any-variable'?