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

locatingRules for DocBook on emacs #68236

Open
jtojnar opened this issue Sep 7, 2019 · 5 comments
Open

locatingRules for DocBook on emacs #68236

jtojnar opened this issue Sep 7, 2019 · 5 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: documentation Meta-discussion about documentation and its workflow 6.topic: emacs Text editor 9.needs: documentation

Comments

@jtojnar
Copy link
Member

jtojnar commented Sep 7, 2019

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:

<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
  <namespace ns="http://docbook.org/ns/docbook" uri="${docbook5}/xml/rng/docbook/docbookxi.rnc"/>
</locatingRules>

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: #24959

@jtojnar jtojnar added 9.needs: documentation 6.topic: emacs Text editor 6.topic: documentation Meta-discussion about documentation and its workflow labels Sep 7, 2019
@jtojnar
Copy link
Member Author

jtojnar commented Sep 7, 2019

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

@jtojnar
Copy link
Member Author

jtojnar commented Sep 8, 2019

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)
   '';
 })
])

@stale
Copy link

stale bot commented Jun 2, 2020

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:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@jtojnar
Copy link
Member Author

jtojnar commented Jun 2, 2020

Needs to be fixed.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@stale
Copy link

stale bot commented Nov 29, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: documentation Meta-discussion about documentation and its workflow 6.topic: emacs Text editor 9.needs: documentation
Projects
None yet
Development

No branches or pull requests

1 participant