Org-mode mailing list
 help / color / mirror / Atom feed
* Bug: org-catch-invisible-edits doesn't actually catch most deletions [9.4 (9.4-41-g9bb930-elpaplus @ /home/omarantolin/.emacs.d/elpa/org-plus-contrib-20201116/)]
@ 2020-11-23  6:33 Omar Antolín Camarena
  0 siblings, 0 replies; only message in thread
From: Omar Antolín Camarena @ 2020-11-23  6:33 UTC (permalink / raw)
  To: emacs-orgmode

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

Your bug report will be posted to the Org mailing list.

Setting org-catch-invisible-edits to 'error does catch org-delete-backward-char (bound to <backspace> by default), but it doesn't catch backward-kill-word (<C-backspace>), or kill-word with argument -1 (M-- M-d), or backward-kill-sexp (ESC <C-backspace>).

Steps to reproduce:

1. Create an org file with the following 3 lines:

* Stop, hammer time!
You can't touch this
* Break it down!

2. Run emacs -Q and visit the file.

3. M-: (setq org-catch-invisible-edits 'error)

4. Make sure the first headline is folded and place point after the ellipsis.

5. Now you can try any of the commands mentioned in the first paragraph.

The org-catch-invisible-edits will successfully block you from using <backspace>, but any of the other command I mentioned will silently delete the word "this". Because of the variable's name, I would expect all these commands to be blocked.

Maybe technically this isn't a bug, since the docstring for org-catch-invisible-edits only says: "Check if in invisible region before inserting or deleting a character." So you can argue it only promises to block deletion if you attempt it one character at a time, and if you try to delete a word, the docstring doesn't promise to stop you.

I'd suggest that naming the variable org-catch-invisible-edits strongly suggests it should catch all deletions in the invisible text and that the current behavior is misleading.

Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, cairo version 1.16.0)
 of 2020-10-13, unofficial emacs-snapshot build:, git commit 8d241e8840fdb02dcfce52425626dd8f2125e51a
Package: Org mode version 9.4 (9.4-41-g9bb930-elpaplus @ /home/omarantolin/.emacs.d/elpa/org-plus-contrib-20201116/)

