From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.bugs Subject: allout.el bugs Date: 24 Apr 2002 08:01:46 +0900 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <53516390-93c0-4520-87a5-c31c91074115@deisui.bug.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1019602842 8756 127.0.0.1 (23 Apr 2002 23:00:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 23 Apr 2002 23:00:42 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 1709H7-0002H0-00 for ; Wed, 24 Apr 2002 01:00:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 1709H8-0007G0-00; Tue, 23 Apr 2002 19:00:42 -0400 Original-Received: from g96069.scn-net.ne.jp ([210.231.96.69] helo=deisui.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 1709Fm-00077m-00 for ; Tue, 23 Apr 2002 18:59:19 -0400 Original-Received: from deisui.bug.org (aquair [127.0.0.1]) by deisui.org (8.12.3/8.12.3/Debian -4) with ESMTP id g3NN1kDf000782 for ; Wed, 24 Apr 2002 08:01:46 +0900 X-Now-Playing: Def Leppard's _Slang_: "Truth?" Original-To: bug-gnu-emacs@gnu.org Original-Lines: 258 Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:894 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:894 This bug report will be sent to the Free Software Foundation, not to your local site managers! Please write in English, because the Emacs maintainers do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. In GNU Emacs 21.2.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2002-04-24 on aquair configured using `configure --with-xpm --with-jpeg -with-tiff --with-gif --with-png --with-x' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: ja_JP.UTF-8 locale-coding-system: nil default-enable-multibyte-characters: t Please describe exactly what actions triggered the bug and the precise symptoms of the bug: I'm using allout.el, I see various bugs and buglets: * outline-title contains an unknown function, current-buffer-name. * outline-make-topic-prefix resets the header-prefix when depth == 1 (is this a feature?) * "Mapping and processing of topics" are totaly broken, because the schema of LISTIFIED is mismatched in places: - The docstring of outline-listify-exposed says what the function returns is (DEPTH PREFIX BULLET STRINGS). However, the function omits BULLET from the return value. - The docstring of outline-insert-listified says that it should be (DEPTH PREFIX STRINGS) or (DEPTH PREFIX STRINGS BULLET) - outline-latexify-one-item accepts it as a series of arguments. * The macro my-region-active-p is used before it is defined. * XEmacs: outline-latex-verb-quote supplies a character type value to number-to-string, so we need to convert it into an integer. The attached patch temporarily fixes these things. --- allout.el 27 Mar 2002 20:13:03 -0000 1.32 +++ allout.el 23 Apr 2002 22:36:40 -0000 @@ -381,7 +381,7 @@ (defcustom outline-title-style "\\Large\ :type 'string :group 'allout) ;;;_ - outline-title -(defcustom outline-title '(or buffer-file-name (current-buffer-name)) +(defcustom outline-title '(or buffer-file-name (buffer-name)) "*Expression to be evaluated to determine the title for LaTeX formatted copy." :type 'sexp @@ -2626,7 +2626,7 @@ (defun outline-make-topic-prefix (&optio (cond ; Simplest situation - level 1: - ((<= depth 1) (setq header-lead "") outline-primary-bullet) + ((<= depth 1) outline-primary-bullet) ; Simple, too: all asterisks: (outline-old-style-prefixes ;; Cheat - make body the whole thing, null out header-lead and @@ -4160,8 +4160,8 @@ (defun outline-listify-exposed (&optiona ;; Goto initial topic, and register preceeding stuff, if any: (if (> (outline-goto-prefix) start) ;; First topic follows beginning point - register preliminary stuff: - (setq result (list (list 0 "" nil - (buffer-substring start (1- (point))))))) + (setq result (list (list 0 "" "" + (list (buffer-substring start (1- (point)))))))) (while (and (not done) (not (eobp)) ; Loop until we've covered the region. (not (> (point) end))) @@ -4211,6 +4211,7 @@ (defun outline-listify-exposed (&optiona gone-out) (outline-stringify-flat-index-plain format)) + bullet strings special)) ((eq format 'indent) @@ -4218,13 +4219,15 @@ (defun outline-listify-exposed (&optiona (list depth (concat (make-string (1+ depth) ? ) (substring prefix -1)) + bullet strings) (list depth (make-string depth ? ) + bullet strings))) (t (error "outline-listify-exposed: %s %s" "invalid format" format)))) - (list depth prefix strings)) + (list depth prefix bullet strings)) result)) ;; Reasses format, if any: (if (and format (listp format)) @@ -4277,7 +4280,9 @@ (defun outline-process-exposed (&optiona ; defaulting if necessary: (if (not func) (setq func 'outline-insert-listified)) (if (not (and from to)) - (if (my-region-active-p) + (if (if (fboundp 'region-active-p) + (region-active-p) + mark-active) (setq from (region-beginning) to (region-end)) (setq from (point-min) to (point-max)))) (if frombuf @@ -4311,26 +4316,25 @@ (defun outline-process-exposed (&optiona (defun outline-insert-listified (listified) "Insert contents of listified outline portion in current buffer. -Listified is a list representing each topic header and body: - - \`(depth prefix text)' - -or \`(depth prefix text bullet-plus)' - -If `bullet-plus' is specified, it is inserted just after the entire prefix." +LISTIFIED is a list representing each topic header and body: +\(DEPTH PREFIX BULLET STRINGS)." (setq listified (cdr listified)) - (let ((prefix (prog1 + (let* ((depth (prog1 (car listified) (setq listified (cdr listified)))) - (text (prog1 - (car listified) - (setq listified (cdr listified)))) - (bullet-plus (car listified))) - (insert prefix) - (if bullet-plus (insert (concat " " bullet-plus))) - (while text - (insert (car text)) - (if (setq text (cdr text)) + (prefix (prog1 + (car listified) + (setq listified (cdr listified)))) + (bullet (prog1 + (car listified) + (setq listified (cdr listified)))) + (strings (prog1 + (car listified) + (setq listified (cdr listified))))) + (insert prefix " " bullet) + (while strings + (insert (car strings)) + (if (setq strings (cdr strings)) (insert "\n"))) (insert "\n"))) ;;;_ > outline-copy-exposed-to-buffer (&optional arg tobuf format) @@ -4419,7 +4423,12 @@ (defun outline-latex-verb-quote (str &op (mapconcat (function (lambda (char) (cond ((memq char '(?\\ ?$ ?% ?# ?& ?{ ?} ?_ ?^ ?- ?*)) - (concat "\\char" (number-to-string char) "{}")) + (concat "\\char" + (number-to-string + (if (fboundp 'char-to-int) + (char-to-int char) + char)) + "{}")) ((= char ?\n) "\\\\") (t (char-to-string char))))) str @@ -4495,7 +4504,7 @@ (defun outline-insert-latex-header (buf) (outline-latex-verb-quote (if outline-title (condition-case err (eval outline-title) - ('error "")) + (error "")) "Unnamed Outline")) "}\n" "\\end{center}\n\n")) @@ -4523,20 +4532,32 @@ (defun outline-insert-latex-trailer (buf (set-buffer buf) (insert "\n\\end{document}\n")) ;;;_ > outline-latexify-one-item (depth prefix bullet text) -(defun outline-latexify-one-item (depth prefix bullet text) +(defun outline-latexify-one-item (listified) "Insert LaTeX commands for formatting one outline item. -Args are the topics numeric DEPTH, the header PREFIX lead string, the -BULLET string, and a list of TEXT strings for the body." - (let* ((head-line (if text (car text))) - (body-lines (cdr text)) +LISTIFIED is a list representing each topic header and body: +\(DEPTH PREFIX BULLET STRINGS)." + (let* ((depth (prog1 + (car listified) + (setq listified (cdr listified)))) + (prefix (prog1 + (car listified) + (setq listified (cdr listified)))) + (bullet (prog1 + (car listified) + (setq listified (cdr listified)))) + (strings (prog1 + (car listified) + (setq listified (cdr listified)))) + (head-line (if strings (car strings))) + (body-lines (cdr strings)) (curr-line) body-content bop) ; Do the head line: (insert (concat "\\OneHeadLine{\\verb\1 " (outline-latex-verb-quote bullet) "\1}{" - depth + (number-to-string depth) "}{\\verb\1 " (if head-line (outline-latex-verb-quote head-line) @@ -4704,11 +4725,6 @@ (defun regexp-sans-escapes (regexp &opti (regexp-sans-escapes (substring regexp 1))) ;; Exclude first char, but maintain count: (regexp-sans-escapes (substring regexp 1) successive-backslashes)))) -;;;_ > my-region-active-p () -(defmacro my-region-active-p () - (if (fboundp 'region-active-p) - '(region-active-p) - 'mark-active)) ;;;_ - add-hook definition for divergent emacsen ;;;_ > add-hook (hook function &optional append) (if (not (fboundp 'add-hook)) Recent input: x r e p o r t C-x 1 C-x k y e s x p Recent messages: For information about the GNU Project and its goals, type C-h C-p. Loading emacsbug...done Loading message... Loading eword-encode...done Loading message...done Loading mail-extr...done Loading gnus-util...done Fill column set to 72 (was 70) Loading view...done Type C-c C-x C-z to exit MIME mode, and type C-c C-x ? to get help. Regards, -- Daiki Ueno