commit 0c856a2c459016f1f9cce173f5b2b49be36e3452 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Wed Aug 5 19:06:57 2015 -0700 Fix some confusion with ‘format’ * lisp/allout-widgets.el (allout-widgets-before-change-handler) (allout-graphics-modification-handler): Protect arbitrary string in a format context with "%s" format. * lisp/avoid.el: * lisp/cedet/semantic/bovine/scm.el: Fix comment. * lisp/calendar/icalendar.el (icalendar--convert-sexp-to-ical): * lisp/erc/erc-button.el (erc-button-beats-to-time): * lisp/gnus/message.el (message-send-form-letter): * lisp/org/ob-core.el (org-babel-check-evaluate) (org-babel-confirm-evaluate): * lisp/org/ob-fortran.el (org-babel-fortran-var-to-fortran): * lisp/org/ox-latex.el (org-latex-compile): * lisp/org/ox-man.el (org-man-compile): * lisp/org/ox-odt.el (org-odt-template): * lisp/org/ox-texinfo.el (org-texinfo-compile): * lisp/progmodes/prolog.el (prolog-help-info) (prolog-view-predspec): * lisp/progmodes/ruby-mode.el (ruby-parse-partial): * lisp/progmodes/verilog-mode.el (verilog-showscopes): * lisp/textmodes/rst.el (rst-replace-lines): Change (message (format ...)) to (message ...), and likewise for ‘error’. This lessens the probability of confusion when the output of ‘format’ contains ‘%’. diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el index 3c71a81..c6dba89 100644 --- a/lisp/allout-widgets.el +++ b/lisp/allout-widgets.el @@ -869,7 +869,7 @@ Optional RECURSING is for internal use, to limit recursion." ;; tell the allout-widgets-post-command-business to reestablish the hook: (setq allout-widgets-reenable-before-change-handler t) ;; and raise an error to prevent the edit (and disable the hook): - (error + (error "%s" (substitute-command-keys allout-structure-unruly-deletion-message))))) ;;;_ > allout-widgets-after-change-handler (defun allout-widgets-after-change-handler (_beg _end _prelength) @@ -2287,7 +2287,7 @@ Deletes allowed only when `inhibit-read-only' is t." ((yes-or-no-p "Unruly edit of outline structure - allow? ") (setq allout-widgets-unset-inhibit-read-only (not inhibit-read-only) inhibit-read-only t)) - (t (error + (t (error "%s" (substitute-command-keys allout-structure-unruly-deletion-message))))) ;;;_ > allout-item-icon-key-handler () (defun allout-item-icon-key-handler () diff --git a/lisp/avoid.el b/lisp/avoid.el index 767f6d3..36ced39 100644 --- a/lisp/avoid.el +++ b/lisp/avoid.el @@ -163,9 +163,9 @@ Analogous to `mouse-position'." ;(defun mouse-avoidance-point-position-test () ; (interactive) -; (message (format "point=%s mouse=%s" -; (cdr (mouse-avoidance-point-position)) -; (cdr (mouse-position))))) +; (message "point=%s mouse=%s" +; (cdr (mouse-avoidance-point-position)) +; (cdr (mouse-position)))) (defun mouse-avoidance-set-mouse-position (pos) ;; Carefully set mouse position to given position (X . Y) diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index 3e2a2f8..734462d 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el @@ -1629,8 +1629,8 @@ enumeration, given as a time value, in same format as returned by (icalendar--convert-ordinary-to-ical nonmarker (format "%4d/%02d/%02d %s" y m d see)))) (;TODO: - (error (format "Unsupported Sexp-entry: %s" - entry-main)))))) + (error "Unsupported Sexp-entry: %s" + entry-main))))) (number-sequence 0 (- icalendar-export-sexp-enumeration-days 1)))))) (t diff --git a/lisp/cedet/semantic/bovine/scm.el b/lisp/cedet/semantic/bovine/scm.el index 8b99e70..745731c 100644 --- a/lisp/cedet/semantic/bovine/scm.el +++ b/lisp/cedet/semantic/bovine/scm.el @@ -70,7 +70,7 @@ Attempts a simple prototype for calling or using TAG." (define-lex-regex-analyzer semantic-lex-scheme-symbol "Detect and create symbol and keyword tokens." "\\(\\sw\\([:]\\|\\sw\\|\\s_\\)*\\)" - ;; (message (format "symbol: %s" (match-string 0))) + ;; (message "symbol: %s" (match-string 0)) (semantic-lex-push-token (semantic-lex-token (or (semantic-lex-keyword-p (match-string 0)) 'symbol) diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 380ea7c..3530a31e 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -537,8 +537,8 @@ and `apropos' for other symbols." (- (car (current-time-zone))))) (hours (mod (floor seconds 3600) 24)) (minutes (mod (round seconds 60) 60))) - (message (format "@%s is %d:%02d local time" - beats hours minutes)))) + (message "@%s is %d:%02d local time" + beats hours minutes))) (provide 'erc-button) @@ -546,4 +546,3 @@ and `apropos' for other symbols." ;; Local Variables: ;; indent-tabs-mode: nil ;; End: - diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 9e813e6..447a8d7 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -8487,7 +8487,7 @@ Header and body are separated by `mail-header-separator'." (progn (setq sent (1+ sent)) (message-send-and-exit)) - (message (format "Message to `%s' skipped." to)) + (message "Message to `%s' skipped." to) (setq skipped (1+ skipped))) (when (buffer-live-p buff) (kill-buffer buff)))) diff --git a/lisp/org/ob-core.el b/lisp/org/ob-core.el index f767a4e..bb46267 100644 --- a/lisp/org/ob-core.el +++ b/lisp/org/ob-core.el @@ -316,8 +316,8 @@ name of the code block." Do not query the user." (org-babel-check-confirm-evaluate info (not (when noeval - (message (format "Evaluation of this%scode-block%sis disabled." - code-block block-name)))))) + (message "Evaluation of this%scode-block%sis disabled." + code-block block-name))))) ;; dynamically scoped for asynchronous export (defvar org-babel-confirm-evaluate-answer-no) @@ -343,8 +343,8 @@ of potentially harmful code." (yes-or-no-p (format "Evaluate this%scode block%son your system? " code-block block-name))) - (message (format "Evaluation of this%scode-block%sis aborted." - code-block block-name))))))) + (message "Evaluation of this%scode-block%sis aborted." + code-block block-name)))))) ;;;###autoload (defun org-babel-execute-safely-maybe () diff --git a/lisp/org/ob-fortran.el b/lisp/org/ob-fortran.el index 7fbfaf2..30b5350 100644 --- a/lisp/org/ob-fortran.el +++ b/lisp/org/ob-fortran.el @@ -147,15 +147,14 @@ of the same value." ;; val is a matrix ((and (listp val) (org-every #'listp val)) (format "real, parameter :: %S(%d,%d) = transpose( reshape( %s , (/ %d, %d /) ) )\n" - var (length val) (length (car val)) + var (length val) (length (car val)) (org-babel-fortran-transform-list val) (length (car val)) (length val))) ((listp val) (format "real, parameter :: %S(%d) = %s\n" var (length val) (org-babel-fortran-transform-list val))) (t - (error (format "the type of parameter %s is not supported by ob-fortran" - var)))))) + (error "the type of parameter %s is not supported by ob-fortran" var))))) (defun org-babel-fortran-transform-list (val) "Return a fortran representation of enclose syntactic lists." diff --git a/lisp/org/ox-latex.el b/lisp/org/ox-latex.el index 98023a4..bfc860a 100644 --- a/lisp/org/ox-latex.el +++ b/lisp/org/ox-latex.el @@ -2846,7 +2846,7 @@ Return PDF file name or an error if it couldn't be produced." (file-name-directory full-name) default-directory)) errors) - (unless snippet (message (format "Processing LaTeX file %s..." texfile))) + (unless snippet (message "Processing LaTeX file %s..." texfile)) (save-window-excursion (cond ;; A function is provided: Apply it. diff --git a/lisp/org/ox-man.el b/lisp/org/ox-man.el index 2b8348f..8b4ddc7 100644 --- a/lisp/org/ox-man.el +++ b/lisp/org/ox-man.el @@ -1190,7 +1190,7 @@ Return PDF file name or an error if it couldn't be produced." (file-name-directory full-name) default-directory)) errors) - (message (format "Processing Groff file %s..." file)) + (message "Processing Groff file %s..." file) (save-window-excursion (cond ;; A function is provided: Apply it. diff --git a/lisp/org/ox-odt.el b/lisp/org/ox-odt.el index f1ef90e..a028142 100644 --- a/lisp/org/ox-odt.el +++ b/lisp/org/ox-odt.el @@ -1389,8 +1389,8 @@ original parsed data. INFO is a plist holding export options." ((member styles-file-type '("odt" "ott")) (org-odt--zip-extract styles-file "styles.xml" org-odt-zip-dir))))) (t - (error (format "Invalid specification of styles.xml file: %S" - org-odt-styles-file)))) + (error "Invalid specification of styles.xml file: %S" + org-odt-styles-file))) ;; create a manifest entry for styles.xml (org-odt-create-manifest-file-entry "text/xml" "styles.xml") diff --git a/lisp/org/ox-texinfo.el b/lisp/org/ox-texinfo.el index 26f58ad..c77a239 100644 --- a/lisp/org/ox-texinfo.el +++ b/lisp/org/ox-texinfo.el @@ -1513,7 +1513,7 @@ Return INFO file name or an error if it couldn't be produced." (file-name-directory full-name) default-directory)) errors) - (message (format "Processing Texinfo file %s..." file)) + (message "Processing Texinfo file %s..." file) (save-window-excursion ;; Replace %b, %f and %o with appropriate values in each command ;; before applying it. Output is redirected to "*Org INFO diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index 2d95345..b95c3f9 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -2305,7 +2305,7 @@ In effect it sets the `fill-prefix' when inside comments and then calls (pop-to-buffer nil) (Info-goto-node prolog-info-predicate-index) (if (not (re-search-forward str nil t)) - (error (format "Help on predicate `%s' not found." predicate))) + (error "Help on predicate `%s' not found." predicate)) (setq oldp (point)) (if (re-search-forward str nil t) @@ -2975,7 +2975,7 @@ Return the final point or nil if no such a beginning was found." (let* ((pinfo (prolog-clause-info)) (predname (nth 0 pinfo)) (arity (nth 1 pinfo))) - (message (format "%s/%d" predname arity)))) + (message "%s/%d" predname arity))) (defun prolog-insert-predicate-template () "Insert the template for the current clause." diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 21ad102..5d59a56 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1178,9 +1178,7 @@ delimiter." (setq in-string (match-end 0)) (goto-char ruby-indent-point))) (t - (error (format "Bad string %s" - (buffer-substring (point) pnt) - )))))) + (error "Bad string %s" (buffer-substring (point) pnt)))))) (list in-string nest depth pcol)) (defun ruby-parse-region (start end) diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 11b7561..4fc4b03 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -7533,7 +7533,7 @@ If search fails, other files are checked based on (regexp "\\(module\\s-+\\w+\\s-*(\\)\\|\\(\\w+\\s-+\\w+\\s-*(\\)")) (with-output-to-temp-buffer "*Occur*" (save-excursion - (message (format "Searching for %s ..." regexp)) + (message "Searching for %s ..." regexp) ;; Find next match, but give up if prev match was at end of buffer. (while (and (not (= prevpos (point-max))) (verilog-re-search-forward regexp nil t)) diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 9d3f2a9..7a2857a 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -4161,7 +4161,7 @@ cand replace with char: ") (let ((width (current-column))) (rst-delete-entire-line) (insert-char tochar width))) - (message (format "%d lines replaced." found))))) + (message "%d lines replaced." found)))) ;; FIXME: Unbound command - should be bound or removed. (defun rst-join-paragraph () commit ec044fd2bfd6257742418d621685017325cb24cc Author: Artur Malabarba Date: Wed Aug 5 18:58:38 2015 +0100 * lisp/replace.el (replace-character-fold): Default to nil diff --git a/lisp/replace.el b/lisp/replace.el index 41debdd..a541c55 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -33,7 +33,7 @@ :type 'boolean :group 'matching) -(defcustom replace-character-fold t +(defcustom replace-character-fold nil "Non-nil means `query-replace' should do character folding in matches. This means, for instance, that ' will match a large variety of unicode quotes." commit 437862c5c9bf381669979b4ebbb13859c5d5d9a5 Author: Artur Malabarba Date: Wed Aug 5 18:51:34 2015 +0100 * lisp/character-fold.el: Fix lax whitespace (character-fold-table): Don't make space match other whitespace chars. (character-fold-to-regexp): Simplify lax behaviour. diff --git a/lisp/character-fold.el b/lisp/character-fold.el index bf5ae59..6bbb3ec 100644 --- a/lisp/character-fold.el +++ b/lisp/character-fold.el @@ -94,8 +94,7 @@ some).") ;; Add some manual entries. (dolist (it '((?\" """ "“" "”" "”" "„" "⹂" "〞" "‟" "‟" "❞" "❝" "❠" "“" "„" "〝" "〟" "🙷" "🙶" "🙸" "«" "»") (?' "❟" "❛" "❜" "‘" "’" "‚" "‛" "‚" "󠀢" "❮" "❯" "‹" "›") - (?` "❛" "‘" "‛" "󠀢" "❮" "‹") - (?\s "\t" "\r" "\n"))) + (?` "❛" "‘" "‛" "󠀢" "❮" "‹"))) (let ((idx (car it)) (chars (cdr it))) (aset equiv idx (append chars (aref equiv idx))))) @@ -121,12 +120,11 @@ If LAX is non-nil, any single whitespace character is allowed to match any number of times." (if character-fold-search (apply #'concat - (mapcar (lambda (c) (let ((out (or (aref character-fold-table c) - (regexp-quote (string c))))) - (if (and lax (memq c '(?\s ?\t ?\r ?\n ))) - (concat out "+") - out))) - string)) + (mapcar (lambda (c) (if (and lax (memq c '(?\s ?\t ?\r ?\n))) + "[ \t\n\r\xa0\x2002\x2d\x200a\x202f\x205f\x3000]+" + (or (aref character-fold-table c) + (regexp-quote (string c))))) + string)) (regexp-quote string))) ;;; character-fold.el ends here commit ee50e62a44d18be697917e1ea708db1c06f590fb Author: Dmitry Gutov Date: Wed Aug 5 15:18:25 2015 +0300 Preserve window point in xref-find-definitions-other-window Fix the problem reported by Ingo Logmar in http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00152.html * lisp/progmodes/xref.el (xref--goto-char): Extract from xref--goto-location. (xref--pop-to-location): Use it. Replace xref--goto-location with a direct xref-location-marker call. (xref--show-location): Likewise. (xref--display-position): Use xref--goto-char. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 27e56f2..c37a4aa 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -65,8 +65,6 @@ (defclass xref-location () () :documentation "A location represents a position in a file or buffer.") -;; If a backend decides to subclass xref-location it can provide -;; methods for some of the following functions: (cl-defgeneric xref-location-marker (location) "Return the marker for LOCATION.") @@ -372,14 +370,19 @@ elements is negated." (ring-empty-p xref--marker-ring)) + +(defun xref--goto-char (pos) + (cond + ((and (<= (point-min) pos) (<= pos (point-max)))) + (widen-automatically (widen)) + (t (user-error "Position is outside accessible part of buffer"))) + (goto-char pos)) + (defun xref--goto-location (location) "Set buffer and point according to xref-location LOCATION." (let ((marker (xref-location-marker location))) (set-buffer (marker-buffer marker)) - (cond ((and (<= (point-min) marker) (<= marker (point-max)))) - (widen-automatically (widen)) - (t (error "Location is outside accessible part of buffer"))) - (goto-char marker))) + (xref--goto-char marker))) (defun xref--pop-to-location (item &optional window) "Go to the location of ITEM and display the buffer. @@ -387,11 +390,14 @@ WINDOW controls how the buffer is displayed: nil -- switch-to-buffer 'window -- pop-to-buffer (other window) 'frame -- pop-to-buffer (other frame)" - (xref--goto-location (xref-item-location item)) - (cl-ecase window - ((nil) (switch-to-buffer (current-buffer))) - (window (pop-to-buffer (current-buffer) t)) - (frame (let ((pop-up-frames t)) (pop-to-buffer (current-buffer) t)))) + (let* ((marker (save-excursion + (xref-location-marker (xref-item-location item)))) + (buf (marker-buffer marker))) + (cl-ecase window + ((nil) (switch-to-buffer buf)) + (window (pop-to-buffer buf t)) + (frame (let ((pop-up-frames t)) (pop-to-buffer buf t)))) + (xref--goto-char marker)) (let ((xref--current-item item)) (run-hooks 'xref-after-jump-hook))) @@ -427,7 +433,7 @@ Used for temporary buffers.") (defun xref--display-position (pos other-window xref-buf) ;; Show the location, but don't hijack focus. (with-selected-window (display-buffer (current-buffer) other-window) - (goto-char pos) + (xref--goto-char pos) (run-hooks 'xref-after-jump-hook) (let ((buf (current-buffer)) (win (selected-window))) @@ -437,17 +443,15 @@ Used for temporary buffers.") (defun xref--show-location (location) (condition-case err - (let ((xref-buf (current-buffer)) - (bl (buffer-list)) - (xref--inhibit-mark-current t)) - (xref--goto-location location) - (let ((buf (current-buffer))) + (let ((bl (buffer-list)) + (xref--inhibit-mark-current t) + (marker (xref-location-marker location))) + (let ((buf (marker-buffer marker))) (unless (memq buf bl) ;; Newly created. (add-hook 'buffer-list-update-hook #'xref--mark-selected nil t) - (with-current-buffer xref-buf - (push buf xref--temporary-buffers)))) - (xref--display-position (point) t xref-buf)) + (push buf xref--temporary-buffers))) + (xref--display-position (point) t (current-buffer))) (user-error (message (error-message-string err))))) (defun xref-show-location-at-point () @@ -504,6 +508,8 @@ Used for temporary buffers.") (while (setq item (xref--search-property 'xref-item)) (when (xref-match-bounds item) (save-excursion + ;; FIXME: Get rid of xref--goto-location, by making + ;; xref-match-bounds return markers already. (xref--goto-location (xref-item-location item)) (let ((bounds (xref--match-buffer-bounds item)) (beg (make-marker)) @@ -849,7 +855,6 @@ and just use etags." (cdr xref-etags-mode--saved)))) (declare-function semantic-symref-find-references-by-name "semantic/symref") -(declare-function semantic-symref-find-text "semantic/symref") (declare-function semantic-find-file-noselect "semantic/fw") (declare-function grep-read-files "grep") (declare-function grep-expand-template "grep") commit 8dbae880947dc7c9f1e8a6be41d3ba18306c1aed Author: Dmitry Gutov Date: Wed Aug 5 15:08:00 2015 +0300 * lisp/progmodes/project.el: Add a paragraph to the front matter. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index d849f93..16578f1 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -22,6 +22,10 @@ ;; This file contains generic infrastructure for dealing with ;; projects, and a number of public functions: finding the current ;; root, related project directories, search path, etc. +;; +;; The goal is to make it easy for Lisp programs to operate on the +;; current project, without having to know which package handles +;; detection of that project type, parsing its config files, etc. ;;; Code: