diff options
| author | Lars Ingebrigtsen | 2020-04-30 06:05:17 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2020-04-30 06:05:26 +0200 |
| commit | 6c1b12e7d2ff38e313eae97bfd01746ecacdb02f (patch) | |
| tree | 9df52d6f67c91d5107b6d2af3af8df952264733b /lisp | |
| parent | 0a982c077e7393d865622ff780906a0cb252348d (diff) | |
| download | emacs-6c1b12e7d2ff38e313eae97bfd01746ecacdb02f.tar.gz emacs-6c1b12e7d2ff38e313eae97bfd01746ecacdb02f.zip | |
Add new function dom-remove-attribute
* doc/lispref/text.texi (Document Object Model): Document it.
* lisp/dom.el (dom-remove-attribute): Add new function.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/dom.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/dom.el b/lisp/dom.el index 34df0e9af4c..7ff9e07b729 100644 --- a/lisp/dom.el +++ b/lisp/dom.el | |||
| @@ -67,6 +67,12 @@ | |||
| 67 | (setcdr old value) | 67 | (setcdr old value) |
| 68 | (setcar (cdr node) (nconc (cadr node) (list (cons attribute value))))))) | 68 | (setcar (cdr node) (nconc (cadr node) (list (cons attribute value))))))) |
| 69 | 69 | ||
| 70 | (defun dom-remove-attribute (node attribute) | ||
| 71 | "Remove ATTRIBUTE from NODE." | ||
| 72 | (setq node (dom-ensure-node node)) | ||
| 73 | (when-let ((old (assoc attribute (cadr node)))) | ||
| 74 | (setcar (cdr node) (delq old (cadr node))))) | ||
| 75 | |||
| 70 | (defmacro dom-attr (node attr) | 76 | (defmacro dom-attr (node attr) |
| 71 | "Return the attribute ATTR from NODE. | 77 | "Return the attribute ATTR from NODE. |
| 72 | A typical attribute is `href'." | 78 | A typical attribute is `href'." |