From 375e49d4d18ff9e5d6d523618aee043768c8ac90 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 1 Oct 2012 00:45:32 -0400 Subject: [PATCH] * lisp/emacs-lisp/bytecomp.el (byte-compiler-abbreviate-file): New function. (byte-compile-warning-prefix, byte-compile-file): Use it. Fixes: debbugs:12508 --- lisp/ChangeLog | 81 ++++++++++++++++++++----------------- 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 @@ +2012-10-01 Stefan Monnier + + * emacs-lisp/bytecomp.el (byte-compiler-abbreviate-file): New function. + (byte-compile-warning-prefix, byte-compile-file): Use it (bug#12508). + 2012-10-01 Karl Fogel * bookmark.el (bookmark-version-control): Give tags in the @@ -19,8 +24,8 @@ Shell output catching a la gud-gdb. * progmodes/python.el (python-shell-fetch-lines-in-progress) - (python-shell-fetch-lines-string, python-shell-fetched-lines): New - Vars. + (python-shell-fetch-lines-string, python-shell-fetched-lines): + New Vars. (python-shell-fetch-lines-filter): New function. (python-shell-send-string-no-output): Use them. @@ -51,12 +56,12 @@ version of the original ChangeLog can be found in the commit log. * textmodes/reftex-auc.el: Move `provide' call to bottom of file. - (reftex-arg-cite): Use `reftex-cite-key-separator'. Correctly - handle new value type returned by `reftex-citation'. + (reftex-arg-cite): Use `reftex-cite-key-separator'. + Correctly handle new value type returned by `reftex-citation'. * textmodes/reftex-cite.el (reftex-create-bibtex-file): Make sure - that entries with whitespace at various places are found. Doc - fix. Include entries that are cross-referenced from cited entries. + that entries with whitespace at various places are found. + Doc fix. Include entries that are cross-referenced from cited entries. Include @String definitions in the resulting bib file. Add header and footer defined in `reftex-create-bibtex-header' and `reftex-create-bibtex-footer'. @@ -75,10 +80,10 @@ (reftex-extract-bib-entries-from-thebibliography): Match \bibitem entries with spaces or tabs in front of arguments. (reftex-pop-to-bibtex-entry, reftex-extract-bib-entries) - (reftex-parse-bibtex-entry, reftex-create-bibtex-file): Match - entries containing numbers and symbol constituents. - (reftex-do-citation, reftex-figure-out-cite-format): Use - `reftex-cite-key-separator'. + (reftex-parse-bibtex-entry, reftex-create-bibtex-file): + Match entries containing numbers and symbol constituents. + (reftex-do-citation, reftex-figure-out-cite-format): + Use `reftex-cite-key-separator'. * textmodes/reftex-dcr.el: Move provide statement to end of file. (reftex-mouse-view-crossref): Explain why point is set. @@ -98,21 +103,21 @@ prevents fontification of quoted content. (reftex-index-phrases-mode): Use it. - * textmodes/reftex-parse.el (reftex-parse-from-file): Move - backward one char if a `\' was matched after a section macro. + * textmodes/reftex-parse.el (reftex-parse-from-file): + Move backward one char if a `\' was matched after a section macro. (reftex-parse-from-file): Use beginning of match instead of end as bound. * textmodes/reftex-ref.el: Adapt creation of `reftex--' functions to new structure of `reftex-ref-style-alist'. - (reftex-reference): Use `reftex-ref-style-list' function. Adapt - to new structure of `reftex-ref-style-alist'. Prompt for a + (reftex-reference): Use `reftex-ref-style-list' function. + Adapt to new structure of `reftex-ref-style-alist'. Prompt for a reference macro if `reftex-ref-macro-prompt' is non-nil. (reftex-reference): Pass refstyle to `reftex-format-special'. Determine reference macro by looking at - `reftex-ref-style-default-list' and `reftex-ref-style-alist'. Use - only one special format function. + `reftex-ref-style-default-list' and `reftex-ref-style-alist'. + Use only one special format function. (reftex-varioref-vref, reftex-fancyref-fref) (reftex-fancyref-Fref): Remove definitions. The functions are now generated from `reftex-ref-style-alist'. @@ -132,8 +137,8 @@ through reference styles. Add `p' for switching between number and page reference types. - * textmodes/reftex-toc.el (reftex-re-enlarge): Call - `enlarge-window' only if there is something to do because in Emacs + * textmodes/reftex-toc.el (reftex-re-enlarge): + Call `enlarge-window' only if there is something to do because in Emacs the horizontal version throws an error even if the parameter is 0. * textmodes/reftex-vars.el (reftex-label-alist): Doc fix. @@ -142,21 +147,21 @@ string. Adapt to new name. (reftex-ref-style-alist): Change structure so that it is not possible to use multiple different package names within a style. - Remove the symbols for symbols for macro type distinction. Add - characters for macro selection. + Remove the symbols for symbols for macro type distinction. + Add characters for macro selection. (reftex-ref-macro-prompt, reftex-create-bibtex-header) (reftex-create-bibtex-footer): New variables. (reftex-format-ref-function): Mention third argument of special format function. - (reftex-ref-style-alist, reftex-ref-style-default-list): New - variables. + (reftex-ref-style-alist, reftex-ref-style-default-list): + New variables. (reftex-vref-is-default, reftex-fref-is-default): Adapt doc string to new implementation. Mark as obsolete. Add compatibility code for honoring the variable values in case they are set. - (reftex-cite-format-builtin, reftex-bibliography-commands): Add - support for ConTeXt. - (reftex-format-ref-function, reftex-format-cite-function): Fix - custom type. + (reftex-cite-format-builtin, reftex-bibliography-commands): + Add support for ConTeXt. + (reftex-format-ref-function, reftex-format-cite-function): + Fix custom type. (reftex-cite-key-separator): New variable. * textmodes/reftex.el (reftex-syntax-table-for-bib) @@ -166,8 +171,8 @@ work. (reftex-in-comment): Do not error out if `comment-start-skip' is not set. Deal correctly with escaped comment characters. - (reftex-tie-multifile-symbols): Add doc string. Initialize - `reftex-ref-style-list'. + (reftex-tie-multifile-symbols): Add doc string. + Initialize `reftex-ref-style-list'. (reftex-untie-multifile-symbols): Add doc string. (reftex-add-index-macros): Doc fix. (reftex-ref-style-activate, reftex-ref-style-toggle) @@ -188,8 +193,8 @@ 2012-09-30 Fabián Ezequiel Gallina Enhancements for triple-quote string syntax. - * progmodes/python.el (python-syntax-propertize-function): Match - both quote cases in one regexp. + * progmodes/python.el (python-syntax-propertize-function): + Match both quote cases in one regexp. (python-syntax-stringify): Handle matches properly. 2012-09-30 Juri Linkov @@ -223,10 +228,10 @@ In buffer display functions handle window-height/window-width alist entries. Suggested by Juri Linkov as fix for Bug#1806. - * window.el (window--display-buffer): New argument ALIST. Obey - window-height and window-width alist entries. - (window--try-to-split-window): New argument ALIST. Bind - window-combination-limit to t when the window's size shall be + * window.el (window--display-buffer): New argument ALIST. + Obey window-height and window-width alist entries. + (window--try-to-split-window): New argument ALIST. + Bind window-combination-limit to t when the window's size shall be changed and window-combination-limit equals `window-size'. (display-buffer-in-atom-window) (display-buffer-in-major-side-window) @@ -249,8 +254,8 @@ temp-buffer-resize-regexps. Use fit-frame-to-buffer instead of temp-buffer-resize-frames. - * dired.el (dired-mark-pop-up): Call - display-buffer-below-selected with a fit-window-to-buffer alist + * dired.el (dired-mark-pop-up): + Call display-buffer-below-selected with a fit-window-to-buffer alist entry. 2012-09-30 Chong Yidong @@ -348,8 +353,8 @@ 2012-09-28 Leo Liu - * pcomplete.el (pcomplete-show-completions): Use - minibuffer-message to make pcomplete usable in minibuffer. + * pcomplete.el (pcomplete-show-completions): + Use minibuffer-message to make pcomplete usable in minibuffer. * ido.el (ido-set-matches-1): Fix 2012-09-11 change. 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'." (defvar byte-compile-root-dir nil "Directory relative to which file names in error messages are written.") +;; FIXME: We should maybe extend abbreviate-file-name with an optional DIR +;; argument to try and use a relative file-name. +(defun byte-compile-abbreviate-file (file &optional dir) + (let ((f1 (abbreviate-file-name file)) + (f2 (file-relative-name file dir))) + (if (< (length f2) (length f1)) f2 f1))) + ;; This is used as warning-prefix for the compiler. ;; It is always called with the warnings buffer current. (defun byte-compile-warning-prefix (level entry) (let* ((inhibit-read-only t) (dir (or byte-compile-root-dir default-directory)) (file (cond ((stringp byte-compile-current-file) - (format "%s:" (file-relative-name + (format "%s:" (byte-compile-abbreviate-file byte-compile-current-file dir))) ((bufferp byte-compile-current-file) (format "Buffer %s:" @@ -1019,7 +1026,8 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." ;; We might be simply loading a file that ;; contains explicit calls to byte-compile functions. ((stringp load-file-name) - (format "%s:" (file-relative-name load-file-name dir))) + (format "%s:" (byte-compile-abbreviate-file + load-file-name dir))) (t ""))) (pos (if (and byte-compile-current-file (integerp byte-compile-read-position)) @@ -1746,11 +1754,11 @@ The value is non-nil if there were no errors, nil if errors." (if (with-current-buffer input-buffer no-byte-compile) (progn ;; (message "%s not compiled because of `no-byte-compile: %s'" - ;; (file-relative-name filename) + ;; (byte-compile-abbreviate-file filename) ;; (with-current-buffer input-buffer no-byte-compile)) (when (file-exists-p target-file) (message "%s deleted because of `no-byte-compile: %s'" - (file-relative-name target-file) + (byte-compile-abbreviate-file target-file) (buffer-local-value 'no-byte-compile input-buffer)) (condition-case nil (delete-file target-file) (error nil))) ;; We successfully didn't compile this file. -- 2.39.2