From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vinicius Jose Latorre Newsgroups: gmane.emacs.devel Subject: Re: blank-mode.el Date: Sun, 28 Oct 2007 20:04:19 -0300 Message-ID: <47251573.90509@ig.com.br> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1193608793 19213 80.91.229.12 (28 Oct 2007 21:59:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Oct 2007 21:59:53 +0000 (UTC) Cc: "GNU Emacs \(devel\)" To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 28 22:59:55 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ImGAk-0002hA-0N for ged-emacs-devel@m.gmane.org; Sun, 28 Oct 2007 22:59:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ImGAb-0004Tf-4p for ged-emacs-devel@m.gmane.org; Sun, 28 Oct 2007 17:59:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ImGAY-0004TL-6D for emacs-devel@gnu.org; Sun, 28 Oct 2007 17:59:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ImGAV-0004Sc-Fe for emacs-devel@gnu.org; Sun, 28 Oct 2007 17:59:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ImGAV-0004SZ-AN for emacs-devel@gnu.org; Sun, 28 Oct 2007 17:59:39 -0400 Original-Received: from an-out-0708.google.com ([209.85.132.246]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ImGAU-00076y-Ry for emacs-devel@gnu.org; Sun, 28 Oct 2007 17:59:39 -0400 Original-Received: by an-out-0708.google.com with SMTP id c38so170775ana for ; Sun, 28 Oct 2007 14:59:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; bh=ifgxmaQ6lV1shGblqbc9SG5vNaYS5BF+deLr1vKi/hM=; b=BKEPI6gu5y7qAUZHbCqGavWDld0Pvpo8V3TxC/KYC/P0DxpZaB+24tOu3MIDhHLq35kcTxdYxjk9AKNTqz0EbTacJ3nme5wGG9KTJG+cnrWEif+3bZ3DS6hKD7xmyLMM2fyxo56jqUgnEHqw6S+Gjd1MztC+FPWYgFyeCG1zPvs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=cIXu9dQrQ2YsqP6SjV1OanQHJzAgsz6Go/36EWpSHAbp5ahnJEHnjw9Yj44P3AHzV68hzqgm35ZyEsP2xL6SYYhjASrbcAmFx7CyZKgMyfcbcb6nPoWaWeS/Rt+1NWG6HZZYEHBlxY5yXWif5BSuc6yDECtsurJepRa7b2oBhGo= Original-Received: by 10.100.231.16 with SMTP id d16mr299223anh.1193608778133; Sun, 28 Oct 2007 14:59:38 -0700 (PDT) Original-Received: from ?192.168.0.100? ( [201.82.40.223]) by mx.google.com with ESMTPS id d35sm6710347and.2007.10.28.14.59.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 28 Oct 2007 14:59:36 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8) Gecko/20071009 SeaMonkey/1.1.5 In-Reply-To: X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:81994 Archived-At: Drew Adams wrote: >>> User option `blank-chars' specifies which blank characters to >>> highlight, but it would be good to also have commands to toggle >>> each highlighting type. For example, `M-x blank-toggle-trailing' >>> and `M-x blank-toggle-tabs'. And it would be good to have this >>> for both local and global use: `blank-toggle-tabs-global', in >>> addition to `blank-toggle-tabs'. >> Hummm, maybe a better approach could be to pass a list to blank-mode or >> blank-global-mode like: >> >> ; turn on local blank-mode but only highlight trailing spaces and spaces >> before tab >> (blank-mode '(trailing space-before-tab)) >> >> So, the command above is the same as the following sequence: >> >> (blank-mode nil) >> (setq blank-chars '(trailing space-before-tab)) >> (blank-mode t) > > What would that mean interactively? Indeed, I was thinking only in terms of an ELisp code. > Would the user need to decide which > chars to highlight each time s?he used the mode command? Well, the user always have to decide which blank to highlight via a toggle command interactively or via a list in an ELisp code. > How would s?he > specify those chars - input their names with completion? Interactively, well, it could pass an ELisp expression, if the command uses (interactive "X"). Hummm, this doesn't seem to be a good thing to do. > What if s?he just > wants the default (current) `blank-chars' - does s?he still need to specify > all the chars to highlight when turning on the mode? Interactively, it could pass an ELisp expression, so it could pass blank-chars var as an argument. > I don't think the choice of what to highlight should be connected with the > mode command. That should remain a simple toggle, just turning on/off > highlighting as specified by the current value of `blank-chars'. Much of the > time, that will be all a user needs. > > I'd prefer to have a separate toggle command for each kind of blank > highlighting - those commands would only change the value of `blank-chars'. > That, to me, is the most convenient for the user - more convenient than > `set-variable' or `customize-option', and more convenient that coupling > highlighting changes with the mode command. > > Second best is just using `set-variable' (but that requires you to specify > each of the chars to highlight). IIUC, least convenient of all, IMO, is > coupling the minor-mode command with the chars choice. > > My suggestion lets users change the highlighting by expressing only the > delta - not all of the chars to highlight, but just what to change. Ok, instead of modifying blank-mode behavior passing a list, we could have the following commands: blank-toggle blank-global-toggle When activated interactively, it asks to user which feature to highlight (it could be via a menu, in a similar way that C-h behaves). The menu options could be something like: t - tabs s - spaces and hard spaces r - trailing blanks b - spaces before tab l - lines ? - display the menu So, if blank-toggle is binded to a key, for example, C-c b, then the user could type: C-c b t toggle tabs C-c b s toggle spaces and hard spaces C-c b r toggle trailing blanks C-c b b toggle spaces before tab C-c b l toggle lines Or the user could type: M-x blank-toggle RET t M-x blank-toggle RET s etc. And via ELisp code, it could pass a symbol like: (blank-toggle 'trailing) (blank-toggle 'space-before-tab) etc. Also, via ELisp code, it could pass a list like: (blank-toggle '(trailing space-before-tab)) > Just one opinion. Thanks for your opinion.