From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Peter Feigl" Newsgroups: gmane.emacs.bugs Subject: bug#44711: [PATCH] Add movement commands `tabulated-list-next-column' and `tabulated-list-previous-column' Date: Tue, 17 Nov 2020 18:52:23 +0100 Message-ID: <87wnyj6fc8.fsf@nexoid.at> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40454"; mail-complaints-to="usenet@ciao.gmane.io" To: 44711@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 17 18:53:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kf5AG-000ANX-0o for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Nov 2020 18:53:12 +0100 Original-Received: from localhost ([::1]:43080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf5AE-00041B-KL for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Nov 2020 12:53:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf5A6-00040E-C3 for bug-gnu-emacs@gnu.org; Tue, 17 Nov 2020 12:53:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf5A6-0004BR-2G for bug-gnu-emacs@gnu.org; Tue, 17 Nov 2020 12:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kf5A6-0001YT-0E for bug-gnu-emacs@gnu.org; Tue, 17 Nov 2020 12:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Peter Feigl" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Nov 2020 17:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44711 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16056355545935 (code B ref -1); Tue, 17 Nov 2020 17:53:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Nov 2020 17:52:34 +0000 Original-Received: from localhost ([127.0.0.1]:32852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kf59e-0001Xf-8x for submit@debbugs.gnu.org; Tue, 17 Nov 2020 12:52:34 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:60026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kf59b-0001XW-J5 for submit@debbugs.gnu.org; Tue, 17 Nov 2020 12:52:32 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf59b-0003wE-0z for bug-gnu-emacs@gnu.org; Tue, 17 Nov 2020 12:52:31 -0500 Original-Received: from www.nexoid.at ([178.79.130.240]:40324 helo=nexoid.at) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf59Y-0003yX-Fp for bug-gnu-emacs@gnu.org; Tue, 17 Nov 2020 12:52:30 -0500 DKIM-Filter: OpenDKIM Filter v2.10.3 nexoid.at 9CE75BC81 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexoid.at; s=mail; t=1605635544; bh=3XIafbJJ2HvT1o3qltHWf1wQsDjGv4AShdwBbyhjN54=; h=From:To:Subject:Date:From; b=n/xbMZuAFny00vHwLolxBTI6SmI07See1hY26HNzkaNlaz7ZkifhukNaMpkbI9285 tPuescoNuSnXYtiy+ijr0Wh7xfkHvsU64mSiRs6oTO9lai0xQqtSq7J/3NNAJWc0tf ocbsOxHccTgRXuPE69ynZRhmVblpls4fzAr+7+Ez8dW8XoJ9SQ/5TijiATC1NJqAMO oq19+COByKldGysI8jDHTCIYU/P9xuXm6XB31jMF1bH5O85u+vVhP19L/dENHUDtwc +O0biXZWmMK96F5qzyJXFgXTPwFnjp6tiXH9XSeO0hSM6UTc+7SpYfogrCikOvrY0U BVpg3RnvMBRHQ== Received-SPF: pass client-ip=178.79.130.240; envelope-from=peter.feigl@nexoid.at; helo=nexoid.at X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/17 12:52:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:193564 Archived-At: --=-=-= Content-Type: text/plain The attached patch adds two movement commands, `tabulated-list-next-column' and `tabulated-list-previous-column', by default bound to "f" and "b" in `tabulated-list-mode'. They move to the next/previous column respectively, and honour a numeric prefix argument. I'd be happy to try to get my employer to sign the papers, please send me the forms (in German, if that is relevant). If possible, feel free to use this patch without papers signed. Thanks and greetings, Peter --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-commands-to-move-to-next-previous-column-in-tabu.patch >From 92cdba70401663f3765571472af3623db8c7c304 Mon Sep 17 00:00:00 2001 From: Peter Feigl Date: Tue, 17 Nov 2020 18:42:03 +0100 Subject: [PATCH] Add commands to move to next/previous column in tabulated-list-mode. * lisp/emacs-lisp/tabulated-list.el (tabulated-list-mode-map): Add keybindings "b" and "f" (tabulated-list-previous-column tabulated-list-next-column): Implement commands. --- lisp/emacs-lisp/tabulated-list.el | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index 30577679f2..a19ab00838 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -212,6 +212,8 @@ If ADVANCE is non-nil, move forward by one line afterwards." special-mode-map)) (define-key map "n" 'next-line) (define-key map "p" 'previous-line) + (define-key map "b" 'tabulated-list-previous-column) + (define-key map "f" 'tabulated-list-next-column) (define-key map "S" 'tabulated-list-sort) (define-key map "}" 'tabulated-list-widen-current-column) (define-key map "{" 'tabulated-list-narrow-current-column) @@ -726,6 +728,24 @@ Interactively, N is the prefix numeric argument, and defaults to (setq-local tabulated-list--current-lnum-width lnum-width) (tabulated-list-init-header))))) +(defun tabulated-list-next-column (&optional arg) + "Go to the start of the next column after point on the current line. +If ARG is provided, move that many columns." + (interactive "p") + (dotimes (c (or arg 1)) + (let ((next (or (next-single-property-change (point) 'tabulated-list-column-name) (point-max)))) + (unless (>= next (line-end-position)) + (goto-char next))))) + +(defun tabulated-list-previous-column (&optional arg) + "Go to the start of the column point is in on the current line. +If ARG is provided, move that many columns." + (interactive "p") + (dotimes (c (or arg 1)) + (let ((prev (or (previous-single-property-change (point) 'tabulated-list-column-name) 1))) + (unless (< prev (line-beginning-position)) + (goto-char prev))))) + ;;; The mode definition: (define-derived-mode tabulated-list-mode special-mode "Tabulated" -- 2.28.0 --=-=-=--