{"action":"created","issue":{"url":"https://api.github.com/repos/syl20bnr/spacemacs/issues/6104","repository_url":"https://api.github.com/repos/syl20bnr/spacemacs","labels_url":"https://api.github.com/repos/syl20bnr/spacemacs/issues/6104/labels{/name}","comments_url":"https://api.github.com/repos/syl20bnr/spacemacs/issues/6104/comments","events_url":"https://api.github.com/repos/syl20bnr/spacemacs/issues/6104/events","html_url":"https://github.com/syl20bnr/spacemacs/issues/6104","id":156013651,"number":6104,"title":"Can't open more than one emacs frame (Invalid face: linum).","user":{"login":"Stebalien","id":310393,"avatar_url":"https://avatars.githubusercontent.com/u/310393?v=3","gravatar_id":"","url":"https://api.github.com/users/Stebalien","html_url":"https://github.com/Stebalien","followers_url":"https://api.github.com/users/Stebalien/followers","following_url":"https://api.github.com/users/Stebalien/following{/other_user}","gists_url":"https://api.github.com/users/Stebalien/gists{/gist_id}","starred_url":"https://api.github.com/users/Stebalien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stebalien/subscriptions","organizations_url":"https://api.github.com/users/Stebalien/orgs","repos_url":"https://api.github.com/users/Stebalien/repos","events_url":"https://api.github.com/users/Stebalien/events{/privacy}","received_events_url":"https://api.github.com/users/Stebalien/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-05-20T17:34:12Z","updated_at":"2016-05-20T22:28:48Z","closed_at":null,"body":"#### Description\r\nSince fa4eeb49f050c0caa23f635a5d2c94fc50e86f86, I can't open more than one emacs frame (client/daemon).\r\n\r\n#### Reproduction guide\r\n- Start Emacs as a daemon.\r\n- Open an emacs frame (`emacsclient -c -n`).\r\n- Repeat once.\r\n\r\n*Observed behaviour:*\r\n\r\nemacsclient spits out the following when run the second time:\r\n\r\n```txt\r\n*ERROR*: Invalid face: linum\r\n```\r\n\r\nThere are no relevant errors in the `*messages*` buffer (as far as I can tell).\r\n\r\n*Expected behaviour:*\r\n\r\nTwo frames are opened.\r\n\r\n#### System Info\r\n- OS: gnu/linux\r\n- Emacs: 24.5.1\r\n- Spacemacs: 0.105.20\r\n- Spacemacs branch: develop (rev. da55a89)\r\n- Graphic display: t\r\n- Distribution: spacemacs\r\n- Editing style: vim\r\n- Completion: helm\r\n- Layers:\r\n```elisp\r\n(helm better-defaults git\r\n      (auto-completion :variables auto-completion-return-key-behavior nil)\r\n      org spell-checking syntax-checking\r\n      (shell :variables shell-default-shell 'ansi-term)\r\n      emoji emacs-lisp markdown latex yaml c-c   html haskell go javascript python systemd\r\n      (rust :variables rust-format-on-save nil))\r\n```"},"comment":{"url":"https://api.github.com/repos/syl20bnr/spacemacs/issues/comments/220733435","html_url":"https://github.com/syl20bnr/spacemacs/issues/6104#issuecomment-220733435","issue_url":"https://api.github.com/repos/syl20bnr/spacemacs/issues/6104","id":220733435,"user":{"login":"Stebalien","id":310393,"avatar_url":"https://avatars.githubusercontent.com/u/310393?v=3","gravatar_id":"","url":"https://api.github.com/users/Stebalien","html_url":"https://github.com/Stebalien","followers_url":"https://api.github.com/users/Stebalien/followers","following_url":"https://api.github.com/users/Stebalien/following{/other_user}","gists_url":"https://api.github.com/users/Stebalien/gists{/gist_id}","starred_url":"https://api.github.com/users/Stebalien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stebalien/subscriptions","organizations_url":"https://api.github.com/users/Stebalien/orgs","repos_url":"https://api.github.com/users/Stebalien/repos","events_url":"https://api.github.com/users/Stebalien/events{/privacy}","received_events_url":"https://api.github.com/users/Stebalien/received_events","type":"User","site_admin":false},"created_at":"2016-05-20T22:28:48Z","updated_at":"2016-05-20T22:28:48Z","body":"It looks related. Unfortunately, that fix only seems to allow one frame to load. Really, it looks like `nlinum--setup-window` (`nlinum.el`) needs to be modified to not run until after the frame is loaded. Is there any way to tell if the current frame is completely loaded? I was able to get it to work by adding:\r\n\r\n```elisp\r\n(defvar frame-ready nil)\r\n(add-hook 'after-make-frame-functions (lambda (frame) (set-frame-parameter frame 'frame-ready t)))\r\n(add-hook 'after-init-hook (lambda () (set-frame-parameter nil 'frame-ready t)))\r\n```\r\n\r\nTo mark a frame as \"ready\" and changing:\r\n\r\n```elisp\r\n(defun nlinum--setup-window ()\r\n  (let ((width (if (display-graphic-p)\r\n                   (ceiling\r\n                    (let ((width (nlinum--face-width 'linum)))\r\n                      (if width\r\n                          (/ (* nlinum--width 1.0 width)\r\n                             (frame-char-width))\r\n                        (/ (* nlinum--width 1.0\r\n                              (nlinum--face-height 'linum))\r\n                           (frame-char-height)))))\r\n                 nlinum--width)))\r\n    (set-window-margins nil (if nlinum-mode width)\r\n                        (cdr (window-margins)))))\r\n```\r\n\r\nTo:\r\n\r\n```elisp\r\n(defun nlinum--setup-window ()\r\n  (let ((width (if (and frame-ready (display-graphic-p)) ;; <-- Here\r\n                   (ceiling\r\n                    (let ((width (nlinum--face-width 'linum)))\r\n                      (if width\r\n                          (/ (* nlinum--width 1.0 width)\r\n                             (frame-char-width))\r\n                        (/ (* nlinum--width 1.0\r\n                              (nlinum--face-height 'linum))\r\n                           (frame-char-height)))))\r\n                 nlinum--width)))\r\n    (set-window-margins nil (if nlinum-mode width)\r\n                        (cdr (window-margins)))))\r\n```"}}
{"actor":{"display_login":"Stebalien"}}