From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eduardo Ochs" Subject: doing `M-x org-mode' loses point Date: Fri, 16 Jun 2006 11:41:03 -0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FrFVX-0007Wu-Pk for emacs-orgmode@gnu.org; Fri, 16 Jun 2006 10:41:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FrFVU-0007Qg-8r for emacs-orgmode@gnu.org; Fri, 16 Jun 2006 10:41:11 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FrFVU-0007QQ-4a for emacs-orgmode@gnu.org; Fri, 16 Jun 2006 10:41:08 -0400 Received: from [64.233.166.180] (helo=py-out-1112.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FrFf7-0004pH-Qd for emacs-orgmode@gnu.org; Fri, 16 Jun 2006 10:51:05 -0400 Received: by py-out-1112.google.com with SMTP id e30so644422pya for ; Fri, 16 Jun 2006 07:41:06 -0700 (PDT) Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hello list, Suppose that I have a file with a structure like this: * an org header (some elisp code) * another org header (more elisp code) * another org header (more elisp code) In a file like that it would be natural to switch between org-mode and emacs-lisp-mode; M-x emacs-lisp-mode works as expected, but when I do M-x org-mode the point moves to the first header line, and that doesn't look like the right thing... One solution that just occurred to me is to have a line like this in each elisp block: ;; (progn (save-excursion (org-mode)) (reveal-post-command)) by executing it with C-x C-e (*) I can switch back to org-mode without losing point... the next obvious steps - binding that to a key, patching org-mode, etc, are not relevant here, so I won't talk about them... So, is this org-mode-jumps-to-the-first-header-line a bug or a feature? Is there a standard workaround? Thanks in advance, cheers, Eduardo Ochs http://angg.twu.net/ eduardoochs@gmail.com (*): We need this: (autoload 'reveal-post-command "reveal"))