From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Schmitt Newsgroups: gmane.emacs.help Subject: Re: outorg-edit-as-org and mu4e Date: Wed, 23 Oct 2013 11:54:42 +0200 Organization: IRISA, INRIA Rennes (FR) Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1382523022 6600 80.91.229.3 (23 Oct 2013 10:10:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2013 10:10:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 23 12:10:26 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VYvOP-00029D-0N for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Oct 2013 12:10:21 +0200 Original-Received: from localhost ([::1]:48508 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYvOO-00060i-5t for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Oct 2013 06:10:20 -0400 X-Received: by 10.204.54.2 with SMTP id o2mr162369bkg.2.1382522835681; Wed, 23 Oct 2013 03:07:15 -0700 (PDT) Original-Newsgroups: gnu.emacs.help Original-Lines: 69 Original-NNTP-Posting-Host: top.irisa.fr Original-X-Trace: news-v3.irisa.fr 1382522081 23406 131.254.16.41 (23 Oct 2013 09:54:41 GMT) Original-X-Complaints-To: abuse@irisa.fr Original-NNTP-Posting-Date: Wed, 23 Oct 2013 09:54:41 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:K4EmF8tzWWZHIpgT5V3LITc5CU8= Original-Path: usenet.stanford.edu!et7no1628352wib.1!news-out.google.com!ed8ni330138wic.0!nntp.google.com!proxad.net!feeder1-2.proxad.net!feed.ac-versailles.fr!news.ecp.fr!news-rocq.inria.fr!news.irisa.fr!.POSTED!not-for-mail Original-Xref: usenet.stanford.edu gnu.emacs.help:201897 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94167 Archived-At: Thorsten Jolitz writes: > Ok, then its not a bug but just a (slightly) different use case. Yes. > I don't use mu4e, actually I never heard of it (is it good?). I like it. It may not be as full-featured as gnus, but it has reliable links to messages (even when they are moved around). I could never get the nnregistry to work reliably for me. > Could you test these changes and let me know if it works for you? Then I'm > happy to apply them to outorg, no matter if this version: > > #+begin_src emacs-lisp > (and (derived-mode-p 'message-mode) > (outorg-prepare-message-mode-buffer-for-editing)) > #+end_src I tried this and it almost works, since mu4e make the "--text follows this line--" read only. Here is how I patched outorg.el: #+BEGIN_SRC diff Changes from head to working tree 1 file changed, 4 insertions(+), 3 deletions(-) outorg.el | 7 ++++--- Modified outorg.el diff --git a/outorg.el b/outorg.el index 189ddb9..ab3e48d 100644 --- a/outorg.el +++ b/outorg.el @@ -469,7 +469,8 @@ headline and out-comments all text below this line - if any." (goto-char (point-min)) ;; (re-search-forward "--text follows this line--" nil 'NOERROR) (re-search-forward mail-header-separator nil 'NOERROR) - (replace-match "* \\&") + (let ((inhibit-read-only t)) + (replace-match "* \\&")) (beginning-of-line) (let ((start-body (point))) (comment-region start-body (point-max)) @@ -994,7 +995,7 @@ With ARG, act conditional on the raw value of ARG: (error "Cannot edit read-only buffer") (setq inhibit-read-only t) (setq outorg-code-buffer-read-only-p t))) - (and (eq major-mode 'message-mode) + (and (derived-mode-p 'message-mode) (outorg-prepare-message-mode-buffer-for-editing)) (and (eq major-mode 'picolisp-mode) (save-excursion @@ -1076,7 +1077,7 @@ With ARG, act conditional on the raw value of ARG: ;; (marker-position outorg-code-buffer-point-marker)) (and outorg-code-buffer-read-only-p (setq inhibit-read-only nil)) - (and (eq major-mode 'message-mode) + (and (derived-mode-p 'message-mode) (outorg-prepare-message-mode-buffer-for-sending)) (and (eq major-mode 'picolisp-mode) (save-excursion #+END_SRC I've made a few tests and things seem to work. I'll keep using it and will report if something break. Thanks, Alan