]> git.notmuchmail.org Git - notmuch/blob - emacs/notmuch-lib.el
fix notmuch_message_file_get_header
[notmuch] / emacs / notmuch-lib.el
1 ;; notmuch-lib.el --- common variables, functions and function declarations
2 ;;
3 ;; Copyright © Carl Worth
4 ;;
5 ;; This file is part of Notmuch.
6 ;;
7 ;; Notmuch is free software: you can redistribute it and/or modify it
8 ;; under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation, either version 3 of the License, or
10 ;; (at your option) any later version.
11 ;;
12 ;; Notmuch is distributed in the hope that it will be useful, but
13 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 ;; General Public License for more details.
16 ;;
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with Notmuch.  If not, see <http://www.gnu.org/licenses/>.
19 ;;
20 ;; Authors: Carl Worth <cworth@cworth.org>
21
22 ;; This is an part of an emacs-based interface to the notmuch mail system.
23
24 (defvar notmuch-command "notmuch"
25   "Command to run the notmuch binary.")
26
27 (declare-function notmuch-toggle-invisible-action "notmuch" (cite-button))
28
29 (define-button-type 'notmuch-button-invisibility-toggle-type
30   'action 'notmuch-toggle-invisible-action
31   'follow-link t
32   'face 'font-lock-comment-face)
33
34 (define-button-type 'notmuch-button-headers-toggle-type
35   'help-echo "mouse-1, RET: Show headers"
36   :supertype 'notmuch-button-invisibility-toggle-type)
37
38 ;; XXX: This should be a generic function in emacs somewhere, not
39 ;; here.
40 (defun point-invisible-p ()
41   "Return whether the character at point is invisible.
42
43 Here visibility is determined by `buffer-invisibility-spec' and
44 the invisible property of any overlays for point. It doesn't have
45 anything to do with whether point is currently being displayed
46 within the current window."
47   (let ((prop (get-char-property (point) 'invisible)))
48     (if (eq buffer-invisibility-spec t)
49         prop
50       (or (memq prop buffer-invisibility-spec)
51           (assq prop buffer-invisibility-spec)))))
52
53 (provide 'notmuch-lib)