all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: Michael Heerdegen <michael_heerdegen@web.de>,
	20141@debbugs.gnu.org,
	Thierry Volpiatto <thierry.volpiatto@gmail.com>
Subject: bug#20141: 24.4.91; Helm is broken after last changes in eieio
Date: Thu, 19 Mar 2015 16:46:36 +0100	[thread overview]
Message-ID: <87r3sl6lcz.fsf@gnu.org> (raw)
In-Reply-To: <jwvtwxh5av0.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Thu, 19 Mar 2015 10:20:26 -0400")

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> (eieio-class-slots 'helm-source)
> [...]
>> Until today it returned (name), now, you get
>> ([cl-struct-cl-slot-descriptor name nil t nil])
>
> eieio-class-slots is new in Emacs-25, so it's OK if it's different
> from yesterday.  But indeed, it looks I failed to adapt object-slots.
> Does the patch below fix the problems people are seeing?

Yes, it seems so.  However, I still get the error from yasnippet.

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (wrong-type-argument integerp nil)
  yas--populate-template([cl-struct-yas--template nil nil nil nil nil nil nil nil nil nil nil nil] :table [cl-struct-yas--table "haskell-mode" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) nil (keymap)] :key "new" :content "newtype ${1:Type} = $1 { un$1 :: ${2:a} } ${3:deriving (${4:Show, Eq})}" :name "newtype" :group nil :condition (= (length "new") (current-column)) :expand-env nil :file "/home/horn/.emacs.d/elpa/haskell-mode-20150317.204/snippets/haskell-mode/newtype" :keybinding nil :uuid "newtype")
  yas--define-snippets-1(("new" "newtype ${1:Type} = $1 { un$1 :: ${2:a} } ${3:deriving (${4:Show, Eq})}" "newtype" (= (length "new") (current-column)) nil nil "/home/horn/.emacs.d/elpa/haskell-mode-20150317.204/snippets/haskell-mode/newtype" nil nil) [cl-struct-yas--table "haskell-mode" #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) nil (keymap)])
--8<---------------cut here---------------end--------------->8---

But I think the code that throws is probably too fragile anyway:

--8<---------------cut here---------------start------------->8---
(defun yas--populate-template (template &rest args)
  "Helper function to populate TEMPLATE with properties."
  (while args
    (aset template
          (position (intern (substring (symbol-name (car args)) 1))
                    (mapcar #'car (get 'yas--template 'cl-struct-slots)))
          (second args))
    (setq args (cddr args)))
  template)

;; the yas--template struct is defined like this
(defstruct (yas--template (:constructor yas--make-blank-template))
  "A template for a snippet."
  key
  content
  name
  condition
  expand-env
  file
  keybinding
  uuid
  menu-binding-pair
  group      ;; as dictated by the #group: directive or .yas-make-groups
  perm-group ;; as dictated by `yas-define-menu'
  table
  )
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo





  reply	other threads:[~2015-03-19 15:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19  5:17 bug#20141: 24.4.91; Helm is broken after last changes in eieio Thierry Volpiatto
2015-03-19  6:05 ` Ivan Shmakov
2015-03-19  6:12   ` Thierry Volpiatto
2015-03-19  7:20     ` Ivan Shmakov
2015-03-19  6:11 ` Thierry Volpiatto
2015-03-19  6:53   ` Tassilo Horn
2015-03-19  7:19     ` Michael Heerdegen
2015-03-19  8:10       ` Michael Heerdegen
2015-03-19 14:20       ` Stefan Monnier
2015-03-19 15:46         ` Tassilo Horn [this message]
2015-03-19 19:22           ` Stefan Monnier
2015-03-19 18:37         ` Thierry Volpiatto
2015-03-19 20:00           ` Stefan Monnier
2015-03-19  6:55 ` Tassilo Horn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r3sl6lcz.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=20141@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=thierry.volpiatto@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.