diff options
Diffstat (limited to 'lisp/textmodes/bibtex.el')
| -rw-r--r-- | lisp/textmodes/bibtex.el | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index b1232d4c0a0..279f657c0ec 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el | |||
| @@ -4232,7 +4232,7 @@ Return t if test was successful, nil otherwise." | |||
| 4232 | (cond ((not previous)) | 4232 | (cond ((not previous)) |
| 4233 | ((member key key-list) | 4233 | ((member key key-list) |
| 4234 | (push (cons (bibtex-current-line) | 4234 | (push (cons (bibtex-current-line) |
| 4235 | (format "Duplicate key `%s'" key)) | 4235 | (format-message "Duplicate key `%s'" key)) |
| 4236 | error-list)) | 4236 | error-list)) |
| 4237 | ((and bibtex-maintain-sorted-entries | 4237 | ((and bibtex-maintain-sorted-entries |
| 4238 | (not (bibtex-lessp previous current))) | 4238 | (not (bibtex-lessp previous current))) |
| @@ -4255,8 +4255,9 @@ Return t if test was successful, nil otherwise." | |||
| 4255 | (cdr (assoc-string (car key) bibtex-reference-keys))) | 4255 | (cdr (assoc-string (car key) bibtex-reference-keys))) |
| 4256 | (bibtex-search-entry (car key)) | 4256 | (bibtex-search-entry (car key)) |
| 4257 | (push (cons (bibtex-current-line) | 4257 | (push (cons (bibtex-current-line) |
| 4258 | (format "Duplicate key `%s' in %s" (car key) | 4258 | (format-message |
| 4259 | (abbreviate-file-name (buffer-file-name buffer)))) | 4259 | "Duplicate key `%s' in %s" (car key) |
| 4260 | (abbreviate-file-name (buffer-file-name buffer)))) | ||
| 4260 | error-list)))) | 4261 | error-list)))) |
| 4261 | 4262 | ||
| 4262 | (when test-thoroughly | 4263 | (when test-thoroughly |
| @@ -4306,14 +4307,16 @@ Return t if test was successful, nil otherwise." | |||
| 4306 | (if (setq idx (nth 3 field)) | 4307 | (if (setq idx (nth 3 field)) |
| 4307 | (bibtex-vec-push alt-expect idx (car field)) | 4308 | (bibtex-vec-push alt-expect idx (car field)) |
| 4308 | (push (cons beg-line | 4309 | (push (cons beg-line |
| 4309 | (format "Required field `%s' missing" | 4310 | (format-message |
| 4310 | (car field))) | 4311 | "Required field `%s' missing" |
| 4312 | (car field))) | ||
| 4311 | error-list))) | 4313 | error-list))) |
| 4312 | (dotimes (idx num-alt) | 4314 | (dotimes (idx num-alt) |
| 4313 | (unless (aref alt-fields idx) | 4315 | (unless (aref alt-fields idx) |
| 4314 | (push (cons beg-line | 4316 | (push (cons beg-line |
| 4315 | (format "Alternative fields `%s' missing" | 4317 | (format-message |
| 4316 | (aref alt-expect idx))) | 4318 | "Alternative fields `%s' missing" |
| 4319 | (aref alt-expect idx))) | ||
| 4317 | error-list)))))))) | 4320 | error-list)))))))) |
| 4318 | (bibtex-progress-message 'done))))) | 4321 | (bibtex-progress-message 'done))))) |
| 4319 | 4322 | ||
| @@ -4327,7 +4330,8 @@ Return t if test was successful, nil otherwise." | |||
| 4327 | (unless (eq major-mode 'compilation-mode) (compilation-mode)) | 4330 | (unless (eq major-mode 'compilation-mode) (compilation-mode)) |
| 4328 | (let ((inhibit-read-only t)) | 4331 | (let ((inhibit-read-only t)) |
| 4329 | (delete-region (point-min) (point-max)) | 4332 | (delete-region (point-min) (point-max)) |
| 4330 | (insert "BibTeX mode command `bibtex-validate'\n" | 4333 | (insert (substitute-command-keys |
| 4334 | "BibTeX mode command `bibtex-validate'\n") | ||
| 4331 | (if syntax-error | 4335 | (if syntax-error |
| 4332 | "Maybe undetected errors due to syntax errors. \ | 4336 | "Maybe undetected errors due to syntax errors. \ |
| 4333 | Correct and validate again.\n" | 4337 | Correct and validate again.\n" |
| @@ -4362,9 +4366,10 @@ Return t if test was successful, nil otherwise." | |||
| 4362 | (if (or (and strings (bibtex-string= entry-type "string")) | 4366 | (if (or (and strings (bibtex-string= entry-type "string")) |
| 4363 | (assoc-string entry-type bibtex-entry-alist t)) | 4367 | (assoc-string entry-type bibtex-entry-alist t)) |
| 4364 | (if (member key key-list) | 4368 | (if (member key key-list) |
| 4365 | (push (format "%s:%d: Duplicate key `%s'\n" | 4369 | (push (format-message |
| 4366 | (buffer-file-name) | 4370 | "%s:%d: Duplicate key `%s'\n" |
| 4367 | (bibtex-current-line) key) | 4371 | (buffer-file-name) |
| 4372 | (bibtex-current-line) key) | ||
| 4368 | error-list) | 4373 | error-list) |
| 4369 | (push key key-list)))) | 4374 | (push key key-list)))) |
| 4370 | (push (cons buffer key-list) buffer-key-list))))) | 4375 | (push (cons buffer key-list) buffer-key-list))))) |
| @@ -4377,9 +4382,10 @@ Return t if test was successful, nil otherwise." | |||
| 4377 | (dolist (key (cdr (assq buffer buffer-key-list))) | 4382 | (dolist (key (cdr (assq buffer buffer-key-list))) |
| 4378 | (when (assoc-string key current-keys) | 4383 | (when (assoc-string key current-keys) |
| 4379 | (bibtex-search-entry key) | 4384 | (bibtex-search-entry key) |
| 4380 | (push (format "%s:%d: Duplicate key `%s' in %s\n" | 4385 | (push (format-message |
| 4381 | (buffer-file-name) (bibtex-current-line) key | 4386 | "%s:%d: Duplicate key `%s' in %s\n" |
| 4382 | (abbreviate-file-name (buffer-file-name buffer))) | 4387 | (buffer-file-name) (bibtex-current-line) key |
| 4388 | (abbreviate-file-name (buffer-file-name buffer))) | ||
| 4383 | error-list)))))) | 4389 | error-list)))))) |
| 4384 | 4390 | ||
| 4385 | ;; Process error list | 4391 | ;; Process error list |
| @@ -4389,7 +4395,8 @@ Return t if test was successful, nil otherwise." | |||
| 4389 | (unless (eq major-mode 'compilation-mode) (compilation-mode)) | 4395 | (unless (eq major-mode 'compilation-mode) (compilation-mode)) |
| 4390 | (let ((inhibit-read-only t)) | 4396 | (let ((inhibit-read-only t)) |
| 4391 | (delete-region (point-min) (point-max)) | 4397 | (delete-region (point-min) (point-max)) |
| 4392 | (insert "BibTeX mode command `bibtex-validate-globally'\n\n") | 4398 | (insert (substitute-command-keys |
| 4399 | "BibTeX mode command `bibtex-validate-globally'\n\n")) | ||
| 4393 | (dolist (err (sort error-list 'string-lessp)) (insert err)) | 4400 | (dolist (err (sort error-list 'string-lessp)) (insert err)) |
| 4394 | (set-buffer-modified-p nil)) | 4401 | (set-buffer-modified-p nil)) |
| 4395 | (goto-char (point-min)) | 4402 | (goto-char (point-min)) |
| @@ -5280,7 +5287,7 @@ where FILE is the BibTeX file of ENTRY." | |||
| 5280 | (bibtex-display-entries entries) | 5287 | (bibtex-display-entries entries) |
| 5281 | (message "No BibTeX entries %smatching `%s'" | 5288 | (message "No BibTeX entries %smatching `%s'" |
| 5282 | (if (string= "" field) "" | 5289 | (if (string= "" field) "" |
| 5283 | (format "with field `%s' " field)) | 5290 | (format-message "with field `%s' " field)) |
| 5284 | regexp))) | 5291 | regexp))) |
| 5285 | entries)) | 5292 | entries)) |
| 5286 | 5293 | ||