jumper047 / fb2-reader

Emacs plugin to read .fb2 and .fb2.zip ebooks.
GNU General Public License v3.0
26 stars 2 forks source link

Face handling is broken #10

Closed vlichevsky closed 2 years ago

vlichevsky commented 2 years ago

If I customize fb2-reader faces (fb2-reader-default to be exact), I cannot open any books.

fb2-reader-default is set in my color theme like this:

`(fb2-reader-default     ((,class (:inherit variable-pitch :height 1.2))))

Backtrace:

Debugger entered--Lisp error: (error "Invalid face" unspecified)
  internal-get-lisp-face-attribute(unspecified :height nil)
  face-attribute(unspecified :height)
  fb2-reader-get-face-height(fb2-reader-default)
  fb2-reader-face-heights()
  fb2-reader-render-async((FictionBook nil ... ... ... ... ... ... ... ... ... ... ... ... ...) fb2-reader-render-xml #f(compiled-function (result) #<bytecode -0xdb344fd670ca874>))
  fb2-reader-mode()
  set-auto-mode-0(fb2-reader-mode nil)
  set-auto-mode--apply-alist((("\\.zst\\'" nil jka-compr) ("\\.dz\\'" nil jka-compr) ("\\.xz\\'" nil jka-compr) ("\\.lzma\\'" nil jka-compr) ("\\.lz\\'" nil jka-compr) ("\\.g?z\\'" nil jka-compr) ("\\.bz2\\'" nil jka-compr) ("\\.Z\\'" nil jka-compr) ("\\.csv\\'" . csv-mode) ("\\.ronn?\\'" . markdown-mode) ("\\.Rmd\\'" . markdown-mode) ("\\.mkdn?\\'" . markdown-mode) ("\\.mdo?wn\\'" . markdown-mode) ("\\.mdpp\\'" . markdown-mode) ("/\\(\\(\\(COMMIT\\|NOTES\\|PULLREQ\\|MERGEREQ\\|TAG\\)_EDI..." . text-mode) ("\\(AUTHORS\\|CHANGE\\(LOG\\|S\\)\\|CONTRIBUTING\\|COPYING..." . text-mode) ("/authorized_keys2?\\'" . ssh-authorized-keys-mode) ("/sshd?_config\\'" . ssh-config-mode) ("/\\.ssh/config\\'" . ssh-config-mode) ("\\.gitignore\\'" . gitignore-mode) ("\\.gitconfig\\'" . gitconfig-mode) ("\\.gitattributes\\'" . gitattributes-mode) ("\\.tpl\\.php\\'" . web-mode) ("\\.phtml\\'" . web-mode) ("\\.mustache\\'" . web-mode) ("\\.js[pt]\\'" . web-mode) ("\\.ftl\\'" . web-mode) ("\\.erb\\'" . web-mode) ("\\.djhtml\\'" . web-mode) ("\\.as[cp]x\\'" . web-mode) ("\\.\\(rdf\\|rng\\|rss\\|sch\\|svg\\|xcu\\|xml\\|xsd\\|xslt\\)..." . nxml-mode) ("\\.[sx]?html?\\(\\.[a-zA-Z_]+\\)?\\'" . html-mode) ("\\.\\(sml\\|sig\\)\\'" . sml-mode) ("\\.\\(scm\\|ss\\)\\'" . scheme-mode) ("\\.\\(ba\\|c\\|k\\|z\\)?sh\\'" . sh-mode) ("\\.scala\\'" . scala-mode) ("\\.just\\(file\\)?\\'" . just-mode) ("/justfile\\'" . just-mode) ("\\.ron\\'" . ron-mode) ("\\.\\(builder\\|gemspec\\|mab\\|podspec\\|irbrc\\|jbuilde..." . enh-ruby-mode) ("\\(Berks\\|Brew\\|Cap\\|Gem\\|Guard\\|Pod\\|Puppet\\|Rake\\..." . enh-ruby-mode) ("\\.rd\\'" . Rd-mode) ("\\.r\\'" . ess-mode) ("\\.\\(pyx\\|pxd\\|pxi\\)\\'" . cython-mode) ("SCons\\(truct\\|cript\\)\\'" . python-mode) ("\\.plg\\'" . prolog-mode) ("\\.pde\\'" . processing-mode) ("\\.php\\'" . php-mode) ("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-mode) ("\\.m\\'" . octave-mode) ...) nil nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer Gashek_Pohozhdeniya_bravogo_soldata_Shveyka.102648.fb2.gz> "~/stuff/books/Gashek_Pohozhdeniya_bravogo_soldata_..." nil nil "~/stuff/books/Gashek_Pohozhdeniya_bravogo_soldata_..." (11666586 2067))
  #f(compiled-function (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer.\nIf a buffer exists visiting FILENAME, return that one, but\nverify that the file has not changed since visited or saved.\nThe buffer is not selected, just returned to the caller.\nOptional second arg NOWARN non-nil means suppress any warning messages.\nOptional third arg RAWFILE non-nil means the file is read literally.\nOptional fourth arg WILDCARDS non-nil means do wildcard processing\nand visit all the matching files.  When wildcards are actually\nused and expanded, return a list of buffers that are visiting\nthe various files." #<bytecode 0x4e5b729dd141d00>)("/home/vova/stuff/books/Gashek_Pohozhdeniya_bravogo..." nil nil nil)
  apply(#f(compiled-function (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer.\nIf a buffer exists visiting FILENAME, return that one, but\nverify that the file has not changed since visited or saved.\nThe buffer is not selected, just returned to the caller.\nOptional second arg NOWARN non-nil means suppress any warning messages.\nOptional third arg RAWFILE non-nil means the file is read literally.\nOptional fourth arg WILDCARDS non-nil means do wildcard processing\nand visit all the matching files.  When wildcards are actually\nused and expanded, return a list of buffers that are visiting\nthe various files." #<bytecode 0x4e5b729dd141d00>) "/home/vova/stuff/books/Gashek_Pohozhdeniya_bravogo..." (nil nil nil))
  editorconfig--advice-find-file-noselect(#f(compiled-function (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer.\nIf a buffer exists visiting FILENAME, return that one, but\nverify that the file has not changed since visited or saved.\nThe buffer is not selected, just returned to the caller.\nOptional second arg NOWARN non-nil means suppress any warning messages.\nOptional third arg RAWFILE non-nil means the file is read literally.\nOptional fourth arg WILDCARDS non-nil means do wildcard processing\nand visit all the matching files.  When wildcards are actually\nused and expanded, return a list of buffers that are visiting\nthe various files." #<bytecode 0x4e5b729dd141d00>) "/home/vova/stuff/books/Gashek_Pohozhdeniya_bravogo..." nil nil nil)
  apply(editorconfig--advice-find-file-noselect #f(compiled-function (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer.\nIf a buffer exists visiting FILENAME, return that one, but\nverify that the file has not changed since visited or saved.\nThe buffer is not selected, just returned to the caller.\nOptional second arg NOWARN non-nil means suppress any warning messages.\nOptional third arg RAWFILE non-nil means the file is read literally.\nOptional fourth arg WILDCARDS non-nil means do wildcard processing\nand visit all the matching files.  When wildcards are actually\nused and expanded, return a list of buffers that are visiting\nthe various files." #<bytecode 0x4e5b729dd141d00>) ("/home/vova/stuff/books/Gashek_Pohozhdeniya_bravogo..." nil nil nil))
  find-file-noselect("/home/vova/stuff/books/Gashek_Pohozhdeniya_bravogo..." nil nil nil)
  #f(compiled-function (filename &optional wildcards) "Edit file FILENAME.\nSwitch to a buffer visiting file FILENAME,\ncreating one if none already exists.\nInteractively, the default if you just type RET is the current directory,\nbut the visited file name is available through the minibuffer history:\ntype \\[next-history-element] to pull it into the minibuffer.\n\nThe first time \\[next-history-element] is used after Emacs prompts for\nthe file name, the result is affected by `file-name-at-point-functions',\nwhich by default try to guess the file name by looking at point in the\ncurrent buffer.  Customize the value of `file-name-at-point-functions'\nor set it to nil, if you want only the visited file name and the\ncurrent directory to be available on first \\[next-history-element]\nrequest.\n\nYou can visit files on remote machines by specifying something\nlike /ssh:SOME_REMOTE_MACHINE:FILE for the file name.  You can\nalso visit local files as a different user by specifying\n/sudo::FILE for the file name.\nSee the Info node `(tramp)File name Syntax' in the Tramp Info\nmanual, for more about this.\n\nInteractively, or if WILDCARDS is non-nil in a call from Lisp,\nexpand wildcards (if any) and visit multiple files.  You can\nsuppress wildcard expansion by setting `find-file-wildcards' to nil.\n\nTo visit a file without any kind of conversion and without\nautomatically choosing a major mode, use \\[find-file-literally]." (interactive #f(compiled-function () #<bytecode 0xd4b0ca7b44742b0>)) #<bytecode 0x1ed47580088af897>)("/home/vova/stuff/books/Gashek_Pohozhdeniya_bravogo...")
  apply(#f(compiled-function (filename &optional wildcards) "Edit file FILENAME.\nSwitch to a buffer visiting file FILENAME,\ncreating one if none already exists.\nInteractively, the default if you just type RET is the current directory,\nbut the visited file name is available through the minibuffer history:\ntype \\[next-history-element] to pull it into the minibuffer.\n\nThe first time \\[next-history-element] is used after Emacs prompts for\nthe file name, the result is affected by `file-name-at-point-functions',\nwhich by default try to guess the file name by looking at point in the\ncurrent buffer.  Customize the value of `file-name-at-point-functions'\nor set it to nil, if you want only the visited file name and the\ncurrent directory to be available on first \\[next-history-element]\nrequest.\n\nYou can visit files on remote machines by specifying something\nlike /ssh:SOME_REMOTE_MACHINE:FILE for the file name.  You can\nalso visit local files as a different user by specifying\n/sudo::FILE for the file name.\nSee the Info node `(tramp)File name Syntax' in the Tramp Info\nmanual, for more about this.\n\nInteractively, or if WILDCARDS is non-nil in a call from Lisp,\nexpand wildcards (if any) and visit multiple files.  You can\nsuppress wildcard expansion by setting `find-file-wildcards' to nil.\n\nTo visit a file without any kind of conversion and without\nautomatically choosing a major mode, use \\[find-file-literally]." (interactive #f(compiled-function () #<bytecode 0xd4b0ca7b44742b0>)) #<bytecode 0x1ed47580088af897>) "/home/vova/stuff/books/Gashek_Pohozhdeniya_bravogo...")
  (let ((result (apply orig args))) (if result (progn (recenter))) result)
  vll/recenter-on-find-function(#f(compiled-function (filename &optional wildcards) "Edit file FILENAME.\nSwitch to a buffer visiting file FILENAME,\ncreating one if none already exists.\nInteractively, the default if you just type RET is the current directory,\nbut the visited file name is available through the minibuffer history:\ntype \\[next-history-element] to pull it into the minibuffer.\n\nThe first time \\[next-history-element] is used after Emacs prompts for\nthe file name, the result is affected by `file-name-at-point-functions',\nwhich by default try to guess the file name by looking at point in the\ncurrent buffer.  Customize the value of `file-name-at-point-functions'\nor set it to nil, if you want only the visited file name and the\ncurrent directory to be available on first \\[next-history-element]\nrequest.\n\nYou can visit files on remote machines by specifying something\nlike /ssh:SOME_REMOTE_MACHINE:FILE for the file name.  You can\nalso visit local files as a different user by specifying\n/sudo::FILE for the file name.\nSee the Info node `(tramp)File name Syntax' in the Tramp Info\nmanual, for more about this.\n\nInteractively, or if WILDCARDS is non-nil in a call from Lisp,\nexpand wildcards (if any) and visit multiple files.  You can\nsuppress wildcard expansion by setting `find-file-wildcards' to nil.\n\nTo visit a file without any kind of conversion and without\nautomatically choosing a major mode, use \\[find-file-literally]." (interactive #f(compiled-function () #<bytecode 0xd4b0ca7b44742b0>)) #<bytecode 0x1ed47580088af897>) "/home/vova/stuff/books/Gashek_Pohozhdeniya_bravogo...")
  apply(vll/recenter-on-find-function #f(compiled-function (filename &optional wildcards) "Edit file FILENAME.\nSwitch to a buffer visiting file FILENAME,\ncreating one if none already exists.\nInteractively, the default if you just type RET is the current directory,\nbut the visited file name is available through the minibuffer history:\ntype \\[next-history-element] to pull it into the minibuffer.\n\nThe first time \\[next-history-element] is used after Emacs prompts for\nthe file name, the result is affected by `file-name-at-point-functions',\nwhich by default try to guess the file name by looking at point in the\ncurrent buffer.  Customize the value of `file-name-at-point-functions'\nor set it to nil, if you want only the visited file name and the\ncurrent directory to be available on first \\[next-history-element]\nrequest.\n\nYou can visit files on remote machines by specifying something\nlike /ssh:SOME_REMOTE_MACHINE:FILE for the file name.  You can\nalso visit local files as a different user by specifying\n/sudo::FILE for the file name.\nSee the Info node `(tramp)File name Syntax' in the Tramp Info\nmanual, for more about this.\n\nInteractively, or if WILDCARDS is non-nil in a call from Lisp,\nexpand wildcards (if any) and visit multiple files.  You can\nsuppress wildcard expansion by setting `find-file-wildcards' to nil.\n\nTo visit a file without any kind of conversion and without\nautomatically choosing a major mode, use \\[find-file-literally]." (interactive #f(compiled-function () #<bytecode 0xd4b0ca7b44742b0>)) #<bytecode 0x1ed47580088af897>) "/home/vova/stuff/books/Gashek_Pohozhdeniya_bravogo...")
  find-file("/home/vova/stuff/books/Gashek_Pohozhdeniya_bravogo...")
  diredp--reuse-dir-buffer-helper("/home/vova/stuff/books/Gashek_Pohozhdeniya_bravogo...")
  diredp-find-file-reuse-dir-buffer()
  funcall-interactively(diredp-find-file-reuse-dir-buffer)
  call-interactively(diredp-find-file-reuse-dir-buffer nil nil)
  command-execute(diredp-find-file-reuse-dir-buffer)
jumper047 commented 2 years ago

Oops, sorry - somehow it works in my use cases. Hope now it's ok.

vlichevsky commented 2 years ago

Confirming the fix.