larsmagne / meme

An Emacs meme generator
https://lars.ingebrigtsen.no/2016/06/27/an-emacs-meme-generator/
178 stars 9 forks source link

Wrong number of arguments: (1 . 1), 0 #9

Closed diogoleal closed 1 year ago

diogoleal commented 1 year ago

When I execute M-meme using GNU Emacs 28.2 on Fedora 37 with these configuration:

(add-to-list 'load-path "~/.emacs.d/lisp/")  ;; path to imgur.el.
(add-to-list 'load-path "~/.emacs.d/lisp/meme") ;;path to meme

(require 'meme)
(autoload 'meme "meme.el" "Create a meme from a collection" t)
(autoload 'meme-file "meme.el" "Create a meme from a file" t)

I received this error:

Wrong number of arguments: (1 . 1), 0

where i'm wrong?

larsmagne commented 1 year ago

Try (setq debug-on-error t), repeat M-x meme, and post the resulting backtrace.

diogoleal commented 1 year ago

Please accept my apologies for the delay.

Debugger entered--Lisp error: (wrong-number-of-arguments image-compute-scaling-factor 0)
  (image-compute-scaling-factor)
  (* 180 (image-compute-scaling-factor))
  (truncate (* 180 (image-compute-scaling-factor)))
  (let* ((dir (expand-file-name "images" (file-name-directory (locate-library "meme")))) (pixels (truncate (* 180 (image-compute-scaling-factor)))) (width (/ (- (nth 2 (window-pixel-edges)) (nth 0 (window-pixel-edges)) 20) pixels)) (inhibit-read-only t) (i 0) image-width image) (erase-buffer) (let ((--dolist-tail-- (directory-files dir t ".jpg\\'"))) (while --dolist-tail-- (let ((file (car --dolist-tail--))) (if (and (not (bolp)) (not (= image-width pixels))) (progn (insert (propertize " " ... ... ... t)))) (setq image (create-image file (meme--image-type) nil :max-width pixels :max-height pixels)) (setq image-width (car (image-size image t))) (insert-image image " ") (add-text-properties (1- (point)) (point) (list 'keymap meme--select-map 'file file)) (if (= 0 (mod (setq i ...) width)) (progn (insert "\n"))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (goto-char (point-min)))
  meme--insert-thumbnails()
  meme()
  funcall-interactively(meme)
  command-execute(meme record)
  execute-extended-command(nil "meme" "meme")
  funcall-interactively(execute-extended-command nil "meme" "meme")
  command-execute(execute-extended-command)
larsmagne commented 1 year ago

I guess you're using Emacs 28? meme needs Emacs 29.