How to check which Emacs I am using?

后端 未结 5 931
夕颜
夕颜 2021-02-05 00:19

I have two Emacs (Aquamacs and text-based Emacs) on my Mac.

In my .emacs file, I can check if I\'m using Aquamacs with ...

(boundp \'aquamacs-         


        
相关标签:
5条回答
  • 2021-02-05 00:46

    I know this question was answered a long time ago, but I found another answer by typing emacs --help. This gives a list of options in which you can find emacs --version.

    In my case, emacs --version prints: GNU Emacs 24.3.1.

    I have only tested this solution on Linux with my current version of Emacs. I do not know if the same solution applies to Windows, or to older versions of Emacs, but in theory it should.

    0 讨论(0)
  • 2021-02-05 00:54

    Errr... (not (boundp 'aquamacs-version)), perhaps?

    0 讨论(0)
  • 2021-02-05 00:57
    M-x emacs-version
    

    ad some more characters here......

    Sorry, from .emacs, just call

    (emacs-version)
    
    0 讨论(0)
  • 2021-02-05 00:59

    Or, you could use this:

    (if (or (eq window-system 'ns)
            (eq window-system 'mac))
        (message "hello, world!"))
    

    It will only print "hello, world!" when you run a graphical Emacs in OS X.

    0 讨论(0)
  • 2021-02-05 01:10
    (if (window-system)
        "window-based"
      "text-based")
    
    0 讨论(0)
提交回复
热议问题