emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 258/299: Prettify file names in error overview.


From: Stefan Monnier
Subject: [elpa] 258/299: Prettify file names in error overview.
Date: Sun, 02 Nov 2014 03:11:50 +0000

monnier pushed a commit to branch externals/auctex
in repository elpa.

commit 4db3ed960f2d200802b7be6faa94501f03d908ea
Author: Mosè Giordano <address@hidden>
Date:   Sat Jun 28 17:26:12 2014 +0200

    Prettify file names in error overview.
    
    * tex-buf.el (TeX-error-overview-make-entries): Add optional
    `master-dir' argument, to shorten file names when they are relative.
    (TeX-error-overview): Pass `TeX-master-directory' as argument to
    `TeX-error-overview-make-entries'.
---
 ChangeLog  |    4 ++++
 tex-buf.el |   13 +++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 96fde52..9b163cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,6 +30,10 @@
        (TeX-error-overview): New function.
        (TeX-find-display-help): Expand the name of the file to be visited
        starting from the directory of the master file.
+       (TeX-error-overview-make-entries): Add optional `master-dir'
+       argument, to shorten file names when they are relative.
+       (TeX-error-overview): Pass `TeX-master-directory' as argument to
+       `TeX-error-overview-make-entries'.
 
        * tex.el (TeX-error-overview): Autoload `TeX-error-overview'.
        (TeX-mode-specific-command-menu-entries): Add an entry for the
diff --git a/tex-buf.el b/tex-buf.el
index 7f669fb..b8785d2 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -2498,8 +2498,9 @@ please restart TeX error overview")))
       (message "No more errors.")
       (beep))))
 
-(defun TeX-error-overview-make-entries ()
-  "Generate the list of errors to be printed using `tabulated-list-entries'."
+(defun TeX-error-overview-make-entries (&optional master-dir)
+  "Generate the list of errors to be printed using `tabulated-list-entries'.
+Write file names relative to MASTER-DIR when they are not absolute."
   (with-current-buffer TeX-error-overview-active-buffer
     (let ((id 0)
          type file line msg entries)
@@ -2516,7 +2517,11 @@ please restart TeX error overview")))
           id
           (vector
            ;; File.
-           (if (stringp file) file "")
+           (if (stringp file)
+               (if (file-name-absolute-p file)
+                   file
+                 (file-relative-name file master-dir))
+             "")
            ;; Line.
            (if (numberp line)
                (number-to-string line)
@@ -2634,7 +2639,7 @@ forward, if negative)."
                TeX-error-list)
              (progn
                (setq TeX-error-overview-list-entries
-                     (TeX-error-overview-make-entries)
+                     (TeX-error-overview-make-entries (TeX-master-directory))
                      TeX-error-overview-orig-window (selected-window)
                      TeX-error-overview-orig-frame
                      (window-frame TeX-error-overview-orig-window))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]