From mboxrd@z Thu Jan 1 00:00:00 1970 From: 42 147 Subject: Re: saving state of buffer Date: Fri, 22 Mar 2013 12:36:50 -0400 Message-ID: References: <878v5inpfd.fsf@bzg.ath.cx> <514AD187.6080903@gmail.com> <514AD606.30505@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d0408d3f7e4150c04d8860f2c Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJ4xa-0002pO-Fz for emacs-orgmode@gnu.org; Fri, 22 Mar 2013 12:36:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJ4xY-00016p-8f for emacs-orgmode@gnu.org; Fri, 22 Mar 2013 12:36:54 -0400 Received: from mail-la0-x22c.google.com ([2a00:1450:4010:c03::22c]:36455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJ4xX-00016a-Sv for emacs-orgmode@gnu.org; Fri, 22 Mar 2013 12:36:52 -0400 Received: by mail-la0-f44.google.com with SMTP id eb20so7709746lab.3 for ; Fri, 22 Mar 2013 09:36:50 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Thomas S. Dye" , Org Mode --f46d0408d3f7e4150c04d8860f2c Content-Type: text/plain; charset=ISO-8859-1 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 > 42 147 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 > --f46d0408d3f7e4150c04d8860f2c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thomas,

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

(require 'saveplace)
(se= tq-default save-place t)

(setq org-show-siblings '((default) (is= earch t) (bookmark-jump . t)))

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

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

Tried my best with what = I have,

42

2013/3/21 Thomas S. Dye= <t= sd@tsdye.com>
42 147 <aeuster@gmail.com> writes:

>> Good - May I suggest, that you write a step - by step howto and ma= il
>> 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 y= ou
> 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 i= n
> 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 ju= st
> the position of point), you can either use customize, or add the follo= wing
> 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)
=A0 mapcar(#[(f) " T =A0 =A0 =A0 =A0\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
=A0 =A0\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 fun= ctionp plist-get string-match match-string 1 2 apply format args *orgtbl-fm= t* *orgtbl-default-fmt*] 6] (bookmark-jump . t))
=A0 orgtbl-format-line((bookmark-jump . t))
=A0 orgtbl-format-section(nil)
=A0 orgtbl-to-generic(((default) (isearch t) (bookmark-jump . t)) (:remove-= newlines t :tstart nil :tend nil :hline "|---" :sep " | &quo= t; :lstart "| " :lend " |" :fmt (lambda (cell) (format = "%s" cell))))
=A0 orgtbl-to-orgtbl(((default) (isearch t) (bookmark-jump . t)) (:fmt (lam= bda (cell) (format "%s" cell))))
=A0 org-babel-insert-result(((default) (isearch t) (bookmark-jump . t)) (&q= uot;replace") ("emacs-lisp" "(require 'saveplace)\n= (setq-default save-place t)\n(setq org-show-siblings '((default) (isear= ch t) (bookmark-jump . t)))" ((:comments . "") (:shebang . &= quot;") (: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-nam= es) (:colname-names)) "" nil 0) nil 0 "emacs-lisp")
=A0 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 . "&quo= t;) (:shebang . "") (:cache . "no") (:padline . "&= quot;) (:noweb . "yes") (:tangle . "yes") (:exports . &= quot;code") (:results . "replace") (:session . "none&qu= ot;) (:padnewline . "yes") (:hlines . "yes") (:colnames= . "no") (:result-type . value) (:result-params "replace&quo= t;) (:rowname-names) (:colname-names)) "" nil 0))
=A0 org-babel-execute-src-block-maybe()
=A0 org-babel-execute-maybe()
=A0 org-babel-execute-safely-maybe()
=A0 run-hook-with-args-until-success(org-babel-execute-safely-maybe)
=A0 org-ctrl-c-ctrl-c(nil)
=A0 call-interactively(org-ctrl-c-ctrl-c nil nil)

All the best,
Tom


--
Thomas S. Dye
http://www.tsdye.com=

--f46d0408d3f7e4150c04d8860f2c--