more emacs 24 changes
parent
ca247bb185
commit
c30627a604
36
bbj.el
36
bbj.el
|
@ -393,24 +393,44 @@ or any of its children."
|
||||||
(bbj:insert-sep)))
|
(bbj:insert-sep)))
|
||||||
|
|
||||||
|
|
||||||
|
;; (defun bbj:render-tag-span (dom)
|
||||||
|
;; "A slightly modified version of `shr-tag-span' which handles quotes and stuff."
|
||||||
|
;; (let ((class (if bbj:old-p
|
||||||
|
;; (assq :class (cdr dom))
|
||||||
|
;; (dom-attr dom 'class))))
|
||||||
|
;; (dolist (sub (if (consp (car dom)) (cddr (car dom)) (cddr dom)))
|
||||||
|
;; (if (stringp sub)
|
||||||
|
;; (cond
|
||||||
|
;; ((equal class "quote")
|
||||||
|
;; (insert (propertize sub
|
||||||
|
;; 'face 'font-lock-constant-face
|
||||||
|
;; 'type 'quote)))
|
||||||
|
;; ((equal class "linequote")
|
||||||
|
;; (insert (propertize sub
|
||||||
|
;; 'face 'font-lock-string-face
|
||||||
|
;; 'type 'linequote)))
|
||||||
|
;; (t (shr-insert sub)))
|
||||||
|
;; (shr-descend sub)))))
|
||||||
|
|
||||||
(defun bbj:render-tag-span (dom)
|
(defun bbj:render-tag-span (dom)
|
||||||
"A slightly modified version of `shr-tag-span' which handles quotes and stuff."
|
"A slightly modified version of `shr-tag-span' which handles quotes and stuff."
|
||||||
(let ((class (if bbj:old-p
|
(let ((class (if bbj:old-p
|
||||||
(assq :class (cdr dom))
|
(alist-get :class dom)
|
||||||
(dom-attr dom 'class))))
|
(dom-attr dom 'class)))
|
||||||
(dolist (sub (if (consp (car dom)) (cddr (car dom)) (cddr dom)))
|
(text (if bbj:old-p
|
||||||
(if (stringp sub)
|
(alist-get 'text dom)
|
||||||
|
(car (last dom)))))
|
||||||
(cond
|
(cond
|
||||||
((equal class "quote")
|
((equal class "quote")
|
||||||
(insert (propertize sub
|
(insert (propertize text
|
||||||
'face 'font-lock-constant-face
|
'face 'font-lock-constant-face
|
||||||
'type 'quote)))
|
'type 'quote)))
|
||||||
((equal class "linequote")
|
((equal class "linequote")
|
||||||
(insert (propertize sub
|
(unless (bolp) (insert "\n"))
|
||||||
|
(insert (propertize text
|
||||||
'face 'font-lock-string-face
|
'face 'font-lock-string-face
|
||||||
'type 'linequote)))
|
'type 'linequote)))
|
||||||
(t (shr-insert sub)))
|
(text (shr-insert text)))))
|
||||||
(shr-descend sub)))))
|
|
||||||
|
|
||||||
|
|
||||||
(defun bbj:mksep ()
|
(defun bbj:mksep ()
|
||||||
|
|
Loading…
Reference in New Issue