From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: a quick way to switch orgmode notes between read-only/editing? Date: Thu, 17 Jul 2014 15:50:17 +0200 Message-ID: <87zjg8w0va.fsf@gmail.com> References: <874mygxh5r.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7m51-0003mo-D0 for emacs-orgmode@gnu.org; Thu, 17 Jul 2014 09:50:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7m4s-00011X-MG for emacs-orgmode@gnu.org; Thu, 17 Jul 2014 09:50:39 -0400 Received: from plane.gmane.org ([80.91.229.3]:41966) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7m4s-00011C-DW for emacs-orgmode@gnu.org; Thu, 17 Jul 2014 09:50:30 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1X7m4q-0005rr-N8 for emacs-orgmode@gnu.org; Thu, 17 Jul 2014 15:50:28 +0200 Received: from g231111159.adsl.alicedsl.de ([92.231.111.159]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Jul 2014 15:50:28 +0200 Received: from tjolitz by g231111159.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Jul 2014 15:50:28 +0200 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: emacs-orgmode@gnu.org Xebar Saram writes: > PS. Also can anyone think of a way to get a visual cue when the file > is in "view mode"? There is a visual cue in the mode-line: ,---- | 1-UUU:**-- `---- changes to ,---- | 1-UUU:%%-- `---- when view-mode is active > On Thu, Jul 17, 2014 at 4:22 PM, Xebar Saram > wrote: > > Thx Thorston this looks great > > > can you recommend a way to open all orgmode notes in view mode by > default, i guess i would then bind a key to disable view mode to > start editing right? > > > thanks alot again > > > Z > > > > > > On Thu, Jul 17, 2014 at 4:13 PM, Thorsten Jolitz > wrote: > > > > Xebar Saram writes: > > > hi all > > > > i keep once and a while screwing up my notes with unintended > editing > > (erroneous key presses etc) and was wondering if any one > knew of a way > > to to switch orgmode notes between read-only/editing? i have > used such > > options in previous note taking apps that had that option > build in but > > i understand that since orgmode notes are just text files > its a bit > > more complicated > > > > i would love to hear any suggestions on how you guys deal > with > > protecting notes/data that still needs to be edited (i do > use git ofc > > but i dont always know i screwed my notes :)) > > > ,----[ C-h f view-mode RET ] > | view-mode is an interactive autoloaded compiled Lisp > function in > | `view.el'. > | > | (view-mode &optional ARG) > | > | Toggle View mode, a minor mode for viewing text but not > editing it. > | With a prefix argument ARG, enable View mode if ARG is > positive, > | and disable it otherwise. If called from Lisp, enable View > mode > | if ARG is omitted or nil. > | > | When View mode is enabled, commands that do not change the > buffer > | contents are available as usual. Kill commands insert text > in > | kill buffers but do not delete. Most other commands beep and > | tell the user that the buffer is read-only. > | > | > | > | The following additional commands are provided. Most > commands > | take prefix arguments. Page commands default to "page size" > | lines which is almost a whole window, or number of lines set > by > | z or w. > | Half page commands default to and set "half page size" lines > | which initially is half a window full. Search commands > default > | to a repeat count of one. > | > | H, h, ? This message. > | Digits provide prefix arguments. > | - negative prefix argument. > | < move to the beginning of buffer. > | > move to the end of buffer. > | o scroll so that buffer end is at last line of window. > | SPC scroll forward "page size" lines. > | With prefix scroll forward prefix lines. > | DEL scroll backward "page size" lines. > | With prefix scroll backward prefix lines. > | z like SPC but with prefix sets "page size" to prefix. > | w like DEL but with prefix sets "page size" to prefix. > | d scroll forward "half page size" lines. With prefix, sets > | "half page size" to prefix lines and scrolls forward that > much. > | u scroll backward "half page size" lines. With prefix, sets > | "half page size" to prefix lines and scrolls backward that > much. > | RET, LFD scroll forward one line. With prefix scroll forward > prefix line(s). > | y scroll backward one line. With prefix scroll backward > prefix line(s). > | F revert-buffer if necessary and scroll forward. > | Use this to view a changing file. > | = prints the current line number. > | % goes prefix argument (default 100) percent into buffer. > | g goes to line given by prefix argument (default first > line). > | . set the mark. > | x exchanges point and mark. > | @ return to mark and pops mark ring. > | Mark ring is pushed at start of every successful search and > when > | jump to line occurs. The mark is set on jump to buffer start > or end. > | m save current position in character register. > | ' go to position saved in character register. > | s do forward incremental search. > | r do reverse incremental search. > | / searches forward for regular expression, starting after > current page. > | ! and @ have a special meaning at the beginning of the > regexp. > | ! means search for a line with no match for regexp. @ means > start > | search at beginning (end for backward search) of buffer. > | \ searches backward for regular expression, starting before > current page. > | n searches forward for last regular expression. > | p searches backward for last regular expression. > | q quit View mode, restoring this window and buffer to > previous state. > | q is the normal way to leave view mode. > | e exit View mode but stay in current buffer. Use this if you > started > | viewing a buffer (file) and find out you want to edit it. > | This command restores the previous read-only status of the > buffer. > | E exit View mode, and make the current buffer editable > | even if it was not editable before entry to View mode. > | Q quit View mode, restoring all windows to previous state. > | c quit View mode and maybe switch buffers, but don't kill > this buffer. > | C quit View mode, kill current buffer and go back to other > buffer. > | > | The effect of c, q and C depends on how view-mode was > entered. If it was > | entered by view-file, view-file-other-window, > view-file-other-frame, or > | M-x dired-view-file (M-x view-file, M-x > view-file-other-window, > | M-x view-file-other-frame, or the Dired mode v command), > | then q will try to kill the current buffer. > | If view-mode was entered from another buffer, by C-c v, > | M-x view-buffer-other-window, M-x view-buffer-other frame, > M-x view-file, > | M-x view-file-other-window, or M-x view-file-other-frame, > | then c, q and C will return to that buffer. > | > | Entry to view-mode runs the normal hook `view-mode-hook'. > | > | [back] > `---- > > -- > cheers, > Thorsten > > > > > > -- cheers, Thorsten