emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Stefan Huchler <stefan.huchler@mail.de>
To: emacs-orgmode@gnu.org
Subject: problem with load-after-eval
Date: Mon, 16 May 2016 08:11:25 +0200	[thread overview]
Message-ID: <8760ue5y7m.fsf@jupiter.lan> (raw)


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.

                 reply	other threads:[~2016-05-16 17:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8760ue5y7m.fsf@jupiter.lan \
    --to=stefan.huchler@mail.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).