diff options
| author | John Wiegley | 2016-01-11 22:51:27 -0800 |
|---|---|---|
| committer | John Wiegley | 2016-01-11 22:51:27 -0800 |
| commit | c7bef6a4f033fa6b22906de0be6da54958d5b3c3 (patch) | |
| tree | 3a0f34b340ad01de290f068530c27f35aba83724 | |
| parent | f5d90b5fcf0251466055c7dbed6069c1850d802d (diff) | |
| parent | 1f6898d0510cd15455f665c0f38451755a374243 (diff) | |
| download | emacs-c7bef6a4f033fa6b22906de0be6da54958d5b3c3.tar.gz emacs-c7bef6a4f033fa6b22906de0be6da54958d5b3c3.zip | |
Merge from origin/emacs-25
1f6898d test/automated/vc-hg.el: Support out-of-tree build
3adb56e Minor change in tramp-tests.el
2b535ba ; * etc/NEWS: Update the js.el entry.
76b518c * etc/HELLO: Add Armenian and Mongolian greetings.
b51f1ef Java Mode: Fontify identifiers in the presence of annotations.
36b9539 Avoid an infloop when we run out of memory
2006752 Avoid unnecessary failures of auto-saving after fatal error
eef6784 Simplify HAVE_MODULES use in mark_maybe_pointer
552694a Revert attempt to use 'noexcept' in typedef
6ad0d39 Update documentation of 'indirect-function'
c6a5314 ; * etc/NEWS: Move entry of 'inhibit-point-motion-hooks'.
303141a Update documentation for obsoleting 'syntax-begin-function'
4e6f61c ; * etc/NEWS: Mark documented and not-to-be-documented entries.
e667bbb Document new features if Eshell
9c4e4e0 ; * etc/NEWS: Update EUDC entries.
1089dc9 Handle too long commands in Tramp
684eb58 * .gitattributes: *.cur and *.pif are binary files too.
d2c7fda * src/alloc.c (mark_maybe_pointer): HAVE_MODULES may be undefined
bd3f53d * sh-script.el (sh-smie-sh-rules): Improve indentation inside $(...)
09b2b8a * src/alloc.c (mark_maybe_pointer): Also check wide-int's emacs_value
cca0f93 ; Account for spaces before the filename
c71e1e8 Use short date for 'hg annotate', and output the author
f50027b Spelling fix
c7dff67 ; * etc/NEWS: Fix the Xref entries that got separated.
cc140bc Document user-level functions in project.el
f8208b6 Document the user-level features of the Xref package
b131fb8 * loading.texi: Add `define-type' entry for load-history
db3c2a8 Improve doc strings and prompts in xref.el
f6117ef Allow the use of `font-lock-extend-region-multiline' in CC Mode.
90fd798 Fix coding system for Tramp on OS X.
e985a0e ; * etc/NEWS: Mark the 'check-expensive' entry not to be documented.
9dfcbf0 Update 'load-history' docs
207e191 Fix (error ...) error
457738f Correctly analyze brace arguments in templated C++ function declarations.
d57724a * lisp/cedet/mode-local.el (describe-function-orig-buffer): Declare.
2a9532d * lisp/ffap.el (ffap-latex-mode): Avoid free variable.
1a6b084 * lisp/play/dunnet.el (dun-fix-screen): Avoid `end-of-buffer`.
8be046f Respect fontification region calculated by major mode. Fixes bug #22316.
4b37cba Improve documentation of Delete Selection mode
a034dd3 Fix two project-find-file issues
30abf29 Clarify doc string of 'dired-current-directory'
e990bb2 Use the face of preceding text for displaying the ellipsis
5810ac3 Suppress Chinese file name test for OSX in tramp-tests.el
eeb710a ; * lisp/startup.el: Sentences end with two spaces.
428b3de * admin/admin.el (set-version): Also handle the NEWS file.
648de81 ; Add NEWS entry for project.el
671862f apropos-library: Skip obvious duplicates; don't error on generics
51668a5 ; Grammar fix
ed41d11 Add project-find-file and project-or-external-find-file
056da45 ; Improve commentary in 'setup_for_ellipsis'
269d008 ; Improve docstring for `inhibit-startup-echo-area-message'
50 files changed, 1181 insertions, 578 deletions
diff --git a/.gitattributes b/.gitattributes index 8f61c807d72..5ccf9a5eabb 100644 --- a/.gitattributes +++ b/.gitattributes | |||
| @@ -34,12 +34,14 @@ test/etags/html-src/algrthms.html whitespace=cr-at-eol | |||
| 34 | doc/misc/texinfo.tex -whitespace=blank-at-eol | 34 | doc/misc/texinfo.tex -whitespace=blank-at-eol |
| 35 | 35 | ||
| 36 | # Some files should not be treated as text when diffing or merging. | 36 | # Some files should not be treated as text when diffing or merging. |
| 37 | *.cur binary | ||
| 37 | *.gpg binary | 38 | *.gpg binary |
| 38 | *.gz binary | 39 | *.gz binary |
| 39 | *.icns binary | 40 | *.icns binary |
| 40 | *.ico binary | 41 | *.ico binary |
| 41 | *.pbm binary | 42 | *.pbm binary |
| 42 | *.pdf binary | 43 | *.pdf binary |
| 44 | *.pif binary | ||
| 43 | *.png binary | 45 | *.png binary |
| 44 | *.sig binary | 46 | *.sig binary |
| 45 | *.tiff binary | 47 | *.tiff binary |
diff --git a/admin/admin.el b/admin/admin.el index 7923f0bb466..fe807ff96fe 100644 --- a/admin/admin.el +++ b/admin/admin.el | |||
| @@ -96,13 +96,74 @@ Root must be the root of an Emacs source tree." | |||
| 96 | (submatch (1+ (in "0-9.")))))) | 96 | (submatch (1+ (in "0-9.")))))) |
| 97 | ;; Major version only. | 97 | ;; Major version only. |
| 98 | (when (string-match "\\([0-9]\\{2,\\}\\)" version) | 98 | (when (string-match "\\([0-9]\\{2,\\}\\)" version) |
| 99 | (setq version (match-string 1 version)) | 99 | (let ((newmajor (match-string 1 version))) |
| 100 | (set-version-in-file root "src/msdos.c" version | 100 | (set-version-in-file root "src/msdos.c" newmajor |
| 101 | (rx (and "Vwindow_system_version" (1+ not-newline) | 101 | (rx (and "Vwindow_system_version" (1+ not-newline) |
| 102 | ?\( (submatch (1+ (in "0-9"))) ?\)))) | 102 | ?\( (submatch (1+ (in "0-9"))) ?\)))) |
| 103 | (set-version-in-file root "etc/refcards/ru-refcard.tex" version | 103 | (set-version-in-file root "etc/refcards/ru-refcard.tex" newmajor |
| 104 | "\\\\newcommand{\\\\versionemacs}\\[0\\]\ | 104 | "\\\\newcommand{\\\\versionemacs}\\[0\\]\ |
| 105 | {\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs")) | 105 | {\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs"))) |
| 106 | (let* ((oldversion | ||
| 107 | (with-temp-buffer | ||
| 108 | (insert-file-contents (expand-file-name "README" root)) | ||
| 109 | (if (re-search-forward "version \\([0-9.]*\\)" nil t) | ||
| 110 | (version-to-list (match-string 1))))) | ||
| 111 | (oldmajor (if oldversion (car oldversion))) | ||
| 112 | (newversion (version-to-list version)) | ||
| 113 | (newmajor (car newversion)) | ||
| 114 | (newshort (format "%s.%s" newmajor | ||
| 115 | (+ (cadr newversion) | ||
| 116 | (if (eq 2 (length newversion)) 0 1)))) | ||
| 117 | (majorbump (and oldversion (not (equal oldmajor newmajor)))) | ||
| 118 | (minorbump (and oldversion (not majorbump) | ||
| 119 | (not (equal (cadr oldversion) (cadr newversion))))) | ||
| 120 | (newsfile (expand-file-name "etc/NEWS" root)) | ||
| 121 | (oldnewsfile (expand-file-name (format "etc/NEWS.%s" oldmajor) root))) | ||
| 122 | (when (and majorbump | ||
| 123 | (not (file-exists-p oldnewsfile))) | ||
| 124 | (rename-file newsfile oldnewsfile) | ||
| 125 | (find-file oldnewsfile) ; to prompt you to commit it | ||
| 126 | (copy-file oldnewsfile newsfile) | ||
| 127 | (with-temp-buffer | ||
| 128 | (insert-file-contents newsfile) | ||
| 129 | (re-search-forward "is about changes in Emacs version \\([0-9]+\\)") | ||
| 130 | (replace-match (number-to-string newmajor) nil nil nil 1) | ||
| 131 | (re-search-forward "^See files \\(NEWS\\)") | ||
| 132 | (replace-match (format "NEWS.%s, NEWS" oldmajor) nil nil nil 1) | ||
| 133 | (let ((start (line-beginning-position))) | ||
| 134 | (search-forward "in older Emacs versions") | ||
| 135 | (or (equal start (line-beginning-position)) | ||
| 136 | (fill-region start (line-beginning-position 2)))) | ||
| 137 | (re-search-forward "^$") | ||
| 138 | (forward-line -1) | ||
| 139 | (let ((start (point))) | ||
| 140 | (goto-char (point-max)) | ||
| 141 | (re-search-backward "^$" nil nil 2) | ||
| 142 | (delete-region start (line-beginning-position 0))) | ||
| 143 | (write-region nil nil newsfile))) | ||
| 144 | (when (or majorbump minorbump) | ||
| 145 | (find-file newsfile) | ||
| 146 | (goto-char (point-min)) | ||
| 147 | (if (re-search-forward (format "^\\* .*in Emacs %s" newshort) nil t) | ||
| 148 | (progn | ||
| 149 | (kill-buffer) | ||
| 150 | (message "No need to update etc/NEWS")) | ||
| 151 | (goto-char (point-min)) | ||
| 152 | (re-search-forward "^$") | ||
| 153 | (forward-line -1) | ||
| 154 | (dolist (s '("Installation Changes" "Startup Changes" "Changes" | ||
| 155 | "Editing Changes" | ||
| 156 | "Changes in Specialized Modes and Packages" | ||
| 157 | "New Modes and Packages" | ||
| 158 | "Incompatible Lisp Changes" | ||
| 159 | "Lisp Changes")) | ||
| 160 | (insert (format "\n\n* %s in Emacs %s\n" s newshort))) | ||
| 161 | (insert (format "\n\n* Changes in Emacs %s on \ | ||
| 162 | Non-Free Operating Systems\n" newshort))) | ||
| 163 | ;; Because we skip "bump version" commits when merging between branches. | ||
| 164 | ;; Probably doesn't matter in practice, because NEWS changes | ||
| 165 | ;; will only happen on master anyway. | ||
| 166 | (message "Commit any NEWS changes separately"))) | ||
| 106 | (message "Setting version numbers...done")) | 167 | (message "Setting version numbers...done")) |
| 107 | 168 | ||
| 108 | ;; Note this makes some assumptions about form of short copyright. | 169 | ;; Note this makes some assumptions about form of short copyright. |
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 3a12795d2b0..3fa89d9062d 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi | |||
| @@ -360,8 +360,8 @@ that specifies how to run @command{grep}. Use the same arguments you | |||
| 360 | would give @command{grep} when running it normally: a @command{grep}-style | 360 | would give @command{grep} when running it normally: a @command{grep}-style |
| 361 | regexp (usually in single-quotes to quote the shell's special | 361 | regexp (usually in single-quotes to quote the shell's special |
| 362 | characters) followed by file names, which may use wildcards. If you | 362 | characters) followed by file names, which may use wildcards. If you |
| 363 | specify a prefix argument for @kbd{M-x grep}, it finds the tag | 363 | specify a prefix argument for @kbd{M-x grep}, it finds the identifier |
| 364 | (@pxref{Tags}) in the buffer around point, and puts that into the | 364 | (@pxref{Xref}) in the buffer around point, and puts that into the |
| 365 | default @command{grep} command. | 365 | default @command{grep} command. |
| 366 | 366 | ||
| 367 | Your command need not simply run @command{grep}; you can use any shell | 367 | Your command need not simply run @command{grep}; you can use any shell |
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 119a10ccc08..92c1fd5a041 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi | |||
| @@ -785,8 +785,8 @@ Search all the specified files for the regular expression @var{regexp} | |||
| 785 | (@code{dired-do-search}). | 785 | (@code{dired-do-search}). |
| 786 | 786 | ||
| 787 | This command is a variant of @code{tags-search}. The search stops at | 787 | This command is a variant of @code{tags-search}. The search stops at |
| 788 | the first match it finds; use @kbd{M-,} to resume the search and find | 788 | the first match it finds; use @kbd{M-x tags-loop-continue} to resume |
| 789 | the next match. @xref{Tags Search}. | 789 | the search and find the next match. @xref{Identifier Search}. |
| 790 | 790 | ||
| 791 | @kindex Q @r{(Dired)} | 791 | @kindex Q @r{(Dired)} |
| 792 | @findex dired-do-query-replace-regexp | 792 | @findex dired-do-query-replace-regexp |
| @@ -797,8 +797,8 @@ replacing matches for @var{regexp} with the string | |||
| 797 | @var{to} (@code{dired-do-query-replace-regexp}). | 797 | @var{to} (@code{dired-do-query-replace-regexp}). |
| 798 | 798 | ||
| 799 | This command is a variant of @code{tags-query-replace}. If you exit the | 799 | This command is a variant of @code{tags-query-replace}. If you exit the |
| 800 | query replace loop, you can use @kbd{M-,} to resume the scan and replace | 800 | query replace loop, you can use @kbd{M-x tags-loop-continue} to resume |
| 801 | more matches. @xref{Tags Search}. | 801 | the scan and replace more matches. @xref{Identifier Search}. |
| 802 | @end table | 802 | @end table |
| 803 | 803 | ||
| 804 | @node Shell Commands in Dired | 804 | @node Shell Commands in Dired |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 53b689fbfbe..5ef938566de 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -788,8 +788,8 @@ Maintaining Large Programs | |||
| 788 | 788 | ||
| 789 | * Version Control:: Using version control systems. | 789 | * Version Control:: Using version control systems. |
| 790 | * Change Log:: Maintaining a change history for your program. | 790 | * Change Log:: Maintaining a change history for your program. |
| 791 | * Tags:: Go directly to any function in your program in one | 791 | * Xref:: Find definitions and references of any function, |
| 792 | command. Tags remembers which file it is in. | 792 | method, struct, macro, @dots{} in your program. |
| 793 | * EDE:: An integrated development environment for Emacs. | 793 | * EDE:: An integrated development environment for Emacs. |
| 794 | @ifnottex | 794 | @ifnottex |
| 795 | * Emerge:: A convenient way of merging two versions of a program. | 795 | * Emerge:: A convenient way of merging two versions of a program. |
| @@ -861,15 +861,25 @@ Change Logs | |||
| 861 | * Change Log Commands:: Commands for editing change log files. | 861 | * Change Log Commands:: Commands for editing change log files. |
| 862 | * Format of ChangeLog:: What the change log file looks like. | 862 | * Format of ChangeLog:: What the change log file looks like. |
| 863 | 863 | ||
| 864 | Xref | ||
| 865 | |||
| 866 | * Find Identifiers:: Commands to find where an identifier is defined | ||
| 867 | or referenced, to list identifiers, etc. | ||
| 868 | * Tags Tables:: Tags table records which file defines a symbol. | ||
| 869 | * Select Tags Table:: How to visit a specific tags table. | ||
| 870 | |||
| 871 | Find Identifiers | ||
| 872 | |||
| 873 | * Looking Up Identifiers:: Commands to find the definition of a specific tag. | ||
| 874 | * Xref Commands:: Commands in the @file{*xref*} buffer. | ||
| 875 | * Identifier Search:: Searching and replacing identifiers. | ||
| 876 | * List Identifiers:: Listing identifiers and completing on them. | ||
| 877 | |||
| 864 | Tags Tables | 878 | Tags Tables |
| 865 | 879 | ||
| 866 | * Tag Syntax:: Tag syntax for various types of code and text files. | 880 | * Tag Syntax:: Tag syntax for various types of code and text files. |
| 867 | * Create Tags Table:: Creating a tags table with @command{etags}. | 881 | * Create Tags Table:: Creating a tags table with @command{etags}. |
| 868 | * Etags Regexps:: Create arbitrary tags using regular expressions. | 882 | * Etags Regexps:: Create arbitrary tags using regular expressions. |
| 869 | * Select Tags Table:: How to visit a tags table. | ||
| 870 | * Find Tag:: Commands to find the definition of a specific tag. | ||
| 871 | * Tags Search:: Using a tags table for searching and replacing. | ||
| 872 | * List Tags:: Using tags for completion, and listing them. | ||
| 873 | 883 | ||
| 874 | @ifnottex | 884 | @ifnottex |
| 875 | Merging Files with Emerge | 885 | Merging Files with Emerge |
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index a0489975c7d..5fbe0fc5774 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi | |||
| @@ -416,9 +416,9 @@ Start composing a mail message in another frame. This runs | |||
| 416 | @code{compose-mail-other-frame}. It is the other-frame variant of | 416 | @code{compose-mail-other-frame}. It is the other-frame variant of |
| 417 | @kbd{C-x m}. @xref{Sending Mail}. | 417 | @kbd{C-x m}. @xref{Sending Mail}. |
| 418 | @item C-x 5 . | 418 | @item C-x 5 . |
| 419 | Find a tag in the current tag table in another frame. This runs | 419 | Find the definition of an identifier in another frame. This runs |
| 420 | @code{find-tag-other-frame}, the multiple-frame variant of @kbd{M-.}. | 420 | @code{xref-find-definitions-other-frame}, the multiple-frame variant |
| 421 | @xref{Tags}. | 421 | of @kbd{M-.}. @xref{Xref}. |
| 422 | @item C-x 5 r @var{filename} @key{RET} | 422 | @item C-x 5 r @var{filename} @key{RET} |
| 423 | @kindex C-x 5 r | 423 | @kindex C-x 5 r |
| 424 | @findex find-file-read-only-other-frame | 424 | @findex find-file-read-only-other-frame |
diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi index 4b9832f904b..bce97dacee2 100644 --- a/doc/emacs/glossary.texi +++ b/doc/emacs/glossary.texi | |||
| @@ -1329,7 +1329,7 @@ indentation or completion. | |||
| 1329 | @anchor{Glossary---Tags Table} | 1329 | @anchor{Glossary---Tags Table} |
| 1330 | @item Tags Table | 1330 | @item Tags Table |
| 1331 | A tags table is a file that serves as an index to the function | 1331 | A tags table is a file that serves as an index to the function |
| 1332 | definitions in one or more other files. @xref{Tags}. | 1332 | definitions in one or more other files. @xref{Tags Tables}. |
| 1333 | 1333 | ||
| 1334 | @item Termscript File | 1334 | @item Termscript File |
| 1335 | A termscript file contains a record of all characters sent by Emacs to | 1335 | A termscript file contains a record of all characters sent by Emacs to |
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 7b72e6650c8..8842b8ea2f5 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi | |||
| @@ -5,17 +5,42 @@ | |||
| 5 | @node Maintaining | 5 | @node Maintaining |
| 6 | @chapter Maintaining Large Programs | 6 | @chapter Maintaining Large Programs |
| 7 | 7 | ||
| 8 | This chapter describes Emacs features for maintaining large | 8 | This chapter describes Emacs features for maintaining medium- to |
| 9 | programs. If you are maintaining a large Lisp program, then in | 9 | large-size programs and packages. These features include: |
| 10 | addition to the features described here, you may find | 10 | |
| 11 | the Emacs Lisp Regression Testing (ERT) library useful | 11 | @itemize @minus |
| 12 | (@pxref{Top,,ERT,ert, Emacs Lisp Regression Testing}). | 12 | @item |
| 13 | Unified interface to Support for Version Control Systems | ||
| 14 | (@acronym{VCS}) that record the history of changes to source files. | ||
| 15 | |||
| 16 | @item | ||
| 17 | A specialized mode for maintaining @file{ChangeLog} files that provide | ||
| 18 | a chronological log of program changes. | ||
| 19 | |||
| 20 | @item | ||
| 21 | @acronym{Xref}, a set of commands for displaying definitions of | ||
| 22 | symbols (a.k.a.@: ``identifiers'') and their references. | ||
| 23 | |||
| 24 | @item | ||
| 25 | @acronym{EDE}, the Emacs's own IDE. | ||
| 26 | |||
| 27 | @ifnottex | ||
| 28 | @item | ||
| 29 | A mode for merging changes to program sources made on separate | ||
| 30 | branches of development. | ||
| 31 | @end ifnottex | ||
| 32 | @end itemize | ||
| 33 | |||
| 34 | If you are maintaining a large Lisp program, then in addition to the | ||
| 35 | features described here, you may find the Emacs Lisp Regression | ||
| 36 | Testing (@acronym{ERT}) library useful (@pxref{Top,,ERT,ert, Emacs | ||
| 37 | Lisp Regression Testing}). | ||
| 13 | 38 | ||
| 14 | @menu | 39 | @menu |
| 15 | * Version Control:: Using version control systems. | 40 | * Version Control:: Using version control systems. |
| 16 | * Change Log:: Maintaining a change history for your program. | 41 | * Change Log:: Maintaining a change history for your program. |
| 17 | * Tags:: Go directly to any function in your program in one | 42 | * Xref:: Find definitions and references of any function, |
| 18 | command. Tags remembers which file it is in. | 43 | method, struct, macro, @dots{} in your program. |
| 19 | * EDE:: An integrated development environment for Emacs. | 44 | * EDE:: An integrated development environment for Emacs. |
| 20 | @ifnottex | 45 | @ifnottex |
| 21 | * Emerge:: A convenient way of merging two versions of a program. | 46 | * Emerge:: A convenient way of merging two versions of a program. |
| @@ -1660,16 +1685,370 @@ permitted provided the copyright notice and this notice are preserved. | |||
| 1660 | @noindent | 1685 | @noindent |
| 1661 | Of course, you should substitute the proper years and copyright holder. | 1686 | Of course, you should substitute the proper years and copyright holder. |
| 1662 | 1687 | ||
| 1663 | @node Tags | 1688 | @node Xref |
| 1664 | @section Tags Tables | 1689 | @section Find Identifier Definitions and References |
| 1665 | @cindex tags and tag tables | 1690 | @cindex xref |
| 1691 | |||
| 1692 | An @dfn{identifier} is a syntactic elements of the program: a | ||
| 1693 | function, a subroutine, a method, a class, a data type, a macro, etc. | ||
| 1694 | In a programming language, each identifier is a symbol in the | ||
| 1695 | language's syntax. Many program development tools provide | ||
| 1696 | capabilities to extract references to identifiers from source files, | ||
| 1697 | record them on specialized data bases, and then use those data bases | ||
| 1698 | to quickly find where each identifier was defined and referenced. | ||
| 1699 | |||
| 1700 | Emacs provides a unified user interface to these tools, called | ||
| 1701 | @samp{xref}. The tools supported by @samp{xref} include: | ||
| 1702 | |||
| 1703 | @enumerate a | ||
| 1704 | @item | ||
| 1705 | Some major modes provide built-in means for looking up the language | ||
| 1706 | symbols. For example, Emacs Lisp symbols can be identified by | ||
| 1707 | searching the package load history, maintained by the Emacs Lisp | ||
| 1708 | interpreter, and by consulting the built-in documentation strings; the | ||
| 1709 | Emacs Lisp mode uses these facilities to find definitions of symbols. | ||
| 1710 | |||
| 1711 | @item | ||
| 1712 | Etags, the command for tagging identifier definitions which is part of | ||
| 1713 | the Emacs distribution. @xref{Create Tags Table}. | ||
| 1714 | |||
| 1715 | @item | ||
| 1716 | @acronym{GNU} GLOBAL, the source code tagging system, which provides | ||
| 1717 | the @command{gtags} command and associated utilities. @xref{Command | ||
| 1718 | Line, gtags, , global, GNU GLOBAL source code tag system}. | ||
| 1719 | |||
| 1720 | @item | ||
| 1721 | Cscope (@uref{http://cscope.sourceforge.net/}, a tool for browsing | ||
| 1722 | source code. | ||
| 1723 | |||
| 1724 | @item | ||
| 1725 | @acronym{GNU} IDUtils, a package for generating databases of | ||
| 1726 | identifier references and querying those databases. @xref{Top,,, | ||
| 1727 | idutils, ID database utilities}. | ||
| 1728 | |||
| 1729 | @item | ||
| 1730 | Grep, the venerable program that searches files for lines matching | ||
| 1731 | patterns. @xref{Invoking,,, grep, GNU Grep Manual}. | ||
| 1732 | @end enumerate | ||
| 1733 | |||
| 1734 | @noindent | ||
| 1735 | Additional tools could be supported as they become available, or as | ||
| 1736 | user extensions. Each such tool is used as a @dfn{backend} by | ||
| 1737 | commands described in this section. Each command detects which | ||
| 1738 | backends are available for the current major mode, and uses the most | ||
| 1739 | capable of the available backends, with Grep generally serving as the | ||
| 1740 | fall-back backend. | ||
| 1741 | |||
| 1742 | @cindex tag | ||
| 1743 | The commands described here are useful for finding references in major | ||
| 1744 | modes other than those defined to support programming languages. For | ||
| 1745 | example, chapters, sections, appendices, etc. of a text or a @TeX{} | ||
| 1746 | document can be treated as identifiers as well. In this chapter, we | ||
| 1747 | collectively refer to a reference that specifies the name of the file | ||
| 1748 | where the corresponding subunit is defined, and the position of the | ||
| 1749 | subunit's definition in that file, as a @dfn{tag}. We refer to the | ||
| 1750 | backends used by @code{xref} as @dfn{tagging backends}. | ||
| 1751 | |||
| 1752 | @menu | ||
| 1753 | * Find Identifiers:: Commands to find where an identifier is defined | ||
| 1754 | or referenced, to list identifiers, etc. | ||
| 1755 | * Tags Tables:: Tags table records which file defines a symbol. | ||
| 1756 | * Select Tags Table:: How to visit a specific tags table. | ||
| 1757 | @end menu | ||
| 1758 | |||
| 1759 | @node Find Identifiers | ||
| 1760 | @subsection Find Identifiers | ||
| 1761 | |||
| 1762 | This subsection describes the commands that use the tagging backends | ||
| 1763 | in order to find definitions of identifiers, references to | ||
| 1764 | identifiers, and perform various queries about identifiers. With most | ||
| 1765 | backends, these definitions and references were recorded as tags in | ||
| 1766 | the database created and maintained by the backend. | ||
| 1767 | |||
| 1768 | @menu | ||
| 1769 | * Looking Up Identifiers:: Commands to find the definition of a specific tag. | ||
| 1770 | * Xref Commands:: Commands in the @file{*xref*} buffer. | ||
| 1771 | * Identifier Search:: Searching and replacing identifiers. | ||
| 1772 | * List Identifiers:: Listing identifiers and completing on them. | ||
| 1773 | @end menu | ||
| 1774 | |||
| 1775 | @node Looking Up Identifiers | ||
| 1776 | @subsubsection Looking Up Identifiers | ||
| 1777 | @cindex find definition of symbols | ||
| 1778 | @cindex identifier, finding definition of | ||
| 1779 | @cindex find references to symbols | ||
| 1780 | |||
| 1781 | The most important thing that @code{xref} enables you to do is to find | ||
| 1782 | the definition of a specific identifier. | ||
| 1783 | |||
| 1784 | @table @kbd | ||
| 1785 | @item M-.@: | ||
| 1786 | Find definitions of an identifier (@code{xref-find-definitions}). | ||
| 1787 | @item C-M-. @var{pattern} @key{RET} | ||
| 1788 | Find all identifiers whose name matches @var{pattern} | ||
| 1789 | (@code{xref-find-apropos}). | ||
| 1790 | @item C-x 4 .@: @key{RET} | ||
| 1791 | Find definitions of identifier, but display it in another window | ||
| 1792 | (@code{xref-find-definitions-other-window}). | ||
| 1793 | @item C-x 5 .@: @key{RET} | ||
| 1794 | Find definition of identifier, and display it in a new frame | ||
| 1795 | (@code{xref-find-definitions-other-frame}). | ||
| 1796 | @item M-, | ||
| 1797 | Pop back to where you previously invoked @kbd{M-.} and friends | ||
| 1798 | (@code{xref-pop-marker-stack}). | ||
| 1799 | @end table | ||
| 1800 | |||
| 1801 | @kindex M-. | ||
| 1802 | @findex xref-find-definitions | ||
| 1803 | @kbd{M-.}@: (@code{xref-find-definitions}) shows the definitions of | ||
| 1804 | the identifier at point. With a prefix argument, or if there's no | ||
| 1805 | valid identifier at point, it prompts for the identifier. If the | ||
| 1806 | identifier has only one definition, the command jumps to it. If the | ||
| 1807 | identifier has more than one possible definition (e.g., in an | ||
| 1808 | object-oriented language, or if there's a function and a variable by | ||
| 1809 | the same name), the command shows the candidate definitions in a | ||
| 1810 | @file{*xref*} buffer, together with the files in which these | ||
| 1811 | definitions are found. Selecting one of these candidates by typing | ||
| 1812 | @kbd{@key{RET}} or clicking @kbd{Mouse-2} will pop a buffer showing | ||
| 1813 | the corresponding definition. | ||
| 1814 | |||
| 1815 | When entering the identifier argument to @kbd{M-.}, the usual | ||
| 1816 | minibuffer completion commands can be used (@pxref{Completion}), with | ||
| 1817 | the known identifier names as completion candidates. | ||
| 1666 | 1818 | ||
| 1667 | A @dfn{tag} is a reference to a subunit in a program or in a | 1819 | @kindex C-x 4 . |
| 1668 | document. In source code, tags reference syntactic elements of the | 1820 | @findex xref-find-definitions-other-window |
| 1669 | program: functions, subroutines, data types, macros, etc. In a | 1821 | @kindex C-x 5 . |
| 1670 | document, tags reference chapters, sections, appendices, etc. Each | 1822 | @findex xref-find-definitions-other-frame |
| 1671 | tag specifies the name of the file where the corresponding subunit is | 1823 | Like most commands that can switch buffers, |
| 1672 | defined, and the position of the subunit's definition in that file. | 1824 | @code{xref-find-definitions} has a variant that displays the new |
| 1825 | buffer in another window, and one that makes a new frame for it. The | ||
| 1826 | former is @w{@kbd{C-x 4 .}} | ||
| 1827 | (@code{xref-find-definitions-other-window}), and the latter is | ||
| 1828 | @w{@kbd{C-x 5 .}} (@code{xref-find-definitions-other-frame}). | ||
| 1829 | |||
| 1830 | @findex xref-find-apropos | ||
| 1831 | @kindex C-M-. | ||
| 1832 | The command @kbd{C-M-.} (@code{xref-find-apropos}) finds the | ||
| 1833 | definitions of one or more identifiers that match a specified regular | ||
| 1834 | expression. It is just like @kbd{M-.} except that it does regexp | ||
| 1835 | matching of identifiers instead of symbol name matching. | ||
| 1836 | |||
| 1837 | When any of the above commands finds more than one definition, it | ||
| 1838 | presents the @file{*xref*} buffer showing the definition candidates. | ||
| 1839 | In that buffer, you have several specialized commands, described in | ||
| 1840 | @ref{Xref Commands}. | ||
| 1841 | |||
| 1842 | @kindex M-, | ||
| 1843 | @findex xref-pop-marker-stack | ||
| 1844 | @vindex xref-marker-ring-length | ||
| 1845 | To go back to places @emph{from where} you found the definition, | ||
| 1846 | use @kbd{M-,} (@code{xref-pop-marker-stack}). It jumps back to the | ||
| 1847 | point of the last invocation of @kbd{M-.}. Thus you can find and | ||
| 1848 | examine the definition of something with @kbd{M-.} and then return to | ||
| 1849 | where you were with @kbd{M-,}. @kbd{M-,} allows you to retrace your | ||
| 1850 | steps to a depth determined by the variable | ||
| 1851 | @code{xref-marker-ring-length}, which defaults to 16. | ||
| 1852 | |||
| 1853 | @node Xref Commands | ||
| 1854 | @subsubsection Commands Available in the @file{*xref*} Buffer | ||
| 1855 | @cindex commands in @file{*xref*} buffers | ||
| 1856 | @cindex XREF mode | ||
| 1857 | |||
| 1858 | The following commands are provided in the @file{*xref*} buffer by | ||
| 1859 | the special XREF mode: | ||
| 1860 | |||
| 1861 | @table @kbd | ||
| 1862 | @item @key{RET} | ||
| 1863 | @itemx Mouse-2 | ||
| 1864 | Display the reference on the current line and bury the @file{*xref*} | ||
| 1865 | buffer. | ||
| 1866 | @item n | ||
| 1867 | @itemx . | ||
| 1868 | @findex xref-next-line | ||
| 1869 | Move to the next reference and display it in the other window | ||
| 1870 | (@code{xref-next-line}). | ||
| 1871 | @item p | ||
| 1872 | @itemx , | ||
| 1873 | @findex xref-prev-line | ||
| 1874 | Move to the previous reference and display it in the other window | ||
| 1875 | (@code{xref-prev-line}). | ||
| 1876 | @item C-o | ||
| 1877 | @findex xref-show-location-at-point | ||
| 1878 | Display the reference on the current line in the other window | ||
| 1879 | (@code{xref-show-location-at-point}). | ||
| 1880 | @findex xref-query-replace | ||
| 1881 | @item r @var{pattern} @key{RET} @var{replacement} @key{RET} | ||
| 1882 | Perform interactive query-replace on references that match | ||
| 1883 | @var{pattern} (@code{xref-query-replace}), replacing the match with | ||
| 1884 | @var{replacement}. @xref{Identifier Search}. | ||
| 1885 | @findex xref-quit | ||
| 1886 | @item q | ||
| 1887 | Quit the window showing the @file{*xref*} buffer (@code{xref-quit}). | ||
| 1888 | @end table | ||
| 1889 | |||
| 1890 | In addition, the usual navigation commands, such as the arrow keys, | ||
| 1891 | @kbd{C-n}, and @kbd{C-p} are available for moving around the buffer | ||
| 1892 | without displaying the references. | ||
| 1893 | |||
| 1894 | @node Identifier Search | ||
| 1895 | @subsubsection Searching and Replacing with Identifiers | ||
| 1896 | @cindex search and replace in multiple files | ||
| 1897 | @cindex multiple-file search and replace | ||
| 1898 | |||
| 1899 | The commands in this section visit and search all the files listed | ||
| 1900 | in the @code{xref} backend's database, one by one. For these | ||
| 1901 | commands, the database serves only to specify a sequence of files to | ||
| 1902 | search. These commands scan all the databases starting with the first | ||
| 1903 | one (if any) that describes the current file, proceed from there to | ||
| 1904 | the end of the list, and then scan from the beginning of the list | ||
| 1905 | until they have covered all the databases in the list. | ||
| 1906 | |||
| 1907 | @table @kbd | ||
| 1908 | @item M-? | ||
| 1909 | Find all the references for the identifier at point. | ||
| 1910 | @item M-x xref-query-replace @key{RET} @var{regexp} @key{RET} @var{replacement} @key{RET} | ||
| 1911 | Interactively replace @var{regexp} with @var{replacement} in the names | ||
| 1912 | of all the identifiers shown in the @file{*xref*} buffer. | ||
| 1913 | @item M-x tags-search @key{RET} @var{regexp} @key{RET} | ||
| 1914 | Search for @var{regexp} through the files in the selected tags | ||
| 1915 | table. | ||
| 1916 | @item M-x tags-query-replace @key{RET} @var{regexp} @key{RET} @var{replacement} @key{RET} | ||
| 1917 | Perform a @code{query-replace-regexp} on each file in the selected tags table. | ||
| 1918 | @item M-x tags-loop-continue | ||
| 1919 | Restart one of the last 2 commands above, from the current location of point. | ||
| 1920 | @end table | ||
| 1921 | |||
| 1922 | @kindex M-? | ||
| 1923 | @findex xref-find-references | ||
| 1924 | @kbd{M-?} finds all the references for the identifier at point. If | ||
| 1925 | there's no valid identifier at point, or when invoked with a prefix | ||
| 1926 | argument, the command prompts for the identifier, with completion. It | ||
| 1927 | then presents a @file{*xref*} buffer with all the references to the | ||
| 1928 | identifier, showing the file name and the line where the identifier is | ||
| 1929 | referenced. The XREF mode commands are available in this buffer, see | ||
| 1930 | @ref{Xref Commands}. | ||
| 1931 | |||
| 1932 | @findex xref-query-replace | ||
| 1933 | @kbd{M-x xref-query-replace} reads a regexp to match identifier | ||
| 1934 | names and a string to replace with, just like ordinary @kbd{M-x | ||
| 1935 | query-replace-regexp}. It then performs the specified replacement in | ||
| 1936 | the names of the matching identifiers in all the places in all the | ||
| 1937 | files where these identifiers are referenced. This is useful when you | ||
| 1938 | rename your identifiers as part of refactoring. This command should | ||
| 1939 | be invoked in the @file{*xref*} buffer generated by @code{M-?}. | ||
| 1940 | |||
| 1941 | @findex tags-search | ||
| 1942 | @kbd{M-x tags-search} reads a regexp using the minibuffer, then | ||
| 1943 | searches for matches in all the files in the selected tags table, one | ||
| 1944 | file at a time. It displays the name of the file being searched so | ||
| 1945 | you can follow its progress. As soon as it finds an occurrence, | ||
| 1946 | @code{tags-search} returns. This command works only with the etags | ||
| 1947 | backend, and requires tags tables to be available (@pxref{Tags | ||
| 1948 | Tables}). | ||
| 1949 | |||
| 1950 | @findex tags-loop-continue | ||
| 1951 | Having found one match, you probably want to find all the rest. | ||
| 1952 | Type @kbd{M-x tags-loop-continue}) to resume the @code{tags-search}, | ||
| 1953 | finding one more match. This searches the rest of the current buffer, | ||
| 1954 | followed by the remaining files of the tags table. | ||
| 1955 | |||
| 1956 | @findex tags-query-replace | ||
| 1957 | @kbd{M-x tags-query-replace} performs a single | ||
| 1958 | @code{query-replace-regexp} through all the files in the tags table. It | ||
| 1959 | reads a regexp to search for and a string to replace with, just like | ||
| 1960 | ordinary @kbd{M-x query-replace-regexp}. It searches much like @kbd{M-x | ||
| 1961 | tags-search}, but repeatedly, processing matches according to your | ||
| 1962 | input. @xref{Query Replace}, for more information on query replace. | ||
| 1963 | This command works only with the etags backend. | ||
| 1964 | |||
| 1965 | @vindex tags-case-fold-search | ||
| 1966 | @cindex case-sensitivity and tags search | ||
| 1967 | You can control the case-sensitivity of tags search commands by | ||
| 1968 | customizing the value of the variable @code{tags-case-fold-search}. The | ||
| 1969 | default is to use the same setting as the value of | ||
| 1970 | @code{case-fold-search} (@pxref{Lax Search}). | ||
| 1971 | |||
| 1972 | It is possible to get through all the files in the tags table with a | ||
| 1973 | single invocation of @kbd{M-x tags-query-replace}. But often it is | ||
| 1974 | useful to exit temporarily, which you can do with any input event that | ||
| 1975 | has no special query replace meaning. You can resume the query | ||
| 1976 | replace subsequently by typing @kbd{M-x tags-loop-continue}; this | ||
| 1977 | command resumes the last tags search or replace command that you did. | ||
| 1978 | For instance, to skip the rest of the current file, you can type | ||
| 1979 | @kbd{M-> M-x tags-loop-continue}. | ||
| 1980 | |||
| 1981 | The commands in this section carry out much broader searches than | ||
| 1982 | the @code{xref-find-definitions} family. The | ||
| 1983 | @code{xref-find-definitions} commands search only for definitions of | ||
| 1984 | identifiers that match your string or regexp. The commands | ||
| 1985 | @code{tags-search} and @code{tags-query-replace} find every occurrence | ||
| 1986 | of the regexp, as ordinary search commands and replace commands do in | ||
| 1987 | the current buffer. | ||
| 1988 | |||
| 1989 | As an alternative to @code{tags-search}, you can run @command{grep} | ||
| 1990 | as a subprocess and have Emacs show you the matching lines one by one. | ||
| 1991 | @xref{Grep Searching}. | ||
| 1992 | |||
| 1993 | @node List Identifiers | ||
| 1994 | @subsubsection Identifier Inquiries | ||
| 1995 | |||
| 1996 | @table @kbd | ||
| 1997 | @item C-M-i | ||
| 1998 | @itemx M-@key{TAB} | ||
| 1999 | Perform completion on the text around point, using the @code{xref} | ||
| 2000 | backend if one is available (@code{completion-at-point}). | ||
| 2001 | @item M-x list-tags @key{RET} @var{file} @key{RET} | ||
| 2002 | Display a list of the tags defined in the program file @var{file}. | ||
| 2003 | @item M-x xref-find-apropos @key{RET} @var{regexp} @key{RET} | ||
| 2004 | Display a list of all known identifiers matching @var{regexp}. | ||
| 2005 | @end table | ||
| 2006 | |||
| 2007 | @cindex completion (symbol names) | ||
| 2008 | In most programming language modes, you can type @kbd{C-M-i} or | ||
| 2009 | @kbd{M-@key{TAB}} (@code{completion-at-point}) to complete the symbol | ||
| 2010 | at point. If there is an @code{xref} backend available, this command | ||
| 2011 | can use it to generate completion candidates more intelligently. | ||
| 2012 | @xref{Symbol Completion}. | ||
| 2013 | |||
| 2014 | @findex list-tags | ||
| 2015 | @kbd{M-x list-tags} reads the name of one of the files covered by | ||
| 2016 | the selected tags table, and displays a list of tags defined in that | ||
| 2017 | file. Do not include a directory as part of the file name unless the | ||
| 2018 | file name recorded in the tags table includes a directory. This | ||
| 2019 | command works only with the etags backend, and requires a tags table | ||
| 2020 | for the project to be available. @xref{Tags Tables}. | ||
| 2021 | |||
| 2022 | @c Sadly, the new-and-improved Xref feature doesn't provide anything | ||
| 2023 | @c close to the described below features of the now-obsoleted | ||
| 2024 | @c tags-apropos. I'm leaving this here to encourage enhancements to | ||
| 2025 | @c xref.el. | ||
| 2026 | @ignore | ||
| 2027 | @findex tags-apropos | ||
| 2028 | @vindex tags-apropos-verbose | ||
| 2029 | @vindex tags-tag-face | ||
| 2030 | @vindex tags-apropos-additional-actions | ||
| 2031 | @kbd{M-x tags-apropos} is like @code{apropos} for tags | ||
| 2032 | (@pxref{Apropos}). It displays a list of tags in the selected tags | ||
| 2033 | table whose entries match @var{regexp}. If the variable | ||
| 2034 | @code{tags-apropos-verbose} is non-@code{nil}, it displays the names | ||
| 2035 | of the tags files together with the tag names. You can customize the | ||
| 2036 | appearance of the output by setting the variable @code{tags-tag-face} | ||
| 2037 | to a face. You can display additional output by customizing the | ||
| 2038 | variable @code{tags-apropos-additional-actions}; see its documentation | ||
| 2039 | for details. | ||
| 2040 | @end ignore | ||
| 2041 | |||
| 2042 | @findex next-file | ||
| 2043 | @kbd{M-x next-file} visits files covered by the selected tags table. | ||
| 2044 | The first time it is called, it visits the first file covered by the | ||
| 2045 | table. Each subsequent call visits the next covered file, unless a | ||
| 2046 | prefix argument is supplied, in which case it returns to the first | ||
| 2047 | file. This command works only with the etags backend. | ||
| 2048 | |||
| 2049 | @node Tags Tables | ||
| 2050 | @subsection Tags Tables | ||
| 2051 | @cindex tags and tag tables | ||
| 1673 | 2052 | ||
| 1674 | A @dfn{tags table} records the tags extracted by scanning the source | 2053 | A @dfn{tags table} records the tags extracted by scanning the source |
| 1675 | code of a certain program or a certain document. Tags extracted from | 2054 | code of a certain program or a certain document. Tags extracted from |
| @@ -1685,12 +2064,14 @@ source files. | |||
| 1685 | on a document or the source code file. The @samp{etags} program | 2064 | on a document or the source code file. The @samp{etags} program |
| 1686 | writes the tags to a @dfn{tags table file}, or @dfn{tags file} in | 2065 | writes the tags to a @dfn{tags table file}, or @dfn{tags file} in |
| 1687 | short. The conventional name for a tags file is @file{TAGS}@. | 2066 | short. The conventional name for a tags file is @file{TAGS}@. |
| 1688 | @xref{Create Tags Table}. | 2067 | @xref{Create Tags Table}. (It is also possible to create a tags table |
| 2068 | by using one of the commands from other packages that can produce such | ||
| 2069 | tables in the same format.) | ||
| 1689 | 2070 | ||
| 1690 | Emacs provides many commands for searching and replacing using the | 2071 | Emacs uses the tags tables via the @code{etags} package as one of |
| 1691 | information recorded in tags tables. For instance, the @kbd{M-.} | 2072 | the supported backends for @code{xref}. Because tags tables are |
| 1692 | (@code{find-tag}) jumps to the location of a specified function | 2073 | produced by the @command{etags} command that is part of an Emacs |
| 1693 | definition in its source file. @xref{Find Tag}. | 2074 | distribution, we describe tags tables in more detail here. |
| 1694 | 2075 | ||
| 1695 | @cindex C++ class browser, tags | 2076 | @cindex C++ class browser, tags |
| 1696 | @cindex tags, C++ | 2077 | @cindex tags, C++ |
| @@ -1706,14 +2087,10 @@ use tags, separate from the @command{etags} facility. | |||
| 1706 | * Tag Syntax:: Tag syntax for various types of code and text files. | 2087 | * Tag Syntax:: Tag syntax for various types of code and text files. |
| 1707 | * Create Tags Table:: Creating a tags table with @command{etags}. | 2088 | * Create Tags Table:: Creating a tags table with @command{etags}. |
| 1708 | * Etags Regexps:: Create arbitrary tags using regular expressions. | 2089 | * Etags Regexps:: Create arbitrary tags using regular expressions. |
| 1709 | * Select Tags Table:: How to visit a tags table. | ||
| 1710 | * Find Tag:: Commands to find the definition of a specific tag. | ||
| 1711 | * Tags Search:: Using a tags table for searching and replacing. | ||
| 1712 | * List Tags:: Using tags for completion, and listing them. | ||
| 1713 | @end menu | 2090 | @end menu |
| 1714 | 2091 | ||
| 1715 | @node Tag Syntax | 2092 | @node Tag Syntax |
| 1716 | @subsection Source File Tag Syntax | 2093 | @subsubsection Source File Tag Syntax |
| 1717 | 2094 | ||
| 1718 | Here is how tag syntax is defined for the most popular languages: | 2095 | Here is how tag syntax is defined for the most popular languages: |
| 1719 | 2096 | ||
| @@ -1883,13 +2260,17 @@ line. | |||
| 1883 | @item | 2260 | @item |
| 1884 | In Python code, @code{def} or @code{class} at the beginning of a line | 2261 | In Python code, @code{def} or @code{class} at the beginning of a line |
| 1885 | generate a tag. | 2262 | generate a tag. |
| 2263 | |||
| 2264 | @item | ||
| 2265 | In Ruby code, @code{def} or @code{class} or @code{module} at the | ||
| 2266 | beginning of a line generate a tag. | ||
| 1886 | @end itemize | 2267 | @end itemize |
| 1887 | 2268 | ||
| 1888 | You can also generate tags based on regexp matching (@pxref{Etags | 2269 | You can also generate tags based on regexp matching (@pxref{Etags |
| 1889 | Regexps}) to handle other formats and languages. | 2270 | Regexps}) to handle other formats and languages. |
| 1890 | 2271 | ||
| 1891 | @node Create Tags Table | 2272 | @node Create Tags Table |
| 1892 | @subsection Creating Tags Tables | 2273 | @subsubsection Creating Tags Tables |
| 1893 | @cindex @command{etags} program | 2274 | @cindex @command{etags} program |
| 1894 | 2275 | ||
| 1895 | The @command{etags} program is used to create a tags table file. It knows | 2276 | The @command{etags} program is used to create a tags table file. It knows |
| @@ -1946,7 +2327,7 @@ source files, and the tags file will still refer correctly to the source | |||
| 1946 | files. If the tags file is @file{-} or is in the @file{/dev} directory, | 2327 | files. If the tags file is @file{-} or is in the @file{/dev} directory, |
| 1947 | however, the file names are | 2328 | however, the file names are |
| 1948 | made relative to the current working directory. This is useful, for | 2329 | made relative to the current working directory. This is useful, for |
| 1949 | example, when writing the tags to @file{/dev/stdout}. | 2330 | example, when writing the tags to the standard output. |
| 1950 | 2331 | ||
| 1951 | When using a relative file name, it should not be a symbolic link | 2332 | When using a relative file name, it should not be a symbolic link |
| 1952 | pointing to a tags file in a different directory, because this would | 2333 | pointing to a tags file in a different directory, because this would |
| @@ -1992,7 +2373,7 @@ options, it outputs detailed information about how tags are generated for | |||
| 1992 | @var{lang}. | 2373 | @var{lang}. |
| 1993 | 2374 | ||
| 1994 | @node Etags Regexps | 2375 | @node Etags Regexps |
| 1995 | @subsection Etags Regexps | 2376 | @subsubsection Etags Regexps |
| 1996 | 2377 | ||
| 1997 | The @samp{--regex} option to @command{etags} allows tags to be | 2378 | The @samp{--regex} option to @command{etags} allows tags to be |
| 1998 | recognized by regular expression matching. You can intermix this | 2379 | recognized by regular expression matching. You can intermix this |
| @@ -2151,7 +2532,7 @@ etags --language=none \ | |||
| 2151 | @subsection Selecting a Tags Table | 2532 | @subsection Selecting a Tags Table |
| 2152 | 2533 | ||
| 2153 | @findex visit-tags-table | 2534 | @findex visit-tags-table |
| 2154 | Emacs has at any time one @dfn{selected} tags table. All the | 2535 | Emacs has at any time at most one @dfn{selected} tags table. All the |
| 2155 | commands for working with tags tables use the selected one. To select | 2536 | commands for working with tags tables use the selected one. To select |
| 2156 | a tags table, type @kbd{M-x visit-tags-table}, which reads the tags | 2537 | a tags table, type @kbd{M-x visit-tags-table}, which reads the tags |
| 2157 | table file name as an argument, with @file{TAGS} in the default | 2538 | table file name as an argument, with @file{TAGS} in the default |
| @@ -2192,212 +2573,6 @@ table mentions that file, as explained above. | |||
| 2192 | 2573 | ||
| 2193 | Do not set both @code{tags-file-name} and @code{tags-table-list}. | 2574 | Do not set both @code{tags-file-name} and @code{tags-table-list}. |
| 2194 | 2575 | ||
| 2195 | @node Find Tag | ||
| 2196 | @subsection Finding a Tag | ||
| 2197 | |||
| 2198 | The most important thing that a tags table enables you to do is to find | ||
| 2199 | the definition of a specific tag. | ||
| 2200 | |||
| 2201 | @table @kbd | ||
| 2202 | @item M-.@: @var{tag} @key{RET} | ||
| 2203 | Find first definition of @var{tag} (@code{find-tag}). | ||
| 2204 | @item C-u M-. | ||
| 2205 | Find next alternate definition of last tag specified. | ||
| 2206 | @item C-u - M-. | ||
| 2207 | Go back to previous tag found. | ||
| 2208 | @item C-M-. @var{pattern} @key{RET} | ||
| 2209 | Find a tag whose name matches @var{pattern} (@code{find-tag-regexp}). | ||
| 2210 | @item C-u C-M-. | ||
| 2211 | Find the next tag whose name matches the last pattern used. | ||
| 2212 | @item C-x 4 .@: @var{tag} @key{RET} | ||
| 2213 | Find first definition of @var{tag}, but display it in another window | ||
| 2214 | (@code{find-tag-other-window}). | ||
| 2215 | @item C-x 5 .@: @var{tag} @key{RET} | ||
| 2216 | Find first definition of @var{tag}, and create a new frame to select the | ||
| 2217 | buffer (@code{find-tag-other-frame}). | ||
| 2218 | @item M-* | ||
| 2219 | Pop back to where you previously invoked @kbd{M-.} and friends. | ||
| 2220 | @end table | ||
| 2221 | |||
| 2222 | @kindex M-. | ||
| 2223 | @findex find-tag | ||
| 2224 | @kbd{M-.}@: (@code{find-tag}) prompts for a tag name and jumps to | ||
| 2225 | its source definition. It works by searching through the tags table | ||
| 2226 | for that tag's file and approximate character position, visiting that | ||
| 2227 | file, and searching for the tag definition at ever-increasing | ||
| 2228 | distances away from the recorded approximate position. | ||
| 2229 | |||
| 2230 | When entering the tag argument to @kbd{M-.}, the usual minibuffer | ||
| 2231 | completion commands can be used (@pxref{Completion}), with the tag | ||
| 2232 | names in the selected tags table as completion candidates. If you | ||
| 2233 | specify an empty argument, the balanced expression in the buffer | ||
| 2234 | before or around point is the default argument. @xref{Expressions}. | ||
| 2235 | |||
| 2236 | You don't need to give @kbd{M-.} the full name of the tag; a part | ||
| 2237 | will do. @kbd{M-.} finds tags which contain that argument as a | ||
| 2238 | substring. However, it prefers an exact match to a substring match. | ||
| 2239 | To find other tags that match the same substring, give @code{find-tag} | ||
| 2240 | a numeric argument, as in @kbd{C-u M-.} or @kbd{M-0 M-.}; this does | ||
| 2241 | not read a tag name, but continues searching the tags table's text for | ||
| 2242 | another tag containing the same substring last used. | ||
| 2243 | |||
| 2244 | @kindex C-x 4 . | ||
| 2245 | @findex find-tag-other-window | ||
| 2246 | @kindex C-x 5 . | ||
| 2247 | @findex find-tag-other-frame | ||
| 2248 | Like most commands that can switch buffers, @code{find-tag} has a | ||
| 2249 | variant that displays the new buffer in another window, and one that | ||
| 2250 | makes a new frame for it. The former is @w{@kbd{C-x 4 .}} | ||
| 2251 | (@code{find-tag-other-window}), and the latter is @w{@kbd{C-x 5 .}} | ||
| 2252 | (@code{find-tag-other-frame}). | ||
| 2253 | |||
| 2254 | To move back to previous tag definitions, use @kbd{C-u - M-.}; more | ||
| 2255 | generally, @kbd{M-.} with a negative numeric argument. Similarly, | ||
| 2256 | @w{@kbd{C-x 4 .}} with a negative argument finds the previous tag | ||
| 2257 | location in another window. | ||
| 2258 | |||
| 2259 | @kindex M-* | ||
| 2260 | @findex pop-tag-mark | ||
| 2261 | @vindex find-tag-marker-ring-length | ||
| 2262 | As well as going back to places you've found tags recently, you can | ||
| 2263 | go back to places @emph{from where} you found them, using @kbd{M-*} | ||
| 2264 | (@code{pop-tag-mark}). Thus you can find and examine the definition | ||
| 2265 | of something with @kbd{M-.} and then return to where you were with | ||
| 2266 | @kbd{M-*}. | ||
| 2267 | |||
| 2268 | Both @kbd{C-u - M-.} and @kbd{M-*} allow you to retrace your steps to | ||
| 2269 | a depth determined by the variable @code{find-tag-marker-ring-length}. | ||
| 2270 | |||
| 2271 | @findex find-tag-regexp | ||
| 2272 | @kindex C-M-. | ||
| 2273 | The command @kbd{C-M-.} (@code{find-tag-regexp}) visits the tags that | ||
| 2274 | match a specified regular expression. It is just like @kbd{M-.} except | ||
| 2275 | that it does regexp matching instead of substring matching. | ||
| 2276 | |||
| 2277 | @node Tags Search | ||
| 2278 | @subsection Searching and Replacing with Tags Tables | ||
| 2279 | @cindex search and replace in multiple files | ||
| 2280 | @cindex multiple-file search and replace | ||
| 2281 | |||
| 2282 | The commands in this section visit and search all the files listed | ||
| 2283 | in the selected tags table, one by one. For these commands, the tags | ||
| 2284 | table serves only to specify a sequence of files to search. These | ||
| 2285 | commands scan the list of tags tables starting with the first tags | ||
| 2286 | table (if any) that describes the current file, proceed from there to | ||
| 2287 | the end of the list, and then scan from the beginning of the list | ||
| 2288 | until they have covered all the tables in the list. | ||
| 2289 | |||
| 2290 | @table @kbd | ||
| 2291 | @item M-x tags-search @key{RET} @var{regexp} @key{RET} | ||
| 2292 | Search for @var{regexp} through the files in the selected tags | ||
| 2293 | table. | ||
| 2294 | @item M-x tags-query-replace @key{RET} @var{regexp} @key{RET} @var{replacement} @key{RET} | ||
| 2295 | Perform a @code{query-replace-regexp} on each file in the selected tags table. | ||
| 2296 | @item M-, | ||
| 2297 | Restart one of the commands above, from the current location of point | ||
| 2298 | (@code{tags-loop-continue}). | ||
| 2299 | @end table | ||
| 2300 | |||
| 2301 | @findex tags-search | ||
| 2302 | @kbd{M-x tags-search} reads a regexp using the minibuffer, then | ||
| 2303 | searches for matches in all the files in the selected tags table, one | ||
| 2304 | file at a time. It displays the name of the file being searched so you | ||
| 2305 | can follow its progress. As soon as it finds an occurrence, | ||
| 2306 | @code{tags-search} returns. | ||
| 2307 | |||
| 2308 | @kindex M-, | ||
| 2309 | @findex tags-loop-continue | ||
| 2310 | Having found one match, you probably want to find all the rest. | ||
| 2311 | Type @kbd{M-,} (@code{tags-loop-continue}) to resume the | ||
| 2312 | @code{tags-search}, finding one more match. This searches the rest of | ||
| 2313 | the current buffer, followed by the remaining files of the tags table. | ||
| 2314 | |||
| 2315 | @findex tags-query-replace | ||
| 2316 | @kbd{M-x tags-query-replace} performs a single | ||
| 2317 | @code{query-replace-regexp} through all the files in the tags table. It | ||
| 2318 | reads a regexp to search for and a string to replace with, just like | ||
| 2319 | ordinary @kbd{M-x query-replace-regexp}. It searches much like @kbd{M-x | ||
| 2320 | tags-search}, but repeatedly, processing matches according to your | ||
| 2321 | input. @xref{Query Replace}, for more information on query replace. | ||
| 2322 | |||
| 2323 | @vindex tags-case-fold-search | ||
| 2324 | @cindex case-sensitivity and tags search | ||
| 2325 | You can control the case-sensitivity of tags search commands by | ||
| 2326 | customizing the value of the variable @code{tags-case-fold-search}. The | ||
| 2327 | default is to use the same setting as the value of | ||
| 2328 | @code{case-fold-search} (@pxref{Lax Search}). | ||
| 2329 | |||
| 2330 | It is possible to get through all the files in the tags table with a | ||
| 2331 | single invocation of @kbd{M-x tags-query-replace}. But often it is | ||
| 2332 | useful to exit temporarily, which you can do with any input event that | ||
| 2333 | has no special query replace meaning. You can resume the query | ||
| 2334 | replace subsequently by typing @kbd{M-,}; this command resumes the | ||
| 2335 | last tags search or replace command that you did. For instance, to | ||
| 2336 | skip the rest of the current file, you can type @kbd{M-> M-,}. | ||
| 2337 | |||
| 2338 | The commands in this section carry out much broader searches than the | ||
| 2339 | @code{find-tag} family. The @code{find-tag} commands search only for | ||
| 2340 | definitions of tags that match your substring or regexp. The commands | ||
| 2341 | @code{tags-search} and @code{tags-query-replace} find every occurrence | ||
| 2342 | of the regexp, as ordinary search commands and replace commands do in | ||
| 2343 | the current buffer. | ||
| 2344 | |||
| 2345 | These commands create buffers only temporarily for the files that they | ||
| 2346 | have to search (those which are not already visited in Emacs buffers). | ||
| 2347 | Buffers in which no match is found are quickly killed; the others | ||
| 2348 | continue to exist. | ||
| 2349 | |||
| 2350 | As an alternative to @code{tags-search}, you can run @command{grep} | ||
| 2351 | as a subprocess and have Emacs show you the matching lines one by one. | ||
| 2352 | @xref{Grep Searching}. | ||
| 2353 | |||
| 2354 | @node List Tags | ||
| 2355 | @subsection Tags Table Inquiries | ||
| 2356 | |||
| 2357 | @table @kbd | ||
| 2358 | @item C-M-i | ||
| 2359 | @itemx M-@key{TAB} | ||
| 2360 | Perform completion on the text around point, using the selected tags | ||
| 2361 | table if one is loaded (@code{completion-at-point}). | ||
| 2362 | @item M-x list-tags @key{RET} @var{file} @key{RET} | ||
| 2363 | Display a list of the tags defined in the program file @var{file}. | ||
| 2364 | @item M-x tags-apropos @key{RET} @var{regexp} @key{RET} | ||
| 2365 | Display a list of all tags matching @var{regexp}. | ||
| 2366 | @end table | ||
| 2367 | |||
| 2368 | @cindex completion (symbol names) | ||
| 2369 | In most programming language modes, you can type @kbd{C-M-i} or | ||
| 2370 | @kbd{M-@key{TAB}} (@code{completion-at-point}) to complete the symbol | ||
| 2371 | at point. If there is a selected tags table, this command can use it | ||
| 2372 | to generate completion candidates. @xref{Symbol Completion}. | ||
| 2373 | |||
| 2374 | @findex list-tags | ||
| 2375 | @kbd{M-x list-tags} reads the name of one of the files covered by | ||
| 2376 | the selected tags table, and displays a list of tags defined in that | ||
| 2377 | file. Do not include a directory as part of the file name unless the | ||
| 2378 | file name recorded in the tags table includes a directory. | ||
| 2379 | |||
| 2380 | @findex tags-apropos | ||
| 2381 | @vindex tags-apropos-verbose | ||
| 2382 | @vindex tags-tag-face | ||
| 2383 | @vindex tags-apropos-additional-actions | ||
| 2384 | @kbd{M-x tags-apropos} is like @code{apropos} for tags | ||
| 2385 | (@pxref{Apropos}). It displays a list of tags in the selected tags | ||
| 2386 | table whose entries match @var{regexp}. If the variable | ||
| 2387 | @code{tags-apropos-verbose} is non-@code{nil}, it displays the names | ||
| 2388 | of the tags files together with the tag names. You can customize the | ||
| 2389 | appearance of the output by setting the variable @code{tags-tag-face} | ||
| 2390 | to a face. You can display additional output by customizing the | ||
| 2391 | variable @code{tags-apropos-additional-actions}; see its documentation | ||
| 2392 | for details. | ||
| 2393 | |||
| 2394 | @findex next-file | ||
| 2395 | @kbd{M-x next-file} visits files covered by the selected tags table. | ||
| 2396 | The first time it is called, it visits the first file covered by the | ||
| 2397 | table. Each subsequent call visits the next covered file, unless a | ||
| 2398 | prefix argument is supplied, in which case it returns to the first | ||
| 2399 | file. | ||
| 2400 | |||
| 2401 | @node EDE | 2576 | @node EDE |
| 2402 | @section Emacs Development Environment | 2577 | @section Emacs Development Environment |
| 2403 | @cindex EDE (Emacs Development Environment) | 2578 | @cindex EDE (Emacs Development Environment) |
diff --git a/doc/emacs/mark.texi b/doc/emacs/mark.texi index 28b4e3ddaea..98980d5fb3f 100644 --- a/doc/emacs/mark.texi +++ b/doc/emacs/mark.texi | |||
| @@ -288,7 +288,9 @@ instead signal an error if the mark is inactive. | |||
| 288 | active---for example, typing @kbd{a} inserts the character @samp{a}, | 288 | active---for example, typing @kbd{a} inserts the character @samp{a}, |
| 289 | then deactivates the mark. If you enable Delete Selection mode, a | 289 | then deactivates the mark. If you enable Delete Selection mode, a |
| 290 | minor mode, then inserting text while the mark is active causes the | 290 | minor mode, then inserting text while the mark is active causes the |
| 291 | text in the region to be deleted first. To toggle Delete Selection | 291 | text in the region to be deleted first. Also, commands that normally |
| 292 | delete just one character, such as @kbd{C-d} or @kbd{@key{DEL}}, will | ||
| 293 | delete the entire region instead. To toggle Delete Selection | ||
| 292 | mode on or off, type @kbd{M-x delete-selection-mode}. | 294 | mode on or off, type @kbd{M-x delete-selection-mode}. |
| 293 | 295 | ||
| 294 | @node Mark Ring | 296 | @node Mark Ring |
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 97c74a9ce81..e4bd85c0ddd 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -271,7 +271,7 @@ bindings for that purpose. | |||
| 271 | The Imenu facility offers a way to find the major definitions in | 271 | The Imenu facility offers a way to find the major definitions in |
| 272 | a file by name. It is also useful in text formatter major modes, | 272 | a file by name. It is also useful in text formatter major modes, |
| 273 | where it treats each chapter, section, etc., as a definition. | 273 | where it treats each chapter, section, etc., as a definition. |
| 274 | (@xref{Tags}, for a more powerful feature that handles multiple files | 274 | (@xref{Xref}, for a more powerful feature that handles multiple files |
| 275 | together.) | 275 | together.) |
| 276 | 276 | ||
| 277 | @findex imenu | 277 | @findex imenu |
| @@ -1358,7 +1358,7 @@ the @kbd{M-@key{TAB}} key is usually reserved by the window manager | |||
| 1358 | for switching graphical windows, so you should type @kbd{C-M-i} or | 1358 | for switching graphical windows, so you should type @kbd{C-M-i} or |
| 1359 | @kbd{@key{ESC} @key{TAB}} instead. | 1359 | @kbd{@key{ESC} @key{TAB}} instead. |
| 1360 | 1360 | ||
| 1361 | @cindex tags-based completion | 1361 | @cindex xref-based completion |
| 1362 | @findex completion-at-point | 1362 | @findex completion-at-point |
| 1363 | @cindex Lisp symbol completion | 1363 | @cindex Lisp symbol completion |
| 1364 | @cindex completion (Lisp symbols) | 1364 | @cindex completion (Lisp symbols) |
| @@ -1368,7 +1368,7 @@ which generates its completion list in a flexible way. If Semantic | |||
| 1368 | mode is enabled, it tries to use the Semantic parser data for | 1368 | mode is enabled, it tries to use the Semantic parser data for |
| 1369 | completion (@pxref{Semantic}). If Semantic mode is not enabled or | 1369 | completion (@pxref{Semantic}). If Semantic mode is not enabled or |
| 1370 | fails at performing completion, it tries to complete using the | 1370 | fails at performing completion, it tries to complete using the |
| 1371 | selected tags table (@pxref{Tags}). If in Emacs Lisp mode, it | 1371 | available @code{xref} backend (@pxref{Xref}). If in Emacs Lisp mode, it |
| 1372 | performs completion using the function, variable, or property names | 1372 | performs completion using the function, variable, or property names |
| 1373 | defined in the current Emacs session. | 1373 | defined in the current Emacs session. |
| 1374 | 1374 | ||
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index cc516ec2d45..bef74e3b2c5 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi | |||
| @@ -12,10 +12,10 @@ a string. Emacs also has commands to replace occurrences of a string | |||
| 12 | with a different string. There are also commands that do the same | 12 | with a different string. There are also commands that do the same |
| 13 | thing, but search for patterns instead of fixed strings. | 13 | thing, but search for patterns instead of fixed strings. |
| 14 | 14 | ||
| 15 | You can also search multiple files under the control of a tags table | 15 | You can also search multiple files under the control of an |
| 16 | (@pxref{Tags Search}) or through the Dired @kbd{A} command | 16 | @code{xref} backend (@pxref{Identifier Search}) or through the Dired |
| 17 | (@pxref{Operating on Files}), or ask the @code{grep} program to do it | 17 | @kbd{A} command (@pxref{Operating on Files}), or ask the @code{grep} |
| 18 | (@pxref{Grep Searching}). | 18 | program to do it (@pxref{Grep Searching}). |
| 19 | 19 | ||
| 20 | @menu | 20 | @menu |
| 21 | * Incremental Search:: Search happens as you type the string. | 21 | * Incremental Search:: Search happens as you type the string. |
diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index cd7d08dede6..f99234b5c1b 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi | |||
| @@ -231,8 +231,9 @@ Mail}), but in another window (@code{compose-mail-other-window}). | |||
| 231 | 231 | ||
| 232 | @findex find-tag-other-window | 232 | @findex find-tag-other-window |
| 233 | @item C-x 4 . | 233 | @item C-x 4 . |
| 234 | Find a tag in the current tags table, similar to @kbd{M-.} | 234 | Find the definition of an identifier, similar to @kbd{M-.} |
| 235 | (@pxref{Tags}), but in another window (@code{find-tag-other-window}). | 235 | (@pxref{Xref}), but in another window |
| 236 | (@code{xref-find-definitions-other-window}). | ||
| 236 | @item C-x 4 r @var{filename} @key{RET} | 237 | @item C-x 4 r @var{filename} @key{RET} |
| 237 | Visit file @var{filename} read-only, and select its buffer in another | 238 | Visit file @var{filename} read-only, and select its buffer in another |
| 238 | window (@code{find-file-read-only-other-window}). @xref{Visiting}. | 239 | window (@code{find-file-read-only-other-window}). @xref{Visiting}. |
diff --git a/doc/lispref/eval.texi b/doc/lispref/eval.texi index 28bf6005769..d2a8ff56b6b 100644 --- a/doc/lispref/eval.texi +++ b/doc/lispref/eval.texi | |||
| @@ -328,13 +328,12 @@ This function returns the meaning of @var{function} as a function. If | |||
| 328 | definition and starts over with that value. If @var{function} is not a | 328 | definition and starts over with that value. If @var{function} is not a |
| 329 | symbol, then it returns @var{function} itself. | 329 | symbol, then it returns @var{function} itself. |
| 330 | 330 | ||
| 331 | This function signals a @code{void-function} error if the final symbol | 331 | This function returns @code{nil} if the final symbol is unbound. It |
| 332 | is unbound and optional argument @var{noerror} is @code{nil} or | 332 | signals a @code{cyclic-function-indirection} error if there is a loop |
| 333 | omitted. Otherwise, if @var{noerror} is non-@code{nil}, it returns | 333 | in the chain of symbols. |
| 334 | @code{nil} if the final symbol is unbound. | ||
| 335 | 334 | ||
| 336 | It signals a @code{cyclic-function-indirection} error if there is a | 335 | The optional argument @var{noerror} is obsolete, kept for backward |
| 337 | loop in the chain of symbols. | 336 | compatibility, and has no effect. |
| 338 | 337 | ||
| 339 | Here is how you could define @code{indirect-function} in Lisp: | 338 | Here is how you could define @code{indirect-function} in Lisp: |
| 340 | 339 | ||
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index 0a01162063b..cb5c7012c16 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi | |||
| @@ -965,6 +965,11 @@ The face @var{face} was defined. | |||
| 965 | The feature @var{feature} was required. | 965 | The feature @var{feature} was required. |
| 966 | @item (provide . @var{feature}) | 966 | @item (provide . @var{feature}) |
| 967 | The feature @var{feature} was provided. | 967 | The feature @var{feature} was provided. |
| 968 | @item (cl-defmethod @var{method} @var{specializers}) | ||
| 969 | The named @var{method} was defined by using @code{cl-defmethod}, with | ||
| 970 | @var{specializers} as its specializers. | ||
| 971 | @item (define-type . @var{type}) | ||
| 972 | The type @var{type} was defined. | ||
| 968 | @end table | 973 | @end table |
| 969 | 974 | ||
| 970 | The value of @code{load-history} may have one element whose @sc{car} is | 975 | The value of @code{load-history} may have one element whose @sc{car} is |
diff --git a/doc/lispref/markers.texi b/doc/lispref/markers.texi index d44085527a9..bf185431384 100644 --- a/doc/lispref/markers.texi +++ b/doc/lispref/markers.texi | |||
| @@ -659,6 +659,24 @@ more marks than this are pushed onto the @code{mark-ring}, | |||
| 659 | @c There is also global-mark-ring-max, but this chapter explicitly | 659 | @c There is also global-mark-ring-max, but this chapter explicitly |
| 660 | @c does not talk about the global mark. | 660 | @c does not talk about the global mark. |
| 661 | 661 | ||
| 662 | @cindex @code{delete-selection}, symbol property | ||
| 663 | @findex delete-selection-helper | ||
| 664 | @findex delete-selection-pre-hook | ||
| 665 | When Delete Selection mode (@pxref{Using Region, Delete Selection, , | ||
| 666 | emacs, The GNU Emacs Manual}) is enabled, commands that operate on the | ||
| 667 | active region (a.k.a.@: ``selection'') behave slightly differently. | ||
| 668 | This works by adding the function @code{delete-selection-pre-hook} to | ||
| 669 | the @code{pre-command-hook} (@pxref{Command Overview}). That function | ||
| 670 | calls @code{delete-selection-helper} to delete the selection as | ||
| 671 | appropriate for the command. If you want to adapt a command to Delete | ||
| 672 | Selection mode, put the @code{delete-selection} property on the | ||
| 673 | function's symbol (@pxref{Symbol Plists}); commands that don't have | ||
| 674 | this property on their symbol won't delete the selection. This | ||
| 675 | property can have one of several values to tailor the behavior to what | ||
| 676 | the command is supposed to do; see the doc strings of | ||
| 677 | @code{delete-selection-pre-hook} and @code{delete-selection-helper} | ||
| 678 | for the details. | ||
| 679 | |||
| 662 | @node The Region | 680 | @node The Region |
| 663 | @section The Region | 681 | @section The Region |
| 664 | @c The index entry must be just "region" to make it the first hit | 682 | @c The index entry must be just "region" to make it the first hit |
diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index af24b996c0a..19782d0fbde 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi | |||
| @@ -787,17 +787,6 @@ used on hooks such as @code{before-change-functions} (@pxref{Change | |||
| 787 | Hooks}). | 787 | Hooks}). |
| 788 | @end defun | 788 | @end defun |
| 789 | 789 | ||
| 790 | Major modes can make @code{syntax-ppss} run faster by specifying | ||
| 791 | where it needs to start parsing. | ||
| 792 | |||
| 793 | @defvar syntax-begin-function | ||
| 794 | If this is non-@code{nil}, it should be a function that moves to an | ||
| 795 | earlier buffer position where the parser state is equivalent to | ||
| 796 | @code{nil}---in other words, a position outside of any comment, | ||
| 797 | string, or parenthesis. @code{syntax-ppss} uses it to further | ||
| 798 | optimize its computations, when the cache gives no help. | ||
| 799 | @end defvar | ||
| 800 | |||
| 801 | @node Parser State | 790 | @node Parser State |
| 802 | @subsection Parser State | 791 | @subsection Parser State |
| 803 | @cindex parser state | 792 | @cindex parser state |
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 9b14dcf8fd9..f90c7d3e8fb 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi | |||
| @@ -84,7 +84,9 @@ such as @command{bash}, @command{zsh}, @command{rc}, or | |||
| 84 | * Concept Index:: | 84 | * Concept Index:: |
| 85 | * Function and Variable Index:: | 85 | * Function and Variable Index:: |
| 86 | * Command Index:: | 86 | * Command Index:: |
| 87 | @ignore | ||
| 87 | * Key Index:: | 88 | * Key Index:: |
| 89 | @end ignore | ||
| 88 | @end menu | 90 | @end menu |
| 89 | 91 | ||
| 90 | @node Introduction | 92 | @node Introduction |
| @@ -670,6 +672,12 @@ page long. If that occurs to you, search for configuration options | |||
| 670 | for calling @samp{less} without the @samp{-F} option. For Git, you | 672 | for calling @samp{less} without the @samp{-F} option. For Git, you |
| 671 | can do that using @samp{git config --global core.pager 'less -+F'}. | 673 | can do that using @samp{git config --global core.pager 'less -+F'}. |
| 672 | 674 | ||
| 675 | @vindex eshell-destroy-buffer-when-process-dies | ||
| 676 | If you want the buffers created by visual programs killed when the | ||
| 677 | program exits, customize the variable | ||
| 678 | @code{eshell-destroy-buffer-when-process-dies} to a non-@code{nil} | ||
| 679 | value; the default is @code{nil}. | ||
| 680 | |||
| 673 | @section Redirection | 681 | @section Redirection |
| 674 | Redirection is mostly the same in Eshell as it is in other command | 682 | Redirection is mostly the same in Eshell as it is in other command |
| 675 | shells. The output redirection operators @code{>} and @code{>>} as | 683 | shells. The output redirection operators @code{>} and @code{>>} as |
| @@ -682,6 +690,8 @@ The buffer redirection operator, @code{>>>}, expects a buffer object | |||
| 682 | on the right-hand side, into which it inserts the output of the | 690 | on the right-hand side, into which it inserts the output of the |
| 683 | left-hand side. e.g., @samp{echo hello >>> #<buffer *scratch*>} | 691 | left-hand side. e.g., @samp{echo hello >>> #<buffer *scratch*>} |
| 684 | inserts the string @code{"hello"} into the @file{*scratch*} buffer. | 692 | inserts the string @code{"hello"} into the @file{*scratch*} buffer. |
| 693 | The convenience shorthand variant @samp{#<@var{buffer-name}>}, as in | ||
| 694 | @samp{#<*scratch*>}, is also accepted. | ||
| 685 | 695 | ||
| 686 | @code{eshell-virtual-targets} is a list of mappings of virtual device | 696 | @code{eshell-virtual-targets} is a list of mappings of virtual device |
| 687 | names to functions. Eshell comes with two virtual devices: | 697 | names to functions. Eshell comes with two virtual devices: |
| @@ -1241,8 +1251,13 @@ Since it keeps the cursor up where the command was invoked. | |||
| 1241 | 1251 | ||
| 1242 | @printindex cm | 1252 | @printindex cm |
| 1243 | 1253 | ||
| 1254 | @c There are no @kindex entries in this manual; avoid generating an | ||
| 1255 | @c empty menu. | ||
| 1256 | @ignore | ||
| 1244 | @node Key Index | 1257 | @node Key Index |
| 1245 | @unnumbered Key Index | 1258 | @unnumbered Key Index |
| 1246 | 1259 | ||
| 1247 | @printindex ky | 1260 | @printindex ky |
| 1261 | @end ignore | ||
| 1262 | |||
| 1248 | @bye | 1263 | @bye |
| @@ -19,6 +19,7 @@ LANGUAGE (NATIVE NAME) HELLO | |||
| 19 | ---------------------- ----- | 19 | ---------------------- ----- |
| 20 | Amharic ($,1O M[MmN{(B) $,1M`MKM](B | 20 | Amharic ($,1O M[MmN{(B) $,1M`MKM](B |
| 21 | Arabic ($,1-g.$-y-q-h.*.1-i(B) $,1-g.$-s.1.$-g.%(B $,1-y.$.*.#.%(B | 21 | Arabic ($,1-g.$-y-q-h.*.1-i(B) $,1-g.$-s.1.$-g.%(B $,1-y.$.*.#.%(B |
| 22 | Armenian ($,1+p+a+u+e, +e+v(B) $,1+2+a, ,'(B $,1+q+e+f(B | ||
| 22 | Bengali ($,17,7>6b727>(B) $,17(7.787M6u7>70(B | 23 | Bengali ($,17,7>6b727>(B) $,17(7.787M6u7>70(B |
| 23 | Braille $,2(3(1('('(5(B | 24 | Braille $,2(3(1('('(5(B |
| 24 | Burmese ($,1H9H\H4HZH9HL(B) $,1H9H$HZHYH"H<HLH5HK(B | 25 | Burmese ($,1H9H\H4HZH9HL(B) $,1H9H$HZHYH"H<HLH5HK(B |
| @@ -48,6 +49,7 @@ Lao ((1>RJRERG(B) (1JP:R-4U(B / (1"mcKib*!4U(B | |||
| 48 | Malayalam ($,1@N@R@O@^@S@"(B) $,1@H@N@X@m@5@^@P@"(B | 49 | Malayalam ($,1@N@R@O@^@S@"(B) $,1@H@N@X@m@5@^@P@"(B |
| 49 | Maltese (il-Malti) Bon,Cu(Bu / Sa,C11(Ba | 50 | Maltese (il-Malti) Bon,Cu(Bu / Sa,C11(Ba |
| 50 | Mathematics $,1x (B p $,1x((B world $,1s"(B hello p $,2!a(B | 51 | Mathematics $,1x (B p $,1x((B world $,1s"(B hello p $,2!a(B |
| 52 | Mongolian (,L\^]S^[(B ,Lem[(B) ,LAPY](B ,LQPY]P(B ,Lcc(B? | ||
| 51 | Norwegian (norsk) Hei / God dag | 53 | Norwegian (norsk) Hei / God dag |
| 52 | Oriya ($,1:s;\;?:f(B) $,1;6;A;#;?;,;G(B | 54 | Oriya ($,1:s;\;?:f(B) $,1;6;A;#;?;,;G(B |
| 53 | Polish (j,Bj(Bzyk polski) Dzie,Bq(B dobry! / Cze,B6f(B! | 55 | Polish (j,Bj(Bzyk polski) Dzie,Bq(B dobry! / Cze,B6f(B! |
| @@ -148,6 +148,7 @@ so if you want to use it, you can always take a copy from an older Emacs. | |||
| 148 | Various resolutions are available as etc/images/icons/hicolor/*/apps/emacs.png. | 148 | Various resolutions are available as etc/images/icons/hicolor/*/apps/emacs.png. |
| 149 | The old Emacs logo icons are available as `emacs23.png' in the same location. | 149 | The old Emacs logo icons are available as `emacs23.png' in the same location. |
| 150 | 150 | ||
| 151 | --- | ||
| 151 | ** New make target `check-expensive' to run additional tests. | 152 | ** New make target `check-expensive' to run additional tests. |
| 152 | This includes all tests which run via "make check", plus additional | 153 | This includes all tests which run via "make check", plus additional |
| 153 | tests which take more time to perform. | 154 | tests which take more time to perform. |
| @@ -791,7 +792,10 @@ If the output of ERT tests in batch mode execution can be saved to a | |||
| 791 | log file, then it can be passed as an argument to the above function | 792 | log file, then it can be passed as an argument to the above function |
| 792 | to produce a neat summary. | 793 | to produce a neat summary. |
| 793 | 794 | ||
| 795 | --- | ||
| 794 | ** New js.el option `js-indent-first-init'. | 796 | ** New js.el option `js-indent-first-init'. |
| 797 | It was renamed from `js-indent-first-initialiser', to avoid issues | ||
| 798 | with American vs British spelling. | ||
| 795 | 799 | ||
| 796 | ** Info | 800 | ** Info |
| 797 | 801 | ||
| @@ -1005,6 +1009,7 @@ New options `tildify-space-string', `tildify-pattern', and | |||
| 1005 | `tildify-ignored-environments-alist' variables (as well as a few | 1009 | `tildify-ignored-environments-alist' variables (as well as a few |
| 1006 | helper functions) obsolete. | 1010 | helper functions) obsolete. |
| 1007 | 1011 | ||
| 1012 | +++ | ||
| 1008 | ** New package Xref replaces Etags's front-end and UI | 1013 | ** New package Xref replaces Etags's front-end and UI |
| 1009 | 1014 | ||
| 1010 | The new package Xref provides a generic framework and new commands to | 1015 | The new package Xref provides a generic framework and new commands to |
| @@ -1027,58 +1032,81 @@ As a result of this, the following commands are now obsolete: | |||
| 1027 | `find-tag-other-window', `find-tag-other-frame', `find-tag-regexp', | 1032 | `find-tag-other-window', `find-tag-other-frame', `find-tag-regexp', |
| 1028 | `tags-apropos', and `tags-loop-continue'. | 1033 | `tags-apropos', and `tags-loop-continue'. |
| 1029 | 1034 | ||
| 1030 | The framework's API is still experimental and can change in major, | 1035 | +++ |
| 1031 | backward-incompatible ways. | ||
| 1032 | |||
| 1033 | *** New variables | 1036 | *** New variables |
| 1034 | 1037 | ||
| 1035 | `find-tag-marker-ring-length' is now an obsolete alias for | 1038 | `find-tag-marker-ring-length' is now an obsolete alias for |
| 1036 | `xref-marker-ring-length'. `find-tag-marker-ring' is now an obsolete | 1039 | `xref-marker-ring-length'. `find-tag-marker-ring' is now an obsolete |
| 1037 | alias for a private variable. `xref-push-marker-stack' and | 1040 | alias for a private variable. `xref-push-marker-stack' and |
| 1038 | `xref-pop-marker-stack' should be used to mutate it instead. | 1041 | `xref-pop-marker-stack' should be used instead to manipulate the stack |
| 1042 | of searches for definitions. | ||
| 1039 | 1043 | ||
| 1040 | --- | 1044 | --- |
| 1041 | *** `xref-find-definitions' and `describe-function' now display | 1045 | *** `xref-find-definitions' and `describe-function' now display |
| 1042 | information about mode local overrides (defined by cedet/mode-local.el | 1046 | information about mode local overrides (defined by cedet/mode-local.el |
| 1043 | `define-overloadable-function' `define-mode-local-overrides'). | 1047 | `define-overloadable-function' `define-mode-local-overrides'). |
| 1044 | 1048 | ||
| 1049 | The framework's Lisp API is still experimental and can change in major, | ||
| 1050 | backward-incompatible ways. | ||
| 1051 | |||
| 1052 | --- | ||
| 1053 | ** New package Project | ||
| 1054 | |||
| 1055 | The new package Project provides generic infrastructure for dealing | ||
| 1056 | with projects. The main commands included in it are | ||
| 1057 | `project-find-file' and `project-find-regexp'. | ||
| 1058 | |||
| 1059 | The Lisp API of this package is still experimental. | ||
| 1060 | |||
| 1045 | ** EUDC | 1061 | ** EUDC |
| 1046 | EUDC's LDAP backend has been improved. | 1062 | EUDC's LDAP backend has been improved. |
| 1047 | 1063 | ||
| 1064 | +++ | ||
| 1048 | *** EUDC supports LDAP-over-SSL URLs (ldaps://). | 1065 | *** EUDC supports LDAP-over-SSL URLs (ldaps://). |
| 1049 | 1066 | ||
| 1067 | --- | ||
| 1050 | *** EUDC passes LDAP passwords through a pipe to the ldapsearch | 1068 | *** EUDC passes LDAP passwords through a pipe to the ldapsearch |
| 1051 | subprocess instead of on the command line. | 1069 | subprocess instead of on the command line. |
| 1052 | 1070 | ||
| 1071 | --- | ||
| 1053 | *** EUDC handles LDAP wildcards automatically so the user shouldn't | 1072 | *** EUDC handles LDAP wildcards automatically so the user shouldn't |
| 1054 | need to configure this manually anymore. | 1073 | need to configure this manually anymore. |
| 1055 | 1074 | ||
| 1075 | +++ | ||
| 1056 | *** The LDAP configuration section of EUDC's manual has been | 1076 | *** The LDAP configuration section of EUDC's manual has been |
| 1057 | rewritten. | 1077 | rewritten. |
| 1058 | 1078 | ||
| 1059 | There have also been customization changes. | 1079 | There have also been customization changes. |
| 1060 | 1080 | ||
| 1081 | +++ | ||
| 1061 | *** New custom variable `eudc-server-hotlist' to allow specifying | 1082 | *** New custom variable `eudc-server-hotlist' to allow specifying |
| 1062 | multiple EUDC servers in init file. | 1083 | multiple EUDC servers in init file. |
| 1063 | 1084 | ||
| 1085 | +++ | ||
| 1064 | *** Custom variable `eudc-inline-query-format' defaults to completing | 1086 | *** Custom variable `eudc-inline-query-format' defaults to completing |
| 1065 | on email and firstname instead of surname. | 1087 | on email and firstname instead of surname. |
| 1066 | 1088 | ||
| 1089 | --- | ||
| 1067 | *** Custom variable `eudc-expansion-overwrites-query' defaults to nil | 1090 | *** Custom variable `eudc-expansion-overwrites-query' defaults to nil |
| 1068 | to avoid interfering with the kill ring. | 1091 | to avoid interfering with the kill ring. |
| 1069 | 1092 | ||
| 1093 | +++ | ||
| 1070 | *** Custom variable `eudc-inline-expansion-format' defaults to | 1094 | *** Custom variable `eudc-inline-expansion-format' defaults to |
| 1071 | "Firstname Surname <mail-address>". | 1095 | "Firstname Surname <mail-address>". |
| 1072 | 1096 | ||
| 1097 | +++ | ||
| 1073 | *** Custom variable `eudc-options-file' defaults to | 1098 | *** Custom variable `eudc-options-file' defaults to |
| 1074 | "~/.emacs.d/eudc-options". | 1099 | "~/.emacs.d/eudc-options". |
| 1075 | 1100 | ||
| 1101 | --- | ||
| 1076 | *** New custom variable `ldap-ldapsearch-password-prompt-regexp' to | 1102 | *** New custom variable `ldap-ldapsearch-password-prompt-regexp' to |
| 1077 | allow overriding the regular expression that recognizes the ldapsearch | 1103 | allow overriding the regular expression that recognizes the ldapsearch |
| 1078 | command line's password prompt. | 1104 | command line's password prompt. |
| 1079 | 1105 | ||
| 1106 | --- | ||
| 1080 | EUDC's BBDB backend now supports BBDB 3. | 1107 | EUDC's BBDB backend now supports BBDB 3. |
| 1081 | 1108 | ||
| 1109 | --- | ||
| 1082 | EUDC's PH backend (eudcb-ph.el) is obsolete. | 1110 | EUDC's PH backend (eudcb-ph.el) is obsolete. |
| 1083 | 1111 | ||
| 1084 | ** Eshell | 1112 | ** Eshell |
| @@ -1087,12 +1115,14 @@ EUDC's PH backend (eudcb-ph.el) is obsolete. | |||
| 1087 | *** The new built-in command `clear' can scroll window contents out of sight. | 1115 | *** The new built-in command `clear' can scroll window contents out of sight. |
| 1088 | If provided with an optional non-nil argument, the scrollback contents will be cleared. | 1116 | If provided with an optional non-nil argument, the scrollback contents will be cleared. |
| 1089 | 1117 | ||
| 1118 | +++ | ||
| 1090 | *** New buffer syntax '#<buffer-name>', which is equivalent to | 1119 | *** New buffer syntax '#<buffer-name>', which is equivalent to |
| 1091 | '#<buffer buffer-name>'. This shorthand makes interacting with | 1120 | '#<buffer buffer-name>'. This shorthand makes interacting with |
| 1092 | buffers from eshell more convenient. Custom variable | 1121 | buffers from eshell more convenient. Custom variable |
| 1093 | `eshell-buffer-shorthand', which has been broken for a while, has been | 1122 | `eshell-buffer-shorthand', which has been broken for a while, has been |
| 1094 | removed. | 1123 | removed. |
| 1095 | 1124 | ||
| 1125 | +++ | ||
| 1096 | *** By default, eshell "visual" program buffers (created by | 1126 | *** By default, eshell "visual" program buffers (created by |
| 1097 | `eshell-visual-commands' and similar custom vars) are no longer killed | 1127 | `eshell-visual-commands' and similar custom vars) are no longer killed |
| 1098 | when their processes die. This fixes issues with short-lived commands | 1128 | when their processes die. This fixes issues with short-lived commands |
| @@ -1103,6 +1133,7 @@ make the new option `eshell-destroy-buffer-when-process-dies' non-nil. | |||
| 1103 | 1133 | ||
| 1104 | ** Browse-url | 1134 | ** Browse-url |
| 1105 | 1135 | ||
| 1136 | --- | ||
| 1106 | *** Support for the Conkeror web browser. | 1137 | *** Support for the Conkeror web browser. |
| 1107 | 1138 | ||
| 1108 | --- | 1139 | --- |
| @@ -1159,11 +1190,13 @@ few or no entries have changed. | |||
| 1159 | --- | 1190 | --- |
| 1160 | *** gulp.el | 1191 | *** gulp.el |
| 1161 | 1192 | ||
| 1193 | --- | ||
| 1162 | *** landmark.el (moved to elpa.gnu.org) | 1194 | *** landmark.el (moved to elpa.gnu.org) |
| 1163 | 1195 | ||
| 1164 | 1196 | ||
| 1165 | * New Modes and Packages in Emacs 25.1 | 1197 | * New Modes and Packages in Emacs 25.1 |
| 1166 | 1198 | ||
| 1199 | --- | ||
| 1167 | ** pinentry.el allows GnuPG passphrase to be prompted through the | 1200 | ** pinentry.el allows GnuPG passphrase to be prompted through the |
| 1168 | minibuffer instead of a graphical dialog, depending on whether the gpg | 1201 | minibuffer instead of a graphical dialog, depending on whether the gpg |
| 1169 | command is called from Emacs (i.e., INSIDE_EMACS environment variable | 1202 | command is called from Emacs (i.e., INSIDE_EMACS environment variable |
| @@ -1172,28 +1205,35 @@ later) and Pinentry (0.9.5 or later). | |||
| 1172 | 1205 | ||
| 1173 | ** cl-generic.el provides CLOS-style multiple-dispatch generic functions. | 1206 | ** cl-generic.el provides CLOS-style multiple-dispatch generic functions. |
| 1174 | 1207 | ||
| 1208 | --- | ||
| 1175 | ** scss-mode (a minor variant of css-mode) | 1209 | ** scss-mode (a minor variant of css-mode) |
| 1176 | 1210 | ||
| 1211 | --- | ||
| 1177 | ** let-alist is a new macro (and a package) that allows one to easily | 1212 | ** let-alist is a new macro (and a package) that allows one to easily |
| 1178 | let-bind the values stored in an alist. | 1213 | let-bind the values stored in an alist. |
| 1179 | 1214 | ||
| 1215 | --- | ||
| 1180 | ** `tildify-mode' allows to automatically insert hard spaces as one | 1216 | ** `tildify-mode' allows to automatically insert hard spaces as one |
| 1181 | types the text. Breaking line after a single-character words is | 1217 | types the text. Breaking line after a single-character words is |
| 1182 | forbidden by Czech and Polish typography (and may be discouraged in | 1218 | forbidden by Czech and Polish typography (and may be discouraged in |
| 1183 | other languages), so `auto-tildify-mode' makes it easier to create | 1219 | other languages), so `auto-tildify-mode' makes it easier to create |
| 1184 | a typographically-correct documents. | 1220 | a typographically-correct documents. |
| 1185 | 1221 | ||
| 1222 | --- | ||
| 1186 | ** The `seq' library adds sequence manipulation functions and macros | 1223 | ** The `seq' library adds sequence manipulation functions and macros |
| 1187 | that complement basic functions provided by subr.el. All functions | 1224 | that complement basic functions provided by subr.el. All functions |
| 1188 | are prefixed with `seq-' and work on lists, strings and vectors. | 1225 | are prefixed with `seq-' and work on lists, strings and vectors. |
| 1189 | 1226 | ||
| 1227 | --- | ||
| 1190 | ** The `map' library provides map-manipulation functions that work on | 1228 | ** The `map' library provides map-manipulation functions that work on |
| 1191 | alists, hash-table and arrays. All functions are prefixed with | 1229 | alists, hash-table and arrays. All functions are prefixed with |
| 1192 | `map-'. | 1230 | `map-'. |
| 1193 | 1231 | ||
| 1232 | --- | ||
| 1194 | ** The `thunk' library provides functions and macros to control the | 1233 | ** The `thunk' library provides functions and macros to control the |
| 1195 | evaluation of forms. | 1234 | evaluation of forms. |
| 1196 | 1235 | ||
| 1236 | --- | ||
| 1197 | ** js-jsx-mode (a minor variant of js-mode) provides indentation | 1237 | ** js-jsx-mode (a minor variant of js-mode) provides indentation |
| 1198 | support for JSX, an XML-like syntax extension to ECMAScript. | 1238 | support for JSX, an XML-like syntax extension to ECMAScript. |
| 1199 | 1239 | ||
| @@ -1206,6 +1246,7 @@ arguments. The earlier behavior of silently supplying a nil to the | |||
| 1206 | last variable when there was an odd number of arguments has been | 1246 | last variable when there was an odd number of arguments has been |
| 1207 | eliminated. | 1247 | eliminated. |
| 1208 | 1248 | ||
| 1249 | +++ | ||
| 1209 | ** `syntax-begin-function' is declared obsolete. | 1250 | ** `syntax-begin-function' is declared obsolete. |
| 1210 | Removed font-lock-beginning-of-syntax-function and the SYNTAX-BEGIN | 1251 | Removed font-lock-beginning-of-syntax-function and the SYNTAX-BEGIN |
| 1211 | slot in font-lock-defaults. | 1252 | slot in font-lock-defaults. |
| @@ -1217,12 +1258,11 @@ file and still expect it to be run after startup should set | |||
| 1217 | `package-enable-at-startup' to t after the call to | 1258 | `package-enable-at-startup' to t after the call to |
| 1218 | `package-initialize'. | 1259 | `package-initialize'. |
| 1219 | 1260 | ||
| 1261 | --- | ||
| 1220 | ** `:global' minor mode use `setq-default' rather than `setq'. | 1262 | ** `:global' minor mode use `setq-default' rather than `setq'. |
| 1221 | This means that you can't use `make-local-variable' and expect them to | 1263 | This means that you can't use `make-local-variable' and expect them to |
| 1222 | "magically" become buffer-local. | 1264 | "magically" become buffer-local. |
| 1223 | 1265 | ||
| 1224 | ** `inhibit-point-motion-hooks' now defaults to t and is obsolete. | ||
| 1225 | |||
| 1226 | +++ | 1266 | +++ |
| 1227 | ** `track-mouse' no longer freezes the shape of the mouse pointer. | 1267 | ** `track-mouse' no longer freezes the shape of the mouse pointer. |
| 1228 | The `track-mouse' form no longer refrains from changing the shape of | 1268 | The `track-mouse' form no longer refrains from changing the shape of |
| @@ -1237,10 +1277,12 @@ to the special value `dragging' in the body of the form. | |||
| 1237 | has any effect. (This change was made in Emacs 24.4 but was not | 1277 | has any effect. (This change was made in Emacs 24.4 but was not |
| 1238 | advertised at the time.) | 1278 | advertised at the time.) |
| 1239 | 1279 | ||
| 1280 | +++ | ||
| 1240 | ** `indirect-function' does not signal `void-function' any more. | 1281 | ** `indirect-function' does not signal `void-function' any more. |
| 1241 | This is mostly a bug-fix, since this change was missed back in 24.4 when | 1282 | This is mostly a bug-fix, since this change was missed back in 24.4 when |
| 1242 | symbol-function was changed not to signal `void-function' any more. | 1283 | symbol-function was changed not to signal `void-function' any more. |
| 1243 | 1284 | ||
| 1285 | +++ | ||
| 1244 | *** As a consequence, the second arg of `indirect-function' is now obsolete. | 1286 | *** As a consequence, the second arg of `indirect-function' is now obsolete. |
| 1245 | 1287 | ||
| 1246 | ** Comint, term, and compile do not set the EMACS env var any more. | 1288 | ** Comint, term, and compile do not set the EMACS env var any more. |
| @@ -1272,10 +1314,12 @@ group ID instead of `t'. | |||
| 1272 | any reference to a buffer position. The 6th member of the mouse | 1314 | any reference to a buffer position. The 6th member of the mouse |
| 1273 | position list returned for such events is now nil. | 1315 | position list returned for such events is now nil. |
| 1274 | 1316 | ||
| 1317 | --- | ||
| 1275 | ** Menu items in keymaps do not support the "key shortcut cache" any more. | 1318 | ** Menu items in keymaps do not support the "key shortcut cache" any more. |
| 1276 | These slots used to hold key-shortcut data, but have been obsolete since | 1319 | These slots used to hold key-shortcut data, but have been obsolete since |
| 1277 | Emacs-21. | 1320 | Emacs-21. |
| 1278 | 1321 | ||
| 1322 | --- | ||
| 1279 | ** Emacs no longer downcases the first letter of a system diagnostic | 1323 | ** Emacs no longer downcases the first letter of a system diagnostic |
| 1280 | when signaling a file error. For example, it now reports "Permission | 1324 | when signaling a file error. For example, it now reports "Permission |
| 1281 | denied" instead of "permission denied". The old behavior was problematic | 1325 | denied" instead of "permission denied". The old behavior was problematic |
| @@ -1321,6 +1365,7 @@ use [:multibyte:] instead. | |||
| 1321 | ** The `diff' command uses the unified format now. To restore the old | 1365 | ** The `diff' command uses the unified format now. To restore the old |
| 1322 | behavior, set `diff-switches' to `-c'. | 1366 | behavior, set `diff-switches' to `-c'. |
| 1323 | 1367 | ||
| 1368 | --- | ||
| 1324 | ** `grep-template' and `grep-find-template' values don't include the | 1369 | ** `grep-template' and `grep-find-template' values don't include the |
| 1325 | --color argument anymore. It's added at the <C> place holder position | 1370 | --color argument anymore. It's added at the <C> place holder position |
| 1326 | dynamically. Any third-party code that changes these templates should | 1371 | dynamically. Any third-party code that changes these templates should |
| @@ -1346,6 +1391,7 @@ that happen, `unhandled-file-name-directory' now defaults to calling | |||
| 1346 | +++ | 1391 | +++ |
| 1347 | *** New vector QPattern. | 1392 | *** New vector QPattern. |
| 1348 | 1393 | ||
| 1394 | --- | ||
| 1349 | ** syntax-propertize is now automatically called on-demand during forward | 1395 | ** syntax-propertize is now automatically called on-demand during forward |
| 1350 | parsing functions like `forward-sexp'. | 1396 | parsing functions like `forward-sexp'. |
| 1351 | 1397 | ||
| @@ -1366,10 +1412,14 @@ Replaced by properties `cursor-intangible' and `cursor-sensor-functions', | |||
| 1366 | implemented by the new `cursor-intangible-mode' and | 1412 | implemented by the new `cursor-intangible-mode' and |
| 1367 | `cursor-sensor-mode' minor modes. | 1413 | `cursor-sensor-mode' minor modes. |
| 1368 | 1414 | ||
| 1415 | ** `inhibit-point-motion-hooks' now defaults to t and is obsolete. | ||
| 1416 | |||
| 1417 | +++ | ||
| 1369 | ** New process type `pipe', which can be used in combination with the | 1418 | ** New process type `pipe', which can be used in combination with the |
| 1370 | `:stderr' keyword of make-process to handle standard error output | 1419 | `:stderr' keyword of make-process to handle standard error output |
| 1371 | of subprocess. | 1420 | of subprocess. |
| 1372 | 1421 | ||
| 1422 | +++ | ||
| 1373 | ** New function `make-process' provides an alternative interface to | 1423 | ** New function `make-process' provides an alternative interface to |
| 1374 | `start-process'. It allows programs to set process parameters such as | 1424 | `start-process'. It allows programs to set process parameters such as |
| 1375 | process filter, sentinel, etc., through keyword arguments (similar to | 1425 | process filter, sentinel, etc., through keyword arguments (similar to |
| @@ -1398,13 +1448,17 @@ buffers to allow certain parts of the text to be writable. | |||
| 1398 | 1448 | ||
| 1399 | ** `read-buffer' takes a new `predicate' argument. | 1449 | ** `read-buffer' takes a new `predicate' argument. |
| 1400 | 1450 | ||
| 1451 | +++ | ||
| 1401 | ** Emacs Lisp now supports generators. | 1452 | ** Emacs Lisp now supports generators. |
| 1453 | See the "Generators" section of the ELisp manual for the details. | ||
| 1402 | 1454 | ||
| 1403 | ** New finalizer facility for running code when objects | 1455 | +++ |
| 1404 | become unreachable. | 1456 | ** New finalizer facility for running code when objects become unreachable. |
| 1457 | See the "Finalizer Type" subsection in the ELisp manual for the | ||
| 1458 | details. | ||
| 1405 | 1459 | ||
| 1406 | ** lexical closures can use (:documentation <form>) to build their docstring. | 1460 | ** lexical closures can use (:documentation FORM) to build their docstring. |
| 1407 | It should be placed right where the docstring would be, and <form> is then | 1461 | It should be placed right where the docstring would be, and FORM is then |
| 1408 | evaluated (and should return a string) when the closure is built. | 1462 | evaluated (and should return a string) when the closure is built. |
| 1409 | 1463 | ||
| 1410 | ** define-inline provides a new way to define inlinable functions. | 1464 | ** define-inline provides a new way to define inlinable functions. |
| @@ -1475,6 +1529,7 @@ have side effects. | |||
| 1475 | ** New macro `with-file-modes', for evaluating expressions with default file | 1529 | ** New macro `with-file-modes', for evaluating expressions with default file |
| 1476 | permissions set to temporary values (e.g., for creating private files). | 1530 | permissions set to temporary values (e.g., for creating private files). |
| 1477 | 1531 | ||
| 1532 | +++ | ||
| 1478 | ** You can access the slots of structures using `cl-struct-slot-value'. | 1533 | ** You can access the slots of structures using `cl-struct-slot-value'. |
| 1479 | 1534 | ||
| 1480 | ** Function `sort' can deal with vectors. | 1535 | ** Function `sort' can deal with vectors. |
| @@ -1487,6 +1542,7 @@ name. The variable `system-name' is now obsolete. | |||
| 1487 | +++ | 1542 | +++ |
| 1488 | ** Function `write-region' no longer outputs "Wrote FILE" in batch mode. | 1543 | ** Function `write-region' no longer outputs "Wrote FILE" in batch mode. |
| 1489 | 1544 | ||
| 1545 | --- | ||
| 1490 | ** If `pwd' is called with a prefix argument, insert the current default | 1546 | ** If `pwd' is called with a prefix argument, insert the current default |
| 1491 | directory at point. | 1547 | directory at point. |
| 1492 | 1548 | ||
| @@ -1587,11 +1643,16 @@ a directory file name. It returns non-nil if the last character in | |||
| 1587 | the name is a directory separator character (forward slash on GNU and | 1643 | the name is a directory separator character (forward slash on GNU and |
| 1588 | Unix systems, forward- or backslash on MS-Windows and MS-DOS). | 1644 | Unix systems, forward- or backslash on MS-Windows and MS-DOS). |
| 1589 | 1645 | ||
| 1646 | --- | ||
| 1590 | ** ASCII approximations to curved quotes are put in standard-display-table | 1647 | ** ASCII approximations to curved quotes are put in standard-display-table |
| 1591 | if the terminal cannot display curved quotes. | 1648 | if the terminal cannot display curved quotes. |
| 1592 | 1649 | ||
| 1650 | +++ | ||
| 1593 | ** Standard output and error streams now transliterate characters via | 1651 | ** Standard output and error streams now transliterate characters via |
| 1594 | standard-display-table, and encode output using locale-coding-system. | 1652 | standard-display-table, and encode output using locale-coding-system. |
| 1653 | To force a specific encoding, bind `coding-system-for-write' to the | ||
| 1654 | coding-system of your choice when invoking functions like `prin1' and | ||
| 1655 | `message'. | ||
| 1595 | 1656 | ||
| 1596 | +++ | 1657 | +++ |
| 1597 | ** New var `truncate-string-ellipsis' to choose how to indicate truncation. | 1658 | ** New var `truncate-string-ellipsis' to choose how to indicate truncation. |
| @@ -1602,6 +1663,7 @@ This is used by Google's Native Client (NaCl). | |||
| 1602 | 1663 | ||
| 1603 | ** Miscellaneous name change | 1664 | ** Miscellaneous name change |
| 1604 | 1665 | ||
| 1666 | --- | ||
| 1605 | For consistency with the usual Emacs spelling, the Lisp variable | 1667 | For consistency with the usual Emacs spelling, the Lisp variable |
| 1606 | `hfy-optimisations' has been renamed to `hfy-optimizations'. | 1668 | `hfy-optimisations' has been renamed to `hfy-optimizations'. |
| 1607 | The old name should still work, as an obsolescent alias. | 1669 | The old name should still work, as an obsolescent alias. |
| @@ -1612,22 +1674,30 @@ The old name should still work, as an obsolescent alias. | |||
| 1612 | *** Emacs can now draw horizontal scroll bars on some platforms that | 1674 | *** Emacs can now draw horizontal scroll bars on some platforms that |
| 1613 | provide toolkit scroll bars, namely Gtk+, Lucid, Motif and Windows. | 1675 | provide toolkit scroll bars, namely Gtk+, Lucid, Motif and Windows. |
| 1614 | Horizontal scroll bars are turned off by default. | 1676 | Horizontal scroll bars are turned off by default. |
| 1677 | |||
| 1615 | **** New function `horizontal-scroll-bars-available-p' telling whether | 1678 | **** New function `horizontal-scroll-bars-available-p' telling whether |
| 1616 | horizontal scroll bars are available on the underlying system. | 1679 | horizontal scroll bars are available on the underlying system. |
| 1680 | |||
| 1617 | **** New mode `horizontal-scroll-bar-mode' to toggle horizontal scroll | 1681 | **** New mode `horizontal-scroll-bar-mode' to toggle horizontal scroll |
| 1618 | bars on all existing and future frames. | 1682 | bars on all existing and future frames. |
| 1683 | |||
| 1619 | **** New function `toggle-horizontal-scroll-bar' to toggle horizontal | 1684 | **** New function `toggle-horizontal-scroll-bar' to toggle horizontal |
| 1620 | scroll bars on the selected frame. | 1685 | scroll bars on the selected frame. |
| 1686 | |||
| 1621 | **** New frame parameters `horizontal-scroll-bars' and | 1687 | **** New frame parameters `horizontal-scroll-bars' and |
| 1622 | `scroll-bar-height' to set horizontal scroll bars and their height | 1688 | `scroll-bar-height' to set horizontal scroll bars and their height |
| 1623 | for individual frames and in `default-frame-alist'. | 1689 | for individual frames and in `default-frame-alist'. |
| 1690 | |||
| 1624 | **** New functions `frame-scroll-bar-height' and | 1691 | **** New functions `frame-scroll-bar-height' and |
| 1625 | `window-scroll-bar-height' return the height of horizontal scroll | 1692 | `window-scroll-bar-height' return the height of horizontal scroll |
| 1626 | bars on a specific frame or window. | 1693 | bars on a specific frame or window. |
| 1694 | |||
| 1627 | **** `set-window-scroll-bars' now accepts five parameters where the last | 1695 | **** `set-window-scroll-bars' now accepts five parameters where the last |
| 1628 | two specify height and type of the window's horizontal scroll bar. | 1696 | two specify height and type of the window's horizontal scroll bar. |
| 1697 | |||
| 1629 | **** `window-scroll-bars' now returns type and sizes of horizontal scroll | 1698 | **** `window-scroll-bars' now returns type and sizes of horizontal scroll |
| 1630 | bars too. | 1699 | bars too. |
| 1700 | |||
| 1631 | **** New buffer-local variables `horizontal-scroll-bar' and | 1701 | **** New buffer-local variables `horizontal-scroll-bar' and |
| 1632 | `scroll-bar-height'. | 1702 | `scroll-bar-height'. |
| 1633 | 1703 | ||
| @@ -1694,6 +1764,7 @@ Those features have been deprecated in Gtk+ for a long time. | |||
| 1694 | 1764 | ||
| 1695 | ** Etags | 1765 | ** Etags |
| 1696 | 1766 | ||
| 1767 | +++ | ||
| 1697 | *** etags no longer qualifies class members by default. | 1768 | *** etags no longer qualifies class members by default. |
| 1698 | 1769 | ||
| 1699 | By default, `etags' will not qualify class members for C-like | 1770 | By default, `etags' will not qualify class members for C-like |
| @@ -1709,11 +1780,13 @@ using -Q might make some class members become "unknown" to `M-.' | |||
| 1709 | (`xref-find-definitions'); if so, you can use `C-u M-.' to specify the | 1780 | (`xref-find-definitions'); if so, you can use `C-u M-.' to specify the |
| 1710 | qualified names by hand. | 1781 | qualified names by hand. |
| 1711 | 1782 | ||
| 1783 | +++ | ||
| 1712 | *** New language Ruby | 1784 | *** New language Ruby |
| 1713 | 1785 | ||
| 1714 | Names of modules, classes, methods, and functions are tagged. | 1786 | Names of modules, classes, methods, and functions are tagged. |
| 1715 | Overloaded operators are also tagged. | 1787 | Overloaded operators are also tagged. |
| 1716 | 1788 | ||
| 1789 | +++ | ||
| 1717 | *** Improved support for Lua | 1790 | *** Improved support for Lua |
| 1718 | 1791 | ||
| 1719 | Etags now tags functions even if the "function" keyword follows some | 1792 | Etags now tags functions even if the "function" keyword follows some |
| @@ -1737,6 +1810,7 @@ of Windows starting with Windows 9X. | |||
| 1737 | +++ | 1810 | +++ |
| 1738 | ** Emacs running on MS-Windows now supports the daemon mode. | 1811 | ** Emacs running on MS-Windows now supports the daemon mode. |
| 1739 | 1812 | ||
| 1813 | --- | ||
| 1740 | ** The byte counts in etags-generated TAGS files are now the same on | 1814 | ** The byte counts in etags-generated TAGS files are now the same on |
| 1741 | MS-Windows as they are on other platforms. | 1815 | MS-Windows as they are on other platforms. |
| 1742 | 1816 | ||
| @@ -1744,8 +1818,10 @@ MS-Windows as they are on other platforms. | |||
| 1744 | ** On OS X, configure creates a Cocoa ("Nextstep") build by default. | 1818 | ** On OS X, configure creates a Cocoa ("Nextstep") build by default. |
| 1745 | Pass '--without-ns' to configure to create an X11 build, the old default. | 1819 | Pass '--without-ns' to configure to create an X11 build, the old default. |
| 1746 | 1820 | ||
| 1821 | --- | ||
| 1747 | ** OS X 10.5 or older is no longer supported. | 1822 | ** OS X 10.5 or older is no longer supported. |
| 1748 | 1823 | ||
| 1824 | --- | ||
| 1749 | ** OS X on PowerPC is no longer supported. | 1825 | ** OS X on PowerPC is no longer supported. |
| 1750 | 1826 | ||
| 1751 | --- | 1827 | --- |
diff --git a/lisp/apropos.el b/lisp/apropos.el index 36a729a34ab..3c1a4136fbf 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el | |||
| @@ -676,6 +676,10 @@ the output includes key-bindings of commands." | |||
| 676 | ;; (autoload (push (cdr x) autoloads)) | 676 | ;; (autoload (push (cdr x) autoloads)) |
| 677 | (`require (push (cdr x) requires)) | 677 | (`require (push (cdr x) requires)) |
| 678 | (`provide (push (cdr x) provides)) | 678 | (`provide (push (cdr x) provides)) |
| 679 | (`t nil) ; Skip "was an autoload" entries. | ||
| 680 | ;; FIXME: Print information about each individual method: both | ||
| 681 | ;; its docstring and specializers (bug#21422). | ||
| 682 | (`cl-defmethod (push (cadr x) provides)) | ||
| 679 | (_ (push (or (cdr-safe x) x) symbols)))) | 683 | (_ (push (or (cdr-safe x) x) symbols)))) |
| 680 | (let ((apropos-pattern "")) ;Dummy binding for apropos-symbols-internal. | 684 | (let ((apropos-pattern "")) ;Dummy binding for apropos-symbols-internal. |
| 681 | (apropos-symbols-internal | 685 | (apropos-symbols-internal |
diff --git a/lisp/cedet/mode-local.el b/lisp/cedet/mode-local.el index c2b7cf50ac1..30320b00946 100644 --- a/lisp/cedet/mode-local.el +++ b/lisp/cedet/mode-local.el | |||
| @@ -633,6 +633,9 @@ SYMBOL is a function that can be overridden." | |||
| 633 | ;; LIST ALL LOADED OVERRIDES FOR SYMBOL HERE | 633 | ;; LIST ALL LOADED OVERRIDES FOR SYMBOL HERE |
| 634 | ))) | 634 | ))) |
| 635 | 635 | ||
| 636 | ;; We are called from describe-function in help-fns.el, where this is defined. | ||
| 637 | (defvar describe-function-orig-buffer) | ||
| 638 | |||
| 636 | (defun describe-mode-local-overload (symbol) | 639 | (defun describe-mode-local-overload (symbol) |
| 637 | "For `help-fns-describe-function-functions'; add overloads for SYMBOL." | 640 | "For `help-fns-describe-function-functions'; add overloads for SYMBOL." |
| 638 | (when (get symbol 'mode-local-overload) | 641 | (when (get symbol 'mode-local-overload) |
diff --git a/lisp/delsel.el b/lisp/delsel.el index 46eea973a70..6a819ebbf67 100644 --- a/lisp/delsel.el +++ b/lisp/delsel.el | |||
| @@ -37,16 +37,26 @@ | |||
| 37 | ;; the values: | 37 | ;; the values: |
| 38 | ;; `yank' | 38 | ;; `yank' |
| 39 | ;; For commands which do a yank; ensures the region about to be | 39 | ;; For commands which do a yank; ensures the region about to be |
| 40 | ;; deleted isn't yanked. | 40 | ;; deleted isn't immediately yanked back, which would make the |
| 41 | ;; command a no-op. | ||
| 41 | ;; `supersede' | 42 | ;; `supersede' |
| 42 | ;; Delete the active region and ignore the current command, | 43 | ;; Delete the active region and ignore the current command, |
| 43 | ;; i.e. the command will just delete the region. | 44 | ;; i.e. the command will just delete the region. This is for |
| 45 | ;; commands that normally delete small amounts of text, like | ||
| 46 | ;; a single character -- they will instead delete the whole | ||
| 47 | ;; active region. | ||
| 48 | ;; `kill' | ||
| 49 | ;; `kill-region' is used on the selection, rather than | ||
| 50 | ;; `delete-region'. (Text selected with the mouse will typically | ||
| 51 | ;; be yankable anyhow.) | ||
| 44 | ;; t | 52 | ;; t |
| 45 | ;; The normal case: delete the active region prior to executing | 53 | ;; The normal case: delete the active region prior to executing |
| 46 | ;; the command which will insert replacement text. | 54 | ;; the command which will insert replacement text. |
| 47 | ;; <function> | 55 | ;; FUNCTION |
| 48 | ;; For commands which need to dynamically determine this behavior. | 56 | ;; For commands which need to dynamically determine this behavior. |
| 49 | ;; The function should return one of the above values or nil. | 57 | ;; FUNCTION should take no argument and return one of the above |
| 58 | ;; values, or nil. In the latter case, FUNCTION should itself | ||
| 59 | ;; do with the active region whatever is appropriate." | ||
| 50 | 60 | ||
| 51 | ;;; Code: | 61 | ;;; Code: |
| 52 | 62 | ||
| @@ -66,7 +76,11 @@ enable the mode if ARG is omitted or nil. | |||
| 66 | 76 | ||
| 67 | When Delete Selection mode is enabled, typed text replaces the selection | 77 | When Delete Selection mode is enabled, typed text replaces the selection |
| 68 | if the selection is active. Otherwise, typed text is just inserted at | 78 | if the selection is active. Otherwise, typed text is just inserted at |
| 69 | point regardless of any selection." | 79 | point regardless of any selection. Also, commands that normally delete |
| 80 | just one character will delete the entire selection instead. | ||
| 81 | |||
| 82 | See `delete-selection-helper' and `delete-selection-pre-hook' for | ||
| 83 | information on adapting behavior of commands in Delete Selection mode." | ||
| 70 | :global t :group 'editing-basics | 84 | :global t :group 'editing-basics |
| 71 | (if (not delete-selection-mode) | 85 | (if (not delete-selection-mode) |
| 72 | (remove-hook 'pre-command-hook 'delete-selection-pre-hook) | 86 | (remove-hook 'pre-command-hook 'delete-selection-pre-hook) |
| @@ -147,10 +161,14 @@ With ARG, repeat that many times. `C-u' means until end of buffer." | |||
| 147 | "Delete selection according to TYPE: | 161 | "Delete selection according to TYPE: |
| 148 | `yank' | 162 | `yank' |
| 149 | For commands which do a yank; ensures the region about to be | 163 | For commands which do a yank; ensures the region about to be |
| 150 | deleted isn't yanked. | 164 | deleted isn't immediately yanked back, which would make the |
| 165 | command a no-op. | ||
| 151 | `supersede' | 166 | `supersede' |
| 152 | Delete the active region and ignore the current command, | 167 | Delete the active region and ignore the current command, |
| 153 | i.e. the command will just delete the region. | 168 | i.e. the command will just delete the region. This is for |
| 169 | commands that normally delete small amounts of text, like | ||
| 170 | a single character -- they will instead delete the whole | ||
| 171 | active region. | ||
| 154 | `kill' | 172 | `kill' |
| 155 | `kill-region' is used on the selection, rather than | 173 | `kill-region' is used on the selection, rather than |
| 156 | `delete-region'. (Text selected with the mouse will typically | 174 | `delete-region'. (Text selected with the mouse will typically |
| @@ -160,7 +178,9 @@ With ARG, repeat that many times. `C-u' means until end of buffer." | |||
| 160 | the command which will insert replacement text. | 178 | the command which will insert replacement text. |
| 161 | FUNCTION | 179 | FUNCTION |
| 162 | For commands which need to dynamically determine this behavior. | 180 | For commands which need to dynamically determine this behavior. |
| 163 | FUNCTION should take no argument and return one of the above values or nil." | 181 | FUNCTION should take no argument and return one of the above |
| 182 | values, or nil. In the latter case, FUNCTION should itself | ||
| 183 | do with the active region whatever is appropriate." | ||
| 164 | (condition-case data | 184 | (condition-case data |
| 165 | (cond ((eq type 'kill) ;Deprecated, backward compatibility. | 185 | (cond ((eq type 'kill) ;Deprecated, backward compatibility. |
| 166 | (delete-active-region t) | 186 | (delete-active-region t) |
diff --git a/lisp/dired.el b/lisp/dired.el index 52386c91198..63124fce5e5 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -2810,7 +2810,9 @@ It runs the hook `dired-initial-position-hook'." | |||
| 2810 | (defun dired-current-directory (&optional localp) | 2810 | (defun dired-current-directory (&optional localp) |
| 2811 | "Return the name of the subdirectory to which this line belongs. | 2811 | "Return the name of the subdirectory to which this line belongs. |
| 2812 | This returns a string with trailing slash, like `default-directory'. | 2812 | This returns a string with trailing slash, like `default-directory'. |
| 2813 | Optional argument means return a file name relative to `default-directory'." | 2813 | Optional argument means return a file name relative to `default-directory', |
| 2814 | in which case the value could be an empty string if `default-directory' | ||
| 2815 | is the directory where the file on this line resides." | ||
| 2814 | (let ((here (point)) | 2816 | (let ((here (point)) |
| 2815 | (alist (or dired-subdir-alist | 2817 | (alist (or dired-subdir-alist |
| 2816 | ;; probably because called in a non-dired buffer | 2818 | ;; probably because called in a non-dired buffer |
diff --git a/lisp/ffap.el b/lisp/ffap.el index 6c7932b512e..abf979f6129 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el | |||
| @@ -974,14 +974,14 @@ out of NAME." | |||
| 974 | (push (cons "" (cdr (assoc (match-string 0) ; i.e. "(TeX-current-macro)" | 974 | (push (cons "" (cdr (assoc (match-string 0) ; i.e. "(TeX-current-macro)" |
| 975 | preferred-suffix-rules))) | 975 | preferred-suffix-rules))) |
| 976 | guess-rules)) | 976 | guess-rules)) |
| 977 | (setq kpsewhich-args (mapcar (lambda (rule) | ||
| 978 | (concat (car rule) name (cdr rule))) | ||
| 979 | guess-rules)) | ||
| 980 | (with-temp-buffer | 977 | (with-temp-buffer |
| 981 | (let ((process-environment (buffer-local-value | 978 | (let ((process-environment (buffer-local-value |
| 982 | 'process-environment curbuf)) | 979 | 'process-environment curbuf)) |
| 983 | (exec-path (buffer-local-value 'exec-path curbuf))) | 980 | (exec-path (buffer-local-value 'exec-path curbuf))) |
| 984 | (apply #'call-process "kpsewhich" nil t nil kpsewhich-args)) | 981 | (apply #'call-process "kpsewhich" nil t nil |
| 982 | (mapcar (lambda (rule) | ||
| 983 | (concat (car rule) name (cdr rule))) | ||
| 984 | guess-rules))) | ||
| 985 | (when (< (point-min) (point-max)) | 985 | (when (< (point-min) (point-max)) |
| 986 | (buffer-substring (goto-char (point-min)) (point-at-eol)))))))) | 986 | (buffer-substring (goto-char (point-min)) (point-at-eol)))))))) |
| 987 | 987 | ||
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 4a92069b12e..3c1f01d5886 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -1302,15 +1302,18 @@ This function does 2 things: | |||
| 1302 | (point-min)))) | 1302 | (point-min)))) |
| 1303 | (when (< end (point-max)) | 1303 | (when (< end (point-max)) |
| 1304 | (setq end | 1304 | (setq end |
| 1305 | (if (get-text-property end 'font-lock-multiline) | 1305 | (cond |
| 1306 | (or (text-property-any end (point-max) | 1306 | ((get-text-property end 'font-lock-multiline) |
| 1307 | 'font-lock-multiline nil) | 1307 | (or (text-property-any end (point-max) |
| 1308 | (point-max)) | 1308 | 'font-lock-multiline nil) |
| 1309 | (point-max))) | ||
| 1310 | ;; If `end' has been set by the function above, don't corrupt it. | ||
| 1311 | (font-lock-extend-after-change-region-function end) | ||
| 1309 | ;; Rounding up to a whole number of lines should include the | 1312 | ;; Rounding up to a whole number of lines should include the |
| 1310 | ;; line right after `end'. Typical case: the first char of | 1313 | ;; line right after `end'. Typical case: the first char of |
| 1311 | ;; the line was deleted. Or a \n was inserted in the middle | 1314 | ;; the line was deleted. Or a \n was inserted in the middle |
| 1312 | ;; of a line. | 1315 | ;; of a line. |
| 1313 | (1+ end)))) | 1316 | (t (1+ end))))) |
| 1314 | ;; Finally, pre-enlarge the region to a whole number of lines, to try | 1317 | ;; Finally, pre-enlarge the region to a whole number of lines, to try |
| 1315 | ;; and anticipate what font-lock-default-fontify-region will do, so as to | 1318 | ;; and anticipate what font-lock-default-fontify-region will do, so as to |
| 1316 | ;; avoid double-redisplay. | 1319 | ;; avoid double-redisplay. |
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 1251a4e1107..ecac0aeb135 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -831,7 +831,8 @@ styles for specific categories, such as files, buffers, etc." | |||
| 831 | 831 | ||
| 832 | (defvar completion-category-defaults | 832 | (defvar completion-category-defaults |
| 833 | '((buffer (styles . (basic substring))) | 833 | '((buffer (styles . (basic substring))) |
| 834 | (unicode-name (styles . (basic substring)))) | 834 | (unicode-name (styles . (basic substring))) |
| 835 | (project-file (styles . (basic substring)))) | ||
| 835 | "Default settings for specific completion categories. | 836 | "Default settings for specific completion categories. |
| 836 | Each entry has the shape (CATEGORY . ALIST) where ALIST is | 837 | Each entry has the shape (CATEGORY . ALIST) where ALIST is |
| 837 | an association list that can specify properties such as: | 838 | an association list that can specify properties such as: |
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index c6de1837e9a..44923aee895 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -56,6 +56,8 @@ | |||
| 56 | (require 'custom) | 56 | (require 'custom) |
| 57 | (require 'format-spec) | 57 | (require 'format-spec) |
| 58 | (require 'shell) | 58 | (require 'shell) |
| 59 | ;; Introduced in Emacs 23.2. | ||
| 60 | (require 'ucs-normalize nil 'noerror) | ||
| 59 | 61 | ||
| 60 | (require 'trampver) | 62 | (require 'trampver) |
| 61 | (require 'tramp-loaddefs) | 63 | (require 'tramp-loaddefs) |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index ca0707f5941..7ace8864f88 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -1100,15 +1100,19 @@ target of the symlink differ." | |||
| 1100 | ;; Right, they are on the same host, regardless of user, method, | 1100 | ;; Right, they are on the same host, regardless of user, method, |
| 1101 | ;; etc. We now make the link on the remote machine. This will | 1101 | ;; etc. We now make the link on the remote machine. This will |
| 1102 | ;; occur as the user that FILENAME belongs to. | 1102 | ;; occur as the user that FILENAME belongs to. |
| 1103 | (tramp-send-command-and-check | 1103 | (and (tramp-send-command-and-check |
| 1104 | l | 1104 | l (format "cd %s" (tramp-shell-quote-argument cwd))) |
| 1105 | (format | 1105 | (tramp-send-command-and-check |
| 1106 | "cd %s && %s -sf %s %s" | 1106 | l (format |
| 1107 | (tramp-shell-quote-argument cwd) | 1107 | "%s -sf %s %s" |
| 1108 | ln | 1108 | ln |
| 1109 | (tramp-shell-quote-argument filename) | 1109 | (tramp-shell-quote-argument filename) |
| 1110 | (tramp-shell-quote-argument l-localname)) | 1110 | ;; The command could exceed PATH_MAX, so we use |
| 1111 | t)))) | 1111 | ;; relative file names. However, relative file names |
| 1112 | ;; could start with "-". `tramp-shell-quote-argument' | ||
| 1113 | ;; does not handle this, we must do it ourselves. | ||
| 1114 | (tramp-shell-quote-argument | ||
| 1115 | (concat "./" (file-name-nondirectory l-localname))))))))) | ||
| 1112 | 1116 | ||
| 1113 | (defun tramp-sh-handle-file-truename (filename) | 1117 | (defun tramp-sh-handle-file-truename (filename) |
| 1114 | "Like `file-truename' for Tramp files." | 1118 | "Like `file-truename' for Tramp files." |
| @@ -1266,100 +1270,108 @@ target of the symlink differ." | |||
| 1266 | res-inode res-filemodes res-numlinks | 1270 | res-inode res-filemodes res-numlinks |
| 1267 | res-uid res-gid res-size res-symlink-target) | 1271 | res-uid res-gid res-size res-symlink-target) |
| 1268 | (tramp-message vec 5 "file attributes with ls: %s" localname) | 1272 | (tramp-message vec 5 "file attributes with ls: %s" localname) |
| 1269 | (tramp-send-command | 1273 | ;; We cannot send all three commands combined, it could exceed |
| 1270 | vec | 1274 | ;; NAME_MAX or PATH_MAX. Happened on Mac OS X, for example. |
| 1271 | (format "(%s %s || %s -h %s) && %s %s %s %s" | 1275 | (when (or (tramp-send-command-and-check |
| 1272 | (tramp-get-file-exists-command vec) | 1276 | vec |
| 1273 | (tramp-shell-quote-argument localname) | 1277 | (format "%s %s" |
| 1274 | (tramp-get-test-command vec) | 1278 | (tramp-get-file-exists-command vec) |
| 1275 | (tramp-shell-quote-argument localname) | 1279 | (tramp-shell-quote-argument localname))) |
| 1276 | (tramp-get-ls-command vec) | 1280 | (tramp-send-command-and-check |
| 1277 | (if (eq id-format 'integer) "-ildn" "-ild") | 1281 | vec |
| 1278 | ;; On systems which have no quoting style, file names | 1282 | (format "%s -h %s" |
| 1279 | ;; with special characters could fail. | 1283 | (tramp-get-test-command vec) |
| 1280 | (cond | 1284 | (tramp-shell-quote-argument localname)))) |
| 1281 | ((tramp-get-ls-command-with-quoting-style vec) | 1285 | (tramp-send-command |
| 1282 | "--quoting-style=c") | 1286 | vec |
| 1283 | ((tramp-get-ls-command-with-w-option vec) | 1287 | (format "%s %s %s %s" |
| 1284 | "-w") | 1288 | (tramp-get-ls-command vec) |
| 1285 | (t "")) | 1289 | (if (eq id-format 'integer) "-ildn" "-ild") |
| 1286 | (tramp-shell-quote-argument localname))) | 1290 | ;; On systems which have no quoting style, file names |
| 1287 | ;; Parse `ls -l' output ... | 1291 | ;; with special characters could fail. |
| 1288 | (with-current-buffer (tramp-get-buffer vec) | 1292 | (cond |
| 1289 | (when (> (buffer-size) 0) | 1293 | ((tramp-get-ls-command-with-quoting-style vec) |
| 1290 | (goto-char (point-min)) | 1294 | "--quoting-style=c") |
| 1291 | ;; ... inode | 1295 | ((tramp-get-ls-command-with-w-option vec) |
| 1292 | (setq res-inode | 1296 | "-w") |
| 1293 | (condition-case err | 1297 | (t "")) |
| 1294 | (read (current-buffer)) | 1298 | (tramp-shell-quote-argument localname))) |
| 1295 | (invalid-read-syntax | 1299 | ;; Parse `ls -l' output ... |
| 1296 | (when (and (equal (cadr err) | 1300 | (with-current-buffer (tramp-get-buffer vec) |
| 1297 | "Integer constant overflow in reader") | 1301 | (when (> (buffer-size) 0) |
| 1298 | (string-match | 1302 | (goto-char (point-min)) |
| 1299 | "^[0-9]+\\([0-9][0-9][0-9][0-9][0-9]\\)\\'" | 1303 | ;; ... inode |
| 1300 | (car (cddr err)))) | 1304 | (setq res-inode |
| 1301 | (let* ((big (read (substring (car (cddr err)) 0 | 1305 | (condition-case err |
| 1302 | (match-beginning 1)))) | 1306 | (read (current-buffer)) |
| 1303 | (small (read (match-string 1 (car (cddr err))))) | 1307 | (invalid-read-syntax |
| 1304 | (twiddle (/ small 65536))) | 1308 | (when (and (equal (cadr err) |
| 1305 | (cons (+ big twiddle) | 1309 | "Integer constant overflow in reader") |
| 1306 | (- small (* twiddle 65536)))))))) | 1310 | (string-match |
| 1307 | ;; ... file mode flags | 1311 | "^[0-9]+\\([0-9][0-9][0-9][0-9][0-9]\\)\\'" |
| 1308 | (setq res-filemodes (symbol-name (read (current-buffer)))) | 1312 | (car (cddr err)))) |
| 1309 | ;; ... number links | 1313 | (let* ((big (read (substring (car (cddr err)) 0 |
| 1310 | (setq res-numlinks (read (current-buffer))) | 1314 | (match-beginning 1)))) |
| 1311 | ;; ... uid and gid | 1315 | (small (read (match-string 1 (car (cddr err))))) |
| 1312 | (setq res-uid (read (current-buffer))) | 1316 | (twiddle (/ small 65536))) |
| 1313 | (setq res-gid (read (current-buffer))) | 1317 | (cons (+ big twiddle) |
| 1314 | (if (eq id-format 'integer) | 1318 | (- small (* twiddle 65536)))))))) |
| 1319 | ;; ... file mode flags | ||
| 1320 | (setq res-filemodes (symbol-name (read (current-buffer)))) | ||
| 1321 | ;; ... number links | ||
| 1322 | (setq res-numlinks (read (current-buffer))) | ||
| 1323 | ;; ... uid and gid | ||
| 1324 | (setq res-uid (read (current-buffer))) | ||
| 1325 | (setq res-gid (read (current-buffer))) | ||
| 1326 | (if (eq id-format 'integer) | ||
| 1327 | (progn | ||
| 1328 | (unless (numberp res-uid) (setq res-uid -1)) | ||
| 1329 | (unless (numberp res-gid) (setq res-gid -1))) | ||
| 1315 | (progn | 1330 | (progn |
| 1316 | (unless (numberp res-uid) (setq res-uid -1)) | 1331 | (unless (stringp res-uid) (setq res-uid (symbol-name res-uid))) |
| 1317 | (unless (numberp res-gid) (setq res-gid -1))) | 1332 | (unless (stringp res-gid) (setq res-gid (symbol-name res-gid))))) |
| 1318 | (progn | 1333 | ;; ... size |
| 1319 | (unless (stringp res-uid) (setq res-uid (symbol-name res-uid))) | 1334 | (setq res-size (read (current-buffer))) |
| 1320 | (unless (stringp res-gid) (setq res-gid (symbol-name res-gid))))) | 1335 | ;; From the file modes, figure out other stuff. |
| 1321 | ;; ... size | 1336 | (setq symlinkp (eq ?l (aref res-filemodes 0))) |
| 1322 | (setq res-size (read (current-buffer))) | 1337 | (setq dirp (eq ?d (aref res-filemodes 0))) |
| 1323 | ;; From the file modes, figure out other stuff. | 1338 | ;; If symlink, find out file name pointed to. |
| 1324 | (setq symlinkp (eq ?l (aref res-filemodes 0))) | 1339 | (when symlinkp |
| 1325 | (setq dirp (eq ?d (aref res-filemodes 0))) | 1340 | (search-forward "-> ") |
| 1326 | ;; If symlink, find out file name pointed to. | 1341 | (setq res-symlink-target |
| 1327 | (when symlinkp | 1342 | (if (tramp-get-ls-command-with-quoting-style vec) |
| 1328 | (search-forward "-> ") | 1343 | (read (current-buffer)) |
| 1329 | (setq res-symlink-target | 1344 | (buffer-substring (point) (point-at-eol))))) |
| 1330 | (if (tramp-get-ls-command-with-quoting-style vec) | 1345 | ;; Return data gathered. |
| 1331 | (read (current-buffer)) | 1346 | (list |
| 1332 | (buffer-substring (point) (point-at-eol))))) | 1347 | ;; 0. t for directory, string (name linked to) for symbolic |
| 1333 | ;; Return data gathered. | 1348 | ;; link, or nil. |
| 1334 | (list | 1349 | (or dirp res-symlink-target) |
| 1335 | ;; 0. t for directory, string (name linked to) for symbolic | 1350 | ;; 1. Number of links to file. |
| 1336 | ;; link, or nil. | 1351 | res-numlinks |
| 1337 | (or dirp res-symlink-target) | 1352 | ;; 2. File uid. |
| 1338 | ;; 1. Number of links to file. | 1353 | res-uid |
| 1339 | res-numlinks | 1354 | ;; 3. File gid. |
| 1340 | ;; 2. File uid. | 1355 | res-gid |
| 1341 | res-uid | 1356 | ;; 4. Last access time, as a list of integers. Normally |
| 1342 | ;; 3. File gid. | 1357 | ;; this would be in the same format as `current-time', but |
| 1343 | res-gid | 1358 | ;; the subseconds part is not currently implemented, and (0 |
| 1344 | ;; 4. Last access time, as a list of integers. Normally this | 1359 | ;; 0) denotes an unknown time. |
| 1345 | ;; would be in the same format as `current-time', but the | 1360 | ;; 5. Last modification time, likewise. |
| 1346 | ;; subseconds part is not currently implemented, and (0 0) | 1361 | ;; 6. Last status change time, likewise. |
| 1347 | ;; denotes an unknown time. | 1362 | '(0 0) '(0 0) '(0 0) ;CCC how to find out? |
| 1348 | ;; 5. Last modification time, likewise. | 1363 | ;; 7. Size in bytes (-1, if number is out of range). |
| 1349 | ;; 6. Last status change time, likewise. | 1364 | res-size |
| 1350 | '(0 0) '(0 0) '(0 0) ;CCC how to find out? | 1365 | ;; 8. File modes, as a string of ten letters or dashes as in ls -l. |
| 1351 | ;; 7. Size in bytes (-1, if number is out of range). | 1366 | res-filemodes |
| 1352 | res-size | 1367 | ;; 9. t if file's gid would change if file were deleted and |
| 1353 | ;; 8. File modes, as a string of ten letters or dashes as in ls -l. | 1368 | ;; recreated. Will be set in `tramp-convert-file-attributes'. |
| 1354 | res-filemodes | 1369 | t |
| 1355 | ;; 9. t if file's gid would change if file were deleted and | 1370 | ;; 10. Inode number. |
| 1356 | ;; recreated. Will be set in `tramp-convert-file-attributes'. | 1371 | res-inode |
| 1357 | t | 1372 | ;; 11. Device number. Will be replaced by a virtual device number. |
| 1358 | ;; 10. Inode number. | 1373 | -1 |
| 1359 | res-inode | 1374 | )))))) |
| 1360 | ;; 11. Device number. Will be replaced by a virtual device number. | ||
| 1361 | -1 | ||
| 1362 | ))))) | ||
| 1363 | 1375 | ||
| 1364 | (defun tramp-do-file-attributes-with-perl | 1376 | (defun tramp-do-file-attributes-with-perl |
| 1365 | (vec localname &optional id-format) | 1377 | (vec localname &optional id-format) |
| @@ -4214,10 +4226,8 @@ process to set up. VEC specifies the connection." | |||
| 4214 | (cons 'undecided 'undecided))) | 4226 | (cons 'undecided 'undecided))) |
| 4215 | cs-decode cs-encode) | 4227 | cs-decode cs-encode) |
| 4216 | (when (symbolp cs) (setq cs (cons cs cs))) | 4228 | (when (symbolp cs) (setq cs (cons cs cs))) |
| 4217 | (setq cs-decode (car cs)) | 4229 | (setq cs-decode (or (car cs) 'undecided) |
| 4218 | (setq cs-encode (cdr cs)) | 4230 | cs-encode (or (cdr cs) 'undecided)) |
| 4219 | (unless cs-decode (setq cs-decode 'undecided)) | ||
| 4220 | (unless cs-encode (setq cs-encode 'undecided)) | ||
| 4221 | (setq cs-encode | 4231 | (setq cs-encode |
| 4222 | (tramp-compat-coding-system-change-eol-conversion | 4232 | (tramp-compat-coding-system-change-eol-conversion |
| 4223 | cs-encode | 4233 | cs-encode |
| @@ -4229,7 +4239,13 @@ process to set up. VEC specifies the connection." | |||
| 4229 | (when (search-forward "\r" nil t) | 4239 | (when (search-forward "\r" nil t) |
| 4230 | (setq cs-decode (tramp-compat-coding-system-change-eol-conversion | 4240 | (setq cs-decode (tramp-compat-coding-system-change-eol-conversion |
| 4231 | cs-decode 'dos))) | 4241 | cs-decode 'dos))) |
| 4232 | (tramp-compat-funcall | 4242 | ;; Special setting for Mac OS X. |
| 4243 | (when (and (string-match | ||
| 4244 | "^Darwin" (tramp-get-connection-property vec "uname" "")) | ||
| 4245 | (memq 'utf-8-hfs (coding-system-list))) | ||
| 4246 | (setq cs-decode 'utf-8-hfs | ||
| 4247 | cs-encode 'utf-8-hfs)) | ||
| 4248 | (tramp-compat-funcall | ||
| 4233 | 'set-buffer-process-coding-system cs-decode cs-encode) | 4249 | 'set-buffer-process-coding-system cs-decode cs-encode) |
| 4234 | (tramp-message | 4250 | (tramp-message |
| 4235 | vec 5 "Setting coding system to `%s' and `%s'" cs-decode cs-encode)) | 4251 | vec 5 "Setting coding system to `%s' and `%s'" cs-decode cs-encode)) |
diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el index 941f98ebb69..8ed0bb3bbb4 100644 --- a/lisp/play/dunnet.el +++ b/lisp/play/dunnet.el | |||
| @@ -1203,7 +1203,7 @@ for a moment, then straighten yourself up. | |||
| 1203 | (interactive) | 1203 | (interactive) |
| 1204 | (forward-line (- 0 (- (window-height) 2 ))) | 1204 | (forward-line (- 0 (- (window-height) 2 ))) |
| 1205 | (set-window-start (selected-window) (point)) | 1205 | (set-window-start (selected-window) (point)) |
| 1206 | (end-of-buffer)) | 1206 | (goto-char (point-max))) |
| 1207 | 1207 | ||
| 1208 | ;;; Insert something into the buffer, followed by newline. | 1208 | ;;; Insert something into the buffer, followed by newline. |
| 1209 | 1209 | ||
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index c42fbe7e51f..2056f3907b8 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el | |||
| @@ -656,23 +656,35 @@ right side of it." | |||
| 656 | ;; Wrappers for common scan-lists cases, mainly because it's almost | 656 | ;; Wrappers for common scan-lists cases, mainly because it's almost |
| 657 | ;; impossible to get a feel for how that function works. | 657 | ;; impossible to get a feel for how that function works. |
| 658 | 658 | ||
| 659 | (defmacro c-go-list-forward () | 659 | (defmacro c-go-list-forward (&optional pos limit) |
| 660 | "Move backward across one balanced group of parentheses. | 660 | "Move forward across one balanced group of parentheses starting at POS or |
| 661 | 661 | point. Return POINT when we succeed, NIL when we fail. In the latter case, | |
| 662 | Return POINT when we succeed, NIL when we fail. In the latter case, leave | 662 | leave point unmoved. |
| 663 | point unmoved." | 663 | |
| 664 | `(c-safe (let ((endpos (scan-lists (point) 1 0))) | 664 | A LIMIT for the search may be given. The start position is assumed to be |
| 665 | (goto-char endpos) | 665 | before it." |
| 666 | endpos))) | 666 | (let ((res `(c-safe (goto-char (scan-lists ,(or pos `(point)) 1 0)) (point)))) |
| 667 | 667 | (if limit | |
| 668 | (defmacro c-go-list-backward () | 668 | `(save-restriction |
| 669 | "Move backward across one balanced group of parentheses. | 669 | (if ,limit |
| 670 | 670 | (narrow-to-region (point-min) ,limit)) | |
| 671 | Return POINT when we succeed, NIL when we fail. In the latter case, leave | 671 | ,res) |
| 672 | point unmoved." | 672 | res))) |
| 673 | `(c-safe (let ((endpos (scan-lists (point) -1 0))) | 673 | |
| 674 | (goto-char endpos) | 674 | (defmacro c-go-list-backward (&optional pos limit) |
| 675 | endpos))) | 675 | "Move backward across one balanced group of parentheses starting at POS or |
| 676 | point. Return POINT when we succeed, NIL when we fail. In the latter case, | ||
| 677 | leave point unmoved. | ||
| 678 | |||
| 679 | A LIMIT for the search may be given. The start position is assumed to be | ||
| 680 | after it." | ||
| 681 | (let ((res `(c-safe (goto-char (scan-lists ,(or pos `(point)) -1 0)) (point)))) | ||
| 682 | (if limit | ||
| 683 | `(save-restriction | ||
| 684 | (if ,limit | ||
| 685 | (narrow-to-region ,limit (point-max))) | ||
| 686 | ,res) | ||
| 687 | res))) | ||
| 676 | 688 | ||
| 677 | (defmacro c-up-list-forward (&optional pos limit) | 689 | (defmacro c-up-list-forward (&optional pos limit) |
| 678 | "Return the first position after the list sexp containing POS, | 690 | "Return the first position after the list sexp containing POS, |
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 3301d415923..b08c555e34f 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -5688,8 +5688,8 @@ comment at the start of cc-engine.el for more info." | |||
| 5688 | (c-backward-token-2) | 5688 | (c-backward-token-2) |
| 5689 | (setq c-restricted-<>-arglists | 5689 | (setq c-restricted-<>-arglists |
| 5690 | (and (not (looking-at c-opt-<>-sexp-key)) | 5690 | (and (not (looking-at c-opt-<>-sexp-key)) |
| 5691 | (progn (c-backward-syntactic-ws) ; to < or , | 5691 | (progn (c-backward-syntactic-ws) ; to ( or , |
| 5692 | (and (memq (char-before) '(?< ?,)) | 5692 | (and (memq (char-before) '(?\( ?,)) ; what about <? |
| 5693 | (not (eq (c-get-char-property (point) 'c-type) | 5693 | (not (eq (c-get-char-property (point) 'c-type) |
| 5694 | 'c-decl-arg-start))))))) | 5694 | 'c-decl-arg-start))))))) |
| 5695 | (or (c-forward-<>-arglist nil) | 5695 | (or (c-forward-<>-arglist nil) |
| @@ -6641,16 +6641,22 @@ comment at the start of cc-engine.el for more info." | |||
| 6641 | res)) | 6641 | res)) |
| 6642 | 6642 | ||
| 6643 | (defun c-forward-annotation () | 6643 | (defun c-forward-annotation () |
| 6644 | ;; Used for Java code only at the moment. Assumes point is on the | 6644 | ;; Used for Java code only at the moment. Assumes point is on the @, moves |
| 6645 | ;; @, moves forward an annotation. returns nil if there is no | 6645 | ;; forward an annotation and returns t. Leaves point unmoved and returns |
| 6646 | ;; annotation at point. | 6646 | ;; nil if there is no annotation at point. |
| 6647 | (and (looking-at "@") | 6647 | (let ((pos (point))) |
| 6648 | (progn (forward-char) t) | 6648 | (or |
| 6649 | (c-forward-type) | 6649 | (and (looking-at "@") |
| 6650 | (progn (c-forward-syntactic-ws) t) | 6650 | (not (looking-at c-keywords-regexp)) |
| 6651 | (if (looking-at "(") | 6651 | (progn (forward-char) t) |
| 6652 | (c-go-list-forward) | 6652 | (looking-at c-symbol-key) |
| 6653 | t))) | 6653 | (progn (goto-char (match-end 0)) |
| 6654 | (c-forward-syntactic-ws) | ||
| 6655 | t) | ||
| 6656 | (if (looking-at "(") | ||
| 6657 | (c-go-list-forward) | ||
| 6658 | t)) | ||
| 6659 | (progn (goto-char pos) nil)))) | ||
| 6654 | 6660 | ||
| 6655 | (defmacro c-pull-open-brace (ps) | 6661 | (defmacro c-pull-open-brace (ps) |
| 6656 | ;; Pull the next open brace from PS (which has the form of paren-state), | 6662 | ;; Pull the next open brace from PS (which has the form of paren-state), |
| @@ -6959,9 +6965,8 @@ comment at the start of cc-engine.el for more info." | |||
| 6959 | (when (or (looking-at c-prefix-spec-kwds-re) ;FIXME!!! includes auto | 6965 | (when (or (looking-at c-prefix-spec-kwds-re) ;FIXME!!! includes auto |
| 6960 | (and (c-major-mode-is 'java-mode) | 6966 | (and (c-major-mode-is 'java-mode) |
| 6961 | (looking-at "@[A-Za-z0-9]+"))) | 6967 | (looking-at "@[A-Za-z0-9]+"))) |
| 6962 | (save-match-data | 6968 | (if (save-match-data (looking-at c-typedef-key)) |
| 6963 | (if (looking-at c-typedef-key) | 6969 | (setq at-typedef t)) |
| 6964 | (setq at-typedef t))) | ||
| 6965 | (setq kwd-sym (c-keyword-sym (match-string 1))) | 6970 | (setq kwd-sym (c-keyword-sym (match-string 1))) |
| 6966 | (save-excursion | 6971 | (save-excursion |
| 6967 | (c-forward-keyword-clause 1) | 6972 | (c-forward-keyword-clause 1) |
| @@ -9106,6 +9111,11 @@ comment at the start of cc-engine.el for more info." | |||
| 9106 | (goto-char containing-sexp) | 9111 | (goto-char containing-sexp) |
| 9107 | (if (or (save-excursion | 9112 | (if (or (save-excursion |
| 9108 | (c-backward-syntactic-ws lim) | 9113 | (c-backward-syntactic-ws lim) |
| 9114 | (while (and (eq (char-before) ?>) | ||
| 9115 | (c-get-char-property (1- (point)) | ||
| 9116 | 'syntax-table) | ||
| 9117 | (c-go-list-backward nil lim)) | ||
| 9118 | (c-backward-syntactic-ws lim)) | ||
| 9109 | (and (> (point) (or lim (point-min))) | 9119 | (and (> (point) (or lim (point-min))) |
| 9110 | (c-on-identifier))) | 9120 | (c-on-identifier))) |
| 9111 | (and c-special-brace-lists | 9121 | (and c-special-brace-lists |
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index f74e5cbf678..03e67a99515 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el | |||
| @@ -1157,15 +1157,6 @@ casts and declarations are fontified. Used on level 2 and higher." | |||
| 1157 | (setq pos (point)))))) ; acts to make the `while' form continue. | 1157 | (setq pos (point)))))) ; acts to make the `while' form continue. |
| 1158 | nil) | 1158 | nil) |
| 1159 | 1159 | ||
| 1160 | (defconst c-font-lock-maybe-decl-faces | ||
| 1161 | ;; List of faces that might be put at the start of a type when | ||
| 1162 | ;; `c-font-lock-declarations' runs. This needs to be evaluated to | ||
| 1163 | ;; ensure that face name aliases in Emacs are resolved. | ||
| 1164 | (list nil | ||
| 1165 | font-lock-type-face | ||
| 1166 | c-reference-face-name | ||
| 1167 | font-lock-keyword-face)) | ||
| 1168 | |||
| 1169 | (defun c-font-lock-declarations (limit) | 1160 | (defun c-font-lock-declarations (limit) |
| 1170 | ;; Fontify all the declarations, casts and labels from the point to LIMIT. | 1161 | ;; Fontify all the declarations, casts and labels from the point to LIMIT. |
| 1171 | ;; Assumes that strings and comments have been fontified already. | 1162 | ;; Assumes that strings and comments have been fontified already. |
| @@ -1256,7 +1247,7 @@ casts and declarations are fontified. Used on level 2 and higher." | |||
| 1256 | (c-find-decl-spots | 1247 | (c-find-decl-spots |
| 1257 | limit | 1248 | limit |
| 1258 | c-decl-start-re | 1249 | c-decl-start-re |
| 1259 | c-font-lock-maybe-decl-faces | 1250 | (eval c-maybe-decl-faces) |
| 1260 | 1251 | ||
| 1261 | (lambda (match-pos inside-macro) | 1252 | (lambda (match-pos inside-macro) |
| 1262 | ;; Note to maintainers: don't use `limit' inside this lambda form; | 1253 | ;; Note to maintainers: don't use `limit' inside this lambda form; |
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 08d84fbb625..b52da3f662d 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el | |||
| @@ -3251,6 +3251,19 @@ way." | |||
| 3251 | objc t) | 3251 | objc t) |
| 3252 | (c-lang-defvar c-type-decl-end-used (c-lang-const c-type-decl-end-used)) | 3252 | (c-lang-defvar c-type-decl-end-used (c-lang-const c-type-decl-end-used)) |
| 3253 | 3253 | ||
| 3254 | (c-lang-defconst c-maybe-decl-faces | ||
| 3255 | "List of faces that might be put at the start of a type when | ||
| 3256 | `c-font-lock-declarations' runs. This must be evaluated (with `eval') at | ||
| 3257 | runtime to get the actual list of faces. This ensures that face name | ||
| 3258 | aliases in Emacs are resolved." | ||
| 3259 | t '(list nil | ||
| 3260 | font-lock-type-face | ||
| 3261 | c-reference-face-name | ||
| 3262 | font-lock-keyword-face) | ||
| 3263 | java (append (c-lang-const c-maybe-decl-faces) | ||
| 3264 | '(font-lock-preprocessor-face))) | ||
| 3265 | (c-lang-defvar c-maybe-decl-faces (c-lang-const c-maybe-decl-faces)) | ||
| 3266 | |||
| 3254 | 3267 | ||
| 3255 | ;;; Wrap up the `c-lang-defvar' system. | 3268 | ;;; Wrap up the `c-lang-defvar' system. |
| 3256 | 3269 | ||
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 644065911dd..738870b727a 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -1336,12 +1336,13 @@ This function is called from `c-common-init', once per mode initialization." | |||
| 1336 | . c-mark-function))) | 1336 | . c-mark-function))) |
| 1337 | 1337 | ||
| 1338 | ;; Prevent `font-lock-default-fontify-region' extending the region it will | 1338 | ;; Prevent `font-lock-default-fontify-region' extending the region it will |
| 1339 | ;; fontify to whole lines by removing `font-lock-extend-region-whole-lines' | 1339 | ;; fontify to whole lines by removing `font-lock-extend-region-wholelines' |
| 1340 | ;; (and, coincidentally, `font-lock-extend-region-multiline' (which we do | 1340 | ;; from `font-lock-extend-region-functions'. (Emacs only). This fixes |
| 1341 | ;; not need)) from `font-lock-extend-region-functions'. (Emacs only). This | 1341 | ;; Emacs bug #19669. |
| 1342 | ;; fixes Emacs bug #19669. | ||
| 1343 | (when (boundp 'font-lock-extend-region-functions) | 1342 | (when (boundp 'font-lock-extend-region-functions) |
| 1344 | (setq font-lock-extend-region-functions nil)) | 1343 | (setq font-lock-extend-region-functions |
| 1344 | (delq 'font-lock-extend-region-wholelines | ||
| 1345 | font-lock-extend-region-functions))) | ||
| 1345 | 1346 | ||
| 1346 | (make-local-variable 'font-lock-fontify-region-function) | 1347 | (make-local-variable 'font-lock-fontify-region-function) |
| 1347 | (setq font-lock-fontify-region-function 'c-font-lock-fontify-region) | 1348 | (setq font-lock-fontify-region-function 'c-font-lock-fontify-region) |
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index d77158761eb..fe28ed776b2 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el | |||
| @@ -27,6 +27,11 @@ | |||
| 27 | ;; current project, without having to know which package handles | 27 | ;; current project, without having to know which package handles |
| 28 | ;; detection of that project type, parsing its config files, etc. | 28 | ;; detection of that project type, parsing its config files, etc. |
| 29 | ;; | 29 | ;; |
| 30 | ;; NOTE: The project API is still experimental and can change in major, | ||
| 31 | ;; backward-incompatible ways. Everyone is encouraged to try it, and | ||
| 32 | ;; report to us any problems or use cases we hadn't anticipated, by | ||
| 33 | ;; sending an email to emacs-devel, or `M-x report-emacs-bug'. | ||
| 34 | ;; | ||
| 30 | ;; Infrastructure: | 35 | ;; Infrastructure: |
| 31 | ;; | 36 | ;; |
| 32 | ;; Function `project-current', to determine the current project | 37 | ;; Function `project-current', to determine the current project |
| @@ -45,10 +50,12 @@ | |||
| 45 | 50 | ||
| 46 | ;;; TODO: | 51 | ;;; TODO: |
| 47 | 52 | ||
| 48 | ;; * Commands `project-find-file' and `project-or-external-find-file'. | 53 | ;; * Reliably cache the list of files in the project, probably using |
| 49 | ;; Currently blocked on adding a new completion style that would let | 54 | ;; filenotify.el (if supported) to invalidate. And avoiding caching |
| 50 | ;; the user enter just the base file name (or a part of it), and get | 55 | ;; if it's not available (manual cache invalidation is not nice). |
| 51 | ;; it expanded to the absolute file name. | 56 | ;; |
| 57 | ;; * Allow the backend to override the file-listing logic? Maybe also | ||
| 58 | ;; to delegate file name completion to an external tool. | ||
| 52 | ;; | 59 | ;; |
| 53 | ;; * Build tool related functionality. Start with a `project-build' | 60 | ;; * Build tool related functionality. Start with a `project-build' |
| 54 | ;; command, which should provide completions on tasks to run, and | 61 | ;; command, which should provide completions on tasks to run, and |
| @@ -251,13 +258,15 @@ DIRS must contain directory names." | |||
| 251 | (defun project--value-in-dir (var dir) | 258 | (defun project--value-in-dir (var dir) |
| 252 | (with-temp-buffer | 259 | (with-temp-buffer |
| 253 | (setq default-directory dir) | 260 | (setq default-directory dir) |
| 254 | (hack-dir-local-variables-non-file-buffer) | 261 | (let ((enable-local-variables :all)) |
| 262 | (hack-dir-local-variables-non-file-buffer)) | ||
| 255 | (symbol-value var))) | 263 | (symbol-value var))) |
| 256 | 264 | ||
| 257 | (declare-function grep-read-files "grep") | 265 | (declare-function grep-read-files "grep") |
| 258 | (declare-function xref-collect-matches "xref") | 266 | (declare-function xref-collect-matches "xref") |
| 259 | (declare-function xref--show-xrefs "xref") | 267 | (declare-function xref--show-xrefs "xref") |
| 260 | (declare-function xref-backend-identifier-at-point "xref") | 268 | (declare-function xref-backend-identifier-at-point "xref") |
| 269 | (declare-function xref--find-ignores-arguments "xref") | ||
| 261 | 270 | ||
| 262 | ;;;###autoload | 271 | ;;;###autoload |
| 263 | (defun project-find-regexp (regexp) | 272 | (defun project-find-regexp (regexp) |
| @@ -302,5 +311,53 @@ pattern to search for." | |||
| 302 | (user-error "No matches for: %s" regexp)) | 311 | (user-error "No matches for: %s" regexp)) |
| 303 | (xref--show-xrefs xrefs nil))) | 312 | (xref--show-xrefs xrefs nil))) |
| 304 | 313 | ||
| 314 | ;;;###autoload | ||
| 315 | (defun project-find-file () | ||
| 316 | "Visit a file in the current project's roots. | ||
| 317 | |||
| 318 | This is like `find-file', but it limits the file-name completion | ||
| 319 | candidates to the files within the current project roots." | ||
| 320 | (interactive) | ||
| 321 | (let* ((pr (project-current t)) | ||
| 322 | (dirs (project-roots pr))) | ||
| 323 | (project--find-file-in dirs pr))) | ||
| 324 | |||
| 325 | ;;;###autoload | ||
| 326 | (defun project-or-external-find-file () | ||
| 327 | "Visit a file in the current project's roots or external roots. | ||
| 328 | |||
| 329 | This is like `find-file', but it limits the file-name completion | ||
| 330 | candidates to the files within the current project roots and external roots." | ||
| 331 | (interactive) | ||
| 332 | (let* ((pr (project-current t)) | ||
| 333 | (dirs (append | ||
| 334 | (project-roots pr) | ||
| 335 | (project-external-roots pr)))) | ||
| 336 | (project--find-file-in dirs pr))) | ||
| 337 | |||
| 338 | ;; FIXME: Uniquely abbreviate the roots? | ||
| 339 | (defun project--find-file-in (dirs project) | ||
| 340 | (require 'xref) | ||
| 341 | (let* ((all-files | ||
| 342 | (cl-mapcan | ||
| 343 | (lambda (dir) | ||
| 344 | (let ((command | ||
| 345 | (format "%s %s %s -type f -print0" | ||
| 346 | find-program | ||
| 347 | dir | ||
| 348 | (xref--find-ignores-arguments | ||
| 349 | (project-ignores project dir) | ||
| 350 | (expand-file-name dir))))) | ||
| 351 | (split-string (shell-command-to-string command) "\0" t))) | ||
| 352 | dirs)) | ||
| 353 | (table (lambda (string pred action) | ||
| 354 | (cond | ||
| 355 | ((eq action 'metadata) | ||
| 356 | '(metadata . ((category . project-file)))) | ||
| 357 | (t | ||
| 358 | (complete-with-action action all-files string pred)))))) | ||
| 359 | (find-file | ||
| 360 | (completing-read "Find file: " table nil t)))) | ||
| 361 | |||
| 305 | (provide 'project) | 362 | (provide 'project) |
| 306 | ;;; project.el ends here | 363 | ;;; project.el ends here |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 02d329d794d..7f89ab2762c 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -2115,7 +2115,11 @@ May return nil if the line should not be treated as continued." | |||
| 2115 | ;; sh-indent-after-done: aligned completely differently. | 2115 | ;; sh-indent-after-done: aligned completely differently. |
| 2116 | (`(:after . "in") (sh-var-value 'sh-indent-for-case-label)) | 2116 | (`(:after . "in") (sh-var-value 'sh-indent-for-case-label)) |
| 2117 | ;; sh-indent-for-continuation: Line continuations are handled differently. | 2117 | ;; sh-indent-for-continuation: Line continuations are handled differently. |
| 2118 | (`(:after . ,(or `"(" `"{" `"[")) (sh-var-value 'sh-indent-after-open)) | 2118 | (`(:after . ,(or `"(" `"{" `"[")) |
| 2119 | (if (not (looking-at ".[ \t]*[^\n \t#]")) | ||
| 2120 | (sh-var-value 'sh-indent-after-open) | ||
| 2121 | (goto-char (1- (match-end 0))) | ||
| 2122 | `(column . ,(current-column)))) | ||
| 2119 | ;; sh-indent-after-function: we don't handle it differently. | 2123 | ;; sh-indent-after-function: we don't handle it differently. |
| 2120 | )) | 2124 | )) |
| 2121 | 2125 | ||
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index ae5ec61520d..fe39122d24f 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el | |||
| @@ -208,7 +208,7 @@ LENGTH is the match length, in characters." | |||
| 208 | 208 | ||
| 209 | (defvar xref-backend-functions nil | 209 | (defvar xref-backend-functions nil |
| 210 | "Special hook to find the xref backend for the current context. | 210 | "Special hook to find the xref backend for the current context. |
| 211 | Each functions on this hook is called in turn with no arguments | 211 | Each function on this hook is called in turn with no arguments, |
| 212 | and should return either nil to mean that it is not applicable, | 212 | and should return either nil to mean that it is not applicable, |
| 213 | or an xref backend, which is a value to be used to dispatch the | 213 | or an xref backend, which is a value to be used to dispatch the |
| 214 | generic functions.") | 214 | generic functions.") |
| @@ -502,10 +502,14 @@ WINDOW controls how the buffer is displayed: | |||
| 502 | (xref--pop-to-location xref window))) | 502 | (xref--pop-to-location xref window))) |
| 503 | 503 | ||
| 504 | (defun xref-query-replace (from to) | 504 | (defun xref-query-replace (from to) |
| 505 | "Perform interactive replacement in all current matches." | 505 | "Perform interactive replacement of FROM with TO in all displayed xrefs. |
| 506 | |||
| 507 | This command interactively replaces FROM with TO in the names of the | ||
| 508 | references displayed in the current *xref* buffer." | ||
| 506 | (interactive | 509 | (interactive |
| 507 | (list (read-regexp "Query replace regexp in matches" ".*") | 510 | (let ((fr (read-regexp "Xref query-replace (regexp)" ".*"))) |
| 508 | (read-regexp "Replace with: "))) | 511 | (list fr |
| 512 | (read-regexp (format "Xref query-replace (regexp) %s with: " fr))))) | ||
| 509 | (let (pairs item) | 513 | (let (pairs item) |
| 510 | (unwind-protect | 514 | (unwind-protect |
| 511 | (progn | 515 | (progn |
| @@ -762,12 +766,10 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)." | |||
| 762 | With prefix argument or when there's no identifier at point, | 766 | With prefix argument or when there's no identifier at point, |
| 763 | prompt for it. | 767 | prompt for it. |
| 764 | 768 | ||
| 765 | If the backend has sufficient information to determine a unique | 769 | If sufficient information is available to determine a unique |
| 766 | definition for IDENTIFIER, it returns only that definition. If | 770 | definition for IDENTIFIER, display it in the selected window. |
| 767 | there are multiple possible definitions, it returns all of them. | 771 | Otherwise, display the list of the possible definitions in a |
| 768 | 772 | buffer where the user can select from the list." | |
| 769 | If the backend returns one definition, jump to it; otherwise, | ||
| 770 | display the list in a buffer." | ||
| 771 | (interactive (list (xref--read-identifier "Find definitions of: "))) | 773 | (interactive (list (xref--read-identifier "Find definitions of: "))) |
| 772 | (xref--find-definitions identifier nil)) | 774 | (xref--find-definitions identifier nil)) |
| 773 | 775 | ||
| @@ -876,7 +878,9 @@ IGNORES is a list of glob patterns." | |||
| 876 | grep-find-template t t)) | 878 | grep-find-template t t)) |
| 877 | (grep-highlight-matches nil) | 879 | (grep-highlight-matches nil) |
| 878 | (command (xref--rgrep-command (xref--regexp-to-extended regexp) | 880 | (command (xref--rgrep-command (xref--regexp-to-extended regexp) |
| 879 | files dir ignores)) | 881 | files |
| 882 | (expand-file-name dir) | ||
| 883 | ignores)) | ||
| 880 | (orig-buffers (buffer-list)) | 884 | (orig-buffers (buffer-list)) |
| 881 | (buf (get-buffer-create " *xref-grep*")) | 885 | (buf (get-buffer-create " *xref-grep*")) |
| 882 | (grep-re (caar grep-regexp-alist)) | 886 | (grep-re (caar grep-regexp-alist)) |
| @@ -912,23 +916,28 @@ IGNORES is a list of glob patterns." | |||
| 912 | " " | 916 | " " |
| 913 | (shell-quote-argument ")")) | 917 | (shell-quote-argument ")")) |
| 914 | dir | 918 | dir |
| 915 | (concat | 919 | (xref--find-ignores-arguments ignores dir))) |
| 916 | (shell-quote-argument "(") | 920 | |
| 917 | " -path " | 921 | (defun xref--find-ignores-arguments (ignores dir) |
| 918 | (mapconcat | 922 | ;; `shell-quote-argument' quotes the tilde as well. |
| 919 | (lambda (ignore) | 923 | (cl-assert (not (string-match-p "\\`~" dir))) |
| 920 | (when (string-match-p "/\\'" ignore) | 924 | (concat |
| 921 | (setq ignore (concat ignore "*"))) | 925 | (shell-quote-argument "(") |
| 922 | (if (string-match "\\`\\./" ignore) | 926 | " -path " |
| 923 | (setq ignore (replace-match dir t t ignore)) | 927 | (mapconcat |
| 924 | (unless (string-prefix-p "*" ignore) | 928 | (lambda (ignore) |
| 925 | (setq ignore (concat "*/" ignore)))) | 929 | (when (string-match-p "/\\'" ignore) |
| 926 | (shell-quote-argument ignore)) | 930 | (setq ignore (concat ignore "*"))) |
| 927 | ignores | 931 | (if (string-match "\\`\\./" ignore) |
| 928 | " -o -path ") | 932 | (setq ignore (replace-match dir t t ignore)) |
| 929 | " " | 933 | (unless (string-prefix-p "*" ignore) |
| 930 | (shell-quote-argument ")") | 934 | (setq ignore (concat "*/" ignore)))) |
| 931 | " -prune -o "))) | 935 | (shell-quote-argument ignore)) |
| 936 | ignores | ||
| 937 | " -o -path ") | ||
| 938 | " " | ||
| 939 | (shell-quote-argument ")") | ||
| 940 | " -prune -o ")) | ||
| 932 | 941 | ||
| 933 | (defun xref--regexp-to-extended (str) | 942 | (defun xref--regexp-to-extended (str) |
| 934 | (replace-regexp-in-string | 943 | (replace-regexp-in-string |
diff --git a/lisp/startup.el b/lisp/startup.el index 61f6db74f2e..15a79f6f5bf 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -76,13 +76,24 @@ once you are familiar with the contents of the startup screen." | |||
| 76 | 76 | ||
| 77 | (defvar startup-screen-inhibit-startup-screen nil) | 77 | (defvar startup-screen-inhibit-startup-screen nil) |
| 78 | 78 | ||
| 79 | ;; FIXME? Why does this get such weirdly extreme treatment, when the | 79 | ;; The mechanism used to ensure that only end users can disable this |
| 80 | ;; more important inhibit-startup-screen does not. | 80 | ;; message is not complex. Clearly, it is possible for a determined |
| 81 | ;; system administrator to inhibit this message anyway, but at least | ||
| 82 | ;; they will do so with knowledge of why the Emacs developers think | ||
| 83 | ;; this is a bad idea. | ||
| 81 | (defcustom inhibit-startup-echo-area-message nil | 84 | (defcustom inhibit-startup-echo-area-message nil |
| 82 | "Non-nil inhibits the initial startup echo area message. | 85 | "Non-nil inhibits the initial startup echo area message. |
| 83 | Setting this variable takes effect | 86 | |
| 84 | only if you do it with the customization buffer | 87 | The startup message is in the echo area as it provides information |
| 85 | or if your init file contains a line of this form: | 88 | about GNU Emacs and the GNU system in general, which we want all |
| 89 | users to see. As this is the least intrusive startup message, | ||
| 90 | this variable gets specialized treatment to prevent the message | ||
| 91 | from being disabled site-wide by systems administrators, while | ||
| 92 | still allowing individual users to do so. | ||
| 93 | |||
| 94 | Setting this variable takes effect only if you do it with the | ||
| 95 | customization buffer or if your init file contains a line of this | ||
| 96 | form: | ||
| 86 | (setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\") | 97 | (setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\") |
| 87 | If your init file is byte-compiled, use the following form | 98 | If your init file is byte-compiled, use the following form |
| 88 | instead: | 99 | instead: |
diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el index a5fe9563afb..45e863340a5 100644 --- a/lisp/vc/add-log.el +++ b/lisp/vc/add-log.el | |||
| @@ -481,9 +481,10 @@ try to visit the file for the change under `point' instead." | |||
| 481 | (apply 'change-log-goto-source-1 | 481 | (apply 'change-log-goto-source-1 |
| 482 | (append change-log-find-head change-log-find-tail)) | 482 | (append change-log-find-head change-log-find-tail)) |
| 483 | (error | 483 | (error |
| 484 | "Cannot find more matches for tag `%s' in file `%s'" | 484 | (format-message |
| 485 | (car change-log-find-head) | 485 | "Cannot find more matches for tag `%s' in file `%s'" |
| 486 | (nth 2 change-log-find-head)))) | 486 | (car change-log-find-head) |
| 487 | (nth 2 change-log-find-head))))) | ||
| 487 | (save-excursion | 488 | (save-excursion |
| 488 | (let* ((at (point)) | 489 | (let* ((at (point)) |
| 489 | (tag-at (change-log-search-tag-name)) | 490 | (tag-at (change-log-search-tag-name)) |
| @@ -515,8 +516,9 @@ try to visit the file for the change under `point' instead." | |||
| 515 | (condition-case nil | 516 | (condition-case nil |
| 516 | (setq change-log-find-tail | 517 | (setq change-log-find-tail |
| 517 | (apply 'change-log-goto-source-1 change-log-find-head)) | 518 | (apply 'change-log-goto-source-1 change-log-find-head)) |
| 518 | (error "Cannot find matches for tag `%s' in file `%s'" | 519 | (error |
| 519 | tag file)))))))) | 520 | (format-message "Cannot find matches for tag `%s' in file `%s'" |
| 521 | tag file))))))))) | ||
| 520 | 522 | ||
| 521 | (defun change-log-next-error (&optional argp reset) | 523 | (defun change-log-next-error (&optional argp reset) |
| 522 | "Move to the Nth (default 1) next match in a ChangeLog buffer. | 524 | "Move to the Nth (default 1) next match in a ChangeLog buffer. |
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 8a0a9f91a48..8cb3547b13b 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el | |||
| @@ -131,7 +131,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." | |||
| 131 | :version "23.1" | 131 | :version "23.1" |
| 132 | :group 'vc-hg) | 132 | :group 'vc-hg) |
| 133 | 133 | ||
| 134 | (defcustom vc-hg-annotate-switches nil | 134 | (defcustom vc-hg-annotate-switches '("-u" "--follow") |
| 135 | "String or list of strings specifying switches for hg annotate under VC. | 135 | "String or list of strings specifying switches for hg annotate under VC. |
| 136 | If nil, use the value of `vc-annotate-switches'. If t, use no | 136 | If nil, use the value of `vc-annotate-switches'. If t, use no |
| 137 | switches." | 137 | switches." |
| @@ -380,36 +380,44 @@ If LIMIT is non-nil, show no more than this many entries." | |||
| 380 | (defun vc-hg-annotate-command (file buffer &optional revision) | 380 | (defun vc-hg-annotate-command (file buffer &optional revision) |
| 381 | "Execute \"hg annotate\" on FILE, inserting the contents in BUFFER. | 381 | "Execute \"hg annotate\" on FILE, inserting the contents in BUFFER. |
| 382 | Optional arg REVISION is a revision to annotate from." | 382 | Optional arg REVISION is a revision to annotate from." |
| 383 | (apply #'vc-hg-command buffer 0 file "annotate" "-d" "-n" "--follow" | 383 | (apply #'vc-hg-command buffer 0 file "annotate" "-dq" "-n" |
| 384 | (append (vc-switches 'hg 'annotate) | 384 | (append (vc-switches 'hg 'annotate) |
| 385 | (if revision (list (concat "-r" revision)))))) | 385 | (if revision (list (concat "-r" revision)))))) |
| 386 | 386 | ||
| 387 | (declare-function vc-annotate-convert-time "vc-annotate" (&optional time)) | 387 | (declare-function vc-annotate-convert-time "vc-annotate" (&optional time)) |
| 388 | 388 | ||
| 389 | ;; The format for one line output by "hg annotate -d -n" looks like this: | 389 | ;; One line printed by "hg annotate -dq -n -u --follow" looks like this: |
| 390 | ;;215 Wed Jun 20 21:22:58 2007 -0700: CONTENTS | 390 | ;; b56girard 114590 2012-03-13 CLOBBER: Lorem ipsum dolor sit |
| 391 | ;; i.e: VERSION_NUMBER DATE: CONTENTS | 391 | ;; i.e. AUTHOR REVISION DATE FILENAME: CONTENTS |
| 392 | ;; If the user has set the "--follow" option, the output looks like: | 392 | ;; The user can omit options "-u" and/or "--follow". Then it'll look like: |
| 393 | ;;215 Wed Jun 20 21:22:58 2007 -0700 foo.c: CONTENTS | 393 | ;; 114590 2012-03-13 CLOBBER: |
| 394 | ;; i.e. VERSION_NUMBER DATE FILENAME: CONTENTS | 394 | ;; or |
| 395 | ;; b56girard 114590 2012-03-13: | ||
| 395 | (defconst vc-hg-annotate-re | 396 | (defconst vc-hg-annotate-re |
| 396 | "^[ \t]*\\([0-9]+\\) \\(.\\{30\\}\\)\\(?:\\(: \\)\\|\\(?: +\\([^:\n]+\\(?::\\(?:[^: \n][^:\n]*\\)?\\)*\\): \\)\\)") | 397 | (concat |
| 398 | "^\\(?: *[^ ]+ +\\)?\\([0-9]+\\) " ;User and revision. | ||
| 399 | "\\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\\)" ;Date. | ||
| 400 | "\\(?: +\\([^:]+\\)\\)?:")) ;Filename. | ||
| 397 | 401 | ||
| 398 | (defun vc-hg-annotate-time () | 402 | (defun vc-hg-annotate-time () |
| 399 | (when (looking-at vc-hg-annotate-re) | 403 | (when (looking-at vc-hg-annotate-re) |
| 400 | (goto-char (match-end 0)) | 404 | (goto-char (match-end 0)) |
| 401 | (vc-annotate-convert-time | 405 | (vc-annotate-convert-time |
| 402 | (date-to-time (match-string-no-properties 2))))) | 406 | (let ((str (match-string-no-properties 2))) |
| 407 | (encode-time 0 0 0 | ||
| 408 | (string-to-number (substring str 6 8)) | ||
| 409 | (string-to-number (substring str 4 6)) | ||
| 410 | (string-to-number (substring str 0 4))))))) | ||
| 403 | 411 | ||
| 404 | (defun vc-hg-annotate-extract-revision-at-line () | 412 | (defun vc-hg-annotate-extract-revision-at-line () |
| 405 | (save-excursion | 413 | (save-excursion |
| 406 | (beginning-of-line) | 414 | (beginning-of-line) |
| 407 | (when (looking-at vc-hg-annotate-re) | 415 | (when (looking-at vc-hg-annotate-re) |
| 408 | (if (match-beginning 3) | 416 | (if (match-beginning 3) |
| 409 | (match-string-no-properties 1) | 417 | (cons (match-string-no-properties 1) |
| 410 | (cons (match-string-no-properties 1) | 418 | (expand-file-name (match-string-no-properties 3) |
| 411 | (expand-file-name (match-string-no-properties 4) | 419 | (vc-hg-root default-directory))) |
| 412 | (vc-hg-root default-directory))))))) | 420 | (match-string-no-properties 1))))) |
| 413 | 421 | ||
| 414 | ;;; Tag system | 422 | ;;; Tag system |
| 415 | 423 | ||
diff --git a/src/alloc.c b/src/alloc.c index 9ec44b8a2c3..03dacc77c6e 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -3732,7 +3732,7 @@ make_event_array (ptrdiff_t nargs, Lisp_Object *args) | |||
| 3732 | #ifdef HAVE_MODULES | 3732 | #ifdef HAVE_MODULES |
| 3733 | /* Create a new module user ptr object. */ | 3733 | /* Create a new module user ptr object. */ |
| 3734 | Lisp_Object | 3734 | Lisp_Object |
| 3735 | make_user_ptr (void (*finalizer) (void*), void *p) | 3735 | make_user_ptr (void (*finalizer) (void *), void *p) |
| 3736 | { | 3736 | { |
| 3737 | Lisp_Object obj; | 3737 | Lisp_Object obj; |
| 3738 | struct Lisp_User_Ptr *uptr; | 3738 | struct Lisp_User_Ptr *uptr; |
| @@ -4594,6 +4594,10 @@ maybe_lisp_pointer (void *p) | |||
| 4594 | return (uintptr_t) p % GCALIGNMENT == 0; | 4594 | return (uintptr_t) p % GCALIGNMENT == 0; |
| 4595 | } | 4595 | } |
| 4596 | 4596 | ||
| 4597 | #ifndef HAVE_MODULES | ||
| 4598 | enum { HAVE_MODULES = false }; | ||
| 4599 | #endif | ||
| 4600 | |||
| 4597 | /* If P points to Lisp data, mark that as live if it isn't already | 4601 | /* If P points to Lisp data, mark that as live if it isn't already |
| 4598 | marked. */ | 4602 | marked. */ |
| 4599 | 4603 | ||
| @@ -4607,8 +4611,17 @@ mark_maybe_pointer (void *p) | |||
| 4607 | VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p)); | 4611 | VALGRIND_MAKE_MEM_DEFINED (&p, sizeof (p)); |
| 4608 | #endif | 4612 | #endif |
| 4609 | 4613 | ||
| 4610 | if (!maybe_lisp_pointer (p)) | 4614 | if (sizeof (Lisp_Object) == sizeof (void *) || !HAVE_MODULES) |
| 4611 | return; | 4615 | { |
| 4616 | if (!maybe_lisp_pointer (p)) | ||
| 4617 | return; | ||
| 4618 | } | ||
| 4619 | else | ||
| 4620 | { | ||
| 4621 | /* For the wide-int case, also mark emacs_value tagged pointers, | ||
| 4622 | which can be generated by emacs-module.c's value_to_lisp. */ | ||
| 4623 | p = (void *) ((uintptr_t) p & ~(GCALIGNMENT - 1)); | ||
| 4624 | } | ||
| 4612 | 4625 | ||
| 4613 | m = mem_find (p); | 4626 | m = mem_find (p); |
| 4614 | if (m != MEM_NIL) | 4627 | if (m != MEM_NIL) |
| @@ -4685,8 +4698,7 @@ mark_maybe_pointer (void *p) | |||
| 4685 | static void ATTRIBUTE_NO_SANITIZE_ADDRESS | 4698 | static void ATTRIBUTE_NO_SANITIZE_ADDRESS |
| 4686 | mark_memory (void *start, void *end) | 4699 | mark_memory (void *start, void *end) |
| 4687 | { | 4700 | { |
| 4688 | void **pp; | 4701 | char *pp; |
| 4689 | int i; | ||
| 4690 | 4702 | ||
| 4691 | /* Make START the pointer to the start of the memory region, | 4703 | /* Make START the pointer to the start of the memory region, |
| 4692 | if it isn't already. */ | 4704 | if it isn't already. */ |
| @@ -4697,6 +4709,8 @@ mark_memory (void *start, void *end) | |||
| 4697 | end = tem; | 4709 | end = tem; |
| 4698 | } | 4710 | } |
| 4699 | 4711 | ||
| 4712 | eassert (((uintptr_t) start) % GC_POINTER_ALIGNMENT == 0); | ||
| 4713 | |||
| 4700 | /* Mark Lisp data pointed to. This is necessary because, in some | 4714 | /* Mark Lisp data pointed to. This is necessary because, in some |
| 4701 | situations, the C compiler optimizes Lisp objects away, so that | 4715 | situations, the C compiler optimizes Lisp objects away, so that |
| 4702 | only a pointer to them remains. Example: | 4716 | only a pointer to them remains. Example: |
| @@ -4715,13 +4729,11 @@ mark_memory (void *start, void *end) | |||
| 4715 | away. The only reference to the life string is through the | 4729 | away. The only reference to the life string is through the |
| 4716 | pointer `s'. */ | 4730 | pointer `s'. */ |
| 4717 | 4731 | ||
| 4718 | for (pp = start; (void *) pp < end; pp++) | 4732 | for (pp = start; (void *) pp < end; pp += GC_POINTER_ALIGNMENT) |
| 4719 | for (i = 0; i < sizeof *pp; i += GC_POINTER_ALIGNMENT) | 4733 | { |
| 4720 | { | 4734 | mark_maybe_pointer (*(void **) pp); |
| 4721 | void *p = *(void **) ((char *) pp + i); | 4735 | mark_maybe_object (*(Lisp_Object *) pp); |
| 4722 | mark_maybe_pointer (p); | 4736 | } |
| 4723 | mark_maybe_object (XIL ((intptr_t) p)); | ||
| 4724 | } | ||
| 4725 | } | 4737 | } |
| 4726 | 4738 | ||
| 4727 | #if !defined GC_SAVE_REGISTERS_ON_STACK && !defined GC_SETJMP_WORKS | 4739 | #if !defined GC_SAVE_REGISTERS_ON_STACK && !defined GC_SETJMP_WORKS |
| @@ -5513,9 +5525,16 @@ garbage_collect_1 (void *end) | |||
| 5513 | don't let that cause a recursive GC. */ | 5525 | don't let that cause a recursive GC. */ |
| 5514 | consing_since_gc = 0; | 5526 | consing_since_gc = 0; |
| 5515 | 5527 | ||
| 5516 | /* Save what's currently displayed in the echo area. */ | 5528 | /* Save what's currently displayed in the echo area. Don't do that |
| 5517 | message_p = push_message (); | 5529 | if we are GC'ing because we've run out of memory, since |
| 5518 | record_unwind_protect_void (pop_message_unwind); | 5530 | push_message will cons, and we might have no memory for that. */ |
| 5531 | if (NILP (Vmemory_full)) | ||
| 5532 | { | ||
| 5533 | message_p = push_message (); | ||
| 5534 | record_unwind_protect_void (pop_message_unwind); | ||
| 5535 | } | ||
| 5536 | else | ||
| 5537 | message_p = false; | ||
| 5519 | 5538 | ||
| 5520 | /* Save a copy of the contents of the stack, for debugging. */ | 5539 | /* Save a copy of the contents of the stack, for debugging. */ |
| 5521 | #if MAX_SAVE_STACK > 0 | 5540 | #if MAX_SAVE_STACK > 0 |
| @@ -5646,7 +5665,7 @@ garbage_collect_1 (void *end) | |||
| 5646 | } | 5665 | } |
| 5647 | } | 5666 | } |
| 5648 | 5667 | ||
| 5649 | if (garbage_collection_messages) | 5668 | if (garbage_collection_messages && NILP (Vmemory_full)) |
| 5650 | { | 5669 | { |
| 5651 | if (message_p || minibuf_level > 0) | 5670 | if (message_p || minibuf_level > 0) |
| 5652 | restore_message (); | 5671 | restore_message (); |
diff --git a/src/emacs-module.c b/src/emacs-module.c index 2fec7e5d0fe..b5e044e758f 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c | |||
| @@ -65,6 +65,12 @@ enum | |||
| 65 | && INTPTR_MAX == EMACS_INT_MAX) | 65 | && INTPTR_MAX == EMACS_INT_MAX) |
| 66 | }; | 66 | }; |
| 67 | 67 | ||
| 68 | /* Function prototype for module user-pointer finalizers. These | ||
| 69 | should not throw C++ exceptions, so emacs-module.h declares the | ||
| 70 | corresponding interfaces with EMACS_NOEXCEPT. There is only C code | ||
| 71 | in this module, though, so this constraint is not enforced here. */ | ||
| 72 | typedef void (*emacs_finalizer_function) (void *); | ||
| 73 | |||
| 68 | 74 | ||
| 69 | /* Private runtime and environment members. */ | 75 | /* Private runtime and environment members. */ |
| 70 | 76 | ||
diff --git a/src/emacs-module.h b/src/emacs-module.h index 3efea349d71..575966ea7b5 100644 --- a/src/emacs-module.h +++ b/src/emacs-module.h | |||
| @@ -26,19 +26,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 26 | 26 | ||
| 27 | #if defined __cplusplus && __cplusplus >= 201103L | 27 | #if defined __cplusplus && __cplusplus >= 201103L |
| 28 | # define EMACS_NOEXCEPT noexcept | 28 | # define EMACS_NOEXCEPT noexcept |
| 29 | |||
| 30 | /* Function prototype for module user-pointer finalizers. | ||
| 31 | |||
| 32 | NOTE: C++11 15.4: An exception-specification shall not appear in a | ||
| 33 | typedef declaration or alias-declaration. | ||
| 34 | |||
| 35 | */ | ||
| 36 | void emacs_dummy_finalizer_function (void *) noexcept; | ||
| 37 | typedef decltype(emacs_dummy_finalizer_function) *emacs_finalizer_function; | ||
| 38 | |||
| 39 | #else | 29 | #else |
| 40 | # define EMACS_NOEXCEPT | 30 | # define EMACS_NOEXCEPT |
| 41 | typedef void (*emacs_finalizer_function) (void *); | ||
| 42 | #endif | 31 | #endif |
| 43 | 32 | ||
| 44 | #ifdef __cplusplus | 33 | #ifdef __cplusplus |
| @@ -184,17 +173,17 @@ struct emacs_env_25 | |||
| 184 | 173 | ||
| 185 | /* Embedded pointer type. */ | 174 | /* Embedded pointer type. */ |
| 186 | emacs_value (*make_user_ptr) (emacs_env *env, | 175 | emacs_value (*make_user_ptr) (emacs_env *env, |
| 187 | emacs_finalizer_function fin, | 176 | void (*fin) (void *) EMACS_NOEXCEPT, |
| 188 | void *ptr); | 177 | void *ptr); |
| 189 | 178 | ||
| 190 | void *(*get_user_ptr) (emacs_env *env, emacs_value uptr); | 179 | void *(*get_user_ptr) (emacs_env *env, emacs_value uptr); |
| 191 | void (*set_user_ptr) (emacs_env *env, emacs_value uptr, void *ptr); | 180 | void (*set_user_ptr) (emacs_env *env, emacs_value uptr, void *ptr); |
| 192 | 181 | ||
| 193 | emacs_finalizer_function (*get_user_finalizer) (emacs_env *env, | 182 | void (*(*get_user_finalizer) (emacs_env *env, emacs_value uptr)) |
| 194 | emacs_value uptr); | 183 | (void *) EMACS_NOEXCEPT; |
| 195 | void (*set_user_finalizer) (emacs_env *env, | 184 | void (*set_user_finalizer) (emacs_env *env, |
| 196 | emacs_value uptr, | 185 | emacs_value uptr, |
| 197 | emacs_finalizer_function fin); | 186 | void (*fin) (void *) EMACS_NOEXCEPT); |
| 198 | 187 | ||
| 199 | /* Vector functions. */ | 188 | /* Vector functions. */ |
| 200 | emacs_value (*vec_get) (emacs_env *env, emacs_value vec, ptrdiff_t i); | 189 | emacs_value (*vec_get) (emacs_env *env, emacs_value vec, ptrdiff_t i); |
diff --git a/src/lisp.h b/src/lisp.h index 90a0c1272c9..02b8078a9fd 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3927,7 +3927,7 @@ extern bool let_shadows_global_binding_p (Lisp_Object symbol); | |||
| 3927 | 3927 | ||
| 3928 | #ifdef HAVE_MODULES | 3928 | #ifdef HAVE_MODULES |
| 3929 | /* Defined in alloc.c. */ | 3929 | /* Defined in alloc.c. */ |
| 3930 | extern Lisp_Object make_user_ptr (void (*finalizer) (void*), void *p); | 3930 | extern Lisp_Object make_user_ptr (void (*finalizer) (void *), void *p); |
| 3931 | 3931 | ||
| 3932 | /* Defined in emacs-module.c. */ | 3932 | /* Defined in emacs-module.c. */ |
| 3933 | extern void module_init (void); | 3933 | extern void module_init (void); |
diff --git a/src/lread.c b/src/lread.c index e9f3d7da967..25e3ff01d47 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -3720,7 +3720,11 @@ static size_t oblookup_last_bucket_number; | |||
| 3720 | Lisp_Object | 3720 | Lisp_Object |
| 3721 | check_obarray (Lisp_Object obarray) | 3721 | check_obarray (Lisp_Object obarray) |
| 3722 | { | 3722 | { |
| 3723 | if (!VECTORP (obarray) || ASIZE (obarray) == 0) | 3723 | /* We don't want to signal a wrong-type-argument error when we are |
| 3724 | shutting down due to a fatal error, and we don't want to hit | ||
| 3725 | assertions in VECTORP and ASIZE if the fatal error was during GC. */ | ||
| 3726 | if (!fatal_error_in_progress | ||
| 3727 | && (!VECTORP (obarray) || ASIZE (obarray) == 0)) | ||
| 3724 | { | 3728 | { |
| 3725 | /* If Vobarray is now invalid, force it to be valid. */ | 3729 | /* If Vobarray is now invalid, force it to be valid. */ |
| 3726 | if (EQ (Vobarray, obarray)) Vobarray = initial_obarray; | 3730 | if (EQ (Vobarray, obarray)) Vobarray = initial_obarray; |
| @@ -3210,7 +3210,8 @@ map_w32_filename (const char * name, const char ** pPath) | |||
| 3210 | return shortname; | 3210 | return shortname; |
| 3211 | } | 3211 | } |
| 3212 | 3212 | ||
| 3213 | if (is_fat_volume (name, (const char **)&path)) /* truncate to 8.3 */ | 3213 | if (!fatal_error_in_progress /* disable fancy processing during crash */ |
| 3214 | && is_fat_volume (name, (const char **)&path)) /* truncate to 8.3 */ | ||
| 3214 | { | 3215 | { |
| 3215 | register int left = 8; /* maximum number of chars in part */ | 3216 | register int left = 8; /* maximum number of chars in part */ |
| 3216 | register int extn = 0; /* extension added? */ | 3217 | register int extn = 0; /* extension added? */ |
diff --git a/src/xdisp.c b/src/xdisp.c index ee748bd8680..d730a0bf1b6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -4583,11 +4583,15 @@ setup_for_ellipsis (struct it *it, int len) | |||
| 4583 | it->current.dpvec_index = 0; | 4583 | it->current.dpvec_index = 0; |
| 4584 | it->dpvec_face_id = -1; | 4584 | it->dpvec_face_id = -1; |
| 4585 | 4585 | ||
| 4586 | /* Remember the current face id in case glyphs specify faces. | 4586 | /* Use IT->saved_face_id for the ellipsis, so that it has the same |
| 4587 | IT's face is restored in set_iterator_to_next. | 4587 | face as the preceding text. IT->saved_face_id was set in |
| 4588 | saved_face_id was set to preceding char's face in handle_stop. */ | 4588 | handle_stop to the face of the preceding character, and will be |
| 4589 | if (it->saved_face_id < 0 || it->saved_face_id != it->face_id) | 4589 | different from IT->face_id only if the invisible text skipped in |
| 4590 | it->saved_face_id = it->face_id = DEFAULT_FACE_ID; | 4590 | handle_invisible_prop has some non-default face on its first |
| 4591 | character. We thus ignore the face of the invisible text when we | ||
| 4592 | display the ellipsis. IT's face is restored in set_iterator_to_next. */ | ||
| 4593 | if (it->saved_face_id >= 0) | ||
| 4594 | it->face_id = it->saved_face_id; | ||
| 4591 | 4595 | ||
| 4592 | /* If the ellipsis represents buffer text, it means we advanced in | 4596 | /* If the ellipsis represents buffer text, it means we advanced in |
| 4593 | the buffer, so we should no longer ignore overlay strings. */ | 4597 | the buffer, so we should no longer ignore overlay strings. */ |
diff --git a/test/automated/vc-hg.el b/test/automated/vc-hg.el new file mode 100644 index 00000000000..ba966598c4d --- /dev/null +++ b/test/automated/vc-hg.el | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | ;;; vc-hg.el --- tests for vc/vc-hg.el | ||
| 2 | |||
| 3 | ;; Copyright (C) 2016 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Dmitry Gutov <dgutov@yandex.ru> | ||
| 6 | ;; Maintainer: emacs-devel@gnu.org | ||
| 7 | |||
| 8 | ;; This file is part of GNU Emacs. | ||
| 9 | |||
| 10 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 11 | ;; it under the terms of the GNU General Public License as published by | ||
| 12 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 13 | ;; (at your option) any later version. | ||
| 14 | |||
| 15 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 18 | ;; GNU General Public License for more details. | ||
| 19 | |||
| 20 | ;; You should have received a copy of the GNU General Public License | ||
| 21 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 22 | |||
| 23 | ;;; Commentary: | ||
| 24 | |||
| 25 | ;;; Code: | ||
| 26 | |||
| 27 | (require 'vc-hg) | ||
| 28 | (require 'vc-annotate) | ||
| 29 | |||
| 30 | (ert-deftest vc-hg-annotate-extract-revision-at-line-with-filename () | ||
| 31 | ;; with filename | ||
| 32 | (with-temp-buffer | ||
| 33 | (save-excursion (insert "215 2007-06-20 CONTENTS:")) | ||
| 34 | (should (equal (vc-hg-annotate-extract-revision-at-line) | ||
| 35 | (cons | ||
| 36 | "215" | ||
| 37 | (expand-file-name "CONTENTS")))))) | ||
| 38 | |||
| 39 | (ert-deftest vc-hg-annotate-extract-revision-at-line-with-user () | ||
| 40 | (with-temp-buffer | ||
| 41 | (save-excursion (insert " gerv 107217 2012-09-17:")) | ||
| 42 | (should (equal (vc-hg-annotate-extract-revision-at-line) | ||
| 43 | "107217")))) | ||
| 44 | |||
| 45 | (ert-deftest vc-hg-annotate-extract-revision-at-line-with-both () | ||
| 46 | (with-temp-buffer | ||
| 47 | (save-excursion (insert "philringnalda 218075 2014-11-28 CLOBBER:")) | ||
| 48 | (should (equal (vc-hg-annotate-extract-revision-at-line) | ||
| 49 | (cons | ||
| 50 | "218075" | ||
| 51 | (expand-file-name "CLOBBER")))))) | ||
| 52 | |||
| 53 | (ert-deftest vc-hg-annotate-time () | ||
| 54 | (with-temp-buffer | ||
| 55 | (save-excursion (insert "philringnalda 218075 2014-11-28 CLOBBER:")) | ||
| 56 | (should (floatp (vc-hg-annotate-time))))) | ||
| 57 | |||
| 58 | ;;; vc-hg.el ends here | ||
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index f0725847699..305ca9d6770 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -44,6 +44,7 @@ | |||
| 44 | (require 'vc-git) | 44 | (require 'vc-git) |
| 45 | (require 'vc-hg) | 45 | (require 'vc-hg) |
| 46 | 46 | ||
| 47 | (autoload 'dired-uncache "dired") | ||
| 47 | (declare-function tramp-find-executable "tramp-sh") | 48 | (declare-function tramp-find-executable "tramp-sh") |
| 48 | (declare-function tramp-get-remote-path "tramp-sh") | 49 | (declare-function tramp-get-remote-path "tramp-sh") |
| 49 | (declare-function tramp-get-remote-stat "tramp-sh") | 50 | (declare-function tramp-get-remote-stat "tramp-sh") |
| @@ -1654,6 +1655,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1654 | (vc-register | 1655 | (vc-register |
| 1655 | nil (list (car vc-handled-backends) | 1656 | nil (list (car vc-handled-backends) |
| 1656 | (list (file-name-nondirectory tmp-name2)))))) | 1657 | (list (file-name-nondirectory tmp-name2)))))) |
| 1658 | ;; vc-git uses an own process sentinel, Tramp's sentinel | ||
| 1659 | ;; for flushing the cache isn't used. | ||
| 1660 | (dired-uncache (concat (file-remote-p default-directory) "/")) | ||
| 1657 | (should (vc-registered (file-name-nondirectory tmp-name2))))) | 1661 | (should (vc-registered (file-name-nondirectory tmp-name2))))) |
| 1658 | 1662 | ||
| 1659 | ;; Cleanup. | 1663 | ;; Cleanup. |
| @@ -1777,14 +1781,6 @@ Several special characters do not work properly there." | |||
| 1777 | (file-truename tramp-test-temporary-file-directory) nil | 1781 | (file-truename tramp-test-temporary-file-directory) nil |
| 1778 | (string-match "^HP-UX" (tramp-get-connection-property v "uname" "")))) | 1782 | (string-match "^HP-UX" (tramp-get-connection-property v "uname" "")))) |
| 1779 | 1783 | ||
| 1780 | (defun tramp--test-darwin-p () | ||
| 1781 | "Check, whether the remote host runs Mac OS X. | ||
| 1782 | Several special characters do not work properly there." | ||
| 1783 | ;; We must refill the cache. `file-truename' does it. | ||
| 1784 | (with-parsed-tramp-file-name | ||
| 1785 | (file-truename tramp-test-temporary-file-directory) nil | ||
| 1786 | (string-match "^Darwin" (tramp-get-connection-property v "uname" "")))) | ||
| 1787 | |||
| 1788 | (defun tramp--test-check-files (&rest files) | 1784 | (defun tramp--test-check-files (&rest files) |
| 1789 | "Run a simple but comprehensive test over every file in FILES." | 1785 | "Run a simple but comprehensive test over every file in FILES." |
| 1790 | ;; We must use `file-truename' for the temporary directory, because | 1786 | ;; We must use `file-truename' for the temporary directory, because |
| @@ -2030,16 +2026,15 @@ Use the `ls' command." | |||
| 2030 | 2026 | ||
| 2031 | (defun tramp--test-utf8 () | 2027 | (defun tramp--test-utf8 () |
| 2032 | "Perform the test in `tramp-test32-utf8*'." | 2028 | "Perform the test in `tramp-test32-utf8*'." |
| 2033 | (tramp--instrument-test-case 10 | ||
| 2034 | (let ((coding-system-for-read 'utf-8) | 2029 | (let ((coding-system-for-read 'utf-8) |
| 2035 | (coding-system-for-write 'utf-8) | 2030 | (coding-system-for-write 'utf-8) |
| 2036 | (file-name-coding-system 'utf-8)) | 2031 | (file-name-coding-system 'utf-8)) |
| 2037 | (tramp--test-check-files | 2032 | (tramp--test-check-files |
| 2038 | (unless (tramp--test-hpux-p) "Γυρίστε το Γαλαξία με Ώτο Στοπ") | 2033 | (unless (tramp--test-hpux-p) "Γυρίστε το Γαλαξία με Ώτο Στοπ") |
| 2039 | (unless (or (tramp--test-hpux-p) (tramp--test-darwin-p)) | 2034 | (unless (tramp--test-hpux-p) |
| 2040 | "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت") | 2035 | "أصبح بوسعك الآن تنزيل نسخة كاملة من موسوعة ويكيبيديا العربية لتصفحها بلا اتصال بالإنترنت") |
| 2041 | "银河系漫游指南系列" | 2036 | "银河系漫游指南系列" |
| 2042 | "Автостопом по гала́ктике")))) | 2037 | "Автостопом по гала́ктике"))) |
| 2043 | 2038 | ||
| 2044 | (ert-deftest tramp-test32-utf8 () | 2039 | (ert-deftest tramp-test32-utf8 () |
| 2045 | "Check UTF8 encoding in file names and file contents." | 2040 | "Check UTF8 encoding in file names and file contents." |
diff --git a/test/manual/indent/shell.sh b/test/manual/indent/shell.sh index b0f69bd9720..dc184ea0d77 100755 --- a/test/manual/indent/shell.sh +++ b/test/manual/indent/shell.sh | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | 3 | ||
| 4 | setlock -n /tmp/getmail.lock && echo getmail isn\'t running | 4 | setlock -n /tmp/getmail.lock && echo getmail isn\'t running |
| 5 | 5 | ||
| 6 | toto=$(grep hello foo | | ||
| 7 | wc) | ||
| 8 | |||
| 6 | # adsgsdg | 9 | # adsgsdg |
| 7 | 10 | ||
| 8 | if foo; then | 11 | if foo; then |