diff options
| author | Glenn Morris | 2010-11-09 20:35:18 -0800 |
|---|---|---|
| committer | Glenn Morris | 2010-11-09 20:35:18 -0800 |
| commit | dea53a431f68f3b8030ccc06949e63532423aedf (patch) | |
| tree | 25b7a28e70cd78005282e9689d75a8b21e9ff8f0 /lisp | |
| parent | b565f5a1b987f01c2eb57437a30adc4904e80df5 (diff) | |
| download | emacs-dea53a431f68f3b8030ccc06949e63532423aedf.tar.gz emacs-dea53a431f68f3b8030ccc06949e63532423aedf.zip | |
Use line-beginning-position in some texinfo.el files.
* lisp/textmodes/texnfo-upd.el (texinfo-all-menus-update)
(texinfo-menu-copy-old-description, texinfo-start-menu-description)
(texinfo-master-menu, texinfo-insert-node-lines)
(texinfo-multiple-files-update):
* lisp/textmodes/texinfmt.el (texinfo-append-refill, texinfo-copying):
Use line-beginning-position.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/textmodes/texinfmt.el | 16 | ||||
| -rw-r--r-- | lisp/textmodes/texnfo-upd.el | 36 |
3 files changed, 28 insertions, 31 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fea67a36719..67ab836359e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2010-11-10 Glenn Morris <rgm@gnu.org> | 1 | 2010-11-10 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * textmodes/texnfo-upd.el (texinfo-all-menus-update) | ||
| 4 | (texinfo-menu-copy-old-description, texinfo-start-menu-description) | ||
| 5 | (texinfo-master-menu, texinfo-insert-node-lines) | ||
| 6 | (texinfo-multiple-files-update): | ||
| 7 | * textmodes/texinfmt.el (texinfo-append-refill, texinfo-copying): | ||
| 8 | Use line-beginning-position. | ||
| 9 | |||
| 3 | * progmodes/cperl-mode.el (cperl-find-pods-heres, cperl-write-tags): | 10 | * progmodes/cperl-mode.el (cperl-find-pods-heres, cperl-write-tags): |
| 4 | No recent Emacs supports system-type `emx'. | 11 | No recent Emacs supports system-type `emx'. |
| 5 | 12 | ||
diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el index 577287c60bc..7c331c7809d 100644 --- a/lisp/textmodes/texinfmt.el +++ b/lisp/textmodes/texinfmt.el | |||
| @@ -663,11 +663,12 @@ Do not append @refill to paragraphs containing @w{TEXT} or @*." | |||
| 663 | ;; Else | 663 | ;; Else |
| 664 | ;; 3. Do not refill a paragraph containing @w or @*, or ending | 664 | ;; 3. Do not refill a paragraph containing @w or @*, or ending |
| 665 | ;; with @<newline> followed by a newline. | 665 | ;; with @<newline> followed by a newline. |
| 666 | (if (or (>= (point) (point-max)) | 666 | (if (or (>= (point) (point-max)) |
| 667 | (re-search-forward | 667 | (re-search-forward |
| 668 | "@w{\\|@\\*\\|@\n\n" | 668 | "@w{\\|@\\*\\|@\n\n" |
| 669 | (save-excursion (forward-paragraph) (forward-line 1) (point)) | 669 | (save-excursion (forward-paragraph) |
| 670 | t)) | 670 | (line-beginning-position 2)) |
| 671 | t)) | ||
| 671 | ;; Go to end of paragraph and do nothing. | 672 | ;; Go to end of paragraph and do nothing. |
| 672 | (forward-paragraph) | 673 | (forward-paragraph) |
| 673 | ;; 4. Else go to end of paragraph and insert @refill | 674 | ;; 4. Else go to end of paragraph and insert @refill |
| @@ -944,8 +945,8 @@ insert the text with the @insertcopying command." | |||
| 944 | (end (progn (re-search-forward "^@end copying[ \t]*\n") (point)))) | 945 | (end (progn (re-search-forward "^@end copying[ \t]*\n") (point)))) |
| 945 | (setq texinfo-copying-text | 946 | (setq texinfo-copying-text |
| 946 | (buffer-substring-no-properties | 947 | (buffer-substring-no-properties |
| 947 | (save-excursion (goto-char beg) (forward-line 1) (point)) | 948 | (save-excursion (goto-char beg) (line-beginning-position 2)) |
| 948 | (save-excursion (goto-char end) (forward-line -1) (point)))) | 949 | (save-excursion (goto-char end) (line-beginning-position 0)))) |
| 949 | (delete-region beg end))) | 950 | (delete-region beg end))) |
| 950 | 951 | ||
| 951 | (defun texinfo-insertcopying () | 952 | (defun texinfo-insertcopying () |
| @@ -4297,5 +4298,4 @@ For example, invoke | |||
| 4297 | ;;; Place `provide' at end of file. | 4298 | ;;; Place `provide' at end of file. |
| 4298 | (provide 'texinfmt) | 4299 | (provide 'texinfmt) |
| 4299 | 4300 | ||
| 4300 | ;; arch-tag: 1e8d9a2d-bca0-40a0-ac6c-dab01bc6f725 | ||
| 4301 | ;;; texinfmt.el ends here | 4301 | ;;; texinfmt.el ends here |
diff --git a/lisp/textmodes/texnfo-upd.el b/lisp/textmodes/texnfo-upd.el index a5b4937f240..4c3dbda80b0 100644 --- a/lisp/textmodes/texnfo-upd.el +++ b/lisp/textmodes/texnfo-upd.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; texnfo-upd.el --- utilities for updating nodes and menus in Texinfo files | 1 | ;;; texnfo-upd.el --- utilities for updating nodes and menus in Texinfo files |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004, | 3 | ;; Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004, 2005, |
| 4 | ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | 4 | ;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Robert J. Chassell | 6 | ;; Author: Robert J. Chassell |
| 7 | ;; Maintainer: bug-texinfo@gnu.org | 7 | ;; Maintainer: bug-texinfo@gnu.org |
| @@ -349,9 +349,7 @@ section titles are often too short to explain a node well." | |||
| 349 | (when (search-forward texinfo-master-menu-header nil t) | 349 | (when (search-forward texinfo-master-menu-header nil t) |
| 350 | ;; Check if @detailmenu kludge is used; | 350 | ;; Check if @detailmenu kludge is used; |
| 351 | ;; if so, leave point before @detailmenu. | 351 | ;; if so, leave point before @detailmenu. |
| 352 | (search-backward "\n@detailmenu" | 352 | (search-backward "\n@detailmenu" (line-beginning-position -2) t) |
| 353 | (save-excursion (forward-line -3) (point)) | ||
| 354 | t) | ||
| 355 | ;; Remove detailed master menu listing | 353 | ;; Remove detailed master menu listing |
| 356 | (setq master-menu-p t) | 354 | (setq master-menu-p t) |
| 357 | (goto-char (match-beginning 0)) | 355 | (goto-char (match-beginning 0)) |
| @@ -627,9 +625,7 @@ Single argument, END-OF-MENU, is position limiting search." | |||
| 627 | (point) | 625 | (point) |
| 628 | (save-excursion | 626 | (save-excursion |
| 629 | (re-search-forward "\\(^\\* \\|^@ignore\\|^@end menu\\)" end-of-menu t) | 627 | (re-search-forward "\\(^\\* \\|^@ignore\\|^@end menu\\)" end-of-menu t) |
| 630 | (forward-line -1) | 628 | (line-end-position 0))) ; end of last description line |
| 631 | (end-of-line) ; go to end of last description line | ||
| 632 | (point))) | ||
| 633 | "")) | 629 | "")) |
| 634 | 630 | ||
| 635 | (defun texinfo-menu-end () | 631 | (defun texinfo-menu-end () |
| @@ -737,16 +733,14 @@ complements the node name rather than repeats it as a title does." | |||
| 737 | (skip-chars-forward " \t") | 733 | (skip-chars-forward " \t") |
| 738 | (setq beginning (point)) | 734 | (setq beginning (point)) |
| 739 | ;; Menu entry line ends in a period, comma, or tab. | 735 | ;; Menu entry line ends in a period, comma, or tab. |
| 740 | (if (re-search-forward "[.,\t]" | 736 | (if (re-search-forward "[.,\t]" (line-beginning-position 2) t) |
| 741 | (save-excursion (forward-line 1) (point)) t) | ||
| 742 | (progn | 737 | (progn |
| 743 | (if (looking-at "[ \t]*[^ \t\n]+") | 738 | (if (looking-at "[ \t]*[^ \t\n]+") |
| 744 | (error "Descriptive text already exists")) | 739 | (error "Descriptive text already exists")) |
| 745 | (skip-chars-backward "., \t") | 740 | (skip-chars-backward "., \t") |
| 746 | (setq node-name (buffer-substring beginning (point)))) | 741 | (setq node-name (buffer-substring beginning (point)))) |
| 747 | ;; Menu entry line ends in a return. | 742 | ;; Menu entry line ends in a return. |
| 748 | (re-search-forward ".*\n" | 743 | (re-search-forward ".*\n" (line-beginning-position 2) t) |
| 749 | (save-excursion (forward-line 1) (point)) t) | ||
| 750 | (skip-chars-backward " \t\n") | 744 | (skip-chars-backward " \t\n") |
| 751 | (setq node-name (buffer-substring beginning (point))) | 745 | (setq node-name (buffer-substring beginning (point))) |
| 752 | (if (= 0 (length node-name)) | 746 | (if (= 0 (length node-name)) |
| @@ -904,9 +898,7 @@ section titles are often too short to explain a node well." | |||
| 904 | (progn | 898 | (progn |
| 905 | ;; Check if @detailmenu kludge is used; | 899 | ;; Check if @detailmenu kludge is used; |
| 906 | ;; if so, leave point before @detailmenu. | 900 | ;; if so, leave point before @detailmenu. |
| 907 | (search-backward "\n@detailmenu" | 901 | (search-backward "\n@detailmenu" (line-beginning-position -2) t) |
| 908 | (save-excursion (forward-line -3) (point)) | ||
| 909 | t) | ||
| 910 | ;; Remove detailed master menu listing | 902 | ;; Remove detailed master menu listing |
| 911 | (goto-char (match-beginning 0)) | 903 | (goto-char (match-beginning 0)) |
| 912 | (let ((end-of-detailed-menu-descriptions | 904 | (let ((end-of-detailed-menu-descriptions |
| @@ -941,9 +933,7 @@ section titles are often too short to explain a node well." | |||
| 941 | (goto-char (match-beginning 0)) | 933 | (goto-char (match-beginning 0)) |
| 942 | ;; Check if @detailmenu kludge is used; | 934 | ;; Check if @detailmenu kludge is used; |
| 943 | ;; if so, leave point before @detailmenu. | 935 | ;; if so, leave point before @detailmenu. |
| 944 | (search-backward "\n@detailmenu" | 936 | (search-backward "\n@detailmenu" (line-beginning-position -2) t) |
| 945 | (save-excursion (forward-line -3) (point)) | ||
| 946 | t) | ||
| 947 | (insert "\n") | 937 | (insert "\n") |
| 948 | (delete-blank-lines) | 938 | (delete-blank-lines) |
| 949 | (goto-char (point-min)))) | 939 | (goto-char (point-min)))) |
| @@ -1449,6 +1439,7 @@ The argument is the kind of section, either `normal' or `no-pointer'." | |||
| 1449 | (end-of-line) ; this handles prev node top case | 1439 | (end-of-line) ; this handles prev node top case |
| 1450 | (re-search-backward ; when point is already | 1440 | (re-search-backward ; when point is already |
| 1451 | "^@node" ; at the beginning of @node line | 1441 | "^@node" ; at the beginning of @node line |
| 1442 | ;; FIXME this can't be right. Missing the point? | ||
| 1452 | (save-excursion (forward-line -3)) | 1443 | (save-excursion (forward-line -3)) |
| 1453 | t) | 1444 | t) |
| 1454 | (setq name (texinfo-copy-node-name))) | 1445 | (setq name (texinfo-copy-node-name))) |
| @@ -1649,7 +1640,8 @@ node names in pre-existing `@node' lines that lack names." | |||
| 1649 | "^@node" | 1640 | "^@node" |
| 1650 | ;; Avoid finding previous node line if node lines are close. | 1641 | ;; Avoid finding previous node line if node lines are close. |
| 1651 | (or last-section-position | 1642 | (or last-section-position |
| 1652 | (save-excursion (forward-line -2) (point))) t) | 1643 | (line-beginning-position -1)) |
| 1644 | t) | ||
| 1653 | ;; @node is present, and point at beginning of that line | 1645 | ;; @node is present, and point at beginning of that line |
| 1654 | (forward-word 1) ; Leave point just after @node. | 1646 | (forward-word 1) ; Leave point just after @node. |
| 1655 | ;; Else @node missing; insert one. | 1647 | ;; Else @node missing; insert one. |
| @@ -1671,7 +1663,7 @@ node names in pre-existing `@node' lines that lack names." | |||
| 1671 | (message "Inserted title %s ... " title))))) | 1663 | (message "Inserted title %s ... " title))))) |
| 1672 | ;; Go forward beyond current section title. | 1664 | ;; Go forward beyond current section title. |
| 1673 | (re-search-forward texinfo-section-types-regexp | 1665 | (re-search-forward texinfo-section-types-regexp |
| 1674 | (save-excursion (forward-line 3) (point)) t) | 1666 | (line-beginning-position 4) t) |
| 1675 | (setq last-section-position (point)) | 1667 | (setq last-section-position (point)) |
| 1676 | (forward-line 1)) | 1668 | (forward-line 1)) |
| 1677 | 1669 | ||
| @@ -2015,9 +2007,7 @@ chapter." | |||
| 2015 | (goto-char (match-beginning 0)) | 2007 | (goto-char (match-beginning 0)) |
| 2016 | ;; Check if @detailmenu kludge is used; | 2008 | ;; Check if @detailmenu kludge is used; |
| 2017 | ;; if so, leave point before @detailmenu. | 2009 | ;; if so, leave point before @detailmenu. |
| 2018 | (search-backward "\n@detailmenu" | 2010 | (search-backward "\n@detailmenu" (line-beginning-position -2) t) |
| 2019 | (save-excursion (forward-line -3) (point)) | ||
| 2020 | t) | ||
| 2021 | ;; Remove detailed master menu listing | 2011 | ;; Remove detailed master menu listing |
| 2022 | (let ((end-of-detailed-menu-descriptions | 2012 | (let ((end-of-detailed-menu-descriptions |
| 2023 | (save-excursion ; beginning of end menu line | 2013 | (save-excursion ; beginning of end menu line |