From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id CE28B/DVv2WvrwAAqHPOHw:P1 (envelope-from ) for ; Sun, 04 Feb 2024 19:22:40 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id CE28B/DVv2WvrwAAqHPOHw (envelope-from ) for ; Sun, 04 Feb 2024 19:22:40 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=EpYk9C2Y; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1707070960; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=nOv47K2faTZWDHLAp2rrdF8UkWGODQJFX9dcdlOnYl4=; b=Opxy9t+nliNK/PpCek9KFsd8IlVkVDZMnAIaOv8d1hWhwhXetQ9MGveN3QNbeS4wJ4Kcx1 SSGOX5ou1c+FBl2dgulCVASMzwWbzyqkCoTQa+ClV0EAFxCTrJYUBq5oJPZqv/yfNTvZKu bqsCnFm7sAolSep3v1GoljyZISyFWWy4NCAjYzbq0Ze45RAKJ2btm2WGbRYPqRdiNQZR3y QqhTRWeI79y22Oy17vhrIbaJgvHgDDT7RgC35HmU/yK4/hL6LPwiZfeWBUUayCqscfXuiN 2B5CPhuk5Lkx4bA/dHMx9JMwPNgy3WIQMAzZG3CFf6UXLhB/RANlzu2vI8vxjA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=EpYk9C2Y; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1707070960; a=rsa-sha256; cv=none; b=dSVA74KADOMvyEognABgMerLYWconwTlCvoTjrUWlTkef7F1FvOpodNd0zczuxUobDQ08Z 3WrXqfEuWrMaTBD/3tnQxOYecywLyfFUqy3C9+UpLsuyPJrkA8eExsttFRBBZhyy7dmR6S PY8AzQfD+jmWxtkOvqwIuV7WX4HtrnExfJN7ya+Hmq4w0GB04ULbPHv1q37Dx61pxqWF+M F7TaH4gk6yR65ImS8WX7wdopRcGzJgeonsQIXVbQJsoRXWppuI6EBUP3bl660JUNhZtQFB v4dOUDY7rdhkcrOUlSmffmlVEPZ8VPgAjb4XYbeL0uq5u7kI5aHvbV3qFf3QcQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 012E41BB82 for ; Sun, 4 Feb 2024 19:22:40 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rWh8C-0001io-4G; Sun, 04 Feb 2024 13:22:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rWh88-0001iJ-JQ for emacs-orgmode@gnu.org; Sun, 04 Feb 2024 13:22:13 -0500 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rWh85-0008Ed-8s for emacs-orgmode@gnu.org; Sun, 04 Feb 2024 13:22:12 -0500 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a3566c0309fso463495266b.1 for ; Sun, 04 Feb 2024 10:22:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707070926; x=1707675726; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=nOv47K2faTZWDHLAp2rrdF8UkWGODQJFX9dcdlOnYl4=; b=EpYk9C2YmXugZjcZzRYRvGk5hkRF4LFN0mglRSGTZ1dy4sSoEIiQCixj/uQbiC6bRo 6nfJoMYUi19IAGTzpB3zProh5vm9iOsBGivGX8dM9f5ym1Als0uib3WMMWliPrFOvbtF deINnWCSKAp6/+AKtxgJzvMNTswk2WJ0MQvCVnLgxk8izb2TN3wja4Y0v1dcPcjHHWyb saH/o7My6I2kcytTymg1bmpngQf/anqWFCIDd1GnVJwWuu8p7u69JDnaZB4fPSo57dUH Fc7jWCOoekjxcowXHpHIHSCrvVbYvQFh1wmcCTAj5I/7advSqNHNuBfJH2p3SP5C1/je 0fxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707070926; x=1707675726; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=nOv47K2faTZWDHLAp2rrdF8UkWGODQJFX9dcdlOnYl4=; b=k3U22JgexGbXK4Gj82KT+VjXffpAkaKd72py9HQ/n5GMeyQRY1QZHI0pT3vjUMonpI axcMdZ682w7fC4IS6znyNB9mdstqEGDO59LW2d0wvio1JEyzAZ6BoACldGnRh4AhaJhD Jm7fJLNatXo6iG0dOIe3e0AWeDCoLShXDMGaZ0yKZHe7UAEw+ME8LVbflv5EGinf0lPa Ba8e7hgRfHocy40ADJoPfzvnbUsxKjX8DHa1lKiekyWHANL3+Hf+LHktoTBKlVXVkCzq Z8xLMyUjh0in6z7q9du1IkGZ/85dwJrCQ5KhtgFAzJFLpp8L1xZz6vQZV9wtmVibGCVJ z64w== X-Gm-Message-State: AOJu0YwDvVlVoSyAwJHQCNAazGwKD/WqLbUUeggf8ZgBoE/X0ulcPVig T2eujBAydnHa6OPl1obCtS2PXqtqge/rbw2IGVVglZDlR3MAzTrXFP3u5ljmEQ8= X-Google-Smtp-Source: AGHT+IFATzmMw5mX5QiGAkk2YmYewLHvZ6epeayR2pMU8CV9w1sqs3RqhMJdgv+RSuHYheOrb+zVfg== X-Received: by 2002:a17:906:130e:b0:a35:ed62:c4fd with SMTP id w14-20020a170906130e00b00a35ed62c4fdmr9455288ejb.0.1707070925518; Sun, 04 Feb 2024 10:22:05 -0800 (PST) Received: from windows ([2a01:110f:1506:3300:34f8:9320:7e9a:c4f1]) by smtp.gmail.com with ESMTPSA id gs15-20020a1709072d0f00b00a36f3250a9asm3378813ejc.224.2024.02.04.10.22.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 10:22:05 -0800 (PST) From: =?utf-8?Q?S=C5=82awomir_Grochowski?= To: emacs-orgmode@gnu.org Subject: [PATCH] lisp/org-colview.el: [refactor] [extract function] `org-columns-move-up' & `org-columns-move-down' Date: Sun, 04 Feb 2024 19:22:04 +0100 Message-ID: <8734u82ipf.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=slawomir.grochowski@gmail.com; helo=mail-ej1-x629.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.98 X-Spam-Score: -9.98 X-Migadu-Queue-Id: 012E41BB82 X-Migadu-Scanner: mx12.migadu.com X-TUID: YVcx2NfxLamc --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Dear All,=20 It's a small refactoring - extract function - and the patch is self-explanatory. Regards, S=C5=82awomir Grochowski --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-org-colview-Extract-functions-org-columns-move-up-or.patch >From e12fe4e911c90b8f0fc587286937d4c76cac4b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C5=82awomir=20Grochowski?= Date: Sat, 3 Feb 2024 20:50:08 +0100 Subject: [PATCH] org-colview: Extract functions `org-columns-move-up' & `org-columns-move-down' * lisp/org-colview.el (org-defkey): Do not use anonymous function as a binding. --- lisp/org-colview.el | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/lisp/org-colview.el b/lisp/org-colview.el index 81254c483..d0eed4838 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -190,24 +190,8 @@ See `org-columns-summary-types' for details.") (org-defkey org-columns-map "s" #'org-columns-edit-attributes) (org-defkey org-columns-map "\M-f" #'forward-char) (org-defkey org-columns-map [right] #'forward-char) -(org-defkey org-columns-map [down] - (lambda () (interactive) - (let ((col (current-column))) - (forward-line 1) - (while (and (org-invisible-p2) (not (eobp))) - (forward-line 1)) - (move-to-column col) - (if (derived-mode-p 'org-agenda-mode) - (org-agenda-do-context-action))))) -(org-defkey org-columns-map [up] - (lambda () (interactive) - (let ((col (current-column))) - (forward-line -1) - (while (and (org-invisible-p2) (not (bobp))) - (forward-line -1)) - (move-to-column col) - (if (eq major-mode 'org-agenda-mode) - (org-agenda-do-context-action))))) +(org-defkey org-columns-map [up] #'org-columns-move-up) +(org-defkey org-columns-map [down] #'org-columns-move-down) (org-defkey org-columns-map [(shift right)] #'org-columns-next-allowed-value) (org-defkey org-columns-map "n" #'org-columns-next-allowed-value) (org-defkey org-columns-map [(shift left)] #'org-columns-previous-allowed-value) @@ -1033,6 +1017,26 @@ details." (org-columns-move-right) (backward-char 1))) +(defun org-columns-move-up () + (interactive) + (let ((col (current-column))) + (forward-line -1) + (while (and (org-invisible-p2) (not (bobp))) + (forward-line -1)) + (move-to-column col) + (if (eq major-mode 'org-agenda-mode) + (org-agenda-do-context-action)))) + +(defun org-columns-move-down () + (interactive) + (let ((col (current-column))) + (forward-line 1) + (while (and (org-invisible-p2) (not (eobp))) + (forward-line 1)) + (move-to-column col) + (if (derived-mode-p 'org-agenda-mode) + (org-agenda-do-context-action)))) + (defun org-columns--move-row (&optional up) "Move the current table row down. With non-nil optional argument UP, move it up." -- 2.30.2 --=-=-=--