[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: psgml help hack -- where?
>>>>> "Dmitry" == Dmitry Astapov writes:
Dmitry> Возник такой вот вопрос: где бы можно было бы найти патчик имени
Dmitry> Тоботраса к psgml-mode для показывания psgmlhelp?
А у меня спросить нельзя? :)
--- psgml.el~ Sun Mar 9 04:37:46 1997
+++ psgml.el Tue Sep 30 12:57:22 1997
@@ -266,6 +266,14 @@
("Yes" . t)
("Ask" . ask)))
+(defvar sgml-insert-psgmlhelp-comment nil
+ "*If non-nil, PSGMLHELP attribute value (if any) will be insert after
+open tag.")
+
+(defvar sgml-use-psgmlhelp-in-popups t
+ "*If non-nil, PSGMLHELP attribute value (if any) will be append to
+element entry in popup menus.")
+
(defvar sgml-trace-entity-lookup nil
"*If non-nil, log messages about catalog files used to look for
external entities.")
@@ -517,6 +521,8 @@
sgml-omittag-transparent
sgml-leave-point-after-insert
sgml-insert-missing-element-comment
+ sgml-insert-psgmlhelp-comment
+ sgml-use-psgmlhelp-in-popups
sgml-insert-end-tag-on-new-line
sgml-warn-about-undefined-elements
sgml-warn-about-undefined-entities
--- psgml-edit.el~ Sun Mar 9 05:37:45 1997
+++ psgml-edit.el Tue Sep 30 13:48:48 1997
@@ -617,6 +617,12 @@
element)
(sgml-element-attlist element))
(forward-char 1)
+
+ (when sgml-insert-psgmlhelp-comment
+ (let ((psgmlhelp (sgml-element-attval element "psgmlhelp")))
+ (if psgmlhelp
+ (insert "<!-- " psgmlhelp " -->"))))
+
(when (not (sgml-element-empty element))
(when (and sgml-auto-insert-required-elements
(sgml-model-group-p sgml-current-state))
--- psgml-xemacs.el~ Thu Apr 3 18:13:51 1997
+++ psgml-xemacs.el Tue Sep 30 22:56:51 1997
@@ -45,11 +45,24 @@
;;;; Pop Up Menus
+(defun sgml-make-popup-menu-entry (entry)
+ "*Makes popup menu entry from ENTRY string. If ENTRY is element name,
+and if ENTRY element have 'psgmlhelp' attribute, it's value is appended
+to ENTRY string, otherwise just ENTRY is returned. This behaviour is turned
+off if sgml-use-psgmlhelp-in-popups is set to nil."
+ (if sgml-use-psgmlhelp-in-popups
+ (let ((attlist (sgml-eltype-attlist (sgml-lookup-eltype entry))))
+ (while attlist
+ (if (equal (caar attlist) "psgmlhelp")
+ (setq entry (concat entry " (" (cadr (caddar attlist)) ")")))
+ (setq attlist (cdr attlist)))))
+ entry)
+
(defun sgml-popup-menu (event title entries)
"Display a popup menu."
(setq entries
(loop for ent in entries collect
- (vector (car ent)
+ (vector (concat (sgml-make-popup-menu-entry (car ent)))
(list 'setq 'value (list 'quote (cdr ent)))
t)))
(cond ((> (length entries) sgml-max-menu-size)
Dmitry> Да, и вот еще что - никак не получается от этого самого psgml
Dmitry> добиться указания правильного пути к catalog при Validate :( Все
Dmitry> время получается /usr/share/xemacs-тра-та-та/sgml/CATALOG :(
Да? Странно. Пропиши в .emacs
(setq sgml-catalog-files (list "catalog" "CATALOG"
"/usr/local/lib/sgml/catalog"))
или в этом духе.
--
Best regards, -- Boris.