Mercurial > emacs
comparison lisp/info.el @ 6339:f0f62abb621b
(Info-insert-dir): Use printable escapes instead of embedding literal control
chars in the source.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Mon, 14 Mar 1994 21:27:13 +0000 |
parents | a9caf92da1d3 |
children | f5ab0b6b9640 |
comparison
equal
deleted
inserted
replaced
6338:63033f2867fd | 6339:f0f62abb621b |
---|---|
389 ;; Find each menu, and add an elt to NODES for it. | 389 ;; Find each menu, and add an elt to NODES for it. |
390 (while (re-search-forward "^\\* Menu:" nil t) | 390 (while (re-search-forward "^\\* Menu:" nil t) |
391 (let (beg nodename end) | 391 (let (beg nodename end) |
392 (forward-line 1) | 392 (forward-line 1) |
393 (setq beg (point)) | 393 (setq beg (point)) |
394 (search-backward "\n") | 394 (search-backward "\n\^_") |
395 (search-forward "Node: ") | 395 (search-forward "Node: ") |
396 (setq nodename (Info-following-node-name)) | 396 (setq nodename (Info-following-node-name)) |
397 (search-forward "\n" nil 'move) | 397 (search-forward "\n\^_" nil 'move) |
398 (beginning-of-line) | 398 (beginning-of-line) |
399 (setq end (point)) | 399 (setq end (point)) |
400 (setq nodes (cons (list nodename other beg end) nodes)))))) | 400 (setq nodes (cons (list nodename other beg end) nodes)))))) |
401 (setq others (cdr others))) | 401 (setq others (cdr others))) |
402 ;; Add to the main menu a menu item for each other node. | 402 ;; Add to the main menu a menu item for each other node. |
403 (re-search-forward "^\\* Menu:") | 403 (re-search-forward "^\\* Menu:") |
404 (forward-line 1) | 404 (forward-line 1) |
405 (let ((menu-items '("top")) | 405 (let ((menu-items '("top")) |
406 (nodes nodes) | 406 (nodes nodes) |
407 (case-fold-search t) | 407 (case-fold-search t) |
408 (end (save-excursion (search-forward "" nil t) (point)))) | 408 (end (save-excursion (search-forward "\^_" nil t) (point)))) |
409 (while nodes | 409 (while nodes |
410 (let ((nodename (car (car nodes)))) | 410 (let ((nodename (car (car nodes)))) |
411 (or (member (downcase nodename) menu-items) | 411 (or (member (downcase nodename) menu-items) |
412 (re-search-forward (concat "^\\* " (regexp-quote nodename) ":") | 412 (re-search-forward (concat "^\\* " (regexp-quote nodename) ":") |
413 end t) | 413 end t) |
419 ;; and merge it into the main buffer. | 419 ;; and merge it into the main buffer. |
420 (while nodes | 420 (while nodes |
421 (let ((nodename (car (car nodes)))) | 421 (let ((nodename (car (car nodes)))) |
422 (goto-char (point-min)) | 422 (goto-char (point-min)) |
423 ;; Find the like-named node in the main buffer. | 423 ;; Find the like-named node in the main buffer. |
424 (if (re-search-forward (concat "\n.*\n.*Node: " | 424 (if (re-search-forward (concat "\n\^_.*\n.*Node: " |
425 (regexp-quote nodename) | 425 (regexp-quote nodename) |
426 "[,\n\t]") | 426 "[,\n\t]") |
427 nil t) | 427 nil t) |
428 (progn | 428 (progn |
429 (search-forward "\n" nil 'move) | 429 (search-forward "\n\^_" nil 'move) |
430 (beginning-of-line)) | 430 (beginning-of-line)) |
431 ;; If none exists, add one. | 431 ;; If none exists, add one. |
432 (goto-char (point-max)) | 432 (goto-char (point-max)) |
433 (insert "\nFile: dir\tnode: " nodename "\n\n* Menu:\n\n")) | 433 (insert "\^_\nFile: dir\tnode: " nodename "\n\n* Menu:\n\n")) |
434 ;; Merge the text from the other buffer's menu | 434 ;; Merge the text from the other buffer's menu |
435 ;; into the menu in the like-named node in the main buffer. | 435 ;; into the menu in the like-named node in the main buffer. |
436 (apply 'insert-buffer-substring (cdr (car nodes))) | 436 (apply 'insert-buffer-substring (cdr (car nodes))) |
437 (insert "\n")) | 437 (insert "\n")) |
438 (setq nodes (cdr nodes))) | 438 (setq nodes (cdr nodes))) |