Open jtojnar opened 5 years ago
Here are the related enacs docs: https://www.gnu.org/software/emacs/manual/html_node/nxml-mode/Locating-a-schema.html#Locating-a-schema
The default schemas (including the old docbook 4) are in ${emacs}/share/emacs/26.3/etc/schema/schemas.xml
I verified that the following works.
let
pkgs = import <nixpkgs> {};
inherit (pkgs) emacsPackages docbook5 writeText;
schemas = writeText "schemas.xml" ''
<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
<namespace ns="http://docbook.org/ns/docbook" uri="${docbook5}/share/xml/docbook-5.0/rng/docbookxi.rnc"/>
</locatingRules>
'';
in emacsPackages.emacsWithPackages (epkgs: [
(emacsPackages.trivialBuild {
pname = "nix-docbook-mode";
version = "1970-01-01";
src = writeText "default.el" ''
(eval-after-load 'rng-loc
'(add-to-list 'rng-schema-locating-files "${schemas}"))
(global-set-key (kbd "<C-return>") 'nxml-complete)
'';
})
])
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
Needs to be fixed.
I marked this as stale due to inactivity. → More info
The emacs DocBook config from Nix Pills, which was copied to the wiki match the schema based on elements, not the namespace. That is suspicious, given that we use DocBook 5 which is namespace aware. Should not we use something like this instead:
cc @grahamc
Edit: We even have this https://nixos.org/nixos/manual/index.html#sec-emacs-docbook-xml in the manual, which looks more correct. Though, it relies on profile paths, which is not a good idea: https://github.com/NixOS/nixpkgs/issues/24959