Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document setting of outline-minor-mode-prefix with customize-variable #11

Open
prosoitos opened this issue Jan 6, 2018 · 23 comments
Open
Labels
configuration docs Documentation improvements

Comments

@prosoitos
Copy link

After 2 years of using outshine all the time without issue (and I love it! thanks for maintaining it!!), I suddenly started to get:

"Wrong type argument: keymapp, nil"

on startup since the new org mode release (Org 9.1.6, Jan 2018). There may not be any connection, but it started just after the org update.

Removing any outshine entry from my init file allows to start emacs without issue. I am not sure how to get started understanding what is going on... I could downgrade to the previous org release to go around the issue, but I'd prefer to keep up to date with org though. Thanks for suggestions.

Note: I am using emacs 25.3-2 on Arch Linux with all packages up to date. And here is the outshine section of my init file (which I haven't changed in ages and worked just fine till now):

;; ** outshine project

;; *** outorg

(require 'outorg)

;; *** outshine

(require 'outshine)

;; **** Set outline minor mode automatically in some major modes

(add-hook 'emacs-lisp-mode-hook 'outline-minor-mode)
(add-hook 'ess-mode-hook 'outline-minor-mode)
(add-hook 'LaTex-mode-hook 'outline-minor-mode)
(add-hook 'sh-mode-hook 'outline-minor-mode)

;; **** use outshine functions in outline minor mode

(add-hook 'outline-minor-mode-hook 'outshine-hook-function)

;; **** outshine speed commands

(setq outshine-use-speed-commands t)

Plus a bunch of keybindings remapping (but removing those had no effect on the issue, so they should not be causing any problem).

@alphapapa
Copy link
Owner

Hi,

Please enable debugging by running toggle-debug-on-error and post the backtrace.

Thanks.

@prosoitos
Copy link
Author

Debugger entered--Lisp error: (wrong-type-argument keymapp nil)
define-key(nil [134217771] nil)
byte-code("\303� "�\304\n\305\306#\210\304\n\307\306#\210\304\n\310\311#\210\304\n\312\313#\210\304\n\314\315#\210\304\n\316\317#\210\304\n\320\321#\210\304\n\322\323#\210\304\n\324\325#\210\304\n\326\327#\210\304\n\330\331#\210\304\n\332\333#\210\304\n\334\335#\210\304\n\336\337#\210\304\n\340\341#\210\304\n\342\343#\210\304\n\344\345#\210\304\n\346\347#\210\304\n\350\351#\210\304\n\352\353#\210\304\n\354\355#\210\304\n\356\357#\210\304\n\360\361#\210\304\n\362\363#\210\304\n\364\365#\210\304\n\366\367#\210\304\n\370\371#\210\304\n\372\373#\210\304\n\374\375#\210\304\n\376\377#\210\304\n\201@�\201A�#\210\304\n\201B�\201C�#\210\304\n\201D�\201E�#\210\304\n\201F�\201G�#\210\304\n\201H�\201I�#\210\304\n\201J�\201K�#\210\304\n\201L�\201M�#\210\304\n\201N�\201O�#\210\304\n\201P�\201Q�#\210\304\n\201R�\201S�#\210\304\n\201T�\201U�#\210\304\n\201V�\201U�#\210\304\n\201W�\201X�#\210\304\n\201Y�\201Z�#\210\304\n\201[�\201\�#\210\304\n\201]�\201^�#\210\304\n\201_�\201�#\210\304\n\201a�\201b�#\210\304\n\201c�\201d�#\210\304\n\201e�\201f�#\210\304\n\201g�\201h�#\210\304\n\201i�\201j�#\210\304\n\201k�\201l�#\210\304\n\201m�\201U�#\210\304\n\201n�\201o�#\210\304\n\201p�\201q�#\210\304\n\201r�\201s�#\210\304\n\201t�\201u�#\210\304\n\201v�\201w�#\210\304\n\201x�\201y�#\210\304\n\201z�\201{�#\210\304\n\201|�\201}�#\210\304\n\201~�\201��#\210\304\n\201\200�\201\201�#\210\304\n\201\202�\201\203�#\210\304\n\201\204�\201\205�#\210\304\n\201\206�\201\207�#\210\304\n\201\210�\201\211�#\210\304\n\201\212�\201\213�#\210\304\n\201\214�\201\215�#\210\304\n\201\216�\201\217�#\210\304\n\201\220�\201\221�#\210\304\n\201\222�\201\223�#\210\304\n\201\224�\201\225�#\210\304\n\201\226�\201\227�#\210\304\n\201\230�\201\231�#\210\304\n\201\232�\201\233�#\210\304\n\201\234�\201\235�#\210\304\n\201\236�\201\237�#\210\304\n\201\240�\201\241�#\210\304\n\201\242�\201\243�#\210\304\n\201\244�\201\245�#\210\304\n\201\246�\201\247�#\210\304\n\201\250�\201\251�#\210\304\n\201\252�\201\253�#\210\304\n\201\254�\201\255�#\210\304\n\201\256�\201\257�#\210\304\n\201\260�\201\261�#\210\304\n\201\262�\201\263�#\210\304\n\201\264�\201\265�#\210\304\n\201\266�\201\267�#\210\304\n\201\270�\201\271�#\210\304\n\201\272�\201\273�#\210\304\n\201\274�\201\275�#\210\304\n\201\276�\201\277�#\210\304\n\201\300�\201\301�#\210\304\n\201\302�\201\303�#\210\304\n\201\304�\201\305�#\210\304\n\201\306�\201\307�#\210\304\n\201\310�\201\311�#\210\304\n\201\312�\201\313�#\210\304\n\201\314�\201\315�#\210\304\n\201\316�\201\317�#\210\304\n\201\320�\201\321�#\210\304\n\201\322�\201\323�#\210\304\n\201\324�\201\325�#\210\304\n\201\326�\201\327�#\210\304\n\201\330�\201\331�#\210\304\n\201\332�\201\333�#\210\304\n\201\334�\201\335�#\210\304\n\201\336�\201\337�#\210\304\n\201\340�\201\341�#\210\304\n\201\342�\201\343�#\210\304\n\201\344�\201\345�#\210\304\n\201\346�\201\347�#\210\304\n\201\350�\201\351�#\210\304\n\201\352�\201\353�#\210\304\n\201\354�\201\355�#\210\304\n\201\356�\201\357�#\210\304\n\201\360�\201\361�#\210\304\n\201\362�\201\363�#\210\304\n\201\364�\201\365�#\210\304\n\201\366�\201\367�#\210\304\n\201\370�\201\371�#\210\304\n\201\372�\201\371�#\210\304\n\201\373�\201\374�#\210\304\n\201\375�\201\376�#\210\304\n\201\377�\201��#\210\304\n\201��\201��#\210\304\n\201��\201��#\210\304\n\201��\201��#\210\304\n\201��\201��#\210\304\n\201 �\201\n�#\210\304\n\201��\201\f�#\210\304\n\201 �\201��#\210\304\n\201��\201��#\210\304\n\201��\201��#\210\304\n\201��\201��#\210\304\n\201��\201��#\210\304\n\201��\201��#\210\304\n\201��\201��#\210\304\n\201��\201��#\210\304\n\201��\201��#\210\304\n\201��\201 �#\210\304\n\201!�\201\"�#\210\304\n\201#�\201$�#\210\304\n\201%�\201&�#\210\304\n\201'�\201\201�#\210\304\n\201(�\201\374�#\210\304\n\201)�\201\376�#\210\304\n\201*�\201��#\210\304\n\201+�\201��#\210\304\n\201,�\201��#\210\304\n\201-�\201��#\210\304\n\201.�\201��#\210\304\n\201/�\201��#\210\304\n\2010�\201��#\210\304\n\2011�\201��#\210\304\n\2012�\201��#\210\304\n\2013�\201��#\210\304\n\2014�\201��#\210\304\n\2015�\201��#\210\304\n\2016�\201 �#\210\304\n\2017�\201\"�#\210\304\n\2018�\201$�#\210\304\n\2019�\201:�#\210\304\n\201;�\201<�#\210)\201=�\201>�!\207" [outline-minor-mode-map outline-minor-mode-prefix map lookup-key define-key [134217771] nil [134217763] "#" outorg-edit-as-org " " outshine-table-blank-field "!" outshine-time-stamp-inactive "$" outshine-archive-subtree "%" outshine-mark-ring-push "&" outshine-mark-ring-goto "'" outshine-edit-special "*" outshine-ctrl-c-star "+" outshine-table-sum "," outshine-priority "-" outshine-ctrl-c-minus "." outshine-time-stamp ":" outshine-toggle-fixed-width ";" outshine-toggle-comment "<" outshine-date-from-calendar "=" outshine-table-eval-formula ">" outshine-goto-calendar "?" outshine-table-field-info "@" outshine-mark-subtree "\\" outshine-match-sparse-tree "^" outshine-sort-entries ...] 4) require(outshine-org-cmds) byte-code("\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\207" [require outline outorg outshine-org-cmds newcomment cl-lib] 2) require(outshine) eval-buffer(#<buffer *load*> nil "/home/marie/.emacs" nil t) ; Reading at buffer position 139934 load-with-code-conversion("/home/marie/.emacs" "/home/marie/.emacs" t t) load("~/.emacs" t t) #[0 "�\205\266� \306=\203��\307�\310Q\202?� \311=\204��\307�\312Q\202?�\313\307\314\315#\203*�\316\202?�\313\307\314\317#\203>�\320\321\322!D\nB�\323\202?�\316\324�\325�\324\211#\210�\324=\203e�\326\327\330\307�\331Q!\"\325�\324\211#\210�\324=\203d���\210�\203\247�\332�!\333\232\203\247�\334�!\211\335P\336�!\203\201�\211\202\214�\336�!\203\213��\202\214�\314\262��\203\245�\337��\"\203\243�\340\341��#\210\342\343!\210��\266�\f?\205\264�\314�\325\344\324\211#)\262�\207" [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" initialization format-message "_emacs' init file is deprecated, please use `.emacs'" "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7]()
command-line()
normal-top-level()

@prosoitos
Copy link
Author

Hi,

Thank you for your quick reply and sorry for being very unknowledgeable when it comes to debugging mode. My previous comment is the content of the backtrace after starting emacs with --debug-init

@alphapapa
Copy link
Owner

Sorry, I can't do anything with that backtrace full of byte-code. Try this:

  1. Remove Outshine from your config.
  2. Restart Emacs.
  3. toggle-debug-on-error to enable backtraces.
  4. Eval (require 'outshine).
  5. If that doesn't produce the error, try to use Outshine.

If that doesn't produce the error either, it's probably an issue with your config rather than Outshine itself.

@prosoitos
Copy link
Author

Yes. I was puzzled with all this byte-code too. Not sure where it's coming from. Thanks for the advice. Will try that.

@prosoitos
Copy link
Author

Just did and am getting the exact same backtrace (with all the crazy byte-code) :(

@alphapapa
Copy link
Owner

alphapapa commented Jan 8, 2018

Try this:

  1. Run emacs -q.
  2. toggle-debug-on-error.
  3. Open your init file and eval the package-initialize form.
  4. Eval (require 'org) and (require 'outshine).

@prosoitos
Copy link
Author

I am not sure what you mean by "eval the package-initialize form". I evaluated the expression: (package-initialize), which returned nil. If this is what you meant, then after evaluating (require 'org) and (require 'outshine), I get no backtrace buffer. So that would mean that the problem is on my end, somewhere (though I don't know where and I don't understand where all the byte-code is coming from).

If you meant something else by "eval the package-initialize form", I apologise for my ignorance and need more details.

In any case, thank you for the help.

I recently moved from running emacs in Cygwin to running emacs in Arch Linux. Maybe something went wrong in the encoding somewhere? But I could use outshine without any issue after the switch, until the new org release (or until the day of the release, if there is no connection). And I have no issue with any other package. And there is nothing in my init file that looks suspicious. My machine is set on utf8-unix. Anyway, I now suspect the problem is in my settings somewhere. But everything else is running without any problem and outshine was running just fine too on my new Arch setup, so I am very confused.

@alphapapa
Copy link
Owner

I am not sure what you mean by "eval the package-initialize form".

What I mean is, evaluate the forms that set up the package system, e.g. on mine they look like this:

(require 'package)
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
                         ("melpa" . "https://melpa.org/packages/")))
(package-initialize)

(though I don't know where and I don't understand where all the byte-code is coming from). ... I recently moved from running emacs in Cygwin to running emacs in Arch Linux.

This is important information. I'm guessing you don't have a package installed that installs the Emacs Lisp source files, so all the backtrace has to go on for some code is the byte-compiled files. I don't know what the package is called on Arch; on Debian/Ubuntu it's, e.g. emacs25-el.

after evaluating (require 'org) and (require 'outshine), I get no backtrace buffer. So that would mean that the problem is on my end

Were you able to actually use Outshine after that? If so, then yes, I think the problem is in your config, and to fix that you should strip out all of your Outshine-related config and add it back piece-by-piece until you find what breaks it. (You could also try using the bug-hunter package to do this for you.)

@prosoitos
Copy link
Author

prosoitos commented Jan 9, 2018

What I mean is, evaluate the forms that set up the package system

Oh, I see. Thank you for the additional info.
I followed your 4 steps properly this time and I could indeed use outshine. So the problem is totally in my settings... Sorry for the issue then and thank you very much for your time and help.

This is important information. I'm guessing you don't have a package installed that installs the Emacs Lisp source files, so all the backtrace has to go on for some code is the byte-compiled files. I don't know what the package is called on Arch; on Debian/Ubuntu it's, e.g. emacs25-el

I did some research, but I haven't been able to find anything on Arch Linux that looks like an equivalent. My backtrace buffer always gets full of byte-codes, whatever the message, so there is clearly something going on there that I will have to work on and keep trying to figure out... at least you pointed me in a starting direction, so thank you.

... to fix that you should strip out all of your Outshine-related config and add it back piece-by-piece until you find what breaks it

If I remove all the outshine related lines of my init file, start emacs, then eval (require 'outshine), that is enough to get the backtrace I posted earlier in this thread. So it is not in my outshine settings per se that something is wrong, but in some other setting that affects outshine. I'll explore and I'll give bug-hunter a shot.

In any case, thanks a lot for your time. I really appreciate. I still have my outshine issue (and have now realised that I also have an issue with my backtrace buffer), but I learnt something and it is a starting point to more exploring. Sorry also for questioning the package when the problem was on my end.

@alphapapa
Copy link
Owner

If I remove all the outshine related lines of my init file, start emacs, then eval (require 'outshine), that is enough to get the backtrace I posted earlier in this thread. So it is not in my outshine settings per se that something is wrong, but in some other setting that affects outshine. I'll explore and I'll give bug-hunter a shot.

I'm guessing that it's something in your Org config then, or perhaps something related to outline-minor-mode. If you can get the backtraces working without the byte-code, it should be possible to track it down.

For the backtrace/byte-code issue, I think if you post on emacs.stackexchange.com or on reddit.com/r/emacs someone will be able to help.

Sorry also for questioning the package when the problem was on my end.

Not at all. :) These are very complex systems with many moving parts, and it's always possible that an update in one has broken something in another. I'm really just the caretaker of this package; I can track down problems and fix them if something breaks, but I don't have a good grasp of how it all fits together, because I haven't worked with it very long.

Let me know if you figure out the problem. It might need to be documented somewhere. :)

@prosoitos
Copy link
Author

prosoitos commented Jan 9, 2018

I got it. I didn't use bug hunter, but I screened my init file for anything that might be related with outshine. I had done this before posting here of course, but I used the customization interface a lot when I started emacs and thus have many lines under custom-set-variables. And I had missed one...

The problem was the variable outline-minor-mode-prefix that I had remapped. For reasons I haven't figured out, I am unable to remap it anymore. Removing that line in my init file allows me to use outshine, but as soon as I remap it, the problem starts again. My remapping was no problem before--and is something I did 2 years ago. So maybe the new org release did change something that is affecting this after all??? Or some outline update? Or maybe it is yet something else in my settings and has nothing to do with any package. I don't know, but it is no big deal. I can live with the default keybinding for this :)

Your help was key in figuring this out, so thank you once more. Now, I will try to tackle the backtrace encoding issue.

@prosoitos
Copy link
Author

prosoitos commented Jan 9, 2018

From https://emacs.stackexchange.com/questions/33748/elisp-backtrace-print-garbage-messages, it seems that it might be a widespread problem? You might be in luck that Debian has a package to go around this nicely.

From the same link: "If you reevaluate the definition of a Lisp function and don't byte-compile it, you won't see its bytecode in the backtrace". And I will dig into https://debbugs.gnu.org/cgi/bugreport.cgi?bug=6991 and try to find something that works for me. I will also keep looking for an equivalent to your Debian package to install the Emacs Lisp source files on Arch Linux.

@prosoitos
Copy link
Author

Or maybe I will explore slime. Anyway, this is getting off topic...

Thanks again!

@alphapapa
Copy link
Owner

I used the customization interface a lot when I started emacs and thus have many lines under custom-set-variables. And I had missed one... The problem was the variable outline-minor-mode-prefix that I had remapped.

That makes sense, since it showed up in the backtrace. I wouldn't think that Org would change that, but I guess you could grep the Org source code if you're interested.

There are also some comments about outline-minor-mode-prefix in outshine.el's commentary section that are probably relevant.

For Arch, according to the list of files at https://www.archlinux.org/packages/extra/x86_64/emacs/ (expand the list at the bottom), the source files are included in the package (the .el.gz files). Maybe there's a configuration issue (either in your config or the way the package was built) that's preventing Emacs from finding them.

I don't think Slime is relevant here; that's for using Common Lisp in Emacs.

Good job digging through all this and figuring it out! :)

I'm going to leave this open for now. There might be an issue with the outline-minor-mode-prefix that we need to look into for newer Emacs or Org versions.

@alphapapa alphapapa changed the title Outshine broke with new org release?? Possible issue with outline-minor-mode-prefix and newer Emacs/Org versions Jan 9, 2018
@prosoitos
Copy link
Author

prosoitos commented Jan 10, 2018

I don't think Slime is relevant here; that's for using Common Lisp in Emacs.

Oh, indeed... *blush*

@thblt
Copy link
Collaborator

thblt commented Oct 31, 2019

@prosoitos Does the issue still appear?

@thblt thblt added the waiting Waiting for response from someone label Oct 31, 2019
@thblt thblt closed this as completed Nov 3, 2019
@prosoitos
Copy link
Author

Sorry for my slow reply!

I never tried remapping outline-minor-mode-prefix (which was triggering the issue). So I don't know whether the problem is still there or not. But I am happy to have this closed since I am not actively looking for any solution for it (or even testing whether the issue is still there).

@disconsis
Copy link

disconsis commented Apr 22, 2020

I also came across the same issue on Spacemacs. It was indeed being caused due to outline-minor-mode-prefix not being set before outline was loaded.

@aspiers
Copy link

aspiers commented Aug 25, 2020

I also came across this. I found that something was triggering the autoload of outline very early on, and that the only way to set the prefix before it loads was to use customize-variable. I think it would be worth suggesting this approach in the README.

@alphapapa
Copy link
Owner

I also came across this. I found that something was triggering the autoload of outline very early on, and that the only way to set the prefix before it loads was to use customize-variable. I think it would be worth suggesting this approach in the README.

Thanks. What version of Emacs and of Org did that happen on?

@alphapapa alphapapa reopened this Aug 28, 2020
@alphapapa alphapapa changed the title Possible issue with outline-minor-mode-prefix and newer Emacs/Org versions Document setting of outline-minor-mode-prefix with customize-variable Aug 28, 2020
@alphapapa alphapapa removed question waiting Waiting for response from someone labels Aug 28, 2020
@alphapapa alphapapa added the docs Documentation improvements label Aug 28, 2020
@aspiers
Copy link

aspiers commented Aug 28, 2020

emacs 26.3 and Org master (release_9.3.7-719-gcdfc404be), since I'm using straight.el not package.el.

@aspiers
Copy link

aspiers commented Aug 28, 2020

BTW I also found that debugging when the autoload happened was tricky because "outline-" => ("outline") gets added to definition-prefixes, so doing describe-function or describe-variable interactively on outline stuff will trigger the autoload, so you can't use either of those to check whether it's been autoloaded yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration docs Documentation improvements
Projects
None yet
Development

No branches or pull requests

5 participants