current state:
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-link-shell-confirm-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-refile-targets '((nil :maxlevel . 2) ("~/Notes/" :maxlevel . 2)
                      ("~/Notes/" :level . 0)
                      ("~/Notes/" :level . 3))
 org-pretty-entities t
 org-capture-bookmark nil
 org-latex-default-packages-alist '(("AUTO" "inputenc" t ("pdflatex"))
                                    ("" "graphicx" t) ("" "grffile" t)
                                    ("" "longtable" nil) ("" "wrapfig" nil)
                                    ("" "rotating" nil) ("normalem" "ulem" t)
                                    ("" "amsmath" t) ("" "amssymb" t)
                                    ("" "capt-of" nil) ("" "hyperref" nil))
 org-special-ctrl-a/e t
 org-agenda-files '("~/Notes/" "~/Notes/"
                    "~/Notes/" "~/Notes/")
 org-mode-hook '(#[0 "\301\211%10\207"
                   [imenu-create-index-function org-imenu-get-tree] 2]
                 #[0 "\300\301\302\303\304$\207"
                   [add-hook change-major-mode-hook org-show-all append local]
                 #[0 "\300\301\302\303\304$\207"
                   [add-hook change-major-mode-hook org-babel-show-result-all
                    append local]
                 org-babel-result-hide-spec org-babel-hide-all-hashes
                 ediff-with-org-show-all turn-on-org-cdlatex beginend-org-mode
 org-outline-path-complete-in-steps nil
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300%1\236A\207" [:title] 3 "\n\n(fn ENTRY)"]
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
 org-hide-leading-stars t
 org-hide-emphasis-markers t
 org-highlight-latex-and-related '(latex script entities)
 org-ellipsis "…"
 org-agenda-loop-over-headlines-in-active-region nil
 org-src-lang-modes '(("latex-macros" . latex) ("inline-js" . javascript)
                      ("redis" . redis) ("php" . php) ("arduino" . arduino)
                      ("C" . c) ("C++" . c++) ("asymptote" . asy)
                      ("bash" . sh) ("beamer" . latex) ("calc" . fundamental)
                      ("cpp" . c++) ("ditaa" . artist) ("dot" . fundamental)
                      ("elisp" . emacs-lisp) ("ocaml" . tuareg)
                      ("screen" . shell-script) ("shell" . sh)
                      ("sqlite" . sql))
 org-occur-hook '(org-first-headline-recenter)
 org-agenda-mode-hook '(beginend-org-agenda-mode)
 org-structure-template-alist '(("a" . "export ascii") ("c" . "center")
                                ("C" . "comment") ("e" . "example")
                                ("E" . "export") ("h" . "export html")
                                ("l" . "export latex") ("q" . "quote")
                                ("s" . "src") ("v" . "verse")
                                ("thm" . "theorem") ("pf" . "proof")
                                ("lem" . "lemma") ("cor" . "corollary")
                                ("def" . "definition") ("rem" . "remark")
                                ("exer" . "exercise") ("prop" . "proposition")
                                ("el" . "src emacs-lisp"))
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
 org-todo-keywords '((sequence "TODO" "|" "DONE" "NOPE") (type "WAIT"))
 org-support-shift-select t
 org-speed-command-hook '(org-speed-command-activate
 org-refile-allow-creating-parent-nodes 'confirm
 org-refile-use-outline-path 'file
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("attachment" :follow org-attach-follow :complete
                       ("id" :follow org-id-open)
                       ("eww" :follow org-eww-open :store org-eww-store-link)
                       ("rmail" :follow org-rmail-open :store
                       ("mhe" :follow org-mhe-open :store org-mhe-store-link)
                       ("irc" :follow org-irc-visit :store org-irc-store-link
                        :export org-irc-export)
                       ("info" :follow org-info-open :export org-info-export
                        :store org-info-store-link)
                       ("gnus" :follow org-gnus-open :store
                       ("docview" :follow org-docview-open :export
                        org-docview-export :store org-docview-store-link)
                       ("bibtex" :follow org-bibtex-open :store
                       ("bbdb" :follow org-bbdb-open :export org-bbdb-export
                        :complete org-bbdb-complete-link :store
                       ("w3m" :store org-w3m-store-link)
                       ("cite" :follow org-bibtex-goto-citation :export nil)
                       ("org-title" :store store-org-title-link) ("file+sys")
                       ("file+emacs") ("shell" :follow org-link--open-shell)
                       ("news" :follow
                        #[514 "\301\300\302%4Q%2\"\207"
                          ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"]
                       ("mailto" :follow
                        #[514 "\301\300\302%4Q%2\"\207"
                          ["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"]
                       ("https" :follow
                        #[514 "\301\300\302%4Q%2\"\207"
                          ["https" browse-url ":"] 6 "\n\n(fn URL ARG)"]
                       ("http" :follow
                        #[514 "\301\300\302%4Q%2\"\207"
                          ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"]
                       ("ftp" :follow
                        #[514 "\301\300\302%4Q%2\"\207" ["ftp" browse-url ":"]
                          6 "\n\n(fn URL ARG)"]
                       ("help" :follow org-link--open-help)
                       ("file" :complete org-link-complete-file)
                       ("elisp" :follow org-link--open-elisp)
                       ("doi" :follow org-link--open-doi))
 org-capture-templates '(("s" "Someday" entry (file "") "* %?\n")
                         ("d" "Daily" entry (file+olp+datetree "")
                          "* TODO %?\n")
                         ("r" "Refile" entry (file "") "* %?\n")
                         ("j" "Journal entry" plain
                          (file+olp+datetree ""))
                         ("e" "Emacs templates")
                         ("ei" "Idea" entry
                          (file+olp "Editors/" "Ideas") "* %?\n")
                         ("et" "Tip" entry
                          (file+olp "Editors/" "Tips") "* %?\n")
                         ("eq" "Question" entry
                          (file+olp "Editors/" "Questions") "* %?\n")
                         ("ep" "Package" entry
                          (file+olp "Editors/" "Packages") "* %?\n")
 org-link-elisp-confirm-function 'yes-or-no-p
 outline-mode-hook '(beginend-outline-mode)
 org-latex-packages-alist '(("AUTO" "babel" t ("pdflatex")))
 org-confirm-babel-evaluate nil
 org-directory "~/Notes"
 org-preview-latex-image-directory "~/.cache/ltximg/"

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-23  6:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23  6:33 Bug: org-catch-invisible-edits doesn't actually catch most deletions [9.4 (9.4-41-g9bb930-elpaplus @ /home/omarantolin/.emacs.d/elpa/org-plus-contrib-20201116/)] Omar Antolín Camarena

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ \
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:

AGPL code for this site: git clone