From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Boruch Baum Newsgroups: gmane.emacs.bugs Subject: bug#32106: 25.2: tabulated-list-resize-current-column [PATCH INCLUDED] Date: Mon, 9 Jul 2018 11:56:11 -0400 Message-ID: <20180709155611.qtqa2s24rzx5osye@E15-2016.optimum.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="yynh3l6564dshf4k" X-Trace: blaine.gmane.org 1531151793 19579 195.159.176.226 (9 Jul 2018 15:56:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 9 Jul 2018 15:56:33 +0000 (UTC) User-Agent: NeoMutt/20180512 To: 32106@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 09 17:56:29 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1fcYWV-0004qc-Ga for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Jul 2018 17:56:23 +0200 Original-Received: from localhost ([::1]:42993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcYYc-00021B-Ln for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Jul 2018 11:58:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcYXB-00016R-7J for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2018 11:57:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcYX8-0003Ef-6Y for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2018 11:57:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44804) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fcYX8-0003EZ-21 for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2018 11:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fcYX7-0005SL-Rm for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2018 11:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Boruch Baum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Jul 2018 15:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 32106 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: Emacs Bug Reporting Original-Received: via spool by submit@debbugs.gnu.org id=B.153115179320934 (code B ref -1); Mon, 09 Jul 2018 15:57:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Jul 2018 15:56:33 +0000 Original-Received: from localhost ([127.0.0.1]:52701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fcYWa-0005RW-Re for submit@debbugs.gnu.org; Mon, 09 Jul 2018 11:56:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fcYWY-0005RI-PM for submit@debbugs.gnu.org; Mon, 09 Jul 2018 11:56:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcYWS-00033s-PN for submit@debbugs.gnu.org; Mon, 09 Jul 2018 11:56:21 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:44169) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcYWS-00033o-Kw for submit@debbugs.gnu.org; Mon, 09 Jul 2018 11:56:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcYWR-0000kD-9h for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2018 11:56:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcYWO-00032U-86 for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2018 11:56:19 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:40635) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fcYWN-00032I-TD for bug-gnu-emacs@gnu.org; Mon, 09 Jul 2018 11:56:16 -0400 Original-Received: from E15-2016.optimum.net ([108.6.168.221]) by mail.gmx.com (mrgmx101 [212.227.17.174]) with ESMTPSA (Nemesis) id 0LdLw5-1gKAoR0ler-00iSBw for ; Mon, 09 Jul 2018 17:56:14 +0200 Content-Disposition: inline X-Provags-ID: V03:K1:6jKazHxokH0iQuXp5ids7G72XKUfHXZSR1b5HjV8A0vYZIWM7Ci 6/D/kTYlSToZzGfMnMdo5YibtXXLp0KFiruSJ0FP57+xh6NvWMKcNZL8FTMkugVmbs1aPch 5J4mS40klgjF09Wl7ajzuqQUCR/0EwcINVh3b38zfY5e9HSivmP0gSEmfVIeipTf0BNzi9p 6Ypp7dmqnh/iW/W6xQQdA== X-UI-Out-Filterresults: notjunk:1;V01:K0:58iXU0nxkrw=:PYoT4B5AGSowF3GfJ2MVPw USAAIzdPkrMh5Z7ZlLoJ7ncGt5BpbbWVGD3KuPrUyO/65wFVsFMN8RzROxlsAMei8Z/XY/5jF lPChHcW0tO6QSVkynamoHcfAqZHHJtwWR7HcPurtA/tW5k2xR3MHdad8AtNEMNDdY7DREXX6d /GmjqcV1qVGBYbKP2H3Uhyuj3AOniOhxurhqqzOgIye4BJAonTn3PhUhrmRdM3vxc3NdmMUjB kjI+c21d0PtjMSuuiioe+9jaVHPl9X0QE8Q+QGK6MqMBNAASjOrKk9W1iu6rDtXIApB0caXCe lsPVp9gu0FWRnk5gKiUjn7TWw/4iHRedIqcnBktyb2uzxnin8bD5ctRbg6Gv2oEmy8BrNi/rX jA8aNASOGFyI8Ey2dhoa55zTf5+UEzSTpKkbDDMKNYSMnVan/TKltw2J0bGRZOWaL6qaFn9by /9PmbHmQJTY30+JBhKNXRhgGDunCPjce0FvwfZeMmPHvmqhzKyBfPqghLFyKF9VKr2Um0Zq2g HHJwvrkn8Vtd2SjuWOC8j1p4PT2NVTH4dGAQFCEskDHLQpCeMqnfHBJJPyI1bO6VdWasXmyC3 68wKm+5cH9hS11HfnKzhrtoszncmpJ9BSCPeuDJ1ZCqcoG9n88+0B3HRSU2gNbF4SO2wShfDv DosALD17y4VQ9VeoCfwAWwP8NDinJ1fgwoVuUY0bOn1ZDvxx4GzFfasgnnzIeOYXSqFSWgOPZ c7aK0PkGTbIqInAxcm8237nMdWliAsREbSSNKgKf8LbRZ7GR4LJx/rdUyE0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:148383 Archived-At: --yynh3l6564dshf4k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline ----- Forwarded message from Boruch Baum ----- Date: Mon, 11 Jun 2018 14:06:41 -0400 From: Boruch Baum To: Emacs-Devel List Cc: Chong Yidong Subject: tabulated-list-resize-current-column User-Agent: NeoMutt/20180512 Attached is a proposed contribution for the package `tabulated-list.el'. The idea is to offer to emacs users a feature long-common in GUI tabulated list widgets - the ability to dynamically resize columns. I only use emacs in nox, so in my selfishness (and in my ignorance of most programming things GUI) that's all this function provides, but it's a start for anyone wanting to extend to that environment. An obvious follow-up idea is a companion function to change the sequence of columns, also a long-common feature in GUI environments. -- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0 --yynh3l6564dshf4k Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="tabulated-list-resize-current-column.el" (defun tabulated-list-resize-current-column (&optional num) "Change width of the current column by N columns. This is a buffer-local change. To permanently change a column's size, see defcustom `tabulated-list-format'." (interactive "N(In/De)crease size of current column by:") (let ((col (current-column)) (total-column-count 0) (len (length tabulated-list-format)) (idx 0) this-column-size found) (while (and (not found) (< idx len)) (if (> col (setq total-column-count (+ total-column-count (setq this-column-size (cadr (aref tabulated-list-format idx)))))) (setq idx (1+ idx)) (setf (cadr (aref tabulated-list-format idx)) (max 1 (+ this-column-size num))) (setq found t) (tabulated-list-init-header) (tabulated-list-print) (move-to-column col))))) --yynh3l6564dshf4k--