all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Dan Davison <davison@stats.ox.ac.uk>
Cc: emacs org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: outline-minor-mode and code editing / export
Date: Sun, 7 Jun 2009 17:56:45 +0200	[thread overview]
Message-ID: <658100FA-212E-4D99-9297-5C73A53A0E70@gmail.com> (raw)
In-Reply-To: <87skidxinh.fsf@stats.ox.ac.uk>

Hi Dan,

an alternative solution would be to turn off the major mode hook for
org-edit-src.  Would that be good or bad?  It is probably never a
good idea to have code folded in these snippet buffers?

- Carsten

On Jun 6, 2009, at 9:32 PM, Dan Davison wrote:

> In turn on outline-minor-mode in the language major modes that I  
> use, so
> that code starts up folded, via a call to org-content that is made  
> in my
> major-mode hook. I'm finding that this has two undesirable  
> consequences
> for org-mode, as follows. I have also described a possible solution,  
> as
> implemented by the patch at the end.
>
> 1. The code appears folded on HTML export
>
>   solution: add this line to org-export-format-source-code-or-example
>   (if (fboundp 'show-all) (show-all))
>
> 2. org-edit-src-save does not remember the visibility state, so C-x  
> C-s
>   causes a jump to a different visibility state
>
>   solution: save the value of org-cycle-global-status and, when the
>   edit buffer is re-entered, call one of {org-overview,
>   org-content,show-all} accordingly
>
> Dan
>
> p.s. Carsten: the first hunk in the second diff (org.el) refers to a
> patch that I submitted a few days ago and which you said had been
> applied. http://article.gmane.org/gmane.emacs.orgmode/14154 However, I
> believe it is not in the current git. Apologies if I have got (git)
> confused, but if not I do believe there is still a need for it or an
> equivalent solution: without this change I go to end of edit buffer,  
> hit
> return a few times, and then C-x C-s fails (leaves me in org buffer).
>
>
>
>
> diff --git a/lisp/org-exp.el b/lisp/org-exp.el
> index 0dcd956..5f0ad88 100644
> --- a/lisp/org-exp.el
> +++ b/lisp/org-exp.el
> @@ -2215,7 +2215,6 @@ INDENT was the original indentation of the  
> block."
> 			    (if (functionp mode)
> 				(funcall mode)
> 			      (fundamental-mode))
> -			    (if (fboundp 'show-all) (show-all))
> 			    (font-lock-fontify-buffer)
> 			    (set-buffer-modified-p nil)
> 			    (org-export-htmlize-region-for-paste
> diff --git a/lisp/org.el b/lisp/org.el
> index d124b1a..1eb5e74 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -6875,9 +6875,7 @@ the language, a switch telling of the content  
> should be in a single line."
> 	code)
>   (goto-char (point-min))
>   (if (looking-at "[ \t\n]*\n") (replace-match ""))
> -  (when (re-search-forward "\n[ \t\n]*\\'" nil t)
> -    (replace-match "")
> -    (setq line (min line (org-current-line))))
> +  (if (re-search-forward "\n[ \t\n]*\\'" nil t) (replace-match ""))
>   (when (org-bound-and-true-p org-edit-src-force-single-line)
>     (goto-char (point-min))
>     (while (re-search-forward "\n" nil t)
> @@ -6916,18 +6914,11 @@ the language, a switch telling of the  
> content should be in a single line."
> (defun org-edit-src-save ()
>   "Save parent buffer with current state source-code buffer."
>   (interactive)
> -  (let ((p (point)) (m (mark))
> -       (visibility org-cycle-global-status) msg)
> +  (let ((p (point)) (m (mark)) msg)
>     (org-edit-src-exit)
>     (save-buffer)
>     (setq msg (current-message))
>     (org-edit-src-code)
> -    (when visibility
> -      (setq org-cycle-global-status visibility)
> -      (cond
> -       ((equal org-cycle-global-status 'overview) (org-overview))
> -       ((equal org-cycle-global-status 'contents) (org-content))
> -       ((equal org-cycle-global-status 'all) (show-all))))
>     (push-mark m 'nomessage)
>     (goto-char (min p (point-max)))
>     (message (or msg ""))))
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  parent reply	other threads:[~2009-06-07 15:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-06 19:32 outline-minor-mode and code editing / export Dan Davison
2009-06-06 19:45 ` Dan Davison
2009-06-07 15:56 ` Carsten Dominik [this message]
2009-06-07 17:19   ` Dan Davison
2009-06-08  6:54     ` Carsten Dominik
2009-06-09 13:22       ` Dan Davison
2009-06-09 17:29         ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=658100FA-212E-4D99-9297-5C73A53A0E70@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=davison@stats.ox.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.