emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: org-catch-invisible-edits [8.2.5h (8.2.5h-30-gdd810b-elpa @ ~/.emacs.d/elpa/org/)]
@ 2014-03-06 17:46 Paul Stansell
  2014-03-13 14:24 ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Stansell @ 2014-03-06 17:46 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

Today I came across org-catch-invisible-edits, but I'm struggling to
get it to work.  Since I've never had it working it's possible that
I'm misunderstanding it or doing something wrong, or maybe it's
broken.

In my .emacs file I put

  (setq org-catch-invisible-edits 'show)

but both 'M-x query-replace' and 'M-x replace-string' still replace
hidden strings in folded sections of an org file.

Thanks,

Paul

current state:
==============
(setq
 org-tab-first-hook '(org-hide-block-toggle-maybe
              org-src-native-tab-command-maybe
              org-babel-hide-result-toggle-maybe
              org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook
              org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-shell-link-function 'yes-or-no-p
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
             org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[nil "\300\301\302\303\304$\207"
           [org-add-hook change-major-mode-hook org-show-block-all
            append local]
           5]
         #[nil "\300\301\302\303\304$\207"
           [org-add-hook change-major-mode-hook
            org-babel-show-result-all append local]
           5]
         org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
              org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
          org-cycle-hide-inline-tasks org-cycle-show-empty-lines
          org-optimize-window-after-visibility-change)
 org-catch-invisible-edits 'show
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug: org-catch-invisible-edits [8.2.5h (8.2.5h-30-gdd810b-elpa @ ~/.emacs.d/elpa/org/)]
  2014-03-06 17:46 Bug: org-catch-invisible-edits [8.2.5h (8.2.5h-30-gdd810b-elpa @ ~/.emacs.d/elpa/org/)] Paul Stansell
@ 2014-03-13 14:24 ` Bastien
  2014-03-13 16:24   ` Paul Stansell
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2014-03-13 14:24 UTC (permalink / raw)
  To: Paul Stansell; +Cc: emacs-orgmode

Hi Paul,

Paul Stansell <paulstansell@gmail.com> writes:

> Today I came across org-catch-invisible-edits, but I'm struggling to
> get it to work.  Since I've never had it working it's possible that
> I'm misunderstanding it or doing something wrong, or maybe it's
> broken.
>
> In my .emacs file I put
>
>   (setq org-catch-invisible-edits 'show)
>
> but both 'M-x query-replace' and 'M-x replace-string' still replace
> hidden strings in folded sections of an org file.

The name of the option is a bit misleading: your setup will catch
*insertions* not editions.  To put it simply, it's only active when
inserting a character, not when using general-purpose editing commands
like replace-string.

I'm not sure it's worth using another name, though.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug: org-catch-invisible-edits [8.2.5h (8.2.5h-30-gdd810b-elpa @ ~/.emacs.d/elpa/org/)]
  2014-03-13 14:24 ` Bastien
@ 2014-03-13 16:24   ` Paul Stansell
  2014-04-20  7:59     ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Stansell @ 2014-03-13 16:24 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

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

Hi Bastien,

Thanks for that info on org-catch-invisible-edits.  It wasn't clear to me
as the documentation implies that it helps when you "inadvertently edit an
invisible part of the buffer", but it seems that the edits have to be
results of key presses (not yanks or replaces, etc).

I'm not sure how useful I would find the function.  I'd like a way to stop
any edits (including yanks etc.) on invisible parts of a buffer.

I experimented with org-catch-invisible-edits by typing and deleting
characters in folded sections of a simple org file.  It seem to work well
if the insertions or deletions occur at one hidden level down.  In this
case it opens the folded section and shows the edit after a short delay.
But if I edit or delete two hidden sections down it doesn't seem to work
properly as it only open the first hidden section and so the edit, which is
another level down, is not shown.

For example, for the org file below, editing the line "level 2" when both
"Section 1" and "Section 2" are folded (hidden) causes only "Section 1" to
be unfolded with "Section 2" still folded inside it.  Thus, the edits are
not visible.

* section 1
  level 1
** section 2
   level 2

Kind regards,

Paul



On 13 March 2014 14:24, Bastien <bzg@gnu.org> wrote:

> Hi Paul,
>
> Paul Stansell <paulstansell@gmail.com> writes:
>
> > Today I came across org-catch-invisible-edits, but I'm struggling to
> > get it to work.  Since I've never had it working it's possible that
> > I'm misunderstanding it or doing something wrong, or maybe it's
> > broken.
> >
> > In my .emacs file I put
> >
> >   (setq org-catch-invisible-edits 'show)
> >
> > but both 'M-x query-replace' and 'M-x replace-string' still replace
> > hidden strings in folded sections of an org file.
>
> The name of the option is a bit misleading: your setup will catch
> *insertions* not editions.  To put it simply, it's only active when
> inserting a character, not when using general-purpose editing commands
> like replace-string.
>
> I'm not sure it's worth using another name, though.
>
> --
>  Bastien
>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug: org-catch-invisible-edits [8.2.5h (8.2.5h-30-gdd810b-elpa @ ~/.emacs.d/elpa/org/)]
  2014-03-13 16:24   ` Paul Stansell
@ 2014-04-20  7:59     ` Bastien
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2014-04-20  7:59 UTC (permalink / raw)
  To: Paul Stansell; +Cc: emacs-orgmode

Hi Paul,

Paul Stansell <paulstansell@gmail.com> writes:

> For example, for the org file below, editing the line "level 2" when
> both "Section 1" and "Section 2" are folded (hidden) causes only
> "Section 1" to be unfolded with "Section 2" still folded inside it. 
> Thus, the edits are not visible.
>
> * section 1
>   level 1
> ** section 2
>    level 2

this is now fixed, thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-20  7:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-06 17:46 Bug: org-catch-invisible-edits [8.2.5h (8.2.5h-30-gdd810b-elpa @ ~/.emacs.d/elpa/org/)] Paul Stansell
2014-03-13 14:24 ` Bastien
2014-03-13 16:24   ` Paul Stansell
2014-04-20  7:59     ` Bastien

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).