Skip to content

Commit

Permalink
🎨 Move pinboard-field closer to where it's used
Browse files Browse the repository at this point in the history
  • Loading branch information
davep committed Jun 3, 2019
1 parent 4685d86 commit 9acb8f4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pinboard.el
Expand Up @@ -384,17 +384,6 @@ The title, description and tags are all searched. Search is case-insensitive."
(interactive)
(pinboard-redraw))

(defmacro pinboard-field (suffix widget)
"Create a Pinboard field for a form.
The field name will be pinboard-field- followed by SUFFIX, and
its value will be set to WIDGET."
(declare (indent 1))
(let ((name (intern (format "pinboard-field-%s" suffix))))
`(progn
(make-local-variable (defvar ,name))
(setq ,name ,widget))))

(defun pinboard-refresh-locally (url title description tags private to-read)
"Refresh the local list of pins with the given information.
Expand Down Expand Up @@ -472,6 +461,17 @@ the pin data as is used in the main list."
(string= (alist-get 'shared pin) "no")
(string= (alist-get 'toread pin) "yes")))

(defmacro pinboard-field (suffix widget)
"Create a Pinboard field for a form.
The field name will be pinboard-field- followed by SUFFIX, and
its value will be set to WIDGET."
(declare (indent 1))
(let ((name (intern (format "pinboard-field-%s" suffix))))
`(progn
(make-local-variable (defvar ,name))
(setq ,name ,widget))))

(defun pinboard-make-form (buffer-name title &optional pin)
"Make a pinboard edit form in the current buffer.
Expand Down

0 comments on commit 9acb8f4

Please sign in to comment.