Now on revision 112962. ------------------------------------------------------------ revno: 112962 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-12 23:35:32 -0700 message: * etc/NEWS: Mention term-suppress-hard-newline diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-06-13 05:19:59 +0000 +++ etc/NEWS 2013-06-13 06:35:32 +0000 @@ -365,6 +365,8 @@ TRAMP-using variants can still be used by enabling the eshell-tramp module. +** New term.el option `term-suppress-hard-newline'. + ** Obsolete packages: *** longlines.el is obsolete; use visual-line-mode instead. ------------------------------------------------------------ revno: 112961 committer: Michael Albinus branch nick: trunk timestamp: Thu 2013-06-13 08:28:05 +0200 message: Fix typo in comment. diff: === modified file 'configure.ac' --- configure.ac 2013-06-11 18:05:05 +0000 +++ configure.ac 2013-06-13 06:28:05 +0000 @@ -86,7 +86,7 @@ ])dnl dnl OPTION_DEFAULT_ON(NAME, HELP-STRING) -dnl Create a new --with option that defaults to $enable_features. +dnl Create a new --with option that defaults to $with_features. dnl NAME is the base name of the option. The shell variable with_NAME dnl will be set either to 'no' (for a plain --without-NAME) or to dnl 'yes' (if the option is not specified). Note that the shell ------------------------------------------------------------ revno: 112960 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-12 23:18:57 -0700 message: * admin/admin.el (manual-style-string): Use new file manual.css. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2013-06-02 13:33:09 +0000 +++ admin/ChangeLog 2013-06-13 06:18:57 +0000 @@ -1,9 +1,12 @@ +2013-06-13 Glenn Morris + + * admin.el (manual-style-string): Use new file manual.css. + 2013-06-02 Eric Ludlam * grammars/srecode-template.wy (variable): Accept a single number as a variable value. Allows the 'priority' to be set to a number. - (wisent-srecode-template-lexer): Move number up so it can be - created. + (wisent-srecode-template-lexer): Move number up so it can be created. 2013-05-16 Glenn Morris === modified file 'admin/admin.el' --- admin/admin.el 2013-03-16 22:08:22 +0000 +++ admin/admin.el 2013-06-13 06:18:57 +0000 @@ -271,7 +271,7 @@ \n\n") (defconst manual-style-string "\n") +@import url('/s/emacs/manual.css');\n\n") (defun manual-misc-html (name root html-node-dir html-mono-dir) (let ((texi (expand-file-name (format "doc/misc/%s.texi" name) root))) ------------------------------------------------------------ revno: 112959 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2013-06-13 06:07:43 +0000 message: lisp/gnus/eww.el (eww): Prepend urls with http:// if scheme is missing (eww-mode): Use `define-derived-mode' (eww-parse-headers): Parse headers from beginning of buffer so that file:// links work (eww-detect-charset): Detect charset from the tag diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-06-12 22:32:33 +0000 +++ lisp/gnus/ChangeLog 2013-06-13 06:07:43 +0000 @@ -1,3 +1,14 @@ +2013-06-13 Rüdiger Sonderfeld + + * eww.el (eww): Prepend urls with http:// if scheme is missing. + (eww-mode): Use `define-derived-mode'. + (eww-parse-headers): Parse headers from beginning of buffer so that + file:// links work. + +2013-06-13 Katsumi Yamaoka + + * eww.el (eww-detect-charset): Detect charset from the tag. + 2013-06-12 Lars Magne Ingebrigtsen * shr.el (shr-tag-svg): Ignore SVG elements, because we don't know how === modified file 'lisp/gnus/eww.el' --- lisp/gnus/eww.el 2013-06-12 01:38:23 +0000 +++ lisp/gnus/eww.el 2013-06-13 06:07:43 +0000 @@ -36,8 +36,22 @@ (defun eww (url) "Fetch URL and render the page." (interactive "sUrl: ") + (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url) + (setq url (concat "http://" url))) (url-retrieve url 'eww-render (list url))) +(defun eww-detect-charset (html-p) + (let ((case-fold-search t) + (pt (point))) + (or (and html-p + (re-search-forward + "]*charset=\\([^\t\n\r \"/>]+\\)" nil t) + (goto-char pt) + (match-string 1)) + (and (looking-at + "[\t\n\r ]*<\\?xml[\t\n\r ]+[^>]*encoding=\"\\([^\"]+\\)") + (match-string 1))))) + (defun eww-render (status url &optional point) (let* ((headers (eww-parse-headers)) (content-type @@ -47,6 +61,8 @@ (charset (intern (downcase (or (cdr (assq 'charset (cdr content-type))) + (eww-detect-charset (equal (car content-type) + "text/html")) "utf8")))) (data-buffer (current-buffer))) (unwind-protect @@ -64,6 +80,7 @@ (defun eww-parse-headers () (let ((headers nil)) + (goto-char (point-min)) (while (and (not (eobp)) (not (eolp))) (when (looking-at "\\([^:]+\\): *\\(.*\\)") @@ -129,17 +146,12 @@ ;;(define-key map "n" 'eww-next-url) map)) -(defun eww-mode () +(define-derived-mode eww-mode nil "eww" "Mode for browsing the web. \\{eww-mode-map}" - (interactive) - (setq major-mode 'eww-mode - mode-name "eww") (set (make-local-variable 'eww-current-url) 'author) - (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url) - ;;(setq buffer-read-only t) - (use-local-map eww-mode-map)) + (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url)) (defun eww-browse-url (url &optional new-window) (push (list eww-current-url (point)) ------------------------------------------------------------ revno: 112958 fixes bug: http://debbugs.gnu.org/12017 author: Michael Hoffman <9qobl2n02@sneakemail.com> committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-12 22:27:05 -0700 message: * term.el (term-suppress-hard-newline): New option (tiny change) (term-emulate-terminal): Respect term-suppress-hard-newline. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-13 05:10:48 +0000 +++ lisp/ChangeLog 2013-06-13 05:27:05 +0000 @@ -1,3 +1,8 @@ +2013-06-13 Michael Hoffman <9qobl2n02@sneakemail.com> (tiny change) + + * term.el (term-suppress-hard-newline): New option. (Bug#12017) + (term-emulate-terminal): Respect term-suppress-hard-newline. + 2013-06-13 E Sabof (tiny change) * image-dired.el (image-dired-dired-toggle-marked-thumbs): === modified file 'lisp/term.el' --- lisp/term.el 2013-05-11 02:15:46 +0000 +++ lisp/term.el 2013-06-13 05:27:05 +0000 @@ -560,6 +560,13 @@ :type 'boolean :group 'term) +(defcustom term-suppress-hard-newline nil + "Non-nil means interpreter should not break long lines with newlines. +This means text can automatically reflow if the window is resized." + :version "24.4" + :type 'boolean + :group 'term) + ;; Where gud-display-frame should put the debugging arrow. This is ;; set by the marker-filter, which scans the debugger's output for ;; indications of the current pc. @@ -2828,8 +2835,9 @@ (setq count (length decoded-substring)) (setq temp (- (+ (term-horizontal-column) count) term-width)) - (cond ((<= temp 0)) ;; All count chars fit in line. - ((> count temp) ;; Some chars fit. + (cond ((or term-suppress-hard-newline (<= temp 0))) + ;; All count chars fit in line. + ((> count temp) ;; Some chars fit. ;; This iteration, handle only what fits. (setq count (- count temp)) (setq count-bytes ------------------------------------------------------------ revno: 112957 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-12 22:19:59 -0700 message: * etc/NEWS: Add entry about utf-8 for elisp files diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-06-11 21:38:35 +0000 +++ etc/NEWS 2013-06-13 05:19:59 +0000 @@ -438,6 +438,15 @@ * Lisp Changes in Emacs 24.4 +FIXME - someone who knows what they are talking about, please improve +this - see http://debbugs.gnu.org/14596 +** The default file coding for Emacs Lisp files is now utf-8. +(See file-coding-system-alist.) In most cases, this change is +totally transparent. Files that contain unusual characters but do +not specify an explicit coding system may fail to load with obscure +errors. You should either convert them to utf-8 or add an explicit +coding: cookie. + ** Obsoleted functions: *** `dont-compile' *** `lisp-complete-symbol' ------------------------------------------------------------ revno: 112956 fixes bug: http://debbugs.gnu.org/14479 author: Kelly Dean committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-12 22:13:05 -0700 message: * src/fileio.c (Fdo_auto_save): Trap errors in auto-save-hook (tiny change) diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-06-12 01:12:59 +0000 +++ src/ChangeLog 2013-06-13 05:13:05 +0000 @@ -1,3 +1,7 @@ +2013-06-13 Kelly Dean (tiny change) + + * fileio.c (Fdo_auto_save): Trap errors in auto-save-hook. (Bug#14479) + 2013-06-12 Xue Fuqiao * fileio.c (expand_file_name): Doc fix. === modified file 'src/fileio.c' --- src/fileio.c 2013-06-12 01:12:59 +0000 +++ src/fileio.c 2013-06-13 05:13:05 +0000 @@ -5596,7 +5596,7 @@ point to non-strings reached from Vbuffer_alist. */ hook = intern ("auto-save-hook"); - Frun_hooks (1, &hook); + safe_run_hooks (hook); if (STRINGP (Vauto_save_list_file_name)) { ------------------------------------------------------------ revno: 112955 fixes bug: http://debbugs.gnu.org/14548 author: E Sabof committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-12 22:10:48 -0700 message: image-dired-dired-toggle-marked-thumbs tiny change * lisp/image-dired.el (image-dired-dired-toggle-marked-thumbs): Only remove a `thumb-file' overlay. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-12 16:08:17 +0000 +++ lisp/ChangeLog 2013-06-13 05:10:48 +0000 @@ -1,3 +1,8 @@ +2013-06-13 E Sabof (tiny change) + + * image-dired.el (image-dired-dired-toggle-marked-thumbs): + Only remove a `thumb-file' overlay. (Bug#14548) + 2013-06-12 Grégoire Jadi * mail/reporter.el (reporter-submit-bug-report): === modified file 'lisp/image-dired.el' --- lisp/image-dired.el 2013-02-17 00:45:53 +0000 +++ lisp/image-dired.el 2013-06-13 05:10:48 +0000 @@ -156,8 +156,9 @@ (require 'format-spec) (require 'widget) +(require 'cl-lib) + (eval-when-compile - (require 'cl-lib) (require 'wid-edit)) (defgroup image-dired nil @@ -657,9 +658,12 @@ (string-match-p (image-file-name-regexp) image-file)) (setq thumb-file (image-dired-get-thumbnail-image image-file)) ;; If image is not already added, then add it. - (let ((cur-ov (overlays-in (point) (1+ (point))))) - (if cur-ov - (delete-overlay (car cur-ov)) + (let* ((cur-ovs (overlays-in (point) (1+ (point)))) + (thumb-ov (car (cl-remove-if-not + (lambda (ov) (overlay-get ov 'thumb-file)) + cur-ovs)))) + (if thumb-ov + (delete-overlay thumb-ov) (put-image thumb-file image-pos) (setq overlay (cl-loop for o in (overlays-in (point) (1+ (point))) ------------------------------------------------------------ revno: 112954 author: Lars Magne Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2013-06-12 22:32:33 +0000 message: lisp/gnus/shr.el (shr-tag-svg): Ignore diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-06-12 01:38:23 +0000 +++ lisp/gnus/ChangeLog 2013-06-12 22:32:33 +0000 @@ -1,3 +1,8 @@ +2013-06-12 Lars Magne Ingebrigtsen + + * shr.el (shr-tag-svg): Ignore SVG elements, because we don't know how + to handle them at all. + 2013-06-11 Lars Magne Ingebrigtsen * eww.el (eww-convert-widgets): Make widgets from non-tabular layouts === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2013-06-10 22:12:47 +0000 +++ lisp/gnus/shr.el 2013-06-12 22:32:33 +0000 @@ -891,6 +891,9 @@ (defun shr-tag-comment (cont) ) +(defun shr-tag-svg (cont) + ) + (defun shr-tag-sup (cont) (let ((start (point))) (shr-generic cont) ------------------------------------------------------------ revno: 112953 fixes bug: http://debbugs.gnu.org/14600 author: Grégoire Jadi committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-12 09:08:17 -0700 message: * mail/reporter.el (reporter-submit-bug-report): Handle missing package-name. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-12 12:42:35 +0000 +++ lisp/ChangeLog 2013-06-12 16:08:17 +0000 @@ -1,3 +1,8 @@ +2013-06-12 Grégoire Jadi + + * mail/reporter.el (reporter-submit-bug-report): + Handle missing package-name. (Bug#14600) + 2013-06-12 Rüdiger Sonderfeld * textmodes/reftex-cite.el (reftex-cite-regexp-hist) === modified file 'lisp/mail/reporter.el' --- lisp/mail/reporter.el 2013-01-01 09:11:05 +0000 +++ lisp/mail/reporter.el 2013-06-12 16:08:17 +0000 @@ -341,10 +341,10 @@ (mail-position-on-field "to") (insert address) ;; insert problem summary if available - (if (and reporter-prompt-for-summary-p problem pkgname) - (progn - (mail-position-on-field "subject") - (insert pkgname "; " problem))) + (when (and reporter-prompt-for-summary-p problem) + (mail-position-on-field "subject") + (if pkgname (insert pkgname "; ")) + (insert problem)) ;; move point to the body of the message (mail-text) (forward-line 1) ------------------------------------------------------------ revno: 112952 committer: Tassilo Horn branch nick: trunk timestamp: Wed 2013-06-12 16:43:46 +0200 message: * automated/reftex-tests.el (reftex-parse-from-file-test): Fix test. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2013-06-12 12:49:25 +0000 +++ test/ChangeLog 2013-06-12 14:43:46 +0000 @@ -1,5 +1,10 @@ 2013-06-12 Rüdiger Sonderfeld + * automated/reftex-tests.el (reftex-parse-from-file-test): Fix + test. + +2013-06-12 Rüdiger Sonderfeld + * automated/reftex-tests.el: New test suite for reftex. 2013-05-31 Dmitry Gutov === modified file 'test/automated/reftex-tests.el' --- test/automated/reftex-tests.el 2013-06-12 12:49:25 +0000 +++ test/automated/reftex-tests.el 2013-06-12 14:43:46 +0000 @@ -115,6 +115,7 @@ (with-temp-buffer (insert "test\n") (write-region (point-min) (point-max) bib-file)) + (reftex-ensure-compiled-variables) (let ((parsed (reftex-parse-from-file tex-file nil temp-dir))) (should (equal (car parsed) `(eof ,tex-file))) (pop parsed) ------------------------------------------------------------ revno: 112951 committer: Tassilo Horn branch nick: trunk timestamp: Wed 2013-06-12 14:49:25 +0200 message: * automated/reftex-tests.el: New test suite for reftex. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2013-05-31 06:04:33 +0000 +++ test/ChangeLog 2013-06-12 12:49:25 +0000 @@ -1,3 +1,7 @@ +2013-06-12 Rüdiger Sonderfeld + + * automated/reftex-tests.el: New test suite for reftex. + 2013-05-31 Dmitry Gutov * automated/ruby-mode-tests.el: New tests, for percent literals === added file 'test/automated/reftex-tests.el' --- test/automated/reftex-tests.el 1970-01-01 00:00:00 +0000 +++ test/automated/reftex-tests.el 2013-06-12 12:49:25 +0000 @@ -0,0 +1,200 @@ +;;; reftex-tests.el --- Test suite for reftex. -*- lexical-binding: t -*- + +;; Copyright (C) 2013 Free Software Foundation, Inc. + +;; Author: Rüdiger Sonderfeld +;; Keywords: internal +;; Human-Keywords: internal + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Code: + +(require 'ert) + +;;; reftex +(require 'reftex) + +;;; reftex-parse +(require 'reftex-parse) + +(ert-deftest reftex-locate-bibliography-files () + "Test `reftex-locate-bibliography-files'." + (let ((temp-dir (make-temp-file "reftex-bib" 'dir)) + (files '("ref1.bib" "ref2.bib")) + (test '(("\\addbibresource{ref1.bib}\n" . ("ref1.bib")) + ("\\\\addbibresource[label=x]{ref2.bib}\\n" . ("ref2.bib")) + ("\\begin{document}\n\\bibliographystyle{plain}\n +\\bibliography{ref1,ref2}\n\\end{document}" . ("ref1.bib" "ref2.bib")))) + (reftex-bibliography-commands + ;; Default value: See reftex-vars.el `reftex-bibliography-commands' + '("bibliography" "nobibliography" "setupbibtex\\[.*?database=" + "addbibresource"))) + (with-temp-buffer + (insert "test\n") + (mapc + (lambda (file) + (write-region (point-min) (point-max) (expand-file-name file + temp-dir))) + files)) + (mapc + (lambda (data) + (with-temp-buffer + (insert (car data)) + (let ((res (mapcar #'file-name-nondirectory + (reftex-locate-bibliography-files temp-dir)))) + (should (equal res (cdr data)))))) + test) + (delete-directory temp-dir 'recursive))) + +(ert-deftest reftex-what-environment-test () + "Test `reftex-what-environment'." + (with-temp-buffer + (insert "\\begin{equation}\n x=y^2\n") + (let ((pt (point)) + pt2) + (insert "\\end{equation}\n") + (goto-char pt) + + (should (equal (reftex-what-environment 1) '("equation" . 1))) + (should (equal (reftex-what-environment t) '(("equation" . 1)))) + + (insert "\\begin{something}\nxxx") + (setq pt2 (point)) + (insert "\\end{something}") + (goto-char pt2) + (should (equal (reftex-what-environment 1) `("something" . ,pt))) + (should (equal (reftex-what-environment t) `(("something" . ,pt) + ("equation" . 1)))) + (should (equal (reftex-what-environment t pt) `(("something" . ,pt)))) + (should (equal (reftex-what-environment '("equation")) + '("equation" . 1)))))) + +(ert-deftest reftex-roman-number-test () + "Test `reftex-roman-number'." + (let ((hindu-arabic '(1 2 4 9 14 1050)) + (roman '("I" "II" "IV" "IX" "XIV" "ML"))) + (while (and hindu-arabic roman) + (should (string= (reftex-roman-number (car hindu-arabic)) + (car roman))) + (pop roman) + (pop hindu-arabic)))) + +(ert-deftest reftex-parse-from-file-test () + "Test `reftex-parse-from-file'." + (let* ((temp-dir (make-temp-file "reftex-parse" 'dir)) + (tex-file (expand-file-name "test.tex" temp-dir)) + (bib-file (expand-file-name "ref.bib" temp-dir))) + (with-temp-buffer + (insert +"\\begin{document} +\\section{test}\\label{sec:test} +\\subsection{subtest} + +\\begin{align*}\\label{eq:foo} + x &= y^2 +\\end{align*} + +\\bibliographystyle{plain} +\\bibliography{ref} +\\end{document}") + (write-region (point-min) (point-max) tex-file)) + (with-temp-buffer + (insert "test\n") + (write-region (point-min) (point-max) bib-file)) + (let ((parsed (reftex-parse-from-file tex-file nil temp-dir))) + (should (equal (car parsed) `(eof ,tex-file))) + (pop parsed) + (while parsed + (let ((entry (pop parsed))) + (cond + ((eq (car entry) 'bib) + (should (string= (cadr entry) bib-file))) + ((eq (car entry) 'toc)) ;; ... + ((string= (car entry) "eq:foo")) + ((string= (car entry) "sec:test")) + ((eq (car entry) 'bof) + (should (string= (cadr entry) tex-file)) + (should (null parsed))) + (t (should-not t))))) + (delete-directory temp-dir 'recursive)))) + +;;; reftex-cite +(require 'reftex-cite) + +(ert-deftest reftex-parse-bibtex-entry-test () + "Test `reftex-parse-bibtex-entry'." + (let ((entry "@Book{Stallman12, + author = {Richard Stallman\net al.}, + title = {The Emacs Editor}, + publisher = {GNU Press}, + year = 2012, + edition = {17th}, + note = {Updated for Emacs Version 24.2} +}") + (check (function + (lambda (parsed) + (should (string= (reftex-get-bib-field "&key" parsed) + "Stallman12")) + (should (string= (reftex-get-bib-field "&type" parsed) + "book")) + (should (string= (reftex-get-bib-field "author" parsed) + "Richard Stallman et al.")) + (should (string= (reftex-get-bib-field "title" parsed) + "The Emacs Editor")) + (should (string= (reftex-get-bib-field "publisher" parsed) + "GNU Press")) + (should (string= (reftex-get-bib-field "year" parsed) + "2012")) + (should (string= (reftex-get-bib-field "edition" parsed) + "17th")) + (should (string= (reftex-get-bib-field "note" parsed) + "Updated for Emacs Version 24.2")))))) + (funcall check (reftex-parse-bibtex-entry entry)) + (with-temp-buffer + (insert entry) + (funcall check (reftex-parse-bibtex-entry nil (point-min) + (point-max)))))) + +(ert-deftest reftex-get-bib-names-test () + "Test `reftex-get-bib-names'." + (let ((entry (reftex-parse-bibtex-entry "@article{Foo123, + author = {Jane Roe and\tJohn Doe and W. Public}, +}"))) + (should (equal (reftex-get-bib-names "author" entry) + '("Jane Roe" "John Doe" "Public")))) + (let ((entry (reftex-parse-bibtex-entry "@article{Foo123, + editor = {Jane Roe and\tJohn Doe and W. Public}, +}"))) + (should (equal (reftex-get-bib-names "author" entry) + '("Jane Roe" "John Doe" "Public"))))) + +(ert-deftest reftex-format-citation-test () + "Test `reftex-format-citation'." + (let ((entry (reftex-parse-bibtex-entry +"@article{Foo13, + author = {Jane Roe and John Doe and Jane Q. Taxpayer}, + title = {Some Article}, + journal = {Some Journal}, + year = 2013, + pages = {1--333} +}"))) + (should (string= (reftex-format-citation entry nil) "\\cite{Foo13}")) + (should (string= (reftex-format-citation entry "%l:%A:%y:%t %j %P %a") + "Foo13:Jane Roe:2013:Some Article Some Journal 1 Jane Roe, John Doe \\& Jane Taxpayer")))) + +(provide 'reftex-tests) +;;; reftex-tests.el ends here. ------------------------------------------------------------ revno: 112950 committer: Tassilo Horn branch nick: trunk timestamp: Wed 2013-06-12 14:42:35 +0200 message: * textmodes/reftex-cite.el (reftex-cite-regexp-hist) (reftex-citation-prompt, reftex-default-bibliography) (reftex-bib-or-thebib, reftex-get-bibfile-list) (reftex-pop-to-bibtex-entry, reftex-extract-bib-entries) (reftex-bib-sort-author, reftex-bib-sort-year) (reftex-bib-sort-year-reverse, reftex-get-crossref-alist) (reftex-extract-bib-entries-from-thebibliography) (reftex-get-bibkey-default, reftex-get-bib-names) (reftex-parse-bibtex-entry, reftex-get-bib-field) (reftex-format-bib-entry, reftex-parse-bibitem) (reftex-format-bibitem, reftex-do-citation) (reftex-figure-out-cite-format, reftex-offer-bib-menu) (reftex-restrict-bib-matches, reftex-extract-bib-file) (reftex-insert-bib-matches, reftex-format-citation) (reftex-make-cite-echo-string, reftex-bibtex-selection-callback) (reftex-create-bibtex-file): Add docstrings, mostly by converting existing comments into docstrings. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-12 12:12:47 +0000 +++ lisp/ChangeLog 2013-06-12 12:42:35 +0000 @@ -1,3 +1,23 @@ +2013-06-12 Rüdiger Sonderfeld + + * textmodes/reftex-cite.el (reftex-cite-regexp-hist) + (reftex-citation-prompt, reftex-default-bibliography) + (reftex-bib-or-thebib, reftex-get-bibfile-list) + (reftex-pop-to-bibtex-entry, reftex-extract-bib-entries) + (reftex-bib-sort-author, reftex-bib-sort-year) + (reftex-bib-sort-year-reverse, reftex-get-crossref-alist) + (reftex-extract-bib-entries-from-thebibliography) + (reftex-get-bibkey-default, reftex-get-bib-names) + (reftex-parse-bibtex-entry, reftex-get-bib-field) + (reftex-format-bib-entry, reftex-parse-bibitem) + (reftex-format-bibitem, reftex-do-citation) + (reftex-figure-out-cite-format, reftex-offer-bib-menu) + (reftex-restrict-bib-matches, reftex-extract-bib-file) + (reftex-insert-bib-matches, reftex-format-citation) + (reftex-make-cite-echo-string, reftex-bibtex-selection-callback) + (reftex-create-bibtex-file): Add docstrings, mostly by converting + existing comments into docstrings. + 2013-06-12 Xue Fuqiao * ibuf-ext.el (ibuffer-mark-help-buffers): Doc fix. === modified file 'lisp/textmodes/reftex-cite.el' --- lisp/textmodes/reftex-cite.el 2013-04-10 14:48:44 +0000 +++ lisp/textmodes/reftex-cite.el 2013-06-12 12:42:35 +0000 @@ -25,18 +25,16 @@ ;;; Code: (eval-when-compile (require 'cl)) -(provide 'reftex-cite) + (require 'reftex) -;;; - -;; Variables and constants - -;; The history list of regular expressions used for citations -(defvar reftex-cite-regexp-hist nil) - -;; Prompt and help string for citation selection + +;;; Variables and constants +(defvar reftex-cite-regexp-hist nil + "The history list of regular expressions used for citations") + (defconst reftex-citation-prompt - "Select: [n]ext [p]revious [r]estrict [ ]full_entry [q]uit RET [?]Help+more") + "Select: [n]ext [p]revious [r]estrict [ ]full_entry [q]uit RET [?]Help+more" + "Prompt and help string for citation selection") (defconst reftex-citation-help " n / p Go to next/previous entry (Cursor motion works as well). @@ -51,8 +49,7 @@ e / E Create BibTeX file with all (marked/unmarked) entries a / A Put all (marked) entries into one/many \\cite commands.") -;; Find bibtex files - +;;; Find bibtex files (defmacro reftex-with-special-syntax-for-bib (&rest body) `(let ((saved-syntax (syntax-table))) (unwind-protect @@ -62,8 +59,8 @@ (set-syntax-table saved-syntax)))) (defun reftex-default-bibliography () - ;; Return the expanded value of `reftex-default-bibliography'. - ;; The expanded value is cached. + "Return the expanded value of variable `reftex-default-bibliography'. +The expanded value is cached." (unless (eq (get 'reftex-default-bibliography :reftex-raw) reftex-default-bibliography) (put 'reftex-default-bibliography :reftex-expanded @@ -74,9 +71,8 @@ (get 'reftex-default-bibliography :reftex-expanded)) (defun reftex-bib-or-thebib () - ;; Tests if BibTeX or \begin{thebibliography} should be used for the - ;; citation - ;; Find the bof of the current file + "Test if BibTeX or \begin{thebibliography} should be used for the citation. +Find the bof of the current file" (let* ((docstruct (symbol-value reftex-docstruct-symbol)) (rest (or (member (list 'bof (buffer-file-name)) docstruct) docstruct)) @@ -94,11 +90,11 @@ (if thebib 'thebib nil)))) (defun reftex-get-bibfile-list () - ;; Return list of bibfiles for current document. - ;; When using the chapterbib or bibunits package you should either - ;; use the same database files everywhere, or separate parts using - ;; different databases into different files (included into the mater file). - ;; Then this function will return the applicable database files. + "Return list of bibfiles for current document. +When using the chapterbib or bibunits package you should either +use the same database files everywhere, or separate parts using +different databases into different files (included into the mater file). +Then this function will return the applicable database files." ;; Ensure access to scanning info (reftex-access-scan-info) @@ -115,16 +111,14 @@ (cdr (assq 'bib (symbol-value reftex-docstruct-symbol))) (error "\\bibliography statement missing or .bib files not found"))) -;; Find a certain reference in any of the BibTeX files. - +;;; Find a certain reference in any of the BibTeX files. (defun reftex-pop-to-bibtex-entry (key file-list &optional mark-to-kill highlight item return) - ;; Find BibTeX KEY in any file in FILE-LIST in another window. - ;; If MARK-TO-KILL is non-nil, mark new buffer to kill. - ;; If HIGHLIGHT is non-nil, highlight the match. - ;; If ITEM in non-nil, search for bibitem instead of database entry. - ;; If RETURN is non-nil, just return the entry and restore point. - + "Find BibTeX KEY in any file in FILE-LIST in another window. +If MARK-TO-KILL is non-nil, mark new buffer to kill. +If HIGHLIGHT is non-nil, highlight the match. +If ITEM in non-nil, search for bibitem instead of database entry. +If RETURN is non-nil, just return the entry and restore point." (let* ((re (if item (concat "\\\\bibitem[ \t]*\\(\\[[^]]*\\]\\)?[ \t]*{" @@ -178,12 +172,11 @@ (progn (forward-list 1) (point))) (error (min (point-max) (+ 300 (point))))))) -;; Parse bibtex buffers - +;;; Parse bibtex buffers (defun reftex-extract-bib-entries (buffers) - ;; Extract bib entries which match regexps from BUFFERS. - ;; BUFFERS is a list of buffers or file names. - ;; Return list with entries." + "Extract bib entries which match regexps from BUFFERS. +BUFFERS is a list of buffers or file names. +Return list with entries." (let* (re-list first-re rest-re (buffer-list (if (listp buffers) buffers (list buffers))) found-list entry buffer1 buffer alist @@ -309,6 +302,8 @@ (t found-list)))) (defun reftex-bib-sort-author (e1 e2) + "Compare bib entries E1 and E2 by author. +The name of the first different author/editor is used." (let ((al1 (reftex-get-bib-names "author" e1)) (al2 (reftex-get-bib-names "author" e2))) (while (and al1 al2 (string= (car al1) (car al2))) @@ -320,15 +315,17 @@ (not (stringp (car al1)))))) (defun reftex-bib-sort-year (e1 e2) + "Compare bib entries E1 and E2 by year in ascending order." (< (string-to-number (or (cdr (assoc "year" e1)) "0")) (string-to-number (or (cdr (assoc "year" e2)) "0")))) (defun reftex-bib-sort-year-reverse (e1 e2) + "Compare bib entries E1 and E2 by year in descending order." (> (string-to-number (or (cdr (assoc "year" e1)) "0")) (string-to-number (or (cdr (assoc "year" e2)) "0")))) (defun reftex-get-crossref-alist (entry) - ;; return the alist from a crossref entry + "Return the alist from a crossref ENTRY." (let ((crkey (cdr (assoc "crossref" entry))) start) (save-excursion @@ -347,10 +344,9 @@ ;; Parse the bibliography environment (defun reftex-extract-bib-entries-from-thebibliography (files) - ;; Extract bib-entries from the \begin{thebibliography} environment. - ;; Parsing is not as good as for the BibTeX database stuff. - ;; The environment should be located in file FILE. - + "Extract bib-entries from the \begin{thebibliography} environment. +Parsing is not as good as for the BibTeX database stuff. +The environment should be located in FILES." (let* (start end buf entries re re-list file default) (unless files (error "Need file name to find thebibliography environment")) @@ -430,8 +426,8 @@ entries)) (defun reftex-get-bibkey-default () - ;; Return the word before the cursor. If the cursor is in a - ;; citation macro, return the word before the macro. + "Return the word before the cursor. +If the cursor is in a citation macro, return the word before the macro." (let* ((macro (reftex-what-macro 1))) (save-excursion (if (and macro (string-match "cite" (car macro))) @@ -439,10 +435,10 @@ (skip-chars-backward "^a-zA-Z0-9") (reftex-this-word)))) -;; Parse and format individual entries - +;;; Parse and format individual entries (defun reftex-get-bib-names (field entry) - ;; Return a list with the author or editor names in ENTRY + "Return a list with the author or editor names in ENTRY. +If FIELD is empty try \"editor\" field." (let ((names (reftex-get-bib-field field entry))) (if (equal "" names) (setq names (reftex-get-bib-field "editor" entry))) @@ -457,7 +453,9 @@ (split-string names "\n"))) (defun reftex-parse-bibtex-entry (entry &optional from to raw) - ; if RAW is non-nil, keep double quotes/curly braces delimiting fields + "Parse BibTeX ENTRY. +If ENTRY is nil then parse the entry in current buffer between FROM and TO. +If RAW is non-nil, keep double quotes/curly braces delimiting fields." (let (alist key start field) (save-excursion (save-restriction @@ -518,7 +516,8 @@ alist)) (defun reftex-get-bib-field (fieldname entry &optional format) - ;; Extract the field FIELDNAME from an ENTRY + "Extract the field FIELDNAME from ENTRY. +If FORMAT is non-nil `format' entry accordingly." (let ((cell (assoc fieldname entry))) (if cell (if format @@ -527,7 +526,7 @@ ""))) (defun reftex-format-bib-entry (entry) - ;; Format a BibTeX ENTRY so that it is nice to look at + "Format a BibTeX ENTRY so that it is nice to look at." (let* ((auth-list (reftex-get-bib-names "author" entry)) (authors (mapconcat 'identity auth-list ", ")) @@ -570,7 +569,7 @@ (concat key "\n " authors " " year " " extra "\n " title "\n\n"))) (defun reftex-parse-bibitem (item) - ;; Parse a \bibitem entry + "Parse a \bibitem entry in ITEM." (let ((key "") (text "")) (when (string-match "\\`{\\([^}]+\\)}\\([^\000]*\\)" item) (setq key (match-string 1 item) @@ -586,7 +585,7 @@ (cons "&entry" (concat key " " text))))) (defun reftex-format-bibitem (item) - ;; Format a \bibitem entry so that it is (relatively) nice to look at. + "Format a \bibitem entry in ITEM so that it is (relatively) nice to look at." (let ((text (reftex-get-bib-field "&text" item)) (key (reftex-get-bib-field "&key" item)) (lines nil)) @@ -603,7 +602,7 @@ (put-text-property 0 (length text) 'face reftex-bib-author-face text)) (concat key "\n " text "\n\n"))) -;; Make a citation +;;; Make a citation ;;;###autoload (defun reftex-citation (&optional no-insert format-key) @@ -627,7 +626,6 @@ Thus, `aaaa&&bbb' matches entries which contain both `aaaa' and `bbb'. While entering the regexp, completion on knows citation keys is possible. `=' is a good regular expression to match all entries in all files." - (interactive) ;; check for recursive edit @@ -645,8 +643,7 @@ (reftex-kill-temporary-buffers))) (defun reftex-do-citation (&optional arg no-insert format-key) - ;; This really does the work of reftex-citation. - + "This really does the work of `reftex-citation'." (let* ((format (reftex-figure-out-cite-format arg no-insert format-key)) (docstruct-symbol reftex-docstruct-symbol) (selected-entries (reftex-offer-bib-menu)) @@ -743,8 +740,8 @@ (mapcar 'car selected-entries))) (defun reftex-figure-out-cite-format (arg &optional no-insert format-key) - ;; Check if there is already a cite command at point and change cite format - ;; in order to only add another reference in the same cite command. + "Check if there is already a cite command at point and change cite format +in order to only add another reference in the same cite command." (let ((macro (car (reftex-what-macro 1))) (cite-format-value (reftex-get-cite-format)) key format) @@ -802,8 +799,7 @@ (defvar reftex-select-bib-map) (defun reftex-offer-bib-menu () - ;; Offer bib menu and return list of selected items - + "Offer bib menu and return list of selected items." (let ((bibtype (reftex-bib-or-thebib)) found-list rtn key data selected-entries) (while @@ -917,7 +913,7 @@ selected-entries)) (defun reftex-restrict-bib-matches (found-list) - ;; Limit FOUND-LIST with more regular expressions + "Limit FOUND-LIST with more regular expressions." (let ((re-list (split-string (read-string "RegExp [ && RegExp...]: " nil 'reftex-cite-regexp-hist) @@ -940,7 +936,7 @@ found-list))) (defun reftex-extract-bib-file (all &optional marked complement) - ;; Limit FOUND-LIST with more regular expressions + "Limit FOUND-LIST with more regular expressions." (let ((file (read-file-name "File to create: "))) (find-file-other-window file) (if (> (buffer-size) 0) @@ -963,7 +959,7 @@ (goto-char (point-min)))) (defun reftex-insert-bib-matches (list) - ;; Insert the bib matches and number them correctly + "Insert the bib matches and number them correctly." (let ((mouse-face (if (memq reftex-highlight-selection '(mouse both)) reftex-mouse-selected-face @@ -996,8 +992,7 @@ last))))) (defun reftex-format-citation (entry format) - ;; Format a citation from the info in the BibTeX ENTRY - + "Format a citation from the info in the BibTeX ENTRY according to FORMAT." (unless (stringp format) (setq format "\\cite{%l}")) (if (and reftex-comment-citations @@ -1064,7 +1059,7 @@ format) (defun reftex-make-cite-echo-string (entry docstruct-symbol) - ;; Format a bibtex entry for the echo area and cache the result. + "Format a bibtex ENTRY for the echo area and cache the result." (let* ((key (reftex-get-bib-field "&key" entry)) (string (let* ((reftex-cite-punctuation '(" " " & " " etal."))) @@ -1088,9 +1083,9 @@ string)) (defun reftex-bibtex-selection-callback (data ignore no-revisit) - ;; Callback function to be called from the BibTeX selection, in - ;; order to display context. This function is relatively slow and not - ;; recommended for follow mode. It works OK for individual lookups. + "Callback function to be called from the BibTeX selection, in +order to display context. This function is relatively slow and not +recommended for follow mode. It works OK for individual lookups." (let ((win (selected-window)) (key (reftex-get-bib-field "&key" data)) bibfile-list item bibtype) @@ -1157,7 +1152,7 @@ alist)))) (defun reftex-create-bibtex-file (bibfile) - "Create a new BibTeX database file with all entries referenced in document. + "Create a new BibTeX database BIBFILE with all entries referenced in document. The command prompts for a filename and writes the collected entries to that file. Only entries referenced in the current document with any \\cite-like macros are used. The sequence in @@ -1247,5 +1242,5 @@ (message "%d entries extracted and copied to new database" (length entries)))) - +(provide 'reftex-cite) ;;; reftex-cite.el ends here === modified file 'lisp/textmodes/reftex-parse.el' --- lisp/textmodes/reftex-parse.el 2013-05-23 15:21:54 +0000 +++ lisp/textmodes/reftex-parse.el 2013-06-12 12:42:35 +0000 @@ -49,7 +49,8 @@ (reftex-access-scan-info '(16))) (defun reftex-do-parse (rescan &optional file) - "Do a document rescan. When allowed, do only a partial scan from FILE." + "Do a document rescan. +When allowed, do only a partial scan from FILE." ;; Normalize the rescan argument (setq rescan (cond ((eq rescan t) t) @@ -191,7 +192,7 @@ (defvar index-tags) (defun reftex-parse-from-file (file docstruct master-dir) - ;; Scan the buffer for labels and save them in a list. + "Scan the buffer for labels and save them in a list." (let ((regexp (reftex-everything-regexp)) (bound 0) file-found tmp include-file @@ -350,8 +351,7 @@ docstruct)) (defun reftex-locate-bibliography-files (master-dir &optional files) - ;; Scan buffer for bibliography macro and return file list. - + "Scan buffer for bibliography macro and return file list." (unless files (save-excursion (goto-char (point-min)) @@ -379,10 +379,10 @@ (delq nil files))) (defun reftex-replace-label-list-segment (old insert &optional entirely) - ;; Replace the segment in OLD which corresponds to INSERT. - ;; Works with side effects, directly changes old. - ;; If entirely is t, just return INSERT. - ;; This function also makes sure the old toc markers do not point anywhere. + "Replace the segment in OLD which corresponds to INSERT. +Works with side effects, directly changes old. +If ENTIRELY is t, just return INSERT. +This function also makes sure the old toc markers do not point anywhere." (cond (entirely @@ -404,8 +404,8 @@ new)))) (defun reftex-section-info (file) - ;; Return a section entry for the current match. - ;; Careful: This function expects the match-data to be still in place! + "Return a section entry for the current match. +Careful: This function expects the match-data to be still in place!" (let* ((marker (set-marker (make-marker) (1- (match-beginning 3)))) (macro (reftex-match-string 3)) (prefix (save-match-data @@ -440,9 +440,9 @@ literal (marker-position marker)))) (defun reftex-ensure-index-support (&optional abort) - ;; When index support is turned off, ask to turn it on and - ;; set the current prefix argument so that `reftex-access-scan-info' - ;; will rescan the entire document. + "When index support is turned off, ask to turn it on and +set the current prefix argument so that `reftex-access-scan-info' +will rescan the entire document." (cond (reftex-support-index t) ((y-or-n-p "Turn on index support and rescan entire document? ") @@ -460,8 +460,8 @@ (defvar test-dummy) (defun reftex-index-info (file) - ;; Return an index entry for the current match. - ;; Careful: This function expects the match-data to be still in place! + "Return an index entry for the current match. +Careful: This function expects the match-data to be still in place!" (catch 'exit (let* ((macro (reftex-match-string 10)) (bom (match-beginning 10)) @@ -508,7 +508,7 @@ (list 'index index-tag context file bom arg key showkey sortkey key-end)))) (defun reftex-short-context (env parse &optional bound derive) - ;; Get about one line of useful context for the label definition at point. + "Get about one line of useful context for the label definition at point." (if (consp parse) (setq parse (if derive (cdr parse) (car parse)))) @@ -568,9 +568,9 @@ "INVALID VALUE OF PARSE")))) (defun reftex-where-am-I () - ;; Return the docstruct entry above point. Actually returns a cons - ;; cell in which the cdr is a flag indicating if the information is - ;; exact (t) or approximate (nil). + "Return the docstruct entry above point. +Actually returns a cons cell in which the cdr is a flag indicating +if the information is exact (t) or approximate (nil)." (let ((docstruct (symbol-value reftex-docstruct-symbol)) (cnt 0) rtn rtn-if-no-other @@ -748,10 +748,10 @@ ) (defsubst reftex-move-to-previous-arg (&optional bound) - ;; Assuming that we are in front of a macro argument, - ;; move backward to the closing parenthesis of the previous argument. - ;; This function understands the splitting of macros over several lines - ;; in TeX. + "Assuming that we are in front of a macro argument, +move backward to the closing parenthesis of the previous argument. +This function understands the splitting of macros over several lines +in TeX." (cond ;; Just to be quick: ((memq (preceding-char) '(?\] ?\}))) @@ -764,28 +764,27 @@ (t nil))) (defun reftex-what-macro-safe (which &optional bound) - ;; reftex-what-macro with special syntax table. + "Call `reftex-what-macro' with special syntax table." (reftex-with-special-syntax (reftex-what-macro which bound))) (defun reftex-what-macro (which &optional bound) - ;; Find out if point is within the arguments of any TeX-macro. - ;; The return value is either ("\\macro" . (point)) or a list of them. - - ;; If WHICH is nil, immediately return nil. - ;; If WHICH is 1, return innermost enclosing macro. - ;; If WHICH is t, return list of all macros enclosing point. - ;; If WHICH is a list of macros, look only for those macros and return the - ;; name of the first macro in this list found to enclose point. - ;; If the optional BOUND is an integer, bound backwards directed - ;; searches to this point. If it is nil, limit to nearest \section - - ;; like statement. - - ;; This function is pretty stable, but can be fooled if the text contains - ;; things like \macro{aa}{bb} where \macro is defined to take only one - ;; argument. As RefTeX cannot know this, the string "bb" would still be - ;; considered an argument of macro \macro. - + "Find out if point is within the arguments of any TeX-macro. +The return value is either (\"\\macro\" . (point)) or a list of them. + +If WHICH is nil, immediately return nil. +If WHICH is 1, return innermost enclosing macro. +If WHICH is t, return list of all macros enclosing point. +If WHICH is a list of macros, look only for those macros and return the + name of the first macro in this list found to enclose point. +If the optional BOUND is an integer, bound backwards directed + searches to this point. If it is nil, limit to nearest \\section - + like statement. + +This function is pretty stable, but can be fooled if the text contains +things like \\macro{aa}{bb} where \\macro is defined to take only one +argument. As RefTeX cannot know this, the string \"bb\" would still be +considered an argument of macro \\macro." (unless reftex-section-regexp (reftex-compile-variables)) (catch 'exit (if (null which) (throw 'exit nil)) @@ -832,20 +831,19 @@ (nreverse cmd-list))))) (defun reftex-what-environment (which &optional bound) - ;; Find out if point is inside a LaTeX environment. - ;; The return value is (e.g.) either ("equation" . (point)) or a list of - ;; them. - - ;; If WHICH is nil, immediately return nil. - ;; If WHICH is 1, return innermost enclosing environment. - ;; If WHICH is t, return list of all environments enclosing point. - ;; If WHICH is a list of environments, look only for those environments and - ;; return the name of the first environment in this list found to enclose - ;; point. - - ;; If the optional BOUND is an integer, bound backwards directed searches to - ;; this point. If it is nil, limit to nearest \section - like statement. - + "Find out if point is inside a LaTeX environment. +The return value is (e.g.) either (\"equation\" . (point)) or a list of +them. + +If WHICH is nil, immediately return nil. +If WHICH is 1, return innermost enclosing environment. +If WHICH is t, return list of all environments enclosing point. +If WHICH is a list of environments, look only for those environments and + return the name of the first environment in this list found to enclose + point. + +If the optional BOUND is an integer, bound backwards directed searches to +this point. If it is nil, limit to nearest \\section - like statement." (unless reftex-section-regexp (reftex-compile-variables)) (catch 'exit (save-excursion @@ -870,18 +868,17 @@ (nreverse env-list))))) (defun reftex-what-special-env (which &optional bound) - ;; Run the special environment parsers and return the matches. - ;; - ;; The return value is (e.g.) either ("my-parser-function" . (point)) - ;; or a list of them. - - ;; If WHICH is nil, immediately return nil. - ;; If WHICH is 1, return innermost enclosing environment. - ;; If WHICH is t, return list of all environments enclosing point. - ;; If WHICH is a list of environments, look only for those environments and - ;; return the name of the first environment in this list found to enclose - ;; point. - + "Run the special environment parsers and return the matches. + +The return value is (e.g.) either (\"my-parser-function\" . (point)) +or a list of them. + +If WHICH is nil, immediately return nil. +If WHICH is 1, return innermost enclosing environment. +If WHICH is t, return list of all environments enclosing point. +If WHICH is a list of environments, look only for those environments and + return the name of the first environment in this list found to enclose + point." (unless reftex-section-regexp (reftex-compile-variables)) (catch 'exit (save-excursion @@ -911,10 +908,10 @@ (car specials)))))) (defsubst reftex-move-to-next-arg (&optional ignore) - ;; Assuming that we are at the end of a macro name or a macro argument, - ;; move forward to the opening parenthesis of the next argument. - ;; This function understands the splitting of macros over several lines - ;; in TeX. + "Assuming that we are at the end of a macro name or a macro argument, +move forward to the opening parenthesis of the next argument. +This function understands the splitting of macros over several lines +in TeX." (cond ;; Just to be quick: ((memq (following-char) '(?\[ ?\{))) @@ -930,8 +927,8 @@ (reftex-nth-arg (nth 5 entry) (nth 6 entry)))) (defun reftex-nth-arg (n &optional opt-args) - ;; Return the nth following {} or [] parentheses content. - ;; OPT-ARGS is a list of argument numbers which are optional. + "Return the Nth following {} or [] parentheses content. +OPT-ARGS is a list of argument numbers which are optional." ;; If we are sitting at a macro start, skip to end of macro name. (and (eq (following-char) ?\\) (skip-chars-forward "a-zA-Z*\\\\")) @@ -974,8 +971,8 @@ (error nil))) (defun reftex-context-substring (&optional to-end) - ;; Return up to 150 chars from point - ;; When point is just after a { or [, limit string to matching parenthesis + "Return up to 150 chars from point. +When point is just after a { or [, limit string to matching parenthesis" (cond (to-end ;; Environment - find next \end @@ -1007,8 +1004,7 @@ (defvar reftex-section-numbers (make-vector reftex-max-section-depth 0)) (defun reftex-init-section-numbers (&optional toc-entry appendix) - ;; Initialize the section numbers with zeros or with what is found - ;; in the toc entry. + "Initialize the section numbers with zeros or with what is found in the TOC-ENTRY." (let* ((level (or (nth 5 toc-entry) -1)) (numbers (nreverse (split-string (or (nth 6 toc-entry) "") "\\."))) (depth (1- (length reftex-section-numbers))) @@ -1026,8 +1022,8 @@ (put 'reftex-section-numbers 'appendix appendix)) (defun reftex-section-number (&optional level star) - ;; Return a string with the current section number. - ;; When LEVEL is non-nil, increase section numbers on that level. + "Return a string with the current section number. +When LEVEL is non-nil, increase section numbers on that level." (let* ((depth (1- (length reftex-section-numbers))) idx n (string "") (appendix (get 'reftex-section-numbers 'appendix)) (partspecial (and (not reftex-part-resets-chapter) @@ -1073,7 +1069,7 @@ string)))) (defun reftex-roman-number (n) - ;; Return as a string the roman number equal to N. + "Return as a string the roman number equal to N." (let ((nrest n) (string "") (list '((1000 . "M") ( 900 . "CM") ( 500 . "D") ( 400 . "CD") ------------------------------------------------------------ revno: 112949 [merge] committer: Xue Fuqiao branch nick: trunk timestamp: Wed 2013-06-12 20:16:07 +0800 message: Merge: Doc fix for VC. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2013-06-11 06:42:15 +0000 +++ doc/emacs/ChangeLog 2013-06-12 12:12:47 +0000 @@ -3,6 +3,11 @@ * maintaining.texi (VC Directory Commands): Copyedit. (Branches): Put back milder version of pre 2013-06-07 text. +2013-06-09 Xue Fuqiao + + * vc1-xtra.texi (Revision Tags): Add a cross reference. + (CVS Options): Fix the default value of `vc-cvs-stay-local'. + 2013-06-07 Xue Fuqiao * maintaining.texi (Branches): Remove text copied from other sources. === modified file 'doc/emacs/vc1-xtra.texi' --- doc/emacs/vc1-xtra.texi 2013-01-01 09:11:05 +0000 +++ doc/emacs/vc1-xtra.texi 2013-06-09 11:15:54 +0000 @@ -199,21 +199,28 @@ and hg) have a native tag facility, and VC uses it where available; those tags will be visible even when you bypass VC. - In a file-oriented VCS, when you rename a registered file you need -to rename its master along with it; the command @code{vc-rename-file} -will do this automatically. If you are using SCCS, you must also -update the records of the tag, to mention the file by its new name -(@code{vc-rename-file} does this, too). An old tag that refers to a -master file that no longer exists under the recorded name is invalid; -VC can no longer retrieve it. It would be beyond the scope of this -manual to explain enough about RCS and SCCS to explain how to update -the tags by hand. Using @code{vc-rename-file} makes the tag remain -valid for retrieval, but it does not solve all problems. For example, -some of the files in your program probably refer to others by name. -At the very least, the makefile probably mentions the file that you -renamed. If you retrieve an old tag, the renamed file is retrieved -under its new name, which is not the name that the makefile expects. -So the program won't really work as retrieved. + In file-based version control systems, when you rename a registered +file you need to rename its master along with it; the command +@code{vc-rename-file} will do this automatically +@iftex +(@pxref{VC Delete/Rename,,,emacs, the Emacs Manual}). +@end iftex +@ifnottex +(@pxref{VC Delete/Rename}). +@end ifnottex +If you are using SCCS, you must also update the records of the tag, to +mention the file by its new name (@code{vc-rename-file} does this, +too). An old tag that refers to a master file that no longer exists +under the recorded name is invalid; VC can no longer retrieve it. It +would be beyond the scope of this manual to explain enough about RCS +and SCCS to explain how to update the tags by hand. Using +@code{vc-rename-file} makes the tag remain valid for retrieval, but it +does not solve all problems. For example, some of the files in your +program probably refer to others by name. At the very least, the +makefile probably mentions the file that you renamed. If you retrieve +an old tag, the renamed file is retrieved under its new name, which is +not the name that the makefile expects. So the program won't really +work as retrieved. @node Version Headers @subsubsection Inserting Version Control Headers @@ -377,12 +384,12 @@ only about @code{vc-cvs-stay-local}, but everything applies to @code{vc-stay-local} as well. - If @code{vc-cvs-stay-local} is @code{t} (the default), VC determines -the version control status of each file using only the entry in the -local CVS subdirectory and the information returned by previous CVS -commands. As a consequence, if you have modified a file and somebody -else has checked in other changes, you will not be notified of the -conflict until you try to commit. + If @code{vc-cvs-stay-local} is @code{only-file} (the default), VC +determines the version control status of each file using only the +entry in the local CVS subdirectory and the information returned by +previous CVS commands. As a consequence, if you have modified a file +and somebody else has checked in other changes, you will not be +notified of the conflict until you try to commit. If you change @code{vc-cvs-stay-local} to @code{nil}, VC queries the remote repository @emph{before} it decides what to do in === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-12 11:42:12 +0000 +++ lisp/ChangeLog 2013-06-12 12:12:47 +0000 @@ -139,6 +139,11 @@ * epa.el (epa-read-file-name): New function. (Bug#14510) (epa-decrypt-file): Make plain-file optional. Use epa-read-file-name. +2013-06-09 Xue Fuqiao + + * vc/vc-cvs.el (vc-cvs-stay-local): Doc fix. + * vc/vc-hooks.el (vc-stay-local): Doc fix. + 2013-06-09 Aidan Gauland * eshell/em-term.el (eshell-visual-command-p): Fix bug that caused === modified file 'lisp/vc/vc-cvs.el' --- lisp/vc/vc-cvs.el 2013-05-28 07:47:11 +0000 +++ lisp/vc/vc-cvs.el 2013-06-09 11:15:54 +0000 @@ -115,7 +115,7 @@ This avoids slow queries over the network and instead uses heuristics and past information to determine the current status of a file. -If value is the symbol `only-file' `vc-dir' will connect to the +If value is the symbol `only-file', `vc-dir' will connect to the server, but heuristics will be used to determine the status for all other VC operations. === modified file 'lisp/vc/vc-hooks.el' --- lisp/vc/vc-hooks.el 2013-02-07 08:50:04 +0000 +++ lisp/vc/vc-hooks.el 2013-06-09 11:15:54 +0000 @@ -128,7 +128,7 @@ This avoids slow queries over the network and instead uses heuristics and past information to determine the current status of a file. -If value is the symbol `only-file' `vc-dir' will connect to the +If value is the symbol `only-file', `vc-dir' will connect to the server, but heuristics will be used to determine the status for all other VC operations. ------------------------------------------------------------ revno: 112948 committer: Xue Fuqiao branch nick: trunk timestamp: Wed 2013-06-12 19:42:12 +0800 message: * lisp/ibuf-ext.el (ibuffer-mark-help-buffers): Doc fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-12 10:31:24 +0000 +++ lisp/ChangeLog 2013-06-12 11:42:12 +0000 @@ -1,3 +1,7 @@ +2013-06-12 Xue Fuqiao + + * ibuf-ext.el (ibuffer-mark-help-buffers): Doc fix. + 2013-06-12 Andreas Schwab * international/mule.el (auto-coding-alist): Use utf-8-emacs-unix === modified file 'lisp/ibuf-ext.el' --- lisp/ibuf-ext.el 2013-01-01 09:11:05 +0000 +++ lisp/ibuf-ext.el 2013-06-12 11:42:12 +0000 @@ -1523,7 +1523,7 @@ ;;;###autoload (defun ibuffer-mark-help-buffers () - "Mark buffers like *Help*, *Apropos*, *Info*." + "Mark buffers whose major mode is in variable `ibuffer-help-buffer-modes'." (interactive) (ibuffer-mark-on-buffer #'(lambda (buf) ------------------------------------------------------------ revno: 112947 committer: Andreas Schwab branch nick: emacs timestamp: Wed 2013-06-12 12:31:24 +0200 message: Add TAGS and leim/ja-dic to .gitignore diff: === modified file '.gitignore' --- .gitignore 2011-03-25 14:06:41 +0000 +++ .gitignore 2013-06-12 10:31:24 +0000 @@ -10,8 +10,10 @@ src/config.in autom4te.cache makefile +TAGS *~ /README.W32 /bin/ /site-lisp/ +/leim/ja-dic/ ------------------------------------------------------------ revno: 112946 committer: Andreas Schwab branch nick: emacs timestamp: Wed 2013-06-12 12:31:24 +0200 message: * international/mule.el (auto-coding-alist): Use utf-8-emacs-unix for auto-save files. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-12 07:46:01 +0000 +++ lisp/ChangeLog 2013-06-12 10:31:24 +0000 @@ -1,3 +1,8 @@ +2013-06-12 Andreas Schwab + + * international/mule.el (auto-coding-alist): Use utf-8-emacs-unix + for auto-save files. + 2013-06-12 Glenn Morris * ido.el (ido-delete-ignored-files): Remove. === modified file 'lisp/international/mule.el' --- lisp/international/mule.el 2013-03-13 02:08:33 +0000 +++ lisp/international/mule.el 2013-06-12 10:31:24 +0000 @@ -1691,7 +1691,7 @@ ("\\.\\(gz\\|Z\\|bz\\|bz2\\|xz\\|gpg\\)\\'" . no-conversion) ("\\.\\(jpe?g\\|png\\|gif\\|tiff?\\|p[bpgn]m\\)\\'" . no-conversion) ("\\.pdf\\'" . no-conversion) - ("/#[^/]+#\\'" . emacs-mule))) + ("/#[^/]+#\\'" . utf-8-emacs-unix))) "Alist of filename patterns vs corresponding coding systems. Each element looks like (REGEXP . CODING-SYSTEM). A file whose name matches REGEXP is decoded by CODING-SYSTEM on reading. ------------------------------------------------------------ revno: 112945 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-12 06:17:38 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2013-06-09 10:19:08 +0000 +++ autogen/configure 2013-06-12 10:17:38 +0000 @@ -4355,7 +4355,7 @@ with_file_notification=$val else - with_file_notification=yes + with_file_notification=$with_features fi ------------------------------------------------------------ revno: 112944 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-12 00:54:57 -0700 message: * lisp/ido.el: Convert some function comments to basic doc strings diff: === modified file 'lisp/ido.el' --- lisp/ido.el 2013-06-12 07:46:01 +0000 +++ lisp/ido.el 2013-06-12 07:54:57 +0000 @@ -3301,7 +3301,7 @@ res)) (defun ido-flatten-merged-list (items) - ;; Create a list of directory names based on a merged directory list. + "Create a list of directory names based on a merged directory list." (let (res) (while items (let* ((item (car items)) @@ -3404,7 +3404,7 @@ res)) (defun ido-make-buffer-list-1 (&optional frame visible) - ;; Return list of non-ignored buffer names + "Return list of non-ignored buffer names." (delq nil (mapcar (lambda (x) @@ -3414,12 +3414,12 @@ (buffer-list frame)))) (defun ido-make-buffer-list (default) - ;; Return the current list of buffers. - ;; Currently visible buffers are put at the end of the list. - ;; The hook `ido-make-buffer-list-hook' is run after the list has been - ;; created to allow the user to further modify the order of the buffer names - ;; in this list. If DEFAULT is non-nil, and corresponds to an existing buffer, - ;; it is put to the start of the list. + "Return the current list of buffers. +Currently visible buffers are put at the end of the list. +The hook `ido-make-buffer-list-hook' is run after the list has been +created to allow the user to further modify the order of the buffer names +in this list. If DEFAULT is non-nil, and corresponds to an existing buffer, +it is put to the start of the list." (let* ((ido-current-buffers (ido-get-buffers-in-frames 'current)) (ido-temp-list (ido-make-buffer-list-1 (selected-frame) ido-current-buffers))) (if ido-temp-list @@ -3461,9 +3461,9 @@ (nreverse (mapcar #'car ido-virtual-buffers)))))) (defun ido-make-choice-list (default) - ;; Return the current list of choices. - ;; If DEFAULT is non-nil, and corresponds to an element of choices, - ;; it is put to the start of the list. + "Return the current list of choices. +If DEFAULT is non-nil, and corresponds to an element of choices, +it is put to the start of the list." (let ((ido-temp-list ido-choice-list)) (if default (progn @@ -3475,7 +3475,7 @@ ido-temp-list)) (defun ido-to-end (items) - ;; Move the elements from ITEMS to the end of `ido-temp-list' + "Move the elements from ITEMS to the end of `ido-temp-list'." (mapc (lambda (elem) (setq ido-temp-list (delq elem ido-temp-list))) @@ -3519,8 +3519,8 @@ (file-name-all-completions "" dir)))) (defun ido-file-name-all-completions (dir) - ;; Return name of all files in DIR - ;; Uses and updates ido-dir-file-cache + "Return name of all files in DIR. +Uses and updates `ido-dir-file-cache'." (cond ((ido-is-unc-root dir) (mapcar @@ -3569,7 +3569,7 @@ (ido-file-name-all-completions-1 dir)))) (defun ido-remove-cached-dir (dir) - ;; Remove dir from ido-dir-file-cache + "Remove DIR from `ido-dir-file-cache'." (if (and ido-dir-file-cache (stringp dir) (> (length dir) 0)) (let ((cached (assoc dir ido-dir-file-cache))) @@ -3578,8 +3578,8 @@ (defun ido-make-file-list-1 (dir &optional merged) - ;; Return list of non-ignored files in DIR - ;; If MERGED is non-nil, each file is cons'ed with DIR + "Return list of non-ignored files in DIR +If MERGED is non-nil, each file is cons'ed with DIR." (and (or (ido-is-tramp-root dir) (ido-is-unc-root dir) (file-directory-p dir)) (delq nil @@ -3590,11 +3590,11 @@ (ido-file-name-all-completions dir))))) (defun ido-make-file-list (default) - ;; Return the current list of files. - ;; Currently visible files are put at the end of the list. - ;; The hook `ido-make-file-list-hook' is run after the list has been - ;; created to allow the user to further modify the order of the file names - ;; in this list. + "Return the current list of files. +Currently visible files are put at the end of the list. +The hook `ido-make-file-list-hook' is run after the list has been +created to allow the user to further modify the order of the file names +in this list." (let ((ido-temp-list (ido-make-file-list-1 ido-current-directory))) (setq ido-temp-list (sort ido-temp-list (if ido-file-extensions-order @@ -3635,8 +3635,8 @@ ido-temp-list)) (defun ido-make-dir-list-1 (dir &optional merged) - ;; Return list of non-ignored subdirs in DIR - ;; If MERGED is non-nil, each subdir is cons'ed with DIR + "Return list of non-ignored subdirs in DIR. +If MERGED is non-nil, each subdir is cons'ed with DIR." (and (or (ido-is-tramp-root dir) (file-directory-p dir)) (delq nil (mapcar @@ -3646,10 +3646,10 @@ (ido-file-name-all-completions dir))))) (defun ido-make-dir-list (default) - ;; Return the current list of directories. - ;; The hook `ido-make-dir-list-hook' is run after the list has been - ;; created to allow the user to further modify the order of the - ;; directory names in this list. + "Return the current list of directories. +The hook `ido-make-dir-list-hook' is run after the list has been +created to allow the user to further modify the order of the +directory names in this list." (let ((ido-temp-list (ido-make-dir-list-1 ido-current-directory))) (setq ido-temp-list (sort ido-temp-list #'ido-file-lessp)) (ido-to-end ;; move . files to end @@ -3680,10 +3680,9 @@ (defvar ido-bufs-in-frame) (defun ido-get-buffers-in-frames (&optional current) - ;; Return the list of buffers that are visible in the current frame. - ;; If optional argument `current' is given, restrict searching to the - ;; current frame, rather than all frames, regardless of value of - ;; `ido-all-frames'. + "Return the list of buffers that are visible in the current frame. +If optional argument CURRENT is given, restrict searching to the current +frame, rather than all frames, regardless of value of `ido-all-frames'." (let ((ido-bufs-in-frame nil)) (walk-windows 'ido-get-bufname nil (if current @@ -3692,7 +3691,7 @@ ido-bufs-in-frame)) (defun ido-get-bufname (win) - ;; Used by `ido-get-buffers-in-frames' to walk through all windows + "Used by `ido-get-buffers-in-frames' to walk through all windows." (let ((buf (buffer-name (window-buffer win)))) (unless (or (member buf ido-bufs-in-frame) (member buf ido-ignore-item-temp-list)) @@ -3705,7 +3704,7 @@ ;;; FIND MATCHING ITEMS (defun ido-set-matches-1 (items &optional do-full) - ;; Return list of matches in items + "Return list of matches in ITEMS." (let* ((case-fold-search ido-case-fold) (slash (and (not ido-enable-prefix) (ido-final-slash ido-text))) (text (if slash (substring ido-text 0 -1) ido-text)) @@ -3793,13 +3792,13 @@ (defun ido-set-matches () - ;; Set `ido-matches' to the list of items matching prompt + "Set `ido-matches' to the list of items matching prompt." (when ido-rescan (setq ido-matches (ido-set-matches-1 (reverse ido-cur-list) (not ido-rotate)) ido-rotate nil))) (defun ido-ignore-item-p (name re-list &optional ignore-ext) - ;; Return t if the buffer or file NAME should be ignored. + "Return t if the buffer or file NAME should be ignored." (or (member name ido-ignore-item-temp-list) (and ido-process-ignore-lists re-list @@ -3839,7 +3838,7 @@ (defvar ido-change-word-sub) (defun ido-find-common-substring (items subs) - ;; Return common string following SUBS in each element of ITEMS. + "Return common string following SUBS in each element of ITEMS." (let (res alist ido-change-word-sub) @@ -3859,8 +3858,8 @@ comp)))) (defun ido-word-matching-substring (word) - ;; Return part of WORD before 1st match to `ido-change-word-sub'. - ;; If `ido-change-word-sub' cannot be found in WORD, return nil. + "Return part of WORD before first match to `ido-change-word-sub'. +If `ido-change-word-sub' cannot be found in WORD, return nil." (let ((case-fold-search ido-case-fold)) (let ((m (string-match ido-change-word-sub (ido-name word)))) (if m @@ -3869,7 +3868,7 @@ nil)))) (defun ido-makealist (res) - ;; Return dotted pair (RES . 1). + "Return dotted pair (RES . 1)." (cons res 1)) (defun ido-choose-completion-string (choice &rest ignored) @@ -4052,8 +4051,8 @@ (defun ido-buffer-window-other-frame (buffer) - ;; Return window pointer if BUFFER is visible in another frame. - ;; If BUFFER is visible in the current frame, return nil. + "Return window pointer if BUFFER is visible in another frame. +If BUFFER is visible in the current frame, return nil." (let ((blist (ido-get-buffers-in-frames 'current))) ;;If the buffer is visible in current frame, return nil (if (member buffer blist) @@ -4537,9 +4536,8 @@ )))) (defun ido-completions (name) - ;; Return the string that is displayed after the user's text. - ;; Modified from `icomplete-completions'. - + "Return the string that is displayed after the user's text. +Modified from `icomplete-completions'." (let* ((comps ido-matches) (ind (and (consp (car comps)) (> (length (cdr (car comps))) 1) ido-merged-indicator)) ------------------------------------------------------------ revno: 112943 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-12 00:46:01 -0700 message: * lisp/ido.el (ido-delete-ignored-files): Remove. (ido-wide-find-dirs-or-files, ido-make-file-list-1): Go back to calling ido-ignore-item-p directly. Doesn't seem worth looping over files twice in ido-make-file-list-1. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-12 07:25:05 +0000 +++ lisp/ChangeLog 2013-06-12 07:46:01 +0000 @@ -1,6 +1,8 @@ 2013-06-12 Glenn Morris - * ido.el (ido-delete-ignored-files): Rewrite to avoid cl-lib. + * ido.el (ido-delete-ignored-files): Remove. + (ido-wide-find-dirs-or-files, ido-make-file-list-1): + Go back to calling ido-ignore-item-p directly. 2013-06-12 Eyal Lotem (tiny change) === modified file 'lisp/ido.el' --- lisp/ido.el 2013-06-12 07:25:05 +0000 +++ lisp/ido.el 2013-06-12 07:46:01 +0000 @@ -3273,25 +3273,21 @@ cur nil))) res)) -(defun ido-delete-ignored-files (files) - "Delete elements from list FILES that match `ido-ignore-item-p'." - (delq nil - (mapcar (lambda (name) - (unless (ido-ignore-item-p name ido-ignore-files t) name)) - files))) - (defun ido-wide-find-dirs-or-files (dir file &optional prefix finddir) ;; As ido-run-find-command, but returns a list of cons pairs ("file" . "dir") (let ((filenames - (ido-delete-ignored-files - (split-string - (shell-command-to-string - (concat "find " - (shell-quote-argument dir) - (if ido-case-fold " -iname " " -name ") - (shell-quote-argument - (concat (if prefix "" "*") file "*")) - " -type " (if finddir "d" "f") " -print"))))) + (delq nil + (mapcar (lambda (name) + (unless (ido-ignore-item-p name ido-ignore-files t) + name)) + (split-string + (shell-command-to-string + (concat "find " + (shell-quote-argument dir) + (if ido-case-fold " -iname " " -name ") + (shell-quote-argument + (concat (if prefix "" "*") file "*")) + " -type " (if finddir "d" "f") " -print")))))) filename d f res) (while filenames @@ -3586,10 +3582,12 @@ ;; If MERGED is non-nil, each file is cons'ed with DIR (and (or (ido-is-tramp-root dir) (ido-is-unc-root dir) (file-directory-p dir)) - (mapcar - (lambda (name) (if merged (cons name dir) name)) - (ido-delete-ignored-files - (ido-file-name-all-completions dir))))) + (delq nil + (mapcar + (lambda (name) + (if (not (ido-ignore-item-p name ido-ignore-files t)) + (if merged (cons name dir) name))) + (ido-file-name-all-completions dir))))) (defun ido-make-file-list (default) ;; Return the current list of files. ------------------------------------------------------------ revno: 112942 fixes bug: http://debbugs.gnu.org/13003 author: Eyal Lotem committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-12 00:25:05 -0700 message: * ido.el (ido-wide-find-dirs-or-files): Respect ido-case-fold (tiny change) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-12 07:22:20 +0000 +++ lisp/ChangeLog 2013-06-12 07:25:05 +0000 @@ -4,6 +4,8 @@ 2013-06-12 Eyal Lotem (tiny change) + * ido.el (ido-wide-find-dirs-or-files): Respect ido-case-fold. + * ido.el (ido-delete-ignored-files): New function, split from ido-make-file-list-1. (ido-wide-find-dirs-or-files): Maybe ignore files. (Bug#13003) === modified file 'lisp/ido.el' --- lisp/ido.el 2013-06-12 07:22:20 +0000 +++ lisp/ido.el 2013-06-12 07:25:05 +0000 @@ -3288,7 +3288,7 @@ (shell-command-to-string (concat "find " (shell-quote-argument dir) - " -name " + (if ido-case-fold " -iname " " -name ") (shell-quote-argument (concat (if prefix "" "*") file "*")) " -type " (if finddir "d" "f") " -print"))))) ------------------------------------------------------------ revno: 112941 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-12 00:22:20 -0700 message: * lisp/ido.el (ido-delete-ignored-files): Rewrite to avoid cl-lib. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-12 07:18:49 +0000 +++ lisp/ChangeLog 2013-06-12 07:22:20 +0000 @@ -1,3 +1,7 @@ +2013-06-12 Glenn Morris + + * ido.el (ido-delete-ignored-files): Rewrite to avoid cl-lib. + 2013-06-12 Eyal Lotem (tiny change) * ido.el (ido-delete-ignored-files): New function, === modified file 'lisp/ido.el' --- lisp/ido.el 2013-06-12 07:18:49 +0000 +++ lisp/ido.el 2013-06-12 07:22:20 +0000 @@ -3273,12 +3273,12 @@ cur nil))) res)) -(require 'cl-lib) - (defun ido-delete-ignored-files (files) - (cl-delete-if - (lambda (name) (ido-ignore-item-p name ido-ignore-files t)) - files)) + "Delete elements from list FILES that match `ido-ignore-item-p'." + (delq nil + (mapcar (lambda (name) + (unless (ido-ignore-item-p name ido-ignore-files t) name)) + files))) (defun ido-wide-find-dirs-or-files (dir file &optional prefix finddir) ;; As ido-run-find-command, but returns a list of cons pairs ("file" . "dir") ------------------------------------------------------------ revno: 112940 fixes bug: http://debbugs.gnu.org/13003 author: Eyal Lotem committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-06-12 00:18:49 -0700 message: Respect ido-ignore-item-p in ido-wide-find-dirs-or-files (tiny change) * lisp/ido.el (ido-delete-ignored-files): New function, split from ido-make-file-list-1. (ido-wide-find-dirs-or-files): Maybe ignore files. (ido-make-file-list-1): Use ido-delete-ignored-files. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-12 02:37:38 +0000 +++ lisp/ChangeLog 2013-06-12 07:18:49 +0000 @@ -1,3 +1,10 @@ +2013-06-12 Eyal Lotem (tiny change) + + * ido.el (ido-delete-ignored-files): New function, + split from ido-make-file-list-1. + (ido-wide-find-dirs-or-files): Maybe ignore files. (Bug#13003) + (ido-make-file-list-1): Use ido-delete-ignored-files. + 2013-06-12 Leo Liu * progmodes/octave.el (inferior-octave-startup) === modified file 'lisp/ido.el' --- lisp/ido.el 2013-05-17 02:43:41 +0000 +++ lisp/ido.el 2013-06-12 07:18:49 +0000 @@ -3273,17 +3273,25 @@ cur nil))) res)) +(require 'cl-lib) + +(defun ido-delete-ignored-files (files) + (cl-delete-if + (lambda (name) (ido-ignore-item-p name ido-ignore-files t)) + files)) + (defun ido-wide-find-dirs-or-files (dir file &optional prefix finddir) ;; As ido-run-find-command, but returns a list of cons pairs ("file" . "dir") (let ((filenames - (split-string - (shell-command-to-string - (concat "find " - (shell-quote-argument dir) - " -name " - (shell-quote-argument - (concat (if prefix "" "*") file "*")) - " -type " (if finddir "d" "f") " -print")))) + (ido-delete-ignored-files + (split-string + (shell-command-to-string + (concat "find " + (shell-quote-argument dir) + " -name " + (shell-quote-argument + (concat (if prefix "" "*") file "*")) + " -type " (if finddir "d" "f") " -print"))))) filename d f res) (while filenames @@ -3578,12 +3586,10 @@ ;; If MERGED is non-nil, each file is cons'ed with DIR (and (or (ido-is-tramp-root dir) (ido-is-unc-root dir) (file-directory-p dir)) - (delq nil - (mapcar - (lambda (name) - (if (not (ido-ignore-item-p name ido-ignore-files t)) - (if merged (cons name dir) name))) - (ido-file-name-all-completions dir))))) + (mapcar + (lambda (name) (if merged (cons name dir) name)) + (ido-delete-ignored-files + (ido-file-name-all-completions dir))))) (defun ido-make-file-list (default) ;; Return the current list of files. ------------------------------------------------------------ revno: 112939 committer: Leo Liu branch nick: trunk timestamp: Wed 2013-06-12 10:58:03 +0800 message: Fix last change to octave.el diff: === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-06-12 02:37:38 +0000 +++ lisp/progmodes/octave.el 2013-06-12 02:58:03 +0000 @@ -772,7 +772,7 @@ (inferior-octave-send-list-and-digest (list "more off;\n" (unless (equal inferior-octave-output-string ">> ") - "PS1 ('\\\\s> ');\n") + "PS1 ('\\s> ');\n") (when (and inferior-octave-startup-file (file-exists-p inferior-octave-startup-file)) (format "source ('%s');\n" inferior-octave-startup-file)))) ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.