Giter VIP home page Giter VIP logo

Comments (5)

alhassy avatar alhassy commented on May 28, 2024

Hey @seanfarley, I'm glad you like the package.

But in the current form, there needs to be some kind of "copy this config to your emacs."

Do you mean something like this? If not, please elaborate.

I think it would lower the adoption friction if this package could mark its own macros as safe so that we could check in a dirlocals file with all the shared macros.

Please elaborate, or give psuedo-code examples. I don't follow here.

from org-special-block-extras.

seanfarley avatar seanfarley commented on May 28, 2024

But in the current form, there needs to be some kind of "copy this config to your emacs."

Do you mean something like this? If not, please elaborate.

Righto, I mean defining o-docs-libraries in a project-specific way.

I think it would lower the adoption friction if this package could mark its own macros as safe so that we could check in a dirlocals file with all the shared macros.

Please elaborate, or give psuedo-code examples. I don't follow here.

Ah, I just meant having the ability to define o-defblock in .dir-locals.el so that we can check that into the repository. In this way, the only thing a collaborator will have to do is install this package. No extra configuration will be needed because the project defines and includes all the needed configuration.

from org-special-block-extras.

alhassy avatar alhassy commented on May 28, 2024

Okay, I'm still not following.

  1. Can you explain to me the problem you're having. (And so this PR would solve said problem).
  2. Perhaps you can give me mock-usage and I'll be able to help.
  3. Why would you want the macro o-defblock in .dir-locals.el. It's a general macro, not really specific for projects.

Righto, I mean defining o-docs-libraries in a project-specific way.

Since o-docs-libraries is just an arbitrary variable, so what's stopping you from overloading it in .dir-locals.el?

  • I haven't tried.
  • Have you? Is there something that my package does to prevent what you want?

Any minimal self-contained examples would help clarify things.

from org-special-block-extras.

seanfarley avatar seanfarley commented on May 28, 2024

Ah, you're right, I haven't tried this and assumed something was different; apologies!

Why would you want the macro o-defblock in .dir-locals.el. It's a general macro, not really specific for projects.

From the example documentation, there is this code,

;; We can use variable values when defining new blocks
(setq angry-red '(:foreground "red" :weight bold))

;; This is our 𝒳, “remark”.
;; As a link, it should be shown angry-red;
;; it takes two arguments: “color” and “signoff”
;; with default values being "red" and "".
(o-defblock rremark
  (editor "Editor Remark" :face angry-red) (color "red" signoff "")
  "Top level (HTML & LaTeX) editorial remarks; in Emacs they're angry red."
  (format (if (equal backend 'html)
            "<strong style=\"color: %s;\">⟦%s:  %s%s⟧</strong>"
            "{\\color{%s}\\bfseries %s:  %s%s}")
          color editor contents signoff))

;; I don't want to change the definition, but I'd like to have
;; the following as personalised defaults for the “remark” block.
;; OR, I'd like to set this for links, which do not have argument options.
(o-set-block-header-args rremark :main-arg "Jasim Jameson" :signoff "( Aim for success! )")

Once I check the example,

The sum of the first $n$ natural numbers is $\sum_{i = 0}^n i = {n × (n + 1)
\over 2}$. Note that $n × (n + 1)$ is even.
[[rremark:Jasim Jameson][Why are you taking about “$\mathsf{even}$” here?]]
#+begin_rremark Bobbert Barakallah :signoff "Thank-you for pointing this out!" :color green
I was trying, uh ...

Yeah, to explain that ${\large n × (n + 1) \over 2}$ is always an integer.
#+end_rremark

Hence, we only need to speak about whole numbers.
[[rremark:][Then please improve your transition sentences.]]

into a repository, then other people that check out the code will not be able to export or preview the org document. Instead, they will receive the error user-error: Unable to resolve link: "rremark:Jasim Jameson". I assumed org-special-block-extras could define rremark with variable (as opposed to macros) which is definitely my mistake. Since we need to run macros, we have to rely on .dir-locals.el having an eval like so,

((nil . ((eval . (progn
                   (setq angry-red '(:foreground "red" :weight bold))
                   (org-special-block-extras-mode 1)
                   (o-defblock rremark
                               (editor "Editor Remark" :face angry-red) (color "red" signoff "")
                               "Top level (HTML & LaTeX) editorial remarks; in Emacs they're angry red."
                               (format (if (equal backend 'html)
                                           "<strong style=\"color: %s;\">⟦%s:  %s%s⟧</strong>"
                                         "{\\color{%s}\\bfseries %s:  %s%s}")
                                       color editor contents signoff))

                   ;; just to get the code to work; in practice, the project would probably not have a default
                   (o-set-block-header-args rremark :main-arg "Jasim Jameson" :signoff "( Aim for success! )"))))))

which definitely works after the user accepts the "do you trust this" prompt from emacs. So, this is not an issue at all and sorry for the noise 😬

from org-special-block-extras.

alhassy avatar alhassy commented on May 28, 2024

Thanks for confirming things work 😁 All the best!

from org-special-block-extras.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.