From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.devel Subject: Re: Ibuffer: w and B default to buffer at current line Date: Thu, 15 Sep 2016 15:05:20 -0700 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1473977280 13585 195.159.176.226 (15 Sep 2016 22:08:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Sep 2016 22:08:00 +0000 (UTC) User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1 (darwin) Cc: Emacs developers To: Tino Calancha Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 16 00:07:54 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkeou-0002KF-GW for ged-emacs-devel@m.gmane.org; Fri, 16 Sep 2016 00:07:48 +0200 Original-Received: from localhost ([::1]:37631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkeos-0002xy-Mv for ged-emacs-devel@m.gmane.org; Thu, 15 Sep 2016 18:07:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkeo1-0002uZ-1S for emacs-devel@gnu.org; Thu, 15 Sep 2016 18:06:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkenv-0008Ro-UU for emacs-devel@gnu.org; Thu, 15 Sep 2016 18:06:51 -0400 Original-Received: from mail-pa0-f47.google.com ([209.85.220.47]:33687) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkenv-0008CV-Op for emacs-devel@gnu.org; Thu, 15 Sep 2016 18:06:47 -0400 Original-Received: by mail-pa0-f47.google.com with SMTP id cm16so19672116pac.0 for ; Thu, 15 Sep 2016 15:06:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mail-followup-to:mime-version; bh=rSIpqfFQI/ETwlHY4cnNEzAAnYqgb9THOj04oAGjfAU=; b=ibwj+VEkLLmDC1Ok+NRdxTf4JBCwNi/TQdrdp+XOYCU+ZczwfIdVPrCMT82I82iTvJ gk/oZLuVOBOaGIqKRYRBmTAtzT4Er9TjBNbpmbFlov8E2xnGMdIZhXiuiAIhFRF+zChD o7ABC5aUSNCA+mAHX9CFMRjGgKHYy+FCG+CHdrdZn8vpPUbt8dNv1AsNzBaIWtfLBJXY ZjQHGhd0CKcTUsrWZEwefCeP9UlJgDL5AQ6t4FlCs+BkKBlDD6dJ/KQjdH874iPbC8eB sLqU6h/+O4ollsxt91PSDdmUpd/BfYE0rhxYKYUY+knH7Opvw47Iu6ArQxdb+f0zvJAK t/Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :references:user-agent:mail-followup-to:mime-version; bh=rSIpqfFQI/ETwlHY4cnNEzAAnYqgb9THOj04oAGjfAU=; b=CoQDU0xEq/z94GIOBCbZ2z0gPHNxwXcLQxLpoRKxPlRlq++p6fxdP7SOPPmQtka1KE 7EQYso9hpemfTulKzOSwhQSYw34mJLT6xXSBqXYB+JQKfjiLLz6rCSxEGz1qI8njltv/ WlFVaGj6iQHxHNZecfO9KhW3bDsn3H5ycVGX1CO9E8aJRtbEtSyP47ukGXEHcH+o4Qi6 rfALSqbs1uiRXPdbKuUeUx+FdPqrUWDDCiqymhPnu1ZTrWM0y9UQh9thZEWwbDKF1Lsn 5AncbimyhqmWYreqpeOQ9I1XipzQhT9OZNKvCTB+CpcqsSkeWbtows6HW4F2FURcJIoc punw== X-Gm-Message-State: AE9vXwO8szyBpnIro1UsfGFwDaInBuYpM53DAtjA/FDQnFm5cMlnQ6LSvASq1fC5Y2xuXw== X-Received: by 10.66.252.167 with SMTP id zt7mr17871524pac.93.1473977126008; Thu, 15 Sep 2016 15:05:26 -0700 (PDT) Original-Received: from Vulcan.local (76-234-69-149.lightspeed.frokca.sbcglobal.net. [76.234.69.149]) by smtp.gmail.com with ESMTPSA id z187sm47285047pfz.39.2016.09.15.15.05.24 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 15 Sep 2016 15:05:24 -0700 (PDT) X-Google-Original-From: "John Wiegley" Original-Received: by Vulcan.local (Postfix, from userid 501) id 28AAC25BD169; Thu, 15 Sep 2016 15:05:24 -0700 (PDT) In-Reply-To: (Tino Calancha's message of "Wed, 14 Sep 2016 16:21:26 +0900 (JST)") Mail-Followup-To: Tino Calancha , Emacs developers X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.47 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207451 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable >>>>> Tino Calancha writes: > If you compare the first patch with `dired-get-marked-files' (d-g-m-f) you > might change your mind: (d-g-m-f) returns a list with the file at point w= hen > there are no marked files. The first patch follow similar idea. I understand dired may also be taking this bad approach, but that's not a g= ood reason to continue the practice. The end goal you're trying to achieve is to make a keystroke more intuitive. That's a great goal. What it sounds like to me is that we need another layer above ibuffer-get-marked-files: a command that, if there are marked buffers, calls ibuffer-get-marked-files, and if there are no marked buffers, calls ibuffer-current-buffer. Then it's clear to the reader what the command mean= s, and what is happening, and each function has exactly one job to do. Monkey-patching Emacs to make single-purpose functions more magical by addi= ng special arguments -- or special meanings to arguments -- will burden us with unnecessary technical debt in the future. I don't like this practice, and I= 'm unmoved by "prior art" as a justification. That said, again, I'm 100% in support of the end goal you want to achieve; I just want to get there in a more principled way. Functions should do what t= hey say, and not have lots of alternative functionality baked into them because it's a convenient hack today. =2D-=20 John Wiegley GPG fingerprint =3D 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGcBAEBCgAGBQJX2xshAAoJEMFE2PTxn+Ywb0UL/16vjQJwtfqZBraENKXSFsCK Mp7wTN3jtrbNXTaMRGHwr0LpHk+v6BPijQdSNStwtu//hqHVdYesS0dKTrsuC4CH LVmY0Jdu6SLMts5y35UJMP3ERqLghzBRk9vHDPO1lacsw6NpFUBZp6UyGHrkCHPC lpjSX6BmDG8VWXDyCR0F2oQcjyC6LGCBUVTTIRPbcNmPfzt6CWk6fktkBcDIwmn+ n5KlN53T8PzAuw+rdBo84SAYJFa3ZyPL31k/k5pAVQeaEIUv0fg/QbTyRQKrdjTQ 33bl8EYHaAyK59SDazQalfIH5mTZjh5IsBVqA0/TFpPA4Hitm7cJSWzLj76Docqe hanc0F4+LS1Qkv2VmExzYYEov/QorlBlcw4wvUgmOKWRsfWeQpnzSAvk3ND6znn3 OhaKtCGzZE/5w3qUBhZCeCpVbZc8+fcGwvDm1IufO6W9f1yMz84dQPZfh0vRJmlA mALqeCrpObzPBYHa3ozuvDOP5RaBKcKfXtRNGy+k9w== =CZu8 -----END PGP SIGNATURE----- --=-=-=--