ergoemacs / ergoemacs-mode

ergoemacs-mode
ergoemacs.github.io/
GNU General Public License v3.0
293 stars 35 forks source link

Custom keyboard layout #316

Closed luxcem closed 10 years ago

luxcem commented 10 years ago

Hi, I use a custom layout keyboard that is not present in ergoemacs-layouts.el, I do not want to edit that file but I do need that keyboard layout to work with ergoemacs.

I made a definition of my layout according to the ergoemacs-layouts.el file. It looks like this :

(defvar ergoemacs-layout-mylayout
  '("" "" "&" "«" "»" "'" "\"" "@" "+" "-" "/" "*" "=" "#" ""
 ...
    ;; Shifted
  ...)
  "My Custom Layout")

And I add this in my .emacs.el :

(package-initialize)
(require 'ergoemacs-mode)
(setq ergoemacs-theme nil)

(defvar ergoemacs-layout-mylayout
  '("" "" "&" "«" "»" "'" "\"" "@" "+" "-" "/" "*" "=" "#" ""
 ...
    ;; Shifted
  ...)
  "My Custom Layout")
(setq ergoemacs-keyboard-layout "mylayout")
(require 'ergoemacs-mode)
(ergoemacs-mode 1)

But I get this message from emacs : Symbol's value as variable is void: ergoemacs-layout-mylayout

Hot to get my layout to work with ergoemacs ?

mattfidler commented 10 years ago

I'm not sure why.

Could you look at the value of the variable ergoemacs-layout-mylayout? Ctrl+h v ergoemacs-layout-mylayout

Also try

(defvar ergoemacs-layout-mylayout
  '("" "" "&" "«" "»" "'" "\"" "@" "+" "-" "/" "*" "=" "#" ""
 ...
    ;; Shifted
  ...)
  "My Custom Layout")
(package-initialize)
(require 'ergoemacs-mode)
(setq ergoemacs-theme nil)

  "My Custom Layout")
(setq ergoemacs-keyboard-layout "mylayout")
(require 'ergoemacs-mode)
(ergoemacs-mode 1)
luxcem commented 10 years ago

Yes it works when defining the var before (package-initialize) Thanks