diff options
| author | Stefan Monnier | 2012-10-01 00:45:32 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-10-01 00:45:32 -0400 |
| commit | 375e49d4d18ff9e5d6d523618aee043768c8ac90 (patch) | |
| tree | 894901cbbe6954489e26b7ecf5b6ac2766c8a47a | |
| parent | 0a9cc82a7756399d1ad90d2cebe86df1353601a5 (diff) | |
| download | emacs-375e49d4d18ff9e5d6d523618aee043768c8ac90.tar.gz emacs-375e49d4d18ff9e5d6d523618aee043768c8ac90.zip | |
* lisp/emacs-lisp/bytecomp.el (byte-compiler-abbreviate-file): New function.
(byte-compile-warning-prefix, byte-compile-file): Use it.
Fixes: debbugs:12508
| -rw-r--r-- | lisp/ChangeLog | 81 | ||||
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 16 |
2 files changed, 55 insertions, 42 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0e515c2a7b4..b5ccfcfcc7c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/bytecomp.el (byte-compiler-abbreviate-file): New function. | ||
| 4 | (byte-compile-warning-prefix, byte-compile-file): Use it (bug#12508). | ||
| 5 | |||
| 1 | 2012-10-01 Karl Fogel <kfogel@red-bean.com> | 6 | 2012-10-01 Karl Fogel <kfogel@red-bean.com> |
| 2 | 7 | ||
| 3 | * bookmark.el (bookmark-version-control): Give tags in the | 8 | * bookmark.el (bookmark-version-control): Give tags in the |
| @@ -19,8 +24,8 @@ | |||
| 19 | 24 | ||
| 20 | Shell output catching a la gud-gdb. | 25 | Shell output catching a la gud-gdb. |
| 21 | * progmodes/python.el (python-shell-fetch-lines-in-progress) | 26 | * progmodes/python.el (python-shell-fetch-lines-in-progress) |
| 22 | (python-shell-fetch-lines-string, python-shell-fetched-lines): New | 27 | (python-shell-fetch-lines-string, python-shell-fetched-lines): |
| 23 | Vars. | 28 | New Vars. |
| 24 | (python-shell-fetch-lines-filter): New function. | 29 | (python-shell-fetch-lines-filter): New function. |
| 25 | (python-shell-send-string-no-output): Use them. | 30 | (python-shell-send-string-no-output): Use them. |
| 26 | 31 | ||
| @@ -51,12 +56,12 @@ | |||
| 51 | version of the original ChangeLog can be found in the commit log. | 56 | version of the original ChangeLog can be found in the commit log. |
| 52 | 57 | ||
| 53 | * textmodes/reftex-auc.el: Move `provide' call to bottom of file. | 58 | * textmodes/reftex-auc.el: Move `provide' call to bottom of file. |
| 54 | (reftex-arg-cite): Use `reftex-cite-key-separator'. Correctly | 59 | (reftex-arg-cite): Use `reftex-cite-key-separator'. |
| 55 | handle new value type returned by `reftex-citation'. | 60 | Correctly handle new value type returned by `reftex-citation'. |
| 56 | 61 | ||
| 57 | * textmodes/reftex-cite.el (reftex-create-bibtex-file): Make sure | 62 | * textmodes/reftex-cite.el (reftex-create-bibtex-file): Make sure |
| 58 | that entries with whitespace at various places are found. Doc | 63 | that entries with whitespace at various places are found. |
| 59 | fix. Include entries that are cross-referenced from cited entries. | 64 | Doc fix. Include entries that are cross-referenced from cited entries. |
| 60 | Include @String definitions in the resulting bib file. Add header | 65 | Include @String definitions in the resulting bib file. Add header |
| 61 | and footer defined in `reftex-create-bibtex-header' and | 66 | and footer defined in `reftex-create-bibtex-header' and |
| 62 | `reftex-create-bibtex-footer'. | 67 | `reftex-create-bibtex-footer'. |
| @@ -75,10 +80,10 @@ | |||
| 75 | (reftex-extract-bib-entries-from-thebibliography): Match \bibitem | 80 | (reftex-extract-bib-entries-from-thebibliography): Match \bibitem |
| 76 | entries with spaces or tabs in front of arguments. | 81 | entries with spaces or tabs in front of arguments. |
| 77 | (reftex-pop-to-bibtex-entry, reftex-extract-bib-entries) | 82 | (reftex-pop-to-bibtex-entry, reftex-extract-bib-entries) |
| 78 | (reftex-parse-bibtex-entry, reftex-create-bibtex-file): Match | 83 | (reftex-parse-bibtex-entry, reftex-create-bibtex-file): |
| 79 | entries containing numbers and symbol constituents. | 84 | Match entries containing numbers and symbol constituents. |
| 80 | (reftex-do-citation, reftex-figure-out-cite-format): Use | 85 | (reftex-do-citation, reftex-figure-out-cite-format): |
| 81 | `reftex-cite-key-separator'. | 86 | Use `reftex-cite-key-separator'. |
| 82 | 87 | ||
| 83 | * textmodes/reftex-dcr.el: Move provide statement to end of file. | 88 | * textmodes/reftex-dcr.el: Move provide statement to end of file. |
| 84 | (reftex-mouse-view-crossref): Explain why point is set. | 89 | (reftex-mouse-view-crossref): Explain why point is set. |
| @@ -98,21 +103,21 @@ | |||
| 98 | prevents fontification of quoted content. | 103 | prevents fontification of quoted content. |
| 99 | (reftex-index-phrases-mode): Use it. | 104 | (reftex-index-phrases-mode): Use it. |
| 100 | 105 | ||
| 101 | * textmodes/reftex-parse.el (reftex-parse-from-file): Move | 106 | * textmodes/reftex-parse.el (reftex-parse-from-file): |
| 102 | backward one char if a `\' was matched after a section macro. | 107 | Move backward one char if a `\' was matched after a section macro. |
| 103 | (reftex-parse-from-file): Use beginning of match instead of end as | 108 | (reftex-parse-from-file): Use beginning of match instead of end as |
| 104 | bound. | 109 | bound. |
| 105 | 110 | ||
| 106 | * textmodes/reftex-ref.el: Adapt creation of | 111 | * textmodes/reftex-ref.el: Adapt creation of |
| 107 | `reftex-<package>-<macro>' functions to new structure of | 112 | `reftex-<package>-<macro>' functions to new structure of |
| 108 | `reftex-ref-style-alist'. | 113 | `reftex-ref-style-alist'. |
| 109 | (reftex-reference): Use `reftex-ref-style-list' function. Adapt | 114 | (reftex-reference): Use `reftex-ref-style-list' function. |
| 110 | to new structure of `reftex-ref-style-alist'. Prompt for a | 115 | Adapt to new structure of `reftex-ref-style-alist'. Prompt for a |
| 111 | reference macro if `reftex-ref-macro-prompt' is non-nil. | 116 | reference macro if `reftex-ref-macro-prompt' is non-nil. |
| 112 | (reftex-reference): Pass refstyle to `reftex-format-special'. | 117 | (reftex-reference): Pass refstyle to `reftex-format-special'. |
| 113 | Determine reference macro by looking at | 118 | Determine reference macro by looking at |
| 114 | `reftex-ref-style-default-list' and `reftex-ref-style-alist'. Use | 119 | `reftex-ref-style-default-list' and `reftex-ref-style-alist'. |
| 115 | only one special format function. | 120 | Use only one special format function. |
| 116 | (reftex-varioref-vref, reftex-fancyref-fref) | 121 | (reftex-varioref-vref, reftex-fancyref-fref) |
| 117 | (reftex-fancyref-Fref): Remove definitions. The functions are now | 122 | (reftex-fancyref-Fref): Remove definitions. The functions are now |
| 118 | generated from `reftex-ref-style-alist'. | 123 | generated from `reftex-ref-style-alist'. |
| @@ -132,8 +137,8 @@ | |||
| 132 | through reference styles. Add `p' for switching between number | 137 | through reference styles. Add `p' for switching between number |
| 133 | and page reference types. | 138 | and page reference types. |
| 134 | 139 | ||
| 135 | * textmodes/reftex-toc.el (reftex-re-enlarge): Call | 140 | * textmodes/reftex-toc.el (reftex-re-enlarge): |
| 136 | `enlarge-window' only if there is something to do because in Emacs | 141 | Call `enlarge-window' only if there is something to do because in Emacs |
| 137 | the horizontal version throws an error even if the parameter is 0. | 142 | the horizontal version throws an error even if the parameter is 0. |
| 138 | 143 | ||
| 139 | * textmodes/reftex-vars.el (reftex-label-alist): Doc fix. | 144 | * textmodes/reftex-vars.el (reftex-label-alist): Doc fix. |
| @@ -142,21 +147,21 @@ | |||
| 142 | string. Adapt to new name. | 147 | string. Adapt to new name. |
| 143 | (reftex-ref-style-alist): Change structure so that it is not | 148 | (reftex-ref-style-alist): Change structure so that it is not |
| 144 | possible to use multiple different package names within a style. | 149 | possible to use multiple different package names within a style. |
| 145 | Remove the symbols for symbols for macro type distinction. Add | 150 | Remove the symbols for symbols for macro type distinction. |
| 146 | characters for macro selection. | 151 | Add characters for macro selection. |
| 147 | (reftex-ref-macro-prompt, reftex-create-bibtex-header) | 152 | (reftex-ref-macro-prompt, reftex-create-bibtex-header) |
| 148 | (reftex-create-bibtex-footer): New variables. | 153 | (reftex-create-bibtex-footer): New variables. |
| 149 | (reftex-format-ref-function): Mention third argument of special | 154 | (reftex-format-ref-function): Mention third argument of special |
| 150 | format function. | 155 | format function. |
| 151 | (reftex-ref-style-alist, reftex-ref-style-default-list): New | 156 | (reftex-ref-style-alist, reftex-ref-style-default-list): |
| 152 | variables. | 157 | New variables. |
| 153 | (reftex-vref-is-default, reftex-fref-is-default): Adapt doc string | 158 | (reftex-vref-is-default, reftex-fref-is-default): Adapt doc string |
| 154 | to new implementation. Mark as obsolete. Add compatibility code | 159 | to new implementation. Mark as obsolete. Add compatibility code |
| 155 | for honoring the variable values in case they are set. | 160 | for honoring the variable values in case they are set. |
| 156 | (reftex-cite-format-builtin, reftex-bibliography-commands): Add | 161 | (reftex-cite-format-builtin, reftex-bibliography-commands): |
| 157 | support for ConTeXt. | 162 | Add support for ConTeXt. |
| 158 | (reftex-format-ref-function, reftex-format-cite-function): Fix | 163 | (reftex-format-ref-function, reftex-format-cite-function): |
| 159 | custom type. | 164 | Fix custom type. |
| 160 | (reftex-cite-key-separator): New variable. | 165 | (reftex-cite-key-separator): New variable. |
| 161 | 166 | ||
| 162 | * textmodes/reftex.el (reftex-syntax-table-for-bib) | 167 | * textmodes/reftex.el (reftex-syntax-table-for-bib) |
| @@ -166,8 +171,8 @@ | |||
| 166 | work. | 171 | work. |
| 167 | (reftex-in-comment): Do not error out if `comment-start-skip' is | 172 | (reftex-in-comment): Do not error out if `comment-start-skip' is |
| 168 | not set. Deal correctly with escaped comment characters. | 173 | not set. Deal correctly with escaped comment characters. |
| 169 | (reftex-tie-multifile-symbols): Add doc string. Initialize | 174 | (reftex-tie-multifile-symbols): Add doc string. |
| 170 | `reftex-ref-style-list'. | 175 | Initialize `reftex-ref-style-list'. |
| 171 | (reftex-untie-multifile-symbols): Add doc string. | 176 | (reftex-untie-multifile-symbols): Add doc string. |
| 172 | (reftex-add-index-macros): Doc fix. | 177 | (reftex-add-index-macros): Doc fix. |
| 173 | (reftex-ref-style-activate, reftex-ref-style-toggle) | 178 | (reftex-ref-style-activate, reftex-ref-style-toggle) |
| @@ -188,8 +193,8 @@ | |||
| 188 | 2012-09-30 Fabián Ezequiel Gallina <fgallina@cuca> | 193 | 2012-09-30 Fabián Ezequiel Gallina <fgallina@cuca> |
| 189 | 194 | ||
| 190 | Enhancements for triple-quote string syntax. | 195 | Enhancements for triple-quote string syntax. |
| 191 | * progmodes/python.el (python-syntax-propertize-function): Match | 196 | * progmodes/python.el (python-syntax-propertize-function): |
| 192 | both quote cases in one regexp. | 197 | Match both quote cases in one regexp. |
| 193 | (python-syntax-stringify): Handle matches properly. | 198 | (python-syntax-stringify): Handle matches properly. |
| 194 | 199 | ||
| 195 | 2012-09-30 Juri Linkov <juri@jurta.org> | 200 | 2012-09-30 Juri Linkov <juri@jurta.org> |
| @@ -223,10 +228,10 @@ | |||
| 223 | 228 | ||
| 224 | In buffer display functions handle window-height/window-width | 229 | In buffer display functions handle window-height/window-width |
| 225 | alist entries. Suggested by Juri Linkov as fix for Bug#1806. | 230 | alist entries. Suggested by Juri Linkov as fix for Bug#1806. |
| 226 | * window.el (window--display-buffer): New argument ALIST. Obey | 231 | * window.el (window--display-buffer): New argument ALIST. |
| 227 | window-height and window-width alist entries. | 232 | Obey window-height and window-width alist entries. |
| 228 | (window--try-to-split-window): New argument ALIST. Bind | 233 | (window--try-to-split-window): New argument ALIST. |
| 229 | window-combination-limit to t when the window's size shall be | 234 | Bind window-combination-limit to t when the window's size shall be |
| 230 | changed and window-combination-limit equals `window-size'. | 235 | changed and window-combination-limit equals `window-size'. |
| 231 | (display-buffer-in-atom-window) | 236 | (display-buffer-in-atom-window) |
| 232 | (display-buffer-in-major-side-window) | 237 | (display-buffer-in-major-side-window) |
| @@ -249,8 +254,8 @@ | |||
| 249 | temp-buffer-resize-regexps. Use fit-frame-to-buffer instead of | 254 | temp-buffer-resize-regexps. Use fit-frame-to-buffer instead of |
| 250 | temp-buffer-resize-frames. | 255 | temp-buffer-resize-frames. |
| 251 | 256 | ||
| 252 | * dired.el (dired-mark-pop-up): Call | 257 | * dired.el (dired-mark-pop-up): |
| 253 | display-buffer-below-selected with a fit-window-to-buffer alist | 258 | Call display-buffer-below-selected with a fit-window-to-buffer alist |
| 254 | entry. | 259 | entry. |
| 255 | 260 | ||
| 256 | 2012-09-30 Chong Yidong <cyd@gnu.org> | 261 | 2012-09-30 Chong Yidong <cyd@gnu.org> |
| @@ -348,8 +353,8 @@ | |||
| 348 | 353 | ||
| 349 | 2012-09-28 Leo Liu <sdl.web@gmail.com> | 354 | 2012-09-28 Leo Liu <sdl.web@gmail.com> |
| 350 | 355 | ||
| 351 | * pcomplete.el (pcomplete-show-completions): Use | 356 | * pcomplete.el (pcomplete-show-completions): |
| 352 | minibuffer-message to make pcomplete usable in minibuffer. | 357 | Use minibuffer-message to make pcomplete usable in minibuffer. |
| 353 | 358 | ||
| 354 | * ido.el (ido-set-matches-1): Fix 2012-09-11 change. | 359 | * ido.el (ido-set-matches-1): Fix 2012-09-11 change. |
| 355 | 360 | ||
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index d49e56bd2ba..4dd44bb6f22 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -1005,13 +1005,20 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." | |||
| 1005 | (defvar byte-compile-root-dir nil | 1005 | (defvar byte-compile-root-dir nil |
| 1006 | "Directory relative to which file names in error messages are written.") | 1006 | "Directory relative to which file names in error messages are written.") |
| 1007 | 1007 | ||
| 1008 | ;; FIXME: We should maybe extend abbreviate-file-name with an optional DIR | ||
| 1009 | ;; argument to try and use a relative file-name. | ||
| 1010 | (defun byte-compile-abbreviate-file (file &optional dir) | ||
| 1011 | (let ((f1 (abbreviate-file-name file)) | ||
| 1012 | (f2 (file-relative-name file dir))) | ||
| 1013 | (if (< (length f2) (length f1)) f2 f1))) | ||
| 1014 | |||
| 1008 | ;; This is used as warning-prefix for the compiler. | 1015 | ;; This is used as warning-prefix for the compiler. |
| 1009 | ;; It is always called with the warnings buffer current. | 1016 | ;; It is always called with the warnings buffer current. |
| 1010 | (defun byte-compile-warning-prefix (level entry) | 1017 | (defun byte-compile-warning-prefix (level entry) |
| 1011 | (let* ((inhibit-read-only t) | 1018 | (let* ((inhibit-read-only t) |
| 1012 | (dir (or byte-compile-root-dir default-directory)) | 1019 | (dir (or byte-compile-root-dir default-directory)) |
| 1013 | (file (cond ((stringp byte-compile-current-file) | 1020 | (file (cond ((stringp byte-compile-current-file) |
| 1014 | (format "%s:" (file-relative-name | 1021 | (format "%s:" (byte-compile-abbreviate-file |
| 1015 | byte-compile-current-file dir))) | 1022 | byte-compile-current-file dir))) |
| 1016 | ((bufferp byte-compile-current-file) | 1023 | ((bufferp byte-compile-current-file) |
| 1017 | (format "Buffer %s:" | 1024 | (format "Buffer %s:" |
| @@ -1019,7 +1026,8 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." | |||
| 1019 | ;; We might be simply loading a file that | 1026 | ;; We might be simply loading a file that |
| 1020 | ;; contains explicit calls to byte-compile functions. | 1027 | ;; contains explicit calls to byte-compile functions. |
| 1021 | ((stringp load-file-name) | 1028 | ((stringp load-file-name) |
| 1022 | (format "%s:" (file-relative-name load-file-name dir))) | 1029 | (format "%s:" (byte-compile-abbreviate-file |
| 1030 | load-file-name dir))) | ||
| 1023 | (t ""))) | 1031 | (t ""))) |
| 1024 | (pos (if (and byte-compile-current-file | 1032 | (pos (if (and byte-compile-current-file |
| 1025 | (integerp byte-compile-read-position)) | 1033 | (integerp byte-compile-read-position)) |
| @@ -1746,11 +1754,11 @@ The value is non-nil if there were no errors, nil if errors." | |||
| 1746 | (if (with-current-buffer input-buffer no-byte-compile) | 1754 | (if (with-current-buffer input-buffer no-byte-compile) |
| 1747 | (progn | 1755 | (progn |
| 1748 | ;; (message "%s not compiled because of `no-byte-compile: %s'" | 1756 | ;; (message "%s not compiled because of `no-byte-compile: %s'" |
| 1749 | ;; (file-relative-name filename) | 1757 | ;; (byte-compile-abbreviate-file filename) |
| 1750 | ;; (with-current-buffer input-buffer no-byte-compile)) | 1758 | ;; (with-current-buffer input-buffer no-byte-compile)) |
| 1751 | (when (file-exists-p target-file) | 1759 | (when (file-exists-p target-file) |
| 1752 | (message "%s deleted because of `no-byte-compile: %s'" | 1760 | (message "%s deleted because of `no-byte-compile: %s'" |
| 1753 | (file-relative-name target-file) | 1761 | (byte-compile-abbreviate-file target-file) |
| 1754 | (buffer-local-value 'no-byte-compile input-buffer)) | 1762 | (buffer-local-value 'no-byte-compile input-buffer)) |
| 1755 | (condition-case nil (delete-file target-file) (error nil))) | 1763 | (condition-case nil (delete-file target-file) (error nil))) |
| 1756 | ;; We successfully didn't compile this file. | 1764 | ;; We successfully didn't compile this file. |