From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id MKnqHT2S118dcgAA0tVLHw (envelope-from ) for ; Mon, 14 Dec 2020 16:26:37 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qEW8GT2S119KYAAA1q6Kng (envelope-from ) for ; Mon, 14 Dec 2020 16:26:37 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1677294042E for ; Mon, 14 Dec 2020 16:26:37 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id D469629D0D; Mon, 14 Dec 2020 11:25:10 -0500 (EST) Received: from mail.hostpark.net (mail.hostpark.net [212.243.197.30]) by mail.notmuchmail.org (Postfix) with ESMTPS id 4DE5829C83 for ; Mon, 14 Dec 2020 11:24:08 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id E255816634 for ; Mon, 14 Dec 2020 17:24:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=sel2011a; t=1607963043; bh=bvDKgJdm9Tyrfwt DBqvM7JZIeLlFF4pBGqy6rZ+xMEM=; b=jzZ+L2s6XkKGBGCb7NDOI39/BL+J+Uv qcrw8AeTbZ0XSvG2qfxtV2oyJ3kWSSncBmaXbme4ICHYoDJ1qejxquZEdRMVxVvI fcqjBMvsV+pImOGmTjKqv67u87XNHVeXrxhqULmzeuHrZk4BvvC2Qi6s/m+04tsO YNYlx32UNWhs= X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail0.hostpark.net [127.0.0.1]) (amavisd-new, port 10224) with ESMTP id dSHvwjLB1ydZ for ; Mon, 14 Dec 2020 17:24:03 +0100 (CET) Received: from customer (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id B27C716690 for ; Mon, 14 Dec 2020 17:24:03 +0100 (CET) From: Jonas Bernoulli To: notmuch@notmuchmail.org Subject: [PATCH 29/32] emacs: reorder notmuch.el a bit Date: Mon, 14 Dec 2020 17:23:58 +0100 Message-Id: <20201214162401.19569-30-jonas@bernoul.li> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201214162401.19569-1-jonas@bernoul.li> References: <20201214162401.19569-1-jonas@bernoul.li> MIME-Version: 1.0 Message-ID-Hash: FFSBVSH47FJZAET6GIY3CKFKFGXSHH7J X-Message-ID-Hash: FFSBVSH47FJZAET6GIY3CKFKFGXSHH7J X-MailFrom: jonas@bernoul.li X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 1.42 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=bernoul.li header.s=sel2011a header.b=jzZ+L2s6; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 1677294042E X-Spam-Score: 1.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: dDbNuTiBKjt5 --- emacs/notmuch.el | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 0fb9874b..24b930bf 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -70,6 +70,8 @@ (eval-when-compile (require 'cl-lib)) (require 'mm-view) (require 'message) +(require 'hl-line) + (require 'notmuch-lib) (require 'notmuch-tag) (require 'notmuch-show) @@ -114,8 +116,12 @@ (defcustom notmuch-init-file (locate-user-emacs-file "notmuch-config") :type 'file :group 'notmuch) -(defvar notmuch-query-history nil - "Variable to store minibuffer history for notmuch queries.") +(defcustom notmuch-search-hook '(notmuch-hl-line-mode) + "List of functions to call when notmuch displays the search results." + :type 'hook + :options '(notmuch-hl-line-mode) + :group 'notmuch-search + :group 'notmuch-hooks) ;;; Mime Utilities @@ -155,24 +161,6 @@ (defun notmuch-save-attachments (mm-handle &optional queryp) (mm-save-part p)))) mm-handle)) -;;; Integrations - -(require 'hl-line) - -(defun notmuch-hl-line-mode () - (prog1 (hl-line-mode) - (when hl-line-overlay - (overlay-put hl-line-overlay 'priority 1)))) - -;;; Options - -(defcustom notmuch-search-hook '(notmuch-hl-line-mode) - "List of functions to call when notmuch displays the search results." - :type 'hook - :options '(notmuch-hl-line-mode) - :group 'notmuch-search - :group 'notmuch-hooks) - ;;; Keymap (defvar notmuch-search-mode-map @@ -207,6 +195,9 @@ (defvar notmuch-search-mode-map ;;; Internal Variables +(defvar notmuch-query-history nil + "Variable to store minibuffer history for notmuch queries.") + (defvar-local notmuch-search-query-string nil) (defvar-local notmuch-search-target-thread nil) (defvar-local notmuch-search-target-line nil) @@ -1154,7 +1145,15 @@ (defun notmuch-cycle-notmuch-buffers () (pop-to-buffer-same-window first)) (notmuch)))) -;;; Imenu Support +;;; Integrations +;;;; Hl-line Support + +(defun notmuch-hl-line-mode () + (prog1 (hl-line-mode) + (when hl-line-overlay + (overlay-put hl-line-overlay 'priority 1)))) + +;;;; Imenu Support (defun notmuch-search-imenu-prev-index-position-function () "Move point to previous message in notmuch-search buffer. -- 2.29.1