diff options
| author | Paul Eggert | 2015-05-25 13:06:11 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-05-25 13:22:36 -0700 |
| commit | 1efdf7feb3e1a56649ea5da621cdf246d9a4ec50 (patch) | |
| tree | 9d39a432c32de5c2c099fad246d7d1d1c9224384 | |
| parent | 175a07a1329eb03176882436af86b3401c91ab77 (diff) | |
| download | emacs-1efdf7feb3e1a56649ea5da621cdf246d9a4ec50.tar.gz emacs-1efdf7feb3e1a56649ea5da621cdf246d9a4ec50.zip | |
Make TAGS files more portable to MS-Windows
* etc/NEWS: Document this.
* lib-src/etags.c (readline_internal) [DOS_NT]:
Don't treat CRs differently from GNUish hosts.
* lisp/progmodes/etags.el (etags-goto-tag-location):
Adjust STARTPOS to account for the skipped CRs in dos-style files.
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lib-src/etags.c | 9 | ||||
| -rw-r--r-- | lisp/progmodes/etags.el | 11 |
3 files changed, 12 insertions, 11 deletions
| @@ -992,6 +992,9 @@ of Windows starting with Windows 9X. | |||
| 992 | +++ | 992 | +++ |
| 993 | ** Emacs running on MS-Windows now supports the daemon mode. | 993 | ** Emacs running on MS-Windows now supports the daemon mode. |
| 994 | 994 | ||
| 995 | ** The byte counts in etags-generated TAGS files are now the same on | ||
| 996 | MS-Windows as they are on other platforms. | ||
| 997 | |||
| 995 | ** OS X 10.5 or older is no longer supported. | 998 | ** OS X 10.5 or older is no longer supported. |
| 996 | 999 | ||
| 997 | ** OS X on PowerPC is no longer supported. | 1000 | ** OS X on PowerPC is no longer supported. |
diff --git a/lib-src/etags.c b/lib-src/etags.c index f124d290da3..8b7f53c808b 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -6075,16 +6075,7 @@ readline_internal (linebuffer *lbp, FILE *stream, char const *filename) | |||
| 6075 | if (p > buffer && p[-1] == '\r') | 6075 | if (p > buffer && p[-1] == '\r') |
| 6076 | { | 6076 | { |
| 6077 | p -= 1; | 6077 | p -= 1; |
| 6078 | #ifdef DOS_NT | ||
| 6079 | /* Assume CRLF->LF translation will be performed by Emacs | ||
| 6080 | when loading this file, so CRs won't appear in the buffer. | ||
| 6081 | It would be cleaner to compensate within Emacs; | ||
| 6082 | however, Emacs does not know how many CRs were deleted | ||
| 6083 | before any given point in the file. */ | ||
| 6084 | chars_deleted = 1; | ||
| 6085 | #else | ||
| 6086 | chars_deleted = 2; | 6078 | chars_deleted = 2; |
| 6087 | #endif | ||
| 6088 | } | 6079 | } |
| 6089 | else | 6080 | else |
| 6090 | { | 6081 | { |
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 60ea456d57c..9ff164e15ef 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -1355,9 +1355,16 @@ hits the start of file." | |||
| 1355 | pat (concat (if (eq selective-display t) | 1355 | pat (concat (if (eq selective-display t) |
| 1356 | "\\(^\\|\^m\\)" "^") | 1356 | "\\(^\\|\^m\\)" "^") |
| 1357 | (regexp-quote (car tag-info)))) | 1357 | (regexp-quote (car tag-info)))) |
| 1358 | ;; The character position in the tags table is 0-origin. | 1358 | ;; The character position in the tags table is 0-origin and counts CRs. |
| 1359 | ;; Convert it to a 1-origin Emacs character position. | 1359 | ;; Convert it to a 1-origin Emacs character position. |
| 1360 | (if startpos (setq startpos (1+ startpos))) | 1360 | (when startpos |
| 1361 | (setq startpos (1+ startpos)) | ||
| 1362 | (when (and line | ||
| 1363 | (eq 1 (coding-system-eol-type buffer-file-coding-system))) | ||
| 1364 | ;; Act as if CRs were elided from all preceding lines. | ||
| 1365 | ;; Although this doesn't always give exactly the correct position, | ||
| 1366 | ;; it does typically improve the guess. | ||
| 1367 | (setq startpos (- startpos (1- line))))) | ||
| 1361 | ;; If no char pos was given, try the given line number. | 1368 | ;; If no char pos was given, try the given line number. |
| 1362 | (or startpos | 1369 | (or startpos |
| 1363 | (if line | 1370 | (if line |