Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 1BF4E431FBC for ; Wed, 5 Jun 2013 09:24:00 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.201 X-Spam-Level: X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tt14rcbTYzNZ for ; Wed, 5 Jun 2013 09:23:52 -0700 (PDT) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 6FE00431FAE for ; Wed, 5 Jun 2013 09:23:52 -0700 (PDT) Received: by mail-wi0-f175.google.com with SMTP id hn14so4994078wib.8 for ; Wed, 05 Jun 2013 09:23:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=EPOCqUhxvsx6MxiGltroN2M8fzPbKtFakbGLmGbwvvU=; b=PZNQGCvz6AdoP2a7f5sGJDG1PUPpa+6Sej7jb8XG4nuV8B14rATgGpJnR9NNZUh+xl Jo69MR4gt/AGfhE17yCEWrWIy7xXxZnOAb5zPMBrPKPb6vkagdR1VkMLadh9668QVRDn MLiiNSl0rB78EK3A1po3UmUsyu42CaXXZOdH1Bj3Ct7u/zPGCk4ho1CVcL6jSwU5HDqo OB9Im4iP6CACXoWQrzNcYX4xf+pKd0MeUWUZw8eiOl8QOeWUZqb7YLusqX9vx34A/an+ 3zUrS9Z73GVcjcFdFbcparmIqgsulZF8whdD08NAmCr+SxALEFz+tSyBZPuyG4RBWiqC ea2g== X-Received: by 10.180.9.7 with SMTP id v7mr7363948wia.61.1370449429947; Wed, 05 Jun 2013 09:23:49 -0700 (PDT) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPSA id fb9sm4458844wid.2.2013.06.05.09.23.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 05 Jun 2013 09:23:49 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [RFC PATCH 0/2] emacs: split show into two parts: show and render Date: Wed, 5 Jun 2013 17:23:44 +0100 Message-Id: <1370449426-2325-1-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2013 16:24:00 -0000 There was some discussion on irc about splitting the very large show.el file into a show part and a render part. I already had some code which did this so am posting for discussion. It needs some slight polishing (eg show-display.el should probably be called render.el) Note it (probably) does not apply to current master: it is based on commit 2cbd68de92e032302a8fc65a6620adb1fc5ba1ae. The split is quite clear: there is essentially only one entry point into render from show which is notmuch-show-insert-forest. The only thing that render needs that is perhaps more natural in show are the visibility functions. As the patches are very large here is a list of the functions which move to render: (defun notmuch-show-fontify-header () (defun notmuch-show-colour-headers () (defun notmuch-show-spaces-n (n) (defun notmuch-clean-address (address) (defun notmuch-show-clean-address (address) (defun notmuch-show-insert-headerline (headers date tags depth) (defun notmuch-show-insert-header (header header-value) (defun notmuch-show-insert-headers (headers) (defun notmuch-show-insert-part-header (nth content-type declared-type &optional name comment) (defun notmuch-show-toggle-part-invisibility (&optional button) (defun notmuch-show-multipart/*-to-list (part) (defun notmuch-show-insert-part-multipart/alternative (msg part content-type nth depth declared-type) (defun notmuch-show-setup-w3m () (defun notmuch-show-w3m-cid-store-internal (content-id (defun notmuch-show-w3m-cid-store (msg part) (defun notmuch-show-w3m-cid-retrieve (url &rest args) (defun notmuch-show-insert-part-multipart/related (msg part content-type nth depth declared-type) (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth depth declared-type) (defun notmuch-show-insert-part-multipart/encrypted (msg part content-type nth depth declared-type) (defun notmuch-show-insert-part-multipart/* (msg part content-type nth depth declared-type) (defun notmuch-show-insert-part-message/rfc822 (msg part content-type nth depth declared-type) (defun notmuch-show-insert-part-text/plain (msg part content-type nth depth declared-type) (defun notmuch-show-insert-part-text/calendar (msg part content-type nth depth declared-type) (defun notmuch-show-insert-part-text/x-vcalendar (msg part content-type nth depth declared-type) (defun notmuch-show-get-mime-type-of-application/octet-stream (part) (defun notmuch-show-insert-part-inline-patch-fake-part (msg part content-type nth depth declared-type) (defun notmuch-show-insert-part-text/html (msg part content-type nth depth declared-type) (defun notmuch-show-insert-part-*/* (msg part content-type nth depth declared-type) (defun notmuch-show-handlers-for (content-type) (defun notmuch-show-insert-bodypart-internal (msg part content-type nth depth declared-type) (defun notmuch-show-create-part-overlays (msg beg end hide) (defun notmuch-show-insert-bodypart (msg part depth &optional hide) (defun notmuch-show-insert-body (msg body depth) (defun notmuch-show-strip-re (string) (defun notmuch-show-insert-msg (msg depth) (defun notmuch-show-insert-tree (tree depth) (defun notmuch-show-insert-thread (thread depth) (defun notmuch-show-insert-forest (forest) (defun notmuch-show-message-visible (props visible-p) (defun notmuch-show-headers-visible (props visible-p) And here is the list of functions remaining in show (defun notmuch-show-turn-on-visual-line-mode () (defun notmuch-show-view-all-mime-parts () (defun notmuch-foreach-mime-part (function mm-handle) (defun notmuch-count-attachments (mm-handle) (defun notmuch-save-attachments (mm-handle &optional queryp) (defun notmuch-show-save-attachments () (defun notmuch-show-with-message-as-text (fn) (defun notmuch-show-print-message () (defun notmuch-show-update-tags (tags) (defun notmuch-show-save-part (message-id nth &optional filename content-type) (defun notmuch-show-view-part (message-id nth &optional filename content-type ) (defun notmuch-show-interactively-view-part (message-id nth &optional filename content-type) (defun notmuch-show-pipe-part (message-id nth &optional filename content-type) (defun notmuch-show-make-symbol (type) (defun notmuch-show-toggle-process-crypto () (defun notmuch-show-toggle-elide-non-matching () (defun notmuch-show-toggle-thread-indentation () (defun notmuch-show-buttonise-links (start end) (defun notmuch-show (thread-id &optional parent-buffer query-context buffer-name) (defun notmuch-show-build-buffer () (defun notmuch-show-capture-state () (defun notmuch-show-apply-state (state) (defun notmuch-show-refresh-view (&optional reset-state) (defun notmuch-show-mode () (defun notmuch-show-move-to-message-top () (defun notmuch-show-move-to-message-bottom () (defun notmuch-show-message-adjust () (defun notmuch-show-message-extent () (defun notmuch-show-message-top () (defun notmuch-show-message-bottom () (defun notmuch-show-goto-message-next () (defun notmuch-show-goto-message-previous () (defun notmuch-show-mapc (function) (defun notmuch-show-set-message-properties (props) (defun notmuch-show-get-message-properties () (defun notmuch-show-set-prop (prop val &optional props) (defun notmuch-show-get-prop (prop &optional props) (defun notmuch-show-get-message-id (&optional bare) (defun notmuch-show-get-messages-ids () (defun notmuch-show-get-messages-ids-search () (defun notmuch-show-get-filename () (defun notmuch-show-get-header (header &optional props) (defun notmuch-show-get-cc () (defun notmuch-show-get-date () (defun notmuch-show-get-from () (defun notmuch-show-get-subject () (defun notmuch-show-get-to () (defun notmuch-show-get-depth () (defun notmuch-show-set-tags (tags) (defun notmuch-show-get-tags () (defun notmuch-show-message-visible-p () (defun notmuch-show-headers-visible-p () (defun notmuch-show-mark-read (&optional unread) (defun notmuch-show-get-message-ids-for-open-messages () (defun notmuch-show-advance () (defun notmuch-show-advance-and-archive () (defun notmuch-show-rewind () (defun notmuch-show-reply (&optional prompt-for-sender) (defun notmuch-show-reply-sender (&optional prompt-for-sender) (defun notmuch-show-forward-message (&optional prompt-for-sender) (defun notmuch-show-next-message (&optional pop-at-end) (defun notmuch-show-previous-message () (defun notmuch-show-next-open-message (&optional pop-at-end) (defun notmuch-show-next-matching-message () (defun notmuch-show-open-if-matched () (defun notmuch-show-goto-first-wanted-message () (defun notmuch-show-previous-open-message () (defun notmuch-show-view-raw-message () (defun notmuch-show-pipe-message (entire-thread command) (defun notmuch-show-tag-message (&rest tag-changes) (defun notmuch-show-tag (&optional tag-changes) (defun notmuch-show-tag-all (&optional tag-changes) (defun notmuch-show-add-tag () (defun notmuch-show-remove-tag () (defun notmuch-show-toggle-visibility-headers () (defun notmuch-show-toggle-message () (defun notmuch-show-open-or-close-all () (defun notmuch-show-next-button () (defun notmuch-show-previous-button () (defun notmuch-show-next-thread (&optional show previous) (defun notmuch-show-next-thread-show () (defun notmuch-show-previous-thread-show () (defun notmuch-show-archive-thread (&optional unarchive) (defun notmuch-show-archive-thread-then-next () (defun notmuch-show-archive-thread-then-exit () (defun notmuch-show-archive-message (&optional unarchive) (defun notmuch-show-archive-message-then-next-or-exit () (defun notmuch-show-archive-message-then-next-or-next-thread () (defun notmuch-show-stash-cc () (defun notmuch-show-stash-date () (defun notmuch-show-stash-filename () (defun notmuch-show-stash-from () (defun notmuch-show-stash-message-id (&optional stash-thread-id) (defun notmuch-show-stash-message-id-stripped () (defun notmuch-show-stash-subject () (defun notmuch-show-stash-tags () (defun notmuch-show-stash-to () (defun notmuch-show-stash-mlarchive-link (&optional mla) (defun notmuch-show-stash-mlarchive-link-and-go (&optional mla) (defun notmuch-show-part-button-default (&optional button) (defun notmuch-show-part-button-save (&optional button) (defun notmuch-show-part-button-view (&optional button) (defun notmuch-show-part-button-interactively-view (&optional button) (defun notmuch-show-part-button-pipe (&optional button) (defun notmuch-show-part-button-internal (button handler) Best wishes Mark Mark Walters (2): initialnullsplit insert forest moved emacs/Makefile.local | 1 + emacs/notmuch-show-display.el | 727 +++++++++++++++++++++++++++++++++++++++++ emacs/notmuch-show-lib.el | 27 ++ emacs/notmuch-show.el | 693 +--------------------------------------- 4 files changed, 756 insertions(+), 692 deletions(-) create mode 100644 emacs/notmuch-show-display.el create mode 100644 emacs/notmuch-show-lib.el -- 1.7.9.1