emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* problem with load-after-eval
@ 2016-05-16  6:11 Stefan Huchler
  0 siblings, 0 replies; only message in thread
From: Stefan Huchler @ 2016-05-16  6:11 UTC (permalink / raw)
  To: emacs-orgmode


I did try to change following code in in the org.el file,
inside the org-cycle-internal-local function.
So that instead of having 3 tab expansions it only shows the next level
of expansion.
I am not 100% shure thats the perfect solution but it seemed to work:

;; THAT IS THE ORIGINAL CODE OF THE TWO LINES I CHANGED:
;; (unless (org-before-first-heading-p)
;;   (run-hook-with-args 'org-pre-cycle-hook 'subtree))
(unless (org-before-first-heading-p)
  (run-hook-with-args 'org-pre-cycle-hook 'folded))


the problem is, I wanted not to modify the systemwide org.el file, so I
thought, either redefine the whole modified function with defun, or add a
eval-after-load call around it, so that it gets overridden when org gets
loaded.

But both does not work, defining it straight had no effect I think, and the
eval-after-load raised an error when I tried to use this function in a
org-file (with tab).

It didnt find the outline-show-children function that gets called in
that function. It gets defined in org-compat, requiring that before that
block did not fix it, too.

I looked at devadvise, if thats maybe the solution but its a very
complex construct and the docu is very bad no easy examples.

But in general it should work with one of the two other solutions I
tried.

But somehow it seems to be not in the same scope as the original
function.

hope somebody can say me what I am doing wrong. Must be something pretty
simple, but I dont find the solution.

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

only message in thread, other threads:[~2016-05-16 17:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-16  6:11 problem with load-after-eval Stefan Huchler

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