annotate lisp/cedet/semantic/tag-write.el @ 110763:0fe64d68a522

Merge changes made in Gnus trunk. shr.el: Implement table rendering. shr.el (shr-make-table): Tweak table generation. shr.el (shr-make-table): Fix typo. nnimap.el (nnimap-open-connection): Allow tls as a synonym for ssl. gnus-util.el (gnus-emacs-completing-read): Mapcar collection to list, for XEmacs. nnimap.el (nnimap-close-server): Implement. gnus-salt.el: Remove all gnus-carpal stuff -- it's not useful. nnir.el (nnir-run-imap): Remove spurious space in search string. message.el (message-idna-to-ascii-rhs-1): Don't bug out on addresses without @ signs. gnus-sum.el (gnus-widen-article-window): New variable. shr.el (browse-url): Required. shr.el (shr-ensure-paragraph): Don't insert a new newline after empty-ish lines. shr.el (shr-show-alt-text, shr-browse-image): New commands. gravatar.el (gravatar-retrieved): kill buffer when retrieved. shr.el (shr-browse-url, shr-copy-url): New commands. shr.el (shr-render-td): Protect against too-wide text. spam-report.el (spam-report-url-ping-plain): Don't query about killing the process. nnimap.el (nnimap-finish-retrieve-group-infos): Message while waiting for data. shr.el (shr-tag-blockquote): Ensure paragraph after quote, too. mml-smime.el: Fix gnus-completing-read usage. shr.el (shr-get-image-data): Ensure against the cache file missing. nnimap.el (nnimap-open-connection): Give an error if nnimap-stream is unknown.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Mon, 04 Oct 2010 22:26:51 +0000
parents 1d1d5d9bd884
children 376148b31b5e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
104446
df08b7ab0ba0 lisp/cedet/semantic/analyze.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents: 104421
diff changeset
1 ;;; semantic/tag-write.el --- Write tags to a text stream
104421
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
2
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 105842
diff changeset
3 ;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
104421
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
4
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
5 ;; Author: Eric M. Ludlam <eric@siege-engine.com>
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
6
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
8
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
9 ;; GNU Emacs is free software: you can redistribute it and/or modify
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
11 ;; the Free Software Foundation, either version 3 of the License, or
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
12 ;; (at your option) any later version.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
13
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
17 ;; GNU General Public License for more details.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
18
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
21
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
22 ;;; Commentary:
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
23 ;;
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
24 ;; Routine for writing out a list of tags to a text stream.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
25 ;;
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
26 ;; These routines will be used by semanticdb to output a tag list into
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
27 ;; a text stream to be saved to a file. Ideally, you could use tag streams
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
28 ;; to share tags between processes as well.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
29 ;;
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
30 ;; As a bonus, these routines will also validate the tag structure, and make sure
105339
adbff0886e10 Fix comment typo.
Glenn Morris <rgm@gnu.org>
parents: 104493
diff changeset
31 ;; that they conform to good semantic tag hygiene.
104421
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
32 ;;
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
33
104446
df08b7ab0ba0 lisp/cedet/semantic/analyze.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents: 104421
diff changeset
34 (require 'semantic)
104421
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
35
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
36 ;;; Code:
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
37 (defun semantic-tag-write-one-tag (tag &optional indent)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
38 "Write a single tag TAG to standard out.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
39 INDENT is the amount of indentation to use for this tag."
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
40 (when (not (semantic-tag-p tag))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
41 (signal 'wrong-type-argument (list tag 'semantic-tag-p)))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
42 (when (not indent) (setq indent 0))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
43 ;(princ (make-string indent ? ))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
44 (princ "(\"")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
45 ;; Base parts
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
46 (let ((name (semantic-tag-name tag))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
47 (class (semantic-tag-class tag)))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
48 (princ name)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
49 (princ "\" ")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
50 (princ (symbol-name class))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
51 )
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
52 (let ((attr (semantic-tag-attributes tag))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
53 )
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
54 ;; Attributes
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
55 (cond ((not attr)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
56 (princ " nil"))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
57
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
58 ((= (length attr) 2) ;; One item
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
59 (princ " (")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
60 (semantic-tag-write-one-attribute attr indent)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
61 (princ ")")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
62 )
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
63 (t
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
64 ;; More than one tag.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
65 (princ "\n")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
66 (princ (make-string (+ indent 3) ? ))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
67 (princ "(")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
68 (while attr
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
69 (semantic-tag-write-one-attribute attr (+ indent 4))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
70 (setq attr (cdr (cdr attr)))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
71 (when attr
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
72 (princ "\n")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
73 (princ (make-string (+ indent 4) ? )))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
74 )
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
75 (princ ")\n")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
76 (princ (make-string (+ indent 3) ? ))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
77 ))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
78 ;; Properties - for now, always nil.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
79 (let ((rs (semantic--tag-get-property tag 'reparse-symbol)))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
80 (if (not rs)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
81 (princ " nil")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
82 ;; Else, put in the property list.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
83 (princ " (reparse-symbol ")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
84 (princ (symbol-name rs))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
85 (princ ")"))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
86 ))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
87 ;; Overlay
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
88 (if (semantic-tag-with-position-p tag)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
89 (let ((bounds (semantic-tag-bounds tag)))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
90 (princ " ")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
91 (prin1 (apply 'vector bounds))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
92 )
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
93 (princ " nil"))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
94 ;; End it.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
95 (princ ")")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
96 )
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
97
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
98 (defun semantic-tag-write-tag-list (tlist &optional indent dontaddnewline)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
99 "Write the tag list TLIST to the current stream.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
100 INDENT indicates the current indentation level.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
101 If optional DONTADDNEWLINE is non-nil, then don't add a newline."
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
102 (if (not indent)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
103 (setq indent 0)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
104 (unless dontaddnewline
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
105 ;; Assume cursor at end of current line. Add a CR, and make the list.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
106 (princ "\n")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
107 (princ (make-string indent ? ))))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
108 (princ "( ")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
109 (while tlist
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
110 (if (semantic-tag-p (car tlist))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
111 (semantic-tag-write-one-tag (car tlist) (+ indent 2))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
112 ;; If we don't have a tag in the tag list, use the below hack, and hope
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
113 ;; it doesn't contain anything bad. If we find something bad, go back here
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
114 ;; and start extending what's expected here.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
115 (princ (format "%S" (car tlist))))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
116 (setq tlist (cdr tlist))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
117 (when tlist
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
118 (princ "\n")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
119 (princ (make-string (+ indent 2) ? )))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
120 )
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
121 (princ ")")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
122 (princ (make-string indent ? ))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
123 )
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
124
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
125
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
126 ;; Writing out random stuff.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
127 (defun semantic-tag-write-one-attribute (attrs indent)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
128 "Write out one attribute from the head of the list of attributes ATTRS.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
129 INDENT is the current amount of indentation."
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
130 (when (not attrs) (signal 'wrong-type-argument (list 'listp attrs)))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
131 (when (not (symbolp (car attrs))) (error "Bad Attribute List in tag"))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
132
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
133 (princ (symbol-name (car attrs)))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
134 (princ " ")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
135 (semantic-tag-write-one-value (car (cdr attrs)) indent)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
136 )
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
137
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
138 (defun semantic-tag-write-one-value (value indent)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
139 "Write out a VALUE for something in a tag.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
140 INDENT is the current tag indentation.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
141 Items that are long lists of tags may need their own line."
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
142 (cond
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
143 ;; Another tag.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
144 ((semantic-tag-p value)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
145 (semantic-tag-write-one-tag value (+ indent 2)))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
146 ;; A list of more tags
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
147 ((and (listp value) (semantic-tag-p (car value)))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
148 (semantic-tag-write-tag-list value (+ indent 2))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
149 )
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
150 ;; Some arbitrary data.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
151 (t
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
152 (let ((str (format "%S" value)))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
153 ;; Protect against odd data types in tags.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
154 (if (= (aref str 0) ?#)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
155 (progn
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
156 (princ "nil")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
157 (message "Warning: Value %s not writable in tag." str))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
158 (princ str)))))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
159 )
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
160 ;;; EIEIO USAGE
104491
ee206d5b836f * cedet/semantic/tag-write.el (semantic-tag-write-list-slot-value):
Chong Yidong <cyd@stupidchicken.com>
parents: 104446
diff changeset
161 ;;;###autoload
104421
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
162 (defun semantic-tag-write-list-slot-value (value)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
163 "Write out the VALUE of a slot for EIEIO.
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
164 The VALUE is a list of tags."
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
165 (if (not value)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
166 (princ "nil")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
167 (princ "\n '")
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
168 (semantic-tag-write-tag-list value 10 t)
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
169 ))
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
170
b66bb908c129 cedet/semantic/debug.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
171 (provide 'semantic/tag-write)
104491
ee206d5b836f * cedet/semantic/tag-write.el (semantic-tag-write-list-slot-value):
Chong Yidong <cyd@stupidchicken.com>
parents: 104446
diff changeset
172
ee206d5b836f * cedet/semantic/tag-write.el (semantic-tag-write-list-slot-value):
Chong Yidong <cyd@stupidchicken.com>
parents: 104446
diff changeset
173 ;; Local variables:
ee206d5b836f * cedet/semantic/tag-write.el (semantic-tag-write-list-slot-value):
Chong Yidong <cyd@stupidchicken.com>
parents: 104446
diff changeset
174 ;; generated-autoload-file: "loaddefs.el"
ee206d5b836f * cedet/semantic/tag-write.el (semantic-tag-write-list-slot-value):
Chong Yidong <cyd@stupidchicken.com>
parents: 104446
diff changeset
175 ;; generated-autoload-load-name: "semantic/tag-write"
ee206d5b836f * cedet/semantic/tag-write.el (semantic-tag-write-list-slot-value):
Chong Yidong <cyd@stupidchicken.com>
parents: 104446
diff changeset
176 ;; End:
ee206d5b836f * cedet/semantic/tag-write.el (semantic-tag-write-list-slot-value):
Chong Yidong <cyd@stupidchicken.com>
parents: 104446
diff changeset
177
105377
7f4c7f5c0eba Add arch tagline
Miles Bader <miles@gnu.org>
parents: 105339
diff changeset
178 ;; arch-tag: aa2301b3-f0c5-4d73-b456-43eaba5b2198
104446
df08b7ab0ba0 lisp/cedet/semantic/analyze.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents: 104421
diff changeset
179 ;;; semantic/tag-write.el ends here