emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ELPA: new package svg-tag-mode


From: Nicolas P. Rougier (inria)
Subject: Re: ELPA: new package svg-tag-mode
Date: Mon, 27 Dec 2021 08:34:44 +0100
User-agent: mu4e 1.6.10; emacs 27.2


Hi Stefan,

Thanks for the code review. I applied most of your patches and fixme comments but I've a few questions:

Stefan Monnier <monnier@iro.umontreal.ca> writes:
The `svg-tag-tags` structure (and the provided examples) encourages the use of code-hidden-inside-data, i.e. code that will never be exposed
to things like flymake or the byte-compiler :-(

You mean there might be a better structure or is the whole concept "flawed"?

(defun svg-tag--build-keywords (item)
  "Process an item in order to install it as a new keyword."
(let* ((pattern (if (string-match "\\\\(.+\\\\)" (car item))
                       (car item)
                     (format "\\(%s\\)" (car item))))
         (tag      (nth 0 (cdr item)))
         (callback (nth 1 (cdr item)))
         (help     (nth 2 (cdr item))))
    (when (or (functionp tag) (and (symbolp tag) (fboundp tag)))
        (setq tag `(,tag (match-string 1))))
     (setq tag ``(face nil
                  display ,,tag
cursor-sensor-functions (svg-tag--cursor-function)
                  ,@(if ,callback '(pointer hand))
                  ,@(if ,help `(help-echo ,,help))
+ ;; FIXME: Don't hard-code the internal representation
+                 ;; of keymaps.
,@(if ,callback `(keymap (keymap (mouse-1 . ,,callback))))))
     `(,pattern 1 ,tag)))

I had a hard time to make this to work and I did not find a proper solution with the use of a local sparse keymap (maybe there's an obvious solution but I get lost with `` and ,,). What would be a clean solution?

Nicolas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]