From patchwork Mon Aug 19 06:34:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Leung X-Patchwork-Id: 14962 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A33C917283; Mon, 19 Aug 2019 07:36:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 18820171CC for ; Mon, 19 Aug 2019 07:36:16 +0100 (BST) Received: from localhost ([::1]:45332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzbH5-0001YA-GR for patchwork@mira.cbaines.net; Mon, 19 Aug 2019 02:36:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53613) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzbGw-0001Y1-Ii for guix-patches@gnu.org; Mon, 19 Aug 2019 02:36:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzbGs-0004So-MX for guix-patches@gnu.org; Mon, 19 Aug 2019 02:36:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50253) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzbGs-0004Sa-CV for guix-patches@gnu.org; Mon, 19 Aug 2019 02:36:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hzbGs-0003NS-7m for guix-patches@gnu.org; Mon, 19 Aug 2019 02:36:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#37080] [PATCH] Update emacs-org-recent-headings. Resent-From: Brian Leung Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Aug 2019 06:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37080 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 37080@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.156619653412936 (code B ref -1); Mon, 19 Aug 2019 06:36:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Aug 2019 06:35:34 +0000 Received: from localhost ([127.0.0.1]:59073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzbGP-0003Ma-UC for submit@debbugs.gnu.org; Mon, 19 Aug 2019 02:35:34 -0400 Received: from lists.gnu.org ([209.51.188.17]:41679) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hzbGO-0003MN-73 for submit@debbugs.gnu.org; Mon, 19 Aug 2019 02:35:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53492) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzbGK-0001VS-Aw for guix-patches@gnu.org; Mon, 19 Aug 2019 02:35:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzbGI-00045J-5b for guix-patches@gnu.org; Mon, 19 Aug 2019 02:35:28 -0400 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]:43974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hzbGC-000405-HS for guix-patches@gnu.org; Mon, 19 Aug 2019 02:35:22 -0400 Received: by mail-qk1-x736.google.com with SMTP id m2so543771qkd.10 for ; Sun, 18 Aug 2019 23:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=r61ii6j0n884Zl4J7F/KKSyGWRkh2SUtBtIs7GqIf74=; b=tHr3EHzH0hm83FxjBHSfUS23CbxQg2YWsweIrmLScdcNyHlhNSeRsVVdX0ztEGsUxT MuvXkml5S6JSWcBRMfCDBWNvtVAIACK0Z9ES+YyoIUFLQn4ingkMikgSK6ZvWJzy/YW2 j4Vvni+kA/Sz41O+rkrJkLMAkDsUPJHMaRMRoi4urru0ME1cvqnNxHUsqcIqQrK40bXv SSgLACeepuSJxbvUDv89BotlJz3nq0HJ42H7+ESaJQ62Tbjm2SCi3Xcwfbf1qpy9mu7b cZ8fx3ni+SXaSTjULwyBOgRosNXyE6lVOkzv8mFsHNqUVWM+z28Q35LnMb07puBsTGN7 /WKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=r61ii6j0n884Zl4J7F/KKSyGWRkh2SUtBtIs7GqIf74=; b=ZDlO9aadolomAhswQp+DQ6Y04wdvSExqp9d9IFxkw6alkEya6MGDBrWSzrxP2mPolO rKwRVc93vi3zWtaERunH4NyFpwyXaQb38niGICK563RkGBckfpbYkqE5bvJAtd4++3Kx lqPpQCQxDDhyXi05ztvjXNb8Sff4R93YTtgiwFpm/NDRh2mai+ZPdZppx0wKntTCUk+E cWijqqTjCOdQzKGUYouqHhhsWxc2cnDvno/DV+y5Hm0BU7lMtM9/vTvbOWU0YEf7aetf 0RC9TV/tm0MX2aCBZGOcYdbzPa2a/y5rE6kBpVEH2P5zl3XECiUQu4pMpMq6tD+IKNJm EMow== X-Gm-Message-State: APjAAAU6GOdMyKxMTsKaYe+v34QMycY9jlmVIu3M8jFLrDVDWzpA/aOZ vdpBPmsz/x/x6Bb9bssd6f1bI4FDZhlHALaiwkLfvCDy X-Google-Smtp-Source: APXvYqyhqkKXl/LwRXRPNuf2HY+bfpWnBJjJiQv8fjInZ5sdenLMfDCVuGMVV2jFnEScvFlpuB4eEd4D01UlOF6ebNs= X-Received: by 2002:a37:f50a:: with SMTP id l10mr4090796qkk.196.1566196515920; Sun, 18 Aug 2019 23:35:15 -0700 (PDT) MIME-Version: 1.0 From: Brian Leung Date: Mon, 19 Aug 2019 08:34:39 +0200 Message-ID: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches The version of emacs-org-recent-headings on Guix doesn't work correctly for people with Helm installed. I submitted patches to the upstream maintainer of emacs-org-recent-headings. Attached is a Guix patch incorporating the changes. From 240c13331359e8c19fc5aa2b35a6839b37fabda2 Mon Sep 17 00:00:00 2001 From: Brian Leung Date: Sun, 11 Aug 2019 18:21:19 +0200 Subject: [PATCH] gnu: emacs-org-recent-headings: Update to 0.1-1.6336a0c. * gnu/packages/emacs-xyz.scm: Update to 0.1-1.6336a0c. * gnu/packages/patches/emacs-org-recent-headings.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/emacs-xyz.scm | 57 +++++--- .../patches/emacs-org-recent-headings.patch | 137 ++++++++++++++++++ 3 files changed, 174 insertions(+), 21 deletions(-) create mode 100644 gnu/packages/patches/emacs-org-recent-headings.patch diff --git a/gnu/local.mk b/gnu/local.mk index aab29beb0a..04d35686aa 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -782,6 +782,7 @@ dist_patch_DATA = \ %D%/packages/patches/emacs-fix-scheme-indent-function.patch \ %D%/packages/patches/emacs-json-reformat-fix-tests.patch \ %D%/packages/patches/emacs-highlight-stages-add-gexp.patch \ + %D%/packages/patches/emacs-org-recent-headings.patch \ %D%/packages/patches/emacs-scheme-complete-scheme-r5rs-info.patch \ %D%/packages/patches/emacs-source-date-epoch.patch \ %D%/packages/patches/emacs-unpackaged-req.patch \ diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index ffc662f746..28571911d7 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -10853,28 +10853,43 @@ a heuristic based on frequency and recency.") (license license:gpl3+)))) (define-public emacs-org-recent-headings - (package - (name "emacs-org-recent-headings") - (version "0.1") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/alphapapa/org-recent-headings.git") - (commit version))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "0gsrzmg3mssh9s28yjm9m866fnhm1pcligssz1q6brga6dm6f2yy")))) - (build-system emacs-build-system) - (propagated-inputs - `(("emacs-org" ,emacs-org) - ("emacs-dash" ,emacs-dash) - ("emacs-frecency" ,emacs-frecency))) - (home-page "https://github.com/alphapapa/org-recent-headings") - (synopsis "Navigate to recently used Org headings and lists") - (description "This package maintains a list of recently used Org headings, + (let ((commit "6336a0c36ef1048ba1f4e07716a421dce106d082") + (revision "1")) + (package + (name "emacs-org-recent-headings") + (version (git-version "0.1" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/alphapapa/org-recent-headings.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1lpkjvlm969pr64j25zkpmsacjnr7qbq9zfwwzb9xyqlhaf5zzz0")) + ;; XXX: Remove once + ;; https://github.com/alphapapa/org-recent-headings/pull/12 + ;; and + ;; https://github.com/alphapapa/org-recent-headings/pull/13 + ;; are merged. We need this patch to ensure that Helm users + ;; on Guix are able to use the package properly, since the + ;; upstream and the release version currently mishandle the + ;; optional Helm dependency. People who aren't using + ;; Guix-installed packages don't seem to be encountering this + ;; problem. + (patches (search-patches "emacs-org-recent-headings.patch")))) + (build-system emacs-build-system) + (propagated-inputs + `(("emacs-org" ,emacs-org) + ("emacs-frecency" ,emacs-frecency))) + (inputs + `(("emacs-dash" ,emacs-dash) + ("emacs-s" ,emacs-s))) + (home-page "https://github.com/alphapapa/org-recent-headings") + (synopsis "Navigate to recently used Org headings and lists") + (description "This package maintains a list of recently used Org headings, as well as functions for navigating between these headings.") - (license license:gpl3+))) + (license license:gpl3+)))) (define-public emacs-org-super-agenda ;; emacs-org-sidebar depends on a newer commit than the latest release version. diff --git a/gnu/packages/patches/emacs-org-recent-headings.patch b/gnu/packages/patches/emacs-org-recent-headings.patch new file mode 100644 index 0000000000..1cfc31b8b4 --- /dev/null +++ b/gnu/packages/patches/emacs-org-recent-headings.patch @@ -0,0 +1,137 @@ +From 9452ff5d9d36974d522fcb9d66ea7243202b1eb5 Mon Sep 17 00:00:00 2001 +From: Brian Leung +Date: Thu, 15 Aug 2019 04:42:37 +0200 +Subject: [PATCH] Change handling of optional dependencies. + +org-recent-headings-helm: `declare-function` does not seem to work on +macros, so `helm-make-source` is used instead of +helm-build-sync-source. + +org-recent-headings-ivy: Add dispatch actions. +--- + org-recent-headings.el | 89 ++++++++++++++++++++++++++++++------------ + 1 file changed, 63 insertions(+), 26 deletions(-) + +diff --git a/org-recent-headings.el b/org-recent-headings.el +index aea76f5..335fb89 100644 +--- a/org-recent-headings.el ++++ b/org-recent-headings.el +@@ -222,27 +222,26 @@ With prefix argument ARG, turn on if positive, otherwise off." + + ;;;;; Helm + +-(with-eval-after-load 'helm +- +- ;; This declaration is absolutely necessary for some reason. Even if `helm' is loaded +- ;; before this package is loaded, an "invalid function" error will be raised when this +- ;; package is loaded, unless this declaration is here. Even if I manually "(require +- ;; 'helm)" and then load this package after the error (and Helm is already loaded, and I've +- ;; verified that `helm-build-sync-source' is defined), once Emacs has tried to load this +- ;; package thinking that the function is invalid, it won't stop thinking it's invalid. It +- ;; also seems to be related to `defvar' not doing anything when run a second time (unless +- ;; called with `eval-defun'). But at the same time, the error didn't always happen in my +- ;; config, or with different combinations of `with-eval-after-load', "(when (fboundp 'helm) +- ;; ...)", and loading packages in a different order. I don't know exactly why it's +- ;; happening, but at the moment, this declaration seems to fix it. Let us hope it really +- ;; does. I hope no one else is suffering from this, because if so, I have inflicted mighty +- ;; annoyances upon them, and I wouldn't blame them if they never used this package again. +- (declare-function helm-build-sync-source "helm") +- (declare-function helm-exit-and-execute-action "helm") +- (declare-function helm-marked-candidates "helm") +- (declare-function with-helm-alive-p "helm") +- (declare-function helm-make-actions "helm-lib") ++;; This declaration is absolutely necessary for some reason. Even if `helm' is loaded ++;; before this package is loaded, an "invalid function" error will be raised when this ++;; package is loaded, unless this declaration is here. Even if I manually "(require ++;; 'helm)" and then load this package after the error (and Helm is already loaded, and I've ++;; verified that `helm-build-sync-source' is defined), once Emacs has tried to load this ++;; package thinking that the function is invalid, it won't stop thinking it's invalid. It ++;; also seems to be related to `defvar' not doing anything when run a second time (unless ++;; called with `eval-defun'). But at the same time, the error didn't always happen in my ++;; config, or with different combinations of `with-eval-after-load', "(when (fboundp 'helm) ++;; ...)", and loading packages in a different order. I don't know exactly why it's ++;; happening, but at the moment, this declaration seems to fix it. Let us hope it really ++;; does. I hope no one else is suffering from this, because if so, I have inflicted mighty ++;; annoyances upon them, and I wouldn't blame them if they never used this package again. ++(declare-function helm-make-source "ext:helm-source") ++(declare-function helm-exit-and-execute-action "ext:helm") ++(declare-function helm-marked-candidates "ext:helm") ++;; (declare-function with-helm-alive-p "ext:helm") ++(declare-function helm-make-actions "ext:helm-lib") + ++(with-eval-after-load 'helm + (defvar helm-map) + (defvar org-recent-headings-helm-map + (let ((map (copy-keymap helm-map))) +@@ -251,7 +250,7 @@ With prefix argument ARG, turn on if positive, otherwise off." + "Keymap for `helm-source-org-recent-headings'.") + + (defvar helm-source-org-recent-headings +- (helm-build-sync-source " Recent Org headings" ++ (helm-make-source " Recent Org headings" 'helm-source-sync + :candidates (lambda () + (org-recent-headings--prepare-list) + org-recent-headings-list) +@@ -297,16 +296,54 @@ With prefix argument ARG, turn on if positive, otherwise off." + + ;;;;; Ivy + +-(with-eval-after-load 'ivy ++(declare-function ivy-read "ext:ivy") ++(declare-function ivy-set-actions "ext:ivy") + +- ;; TODO: Might need to declare `ivy-completing-read' also, but I +- ;; haven't hit the error yet. ++(with-eval-after-load 'ivy ++ (defun org-recent-headings-make-tuple (entry) ++ "Make a tuple containing the display text of ENTRY paired with ENTRY." ++ (let* ((init-display (org-recent-headings-entry-display entry)) ++ (heading-fragment (substring init-display ++ (next-property-change 0 init-display))) ++ (final-display (concat (org-recent-headings-entry-file entry) ++ ":" ++ heading-fragment))) ++ (cons final-display entry))) ++ ++ (defun org-recent-headings--show-entry-indirect-ivy (cand) ++ "Ivy-friendly wrapper for org-recent-headings--show-entry-indirect." ++ (org-recent-headings--show-entry-indirect ++ (cdr cand))) ++ (defun org-recent-headings--show-entry-direct-ivy (cand) ++ "Ivy-friendly wrapper for org-recent-headings--show-entry-direct." ++ (org-recent-headings--show-entry-direct ++ (cdr cand))) ++ (defun org-recent-headings--bookmark-entry-ivy (cand) ++ "Ivy-friendly wrapper for org-recent-headings--bookmark-entry" ++ (org-recent-headings--bookmark-entry ++ (cdr cand))) ++ (defun org-recent-headings--show-entry-default-ivy (cand) ++ "Ivy-friendly wrapper for org-recent-headings--show-entry-default." ++ (funcall org-recent-headings-show-entry-function ++ (cdr cand))) + + (defun org-recent-headings-ivy () + "Choose from recent Org headings with Ivy." + (interactive) +- (let ((completing-read-function #'ivy-completing-read)) +- (org-recent-headings)))) ++ (ivy-read "Recent Org headings: " ++ (progn ++ (org-recent-headings--prepare-list) ++ (-map #'org-recent-headings-make-tuple ++ org-recent-headings-list)) ++ :history 'org-recent-headings-ivy-history ++ :caller 'org-recent-headings-ivy ++ :action 'org-recent-headings--show-entry-default-ivy)) ++ ++ (ivy-set-actions ++ 'org-recent-headings-ivy ++ '(("n" org-recent-headings--show-entry-indirect-ivy "show in indirect buffer") ++ ("d" org-recent-headings--show-entry-direct-ivy "show in direct buffer") ++ ("b" org-recent-headings--bookmark-entry-ivy "bookmark heading")))) + + ;;;; Functions + +-- +2.22.0 + -- 2.23.0