emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: 42 147 <aeuster@gmail.com>
To: "Thomas S. Dye" <tsd@tsdye.com>, Org Mode <emacs-orgmode@gnu.org>
Subject: Re: saving state of buffer
Date: Fri, 22 Mar 2013 12:36:50 -0400	[thread overview]
Message-ID: <CAMgvimF4NyXSTZodSwwVeoP1FQ=dqvRS-OdiMg8efrrNHLUgbA@mail.gmail.com> (raw)
In-Reply-To: <m14ng4ka2s.fsf@tsdye.com>

[-- Attachment #1: Type: text/plain, Size: 4143 bytes --]

Thomas,

Could you provide a recipe? As a test, I ran Emacs with just the following
code in my .emacs:

(require 'saveplace)
(setq-default save-place t)

(setq org-show-siblings '((default) (isearch t) (bookmark-jump . t)))

Emacs ran without any errors, and I made a test.org file, created multiple
headlines, and left point in the middle of a paragraph. Everything restored
fine after closing and revisiting the file.

I was hoping someone else would jump in and interpret those debugging
messages, because I'm not proficient enough in Emacs Lisp yet, nor familiar
enough with the org-mode code base. All I can do is try and reproduce your
error. The code seems to be robust, though.

Tried my best with what I have,

42

2013/3/21 Thomas S. Dye <tsd@tsdye.com>

> 42 147 <aeuster@gmail.com> writes:
>
> >> Good - May I suggest, that you write a step - by step howto and mail
> >> it here or even add it to
> >> worg? This would be a useful addition.
> >
> > I adapted this thread the best I could. Feel free to do with it what you
> > wish.
> >
> > QUESTION
> >
> > How do I restore the state of my buffer where I left it?
> >
> > ANSWER
> >
> > When Emacs first visits an Org file, the global state is set to
> > OVERVIEW, i.e., only the top level headlines are visible.
> >
> > If you wish Emacs to restore the position of point where you left it in
> > your previous session, add the following code to your .emacs:
> >
> > (require 'saveplace)
> > (setq-default save-place t)
> >
> > If you wish Org-mode to restore the folded state of the buffer (not just
> > the position of point), you can either use customize, or add the
> following
> > to .emacs:
> >
> > (setq org-show-siblings '((default) (isearch t) (bookmark-jump . t)))
>
> This doesn't work for me:
>
> Debugger entered--Lisp error: (wrong-type-argument listp t)
>   mapcar(#[(f) " T        \306\n!\204 \n:\203 \307\n \"\202
> \n*\211\203`\310\f
> \"\203` \311\312
> \"\311\313
> \"D \306\n!\203B\314\n \"\202\\\n\203O\314\315\n #\202\\ \203Z @\202\\
> *\202a
>    \306\n!\204y\n:\203y\307\n \"\202z\n*\206\200
> C \306\n!\203\223\314\n \"\202\255\n\203\240\314\315\n #\202\255 \203\253
> @\202\255 ,\207" [i *orgtbl-efmt* fmt efmt orgtbl-exp-regexp f functionp
> plist-get string-match match-string 1 2 apply format args *orgtbl-fmt*
> *orgtbl-default-fmt*] 6] (bookmark-jump . t))
>   orgtbl-format-line((bookmark-jump . t))
>   orgtbl-format-section(nil)
>   orgtbl-to-generic(((default) (isearch t) (bookmark-jump . t))
> (:remove-newlines t :tstart nil :tend nil :hline "|---" :sep " | " :lstart
> "| " :lend " |" :fmt (lambda (cell) (format "%s" cell))))
>   orgtbl-to-orgtbl(((default) (isearch t) (bookmark-jump . t)) (:fmt
> (lambda (cell) (format "%s" cell))))
>   org-babel-insert-result(((default) (isearch t) (bookmark-jump . t))
> ("replace") ("emacs-lisp" "(require 'saveplace)\n(setq-default save-place
> t)\n(setq org-show-siblings '((default) (isearch t) (bookmark-jump . t)))"
> ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb .
> "yes") (:tangle . "yes") (:exports . "code") (:results . "replace")
> (:session . "none") (:padnewline . "yes") (:hlines . "yes") (:colnames .
> "no") (:result-type . value) (:result-params "replace") (:rowname-names)
> (:colname-names)) "" nil 0) nil 0 "emacs-lisp")
>   org-babel-execute-src-block(nil ("emacs-lisp" "(require
> 'saveplace)\n(setq-default save-place t)\n(setq org-show-siblings
> '((default) (isearch t) (bookmark-jump . t)))" ((:comments . "") (:shebang
> . "") (:cache . "no") (:padline . "") (:noweb . "yes") (:tangle . "yes")
> (:exports . "code") (:results . "replace") (:session . "none") (:padnewline
> . "yes") (:hlines . "yes") (:colnames . "no") (:result-type . value)
> (:result-params "replace") (:rowname-names) (:colname-names)) "" nil 0))
>   org-babel-execute-src-block-maybe()
>   org-babel-execute-maybe()
>   org-babel-execute-safely-maybe()
>   run-hook-with-args-until-success(org-babel-execute-safely-maybe)
>   org-ctrl-c-ctrl-c(nil)
>   call-interactively(org-ctrl-c-ctrl-c nil nil)
>
> All the best,
> Tom
>
>
> --
> Thomas S. Dye
> http://www.tsdye.com
>

[-- Attachment #2: Type: text/html, Size: 5379 bytes --]

  reply	other threads:[~2013-03-22 16:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20 11:19 saving state of buffer 42 147
2013-03-20 13:49 ` Bastien
2013-03-20 17:00   ` 42 147
2013-03-20 17:09     ` Christoph
2013-03-20 18:28     ` 42 147
2013-03-20 18:57       ` Loyall, David
2013-03-21  6:58       ` Carsten Dominik
2013-03-21  7:14         ` Marcin Borkowski
2013-03-21  9:05         ` 42 147
2013-03-21  9:23           ` Rainer M Krug
2013-03-21  9:28             ` Carsten Dominik
2013-03-21  9:42               ` Rainer M Krug
2013-03-21 10:16                 ` 42 147
2013-03-21 11:02                   ` Carsten Dominik
2013-03-21 11:25                     ` Rainer M Krug
2013-03-21 11:38                       ` Carsten Dominik
2013-03-21 11:59                         ` Rainer M Krug
2013-03-21 13:50                           ` Carsten Dominik
2013-04-06  1:03                             ` Bastien
2013-03-21 16:10                   ` Thomas S. Dye
2013-03-22 16:36                     ` 42 147 [this message]
2013-03-22 21:30                       ` Thomas S. Dye
2013-03-22 22:24                         ` 42 147
2013-03-21  9:47           ` 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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to='CAMgvimF4NyXSTZodSwwVeoP1FQ=dqvRS-OdiMg8efrrNHLUgbA@mail.gmail.com' \
    --to=aeuster@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tsd@tsdye.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).