From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#2738: Content-free doc string: `handle-shift-selection'. Date: Sun, 22 Mar 2009 22:59:15 +0000 Message-ID: <20090322225915.GA4466@muc.de> References: <20090321172343.GB6890@muc.de> Reply-To: Alan Mackenzie , 2738@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1237764244 21391 80.91.229.12 (22 Mar 2009 23:24:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Mar 2009 23:24:04 +0000 (UTC) Cc: 2738@emacsbugs.donarmstrong.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 23 00:25:21 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LlX2e-0007Ta-8N for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Mar 2009 00:25:20 +0100 Original-Received: from localhost ([127.0.0.1]:43628 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LlX1H-0007by-Bg for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Mar 2009 19:23:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LlX1C-0007ZC-FX for bug-gnu-emacs@gnu.org; Sun, 22 Mar 2009 19:23:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LlX18-0007Yk-T5 for bug-gnu-emacs@gnu.org; Sun, 22 Mar 2009 19:23:50 -0400 Original-Received: from [199.232.76.173] (port=60697 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LlX18-0007Yf-Mb for bug-gnu-emacs@gnu.org; Sun, 22 Mar 2009 19:23:46 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:41305) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LlX18-0003qG-83 for bug-gnu-emacs@gnu.org; Sun, 22 Mar 2009 19:23:46 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2MNNie5021478; Sun, 22 Mar 2009 16:23:44 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n2MN55EX016494; Sun, 22 Mar 2009 16:05:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Alan Mackenzie Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 22 Mar 2009 23:05:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2738 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 2738-submit@emacsbugs.donarmstrong.com id=B2738.123776280514446 (code B ref 2738); Sun, 22 Mar 2009 23:05:04 +0000 Original-Received: (at 2738) by emacsbugs.donarmstrong.com; 22 Mar 2009 23:00:05 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mail.muc.de (qmailr@colin.muc.de [193.149.48.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2MMxx4Q014290 for <2738@emacsbugs.donarmstrong.com>; Sun, 22 Mar 2009 16:00:01 -0700 Original-Received: (qmail 94639 invoked by uid 3782); 22 Mar 2009 22:59:58 -0000 Original-Received: from acm.muc.de (pD9E51412.dip.t-dialin.net [217.229.20.18]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sun, 22 Mar 2009 23:59:55 +0100 Original-Received: (qmail 13901 invoked by uid 1000); 22 Mar 2009 22:59:15 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sun, 22 Mar 2009 19:23:50 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:26560 Archived-At: Hi, Eli! On Sat, Mar 21, 2009 at 08:46:54PM +0200, Eli Zaretskii wrote: > > Date: Sat, 21 Mar 2009 17:23:43 +0000 > > From: Alan Mackenzie > > Cc: > > The doc-string for `handle-shift-selection' is of little or no help in > > informing the reader what the function does. It is, in fact, > > infuriatingly useless. This should be fixed. > I changed it to say this: > "Activate/deactivate mark depending on invocation thru ``shift translation.'' > \(See `this-command-keys-shift-translated' for the meaning of > shift translation.) > This is called whenever a command with a `^' character in its > `interactive' spec is invoked while `shift-select-mode' is > non-nil. > If the command was invoked through shift translation, set the > mark and activate the region temporarily, unless it was already > set in this way. If the command was invoked without shift > translation, or if the optional argument DEACTIVATE is non-nil, > deactivate the mark if the region is temporarily active." > Is this good enough to close the bug? If not, please tell what still > needs improvement. I don't think it is. I'm not sure this function can be documented coherently. I think it's a bad function. Sorry, I'm not being very constructive here. I just find the whole thing distasteful in the extreme, the idea that rather than binding commands to key sequences, with a clean separation between the interactive commander, the key sequences and the commands, we've now got a hodge podge where the command loop now actually performs part of a command's function - sometimes, depending on the key binding. In fact, how about just saying something like "this function ensures the mark is set for a movement command making a CUA region", or something like that? In addition this, the function is buggy. It spuriously enables transient-mark-mode in certain circumstances (I'll be submitting a bug report soon). [ .... ] > > If the command was invoked through shift-translation, > > "THROUGH" shift-translation. Is "shift-translation" some sort of > > processing step? Is a translation being shifted here, or is a shift > > being translated? > I added a direct link to where shift-translation is explained. > (Before that, it was reachable only from the doc string of > `shift-select-mode', i.e. by following one more link.) Thanks! > > set the mark and activate the region temporarily, unless it was > > already set in this way. If the command was invoked without > > shift-translation and a region is temporarily active, deactivate > > the mark. > > This reads like a flowchart, and it's uncomfortably close to > > gibberish. Is it not possible to state the function's FUNCTION, > > rather than leaving the reader to figure this out from its > > quasi-flowchart? > Is the replacement better? A bit better, yes. > > When getting arguments from the user, what does "^" at the beginning of > > the string instruct the command loop to do? > This is not about getting arguments, this is about the `interactive' > spec, as the doc string says. See "(elisp)Interactive Codes". Does this bit not perhaps need a warning that "^" in an interactive spec is really intended for Emacs's internal use and will throw an error on anything but Emacs 23 (or later)? -- Alan Mackenzie (Nuremberg, Germany).