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)))
|
||||
|
||||
|
||||
;; (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)
|
||||
"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)
|
||||
(alist-get :class dom)
|
||||
(dom-attr dom 'class)))
|
||||
(text (if bbj:old-p
|
||||
(alist-get 'text dom)
|
||||
(car (last dom)))))
|
||||
(cond
|
||||
((equal class "quote")
|
||||
(insert (propertize sub
|
||||
(insert (propertize text
|
||||
'face 'font-lock-constant-face
|
||||
'type 'quote)))
|
||||
((equal class "linequote")
|
||||
(insert (propertize sub
|
||||
(unless (bolp) (insert "\n"))
|
||||
(insert (propertize text
|
||||
'face 'font-lock-string-face
|
||||
'type 'linequote)))
|
||||
(t (shr-insert sub)))
|
||||
(shr-descend sub)))))
|
||||
(text (shr-insert text)))))
|
||||
|
||||
|
||||
(defun bbj:mksep ()
|
||||
|
|
Loading…
Reference in New Issue