0

I find calc-embedded-mode handy for typing math from LaTeX mode. As I use it very little, I would like to have the calc menu in integrated mode. The menu remains in latex mode which is useless. I tried to activate without success the `calc-menu function which must have another use than the one I want.

1
  • Not sure I understood what you mean, so the answer is a stab in the dark. If I'm completely off the mark, maybe you can explain what you want in more detail.
    – NickD
    Feb 7 at 17:31

1 Answer 1

1

The calc menu is only visible when the major mode of the buffer is calc-mode. If you want it visible in other modes, you have to lift that restriction, e.g. here's how to redefine it so that it is visible in latex-mode (as well as in calc-mode):

(easy-menu-define
  calc-menu
  calc-mode-map
  "Menu for Calc."
  (list "Calc"
        :visible '(or (eq major-mode 'latex-mode)
                      (eq major-mode 'calc-mode))
        calc-arithmetic-menu
        calc-scientific-function-menu
        calc-algebra-menu
        calc-graphics-menu
        calc-vectors-menu
        calc-units-menu
        calc-variables-menu
        calc-stack-menu
        calc-errors-menu
        calc-modes-menu
        calc-help-menu
        ["Reset"
         (progn
           (require 'calc-ext)
           (call-interactively 'calc-reset))
         :help "Reset Calc to its initial state"]
        ["Quit" calc-quit]))

Do C-h v calc-menu and look at the definition of the menu in calc-menu.el.

2
  • You understood the problem correctly. I created a function and added it as a hook to calc-embedded mode. Your solution should be more complete if you add this.
    – gigiair
    Feb 8 at 9:34
  • Feel free to modify the answer (or add another answer): since you have already done it, it should be easy for you to write up - I'd have to spend more time on this (which I can ill afford :-) ) to develop it, test it and write it up.
    – NickD
    Feb 8 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.