diff options
author | Bastien Guerry <bzg@altern.org> | 2012-02-02 15:56:30 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2012-05-06 00:42:07 +0200 |
commit | 587b534544a3c631f9a167dfadbd5a511226b1c2 (patch) | |
tree | 96d782f363a03aa79d5897ed793334bc2e824583 | |
parent | 0dbe17b8e001b7df079ed4325057f3abfb191138 (diff) | |
download | org-mode-587b534544a3c631f9a167dfadbd5a511226b1c2.tar.gz |
org.el: Prevent the display of messages when cycling from with a Gnus article buffer.
* org.el (org-cycle-internal-global): Prevent the display of
messages when cycling from with a Gnus article buffer.
-rw-r--r-- | lisp/org.el | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/lisp/org.el b/lisp/org.el index 28218ed..a96c42e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6256,34 +6256,36 @@ in special contexts. (defun org-cycle-internal-global () "Do the global cycling action." - (cond - ((and (eq last-command this-command) - (eq org-cycle-global-status 'overview)) - ;; We just created the overview - now do table of contents - ;; This can be slow in very large buffers, so indicate action - (run-hook-with-args 'org-pre-cycle-hook 'contents) - (message "CONTENTS...") - (org-content) - (message "CONTENTS...done") - (setq org-cycle-global-status 'contents) - (run-hook-with-args 'org-cycle-hook 'contents)) - - ((and (eq last-command this-command) - (eq org-cycle-global-status 'contents)) - ;; We just showed the table of contents - now show everything - (run-hook-with-args 'org-pre-cycle-hook 'all) - (show-all) - (message "SHOW ALL") - (setq org-cycle-global-status 'all) - (run-hook-with-args 'org-cycle-hook 'all)) + ;; Hack to avoid display of messages for .org attachments in Gnus + (let ((ga (string-match "\\*fontification" (buffer-name)))) + (cond + ((and (eq last-command this-command) + (eq org-cycle-global-status 'overview)) + ;; We just created the overview - now do table of contents + ;; This can be slow in very large buffers, so indicate action + (run-hook-with-args 'org-pre-cycle-hook 'contents) + (unless ga (message "CONTENTS...")) + (org-content) + (unless ga (message "CONTENTS...done")) + (setq org-cycle-global-status 'contents) + (run-hook-with-args 'org-cycle-hook 'contents)) + + ((and (eq last-command this-command) + (eq org-cycle-global-status 'contents)) + ;; We just showed the table of contents - now show everything + (run-hook-with-args 'org-pre-cycle-hook 'all) + (show-all) + (unless ga (message "SHOW ALL")) + (setq org-cycle-global-status 'all) + (run-hook-with-args 'org-cycle-hook 'all)) - (t - ;; Default action: go to overview - (run-hook-with-args 'org-pre-cycle-hook 'overview) - (org-overview) - (message "OVERVIEW") - (setq org-cycle-global-status 'overview) - (run-hook-with-args 'org-cycle-hook 'overview)))) + (t + ;; Default action: go to overview + (run-hook-with-args 'org-pre-cycle-hook 'overview) + (org-overview) + (unless ga (message "OVERVIEW")) + (setq org-cycle-global-status 'overview) + (run-hook-with-args 'org-cycle-hook 'overview))))) (defun org-cycle-internal-local () "Do the local cycling action." |