commit a3f3cd7c4a79ba54f00ebd8424db3137f297517b (HEAD, refs/remotes/origin/master) Author: Martin Rudalics Date: Sat Aug 22 10:22:26 2015 +0200 In ‘adjust-window-trailing-edge’ fix bug with size-preserved windows. * lisp/window.el (adjust-window-trailing-edge): Fix bug where this function refused to resize a size-preserved window. diff --git a/ChangeLog.2 b/ChangeLog.2 index 3a93fda..242cf6b 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -3151,8 +3151,6 @@ 2015-06-18 Martin Rudalics - Fix last fix" - Set image_cache_refcount before x_default_parameter calls. (Bug#20802) * src/nsfns.m (Fx_create_frame): * src/xfns.c (Fx_create_frame, x_create_tip_frame): Move setting diff --git a/lisp/window.el b/lisp/window.el index d39c701..f198d78 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -3160,7 +3160,7 @@ move it as far as possible in the desired direction." (let* ((frame (window-frame window)) (minibuffer-window (minibuffer-window frame)) (right window) - left this-delta min-delta max-delta ignore) + left first-left first-right this-delta min-delta max-delta ignore) (unless pixelwise (setq pixelwise t) @@ -3188,6 +3188,7 @@ move it as far as possible in the desired direction." (t ;; Set LEFT to the first resizable window on the left. This step is ;; needed to handle fixed-size windows. + (setq first-left left) (while (and left (or (window-size-fixed-p left horizontal) (and (< delta 0) @@ -3200,8 +3201,10 @@ move it as far as possible in the desired direction." (not (window-combined-p left horizontal)))) (window-left left))))) (unless left + ;; We have to resize a size-preserved window. Start again with + ;; the window initially on the left. (setq ignore 'preserved) - (setq left window) + (setq left first-left) (while (and left (or (window-size-fixed-p left horizontal 'preserved) (<= (window-size left horizontal t) @@ -3220,6 +3223,7 @@ move it as far as possible in the desired direction." ;; Set RIGHT to the first resizable window on the right. This step ;; is needed to handle fixed-size windows. + (setq first-right right) (while (and right (or (window-size-fixed-p right horizontal) (and (> delta 0) @@ -3232,12 +3236,14 @@ move it as far as possible in the desired direction." (not (window-combined-p right horizontal)))) (window-right right))))) (unless right + ;; We have to resize a size-preserved window. Start again with + ;; the window initially on the right. (setq ignore 'preserved) - (setq right (window-right window)) + (setq right first-right) (while (and right (or (window-size-fixed-p right horizontal 'preserved)) (<= (window-size right horizontal t) - (window-min-size right horizontal nil t))) + (window-min-size right horizontal 'preserved t))) (setq right (or (window-right right) (progn commit 385fa75721d6d1aa1d82b9e4f05f7a76a4f79845 Author: Eli Zaretskii Date: Sat Aug 22 10:57:16 2015 +0300 Improve documentation of 'window-use-time' * doc/lispref/windows.texi (Selecting Windows): Improve documentation and indexing of 'window-use-time'. diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index e53edb3..4656938 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -1727,11 +1727,15 @@ nor the buffer list. @cindex window use time @cindex use time of window +@cindex window order by time of last use @defun window-use-time &optional window -This functions returns the @dfn{use time} of window @var{window}. +This functions returns the ``use time'' of window @var{window}. @var{window} must be a live window and defaults to the selected one. -The window with the lowest use time is the least recently selected one. -The window with the highest use time is the most recently selected one. +The @dfn{use time} of a window is not really a time value, but it does +increase monotonically with each window selection, so the window with +the lowest ``use time'' is the least recently selected one, and the +window with the highest ``use time'' is the most recently selected +one. @end defun commit 18371ed2da77c6b465dbc999a0f3baff0edfc94c Author: Stefan Monnier Date: Fri Aug 21 23:46:21 2015 -0400 * lisp/progmodes/cc-*.el: Fix up commenting style * lisp/progmodes/cc-vars.el, lisp/progmodes/cc-styles.el: * lisp/progmodes/cc-mode.el, lisp/progmodes/cc-menus.el: * lisp/progmodes/cc-langs.el, lisp/progmodes/cc-guess.el: * lisp/progmodes/cc-fonts.el, lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-defs.el, lisp/progmodes/cc-cmds.el: * lisp/progmodes/cc-bytecomp.el, lisp/progmodes/cc-awk.el: * lisp/progmodes/cc-align.el, lisp/net/soap-client.el: Fix up commenting style. diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el index 7740574..3fc6022 100644 --- a/lisp/net/soap-client.el +++ b/lisp/net/soap-client.el @@ -1818,9 +1818,9 @@ operations in a WSDL document." (provide 'soap-client) -;;; Local Variables: -;;; eval: (outline-minor-mode 1) -;;; outline-regexp: ";;;;+" -;;; End: +;; Local Variables: +;; eval: (outline-minor-mode 1) +;; outline-regexp: ";;;;+" +;; End: ;;; soap-client.el ends here diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el index 4db310d..0b96b4a 100644 --- a/lisp/progmodes/cc-align.el +++ b/lisp/progmodes/cc-align.el @@ -1345,8 +1345,8 @@ For other semicolon contexts, no determination is made." (cc-provide 'cc-align) -;;; Local Variables: -;;; indent-tabs-mode: t -;;; tab-width: 8 -;;; End: +;; Local Variables: +;; indent-tabs-mode: t +;; tab-width: 8 +;; End: ;;; cc-align.el ends here diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index ad02485..337fdc8 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el @@ -1147,8 +1147,8 @@ comment at the start of cc-engine.el for more info." (cc-provide 'cc-awk) ; Changed from 'awk-mode, ACM 2002/5/21 -;;; Local Variables: -;;; indent-tabs-mode: t -;;; tab-width: 8 -;;; End: +;; Local Variables: +;; indent-tabs-mode: t +;; tab-width: 8 +;; End: ;;; awk-mode.el ends here diff --git a/lisp/progmodes/cc-bytecomp.el b/lisp/progmodes/cc-bytecomp.el index b63eeb4..81b7a82 100644 --- a/lisp/progmodes/cc-bytecomp.el +++ b/lisp/progmodes/cc-bytecomp.el @@ -439,8 +439,8 @@ exclude any functions that have been bound during compilation with (provide 'cc-bytecomp) -;;; Local Variables: -;;; indent-tabs-mode: t -;;; tab-width: 8 -;;; End: +;; Local Variables: +;; indent-tabs-mode: t +;; tab-width: 8 +;; End: ;;; cc-bytecomp.el ends here diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 0beaf26..0e249bd 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -4769,8 +4769,8 @@ normally bound to C-o. See `c-context-line-break' for the details." (cc-provide 'cc-cmds) -;;; Local Variables: -;;; indent-tabs-mode: t -;;; tab-width: 8 -;;; End: +;; Local Variables: +;; indent-tabs-mode: t +;; tab-width: 8 +;; End: ;;; cc-cmds.el ends here diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 9e750a4..9826035 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -2497,8 +2497,8 @@ fallback definition for all modes, to break the cycle).") (cc-provide 'cc-defs) -;;; Local Variables: -;;; indent-tabs-mode: t -;;; tab-width: 8 -;;; End: +;; Local Variables: +;; indent-tabs-mode: t +;; tab-width: 8 +;; End: ;;; cc-defs.el ends here diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index a0f44a2..6c6a454 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -11232,8 +11232,8 @@ Cannot combine absolute offsets %S and %S in `add' method" (cc-provide 'cc-engine) -;;; Local Variables: -;;; indent-tabs-mode: t -;;; tab-width: 8 -;;; End: +;; Local Variables: +;; indent-tabs-mode: t +;; tab-width: 8 +;; End: ;;; cc-engine.el ends here diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 02599e8..f05d6a0 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -2704,8 +2704,8 @@ need for `pike-font-lock-extra-types'.") ;; 2006-07-10: awk-font-lock-keywords has been moved back to cc-awk.el. (cc-provide 'cc-fonts) -;;; Local Variables: -;;; indent-tabs-mode: t -;;; tab-width: 8 -;;; End: +;; Local Variables: +;; indent-tabs-mode: t +;; tab-width: 8 +;; End: ;;; cc-fonts.el ends here diff --git a/lisp/progmodes/cc-guess.el b/lisp/progmodes/cc-guess.el index ba23a75..4295fc7 100644 --- a/lisp/progmodes/cc-guess.el +++ b/lisp/progmodes/cc-guess.el @@ -573,8 +573,8 @@ WITH-NAME is asked to the user." (cc-provide 'cc-guess) -;;; Local Variables: -;;; indent-tabs-mode: t -;;; tab-width: 8 -;;; End: +;; Local Variables: +;; indent-tabs-mode: t +;; tab-width: 8 +;; End: ;;; cc-guess.el ends here diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index f971956..46da7f9 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -3356,8 +3356,8 @@ evaluated and should not be quoted." (cc-provide 'cc-langs) -;;; Local Variables: -;;; indent-tabs-mode: t -;;; tab-width: 8 -;;; End: +;; Local Variables: +;; indent-tabs-mode: t +;; tab-width: 8 +;; End: ;;; cc-langs.el ends here diff --git a/lisp/progmodes/cc-menus.el b/lisp/progmodes/cc-menus.el index 414b957..51cb920 100644 --- a/lisp/progmodes/cc-menus.el +++ b/lisp/progmodes/cc-menus.el @@ -521,8 +521,8 @@ Example: (cc-provide 'cc-menus) -;;; Local Variables: -;;; indent-tabs-mode: t -;;; tab-width: 8 -;;; End: +;; Local Variables: +;; indent-tabs-mode: t +;; tab-width: 8 +;; End: ;;; cc-menus.el ends here diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 8365702..97491e4 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -1919,8 +1919,8 @@ Key bindings: (cc-provide 'cc-mode) -;;; Local Variables: -;;; indent-tabs-mode: t -;;; tab-width: 8 -;;; End: +;; Local Variables: +;; indent-tabs-mode: t +;; tab-width: 8 +;; End: ;;; cc-mode.el ends here diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index 9a29c01..527d4c4 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -663,8 +663,8 @@ DEFAULT-STYLE has the same format as `c-default-style'." (cc-provide 'cc-styles) -;;; Local Variables: -;;; indent-tabs-mode: t -;;; tab-width: 8 -;;; End: +;; Local Variables: +;; indent-tabs-mode: t +;; tab-width: 8 +;; End: ;;; cc-styles.el ends here diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index 022bc22..df6e987 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el @@ -1772,8 +1772,8 @@ It treats escaped EOLs as whitespace.") (cc-provide 'cc-vars) -;;; Local Variables: -;;; indent-tabs-mode: t -;;; tab-width: 8 -;;; End: +;; Local Variables: +;; indent-tabs-mode: t +;; tab-width: 8 +;; End: ;;; cc-vars.el ends here commit c87523bd8dbd9c9c5b8afdae43107f0badc0c924 Author: Paul Eggert Date: Fri Aug 21 20:19:46 2015 -0700 text-quoting-style in emacs-lisp diagnostics * lisp/emacs-lisp/advice.el (ad-read-advised-function) (ad-read-advice-class, ad-read-advice-name, ad-enable-advice) (ad-disable-advice, ad-remove-advice, ad-set-argument) (ad-set-arguments): * lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand) (byte-compile-unfold-lambda, byte-optimize-form-code-walker) (byte-optimize-while, byte-optimize-apply): * lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode) (byte-compile-log-file, byte-compile-format-warn) (byte-compile-nogroup-warn, byte-compile-arglist-warn) (byte-compile-cl-warn) (byte-compile-warn-about-unresolved-functions) (byte-compile-file, byte-compile-fix-header) (byte-compile--declare-var, byte-compile-file-form-defmumble) (byte-compile-form, byte-compile-normal-call) (byte-compile-variable-ref, byte-compile-variable-set) (byte-compile-subr-wrong-args, byte-compile-setq-default) (byte-compile-negation-optimizer) (byte-compile-condition-case--old) (byte-compile-condition-case--new, byte-compile-save-excursion) (byte-compile-defvar, byte-compile-autoload) (byte-compile-lambda-form) (byte-compile-make-variable-buffer-local, display-call-tree) (batch-byte-compile): * lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use) (cconv-analyze-form): * lisp/emacs-lisp/chart.el (chart-space-usage): * lisp/emacs-lisp/check-declare.el (check-declare-scan) (check-declare-warn, check-declare-file) (check-declare-directory): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine) (checkdoc-message-text-engine): * lisp/emacs-lisp/cl-extra.el (cl-parse-integer): * lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody) (cl-symbol-macrolet): * lisp/emacs-lisp/cl.el (cl-unload-function, flet): * lisp/emacs-lisp/copyright.el (copyright) (copyright-update-directory): * lisp/emacs-lisp/edebug.el (edebug-read-list): * lisp/emacs-lisp/eieio-base.el (eieio-persistent-read): * lisp/emacs-lisp/eieio-core.el (eieio--slot-override) (eieio-oref, eieio-oset-default): * lisp/emacs-lisp/eieio-speedbar.el: (eieio-speedbar-child-make-tag-lines) (eieio-speedbar-child-description): * lisp/emacs-lisp/eieio.el (defclass, change-class): * lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms) (elint-init-form, elint-check-defalias-form) (elint-check-let-form): * lisp/emacs-lisp/ert.el (ert-get-test): * lisp/emacs-lisp/find-func.el (find-function-search-for-symbol) (find-function-library): * lisp/emacs-lisp/generator.el (iter-yield): * lisp/emacs-lisp/gv.el (gv-define-simple-setter): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emacs-lisp/package-x.el (package-upload-file): * lisp/emacs-lisp/package.el (package-version-join) (package-disabled-p, package-activate-1, package-activate) (package--download-one-archive) (package--download-and-read-archives) (package-compute-transaction, package-install-from-archive) (package-install, package-install-selected-packages) (package-delete, package-autoremove) (package-install-button-action, package-delete-button-action) (package-menu-hide-package, package-menu--list-to-prompt) (package-menu--perform-transaction) (package-menu--find-and-notify-upgrades): * lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1): * lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode): * lisp/emacs-lisp/ring.el (ring-next, ring-previous): * lisp/emacs-lisp/rx.el (rx-check, rx-anything): * lisp/emacs-lisp/smie.el (smie-config-save): * lisp/emacs-lisp/subr-x.el (internal--check-binding): * lisp/emacs-lisp/testcover.el (testcover-1value): Use curved quotes in diagnostic format strings. diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index 1915d94..bbff34d 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -168,7 +168,7 @@ ;; "Switch to non-existing buffers only upon confirmation." ;; (interactive "BSwitch to buffer: ") ;; (if (or (get-buffer (ad-get-arg 0)) -;; (y-or-n-p (format "`%s' does not exist, create? " (ad-get-arg 0)))) +;; (y-or-n-p (format "‘%s’ does not exist, create? " (ad-get-arg 0)))) ;; ad-do-it)) ;; ;;(defadvice find-file (before existing-files-only activate) @@ -1870,7 +1870,7 @@ function at point for which PREDICATE returns non-nil)." (if (equal function "") (if (ad-is-advised default) default - (error "ad-read-advised-function: `%s' is not advised" default)) + (error "ad-read-advised-function: ‘%s’ is not advised" default)) (intern function)))) (defvar ad-advice-class-completion-table @@ -1887,7 +1887,7 @@ class of FUNCTION)." (cl-dolist (class ad-advice-classes) (if (ad-get-advice-info-field function class) (cl-return class))) - (error "ad-read-advice-class: `%s' has no advices" function))) + (error "ad-read-advice-class: ‘%s’ has no advices" function))) (let ((class (completing-read (format "%s (default %s): " (or prompt "Class") default) ad-advice-class-completion-table nil t))) @@ -1904,7 +1904,7 @@ An optional PROMPT is used to prompt for the name." (ad-get-advice-info-field function class))) (default (if (null name-completion-table) - (error "ad-read-advice-name: `%s' has no %s advice" + (error "ad-read-advice-name: ‘%s’ has no %s advice" function class) (car (car name-completion-table)))) (prompt (format "%s (default %s): " (or prompt "Name") default)) @@ -1995,9 +1995,9 @@ FUNCTION was not advised)." (interactive (ad-read-advice-specification "Enable advice of")) (if (ad-is-advised function) (if (eq (ad-enable-advice-internal function class name t) 0) - (error "ad-enable-advice: `%s' has no %s advice matching `%s'" + (error "ad-enable-advice: ‘%s’ has no %s advice matching ‘%s’" function class name)) - (error "ad-enable-advice: `%s' is not advised" function))) + (error "ad-enable-advice: ‘%s’ is not advised" function))) ;;;###autoload (defun ad-disable-advice (function class name) @@ -2005,9 +2005,9 @@ FUNCTION was not advised)." (interactive (ad-read-advice-specification "Disable advice of")) (if (ad-is-advised function) (if (eq (ad-enable-advice-internal function class name nil) 0) - (error "ad-disable-advice: `%s' has no %s advice matching `%s'" + (error "ad-disable-advice: ‘%s’ has no %s advice matching ‘%s’" function class name)) - (error "ad-disable-advice: `%s' is not advised" function))) + (error "ad-disable-advice: ‘%s’ is not advised" function))) (defun ad-enable-regexp-internal (regexp class flag) "Set enable FLAGs of all CLASS advices whose name contains a REGEXP match. @@ -2053,9 +2053,9 @@ in that CLASS." (ad-set-advice-info-field function class (delq advice-to-remove (ad-get-advice-info-field function class))) - (error "ad-remove-advice: `%s' has no %s advice `%s'" + (error "ad-remove-advice: ‘%s’ has no %s advice ‘%s’" function class name))) - (error "ad-remove-advice: `%s' is not advised" function))) + (error "ad-remove-advice: ‘%s’ is not advised" function))) ;;;###autoload (defun ad-add-advice (function advice class position) @@ -2319,7 +2319,7 @@ INDEX counts from zero." ,value-form)) (argument-access `(setq ,argument-access ,value-form)) - (t (error "ad-set-argument: No argument at position %d of `%s'" + (t (error "ad-set-argument: No argument at position %d of ‘%s’" index arglist))))) (defun ad-get-arguments (arglist index) @@ -2361,7 +2361,7 @@ The assignment starts at position INDEX." (setq index (1+ index)) (setq values-index (1+ values-index))) (if (null set-forms) - (error "ad-set-arguments: No argument at position %d of `%s'" + (error "ad-set-arguments: No argument at position %d of ‘%s’" index arglist) (if (= (length set-forms) 1) ;; For exactly one set-form we can use values-form directly,... @@ -2911,14 +2911,14 @@ the value of `ad-redefinition-action' and de/activate again." (if (not (eq current-definition original-definition)) ;; We have a redefinition: (if (not (memq ad-redefinition-action '(accept discard warn))) - (error "ad-redefinition-action: `%s' %s" + (error "ad-redefinition-action: ‘%s’ %s" function "invalidly redefined") (if (eq ad-redefinition-action 'discard) nil ;; Just drop it! (funcall (or fsetfun #'fset) function newdef) (ad-activate-internal function) (if (eq ad-redefinition-action 'warn) - (message "ad-handle-definition: `%s' got redefined" + (message "ad-handle-definition: ‘%s’ got redefined" function)))) ;; either advised def or correct original is in place: nil) @@ -2953,7 +2953,7 @@ definition will always be cached for later usage." current-prefix-arg)) (cond ((not (ad-is-advised function)) - (error "ad-activate: `%s' is not advised" function)) + (error "ad-activate: ‘%s’ is not advised" function)) ;; Just return for forward advised and not yet defined functions: ((not (ad-get-orig-definition function)) nil) ((not (ad-has-any-advice function)) (ad-unadvise function)) @@ -2977,10 +2977,10 @@ a call to `ad-activate'." (interactive (list (ad-read-advised-function "Deactivate advice of" 'ad-is-active))) (if (not (ad-is-advised function)) - (error "ad-deactivate: `%s' is not advised" function) + (error "ad-deactivate: ‘%s’ is not advised" function) (cond ((ad-is-active function) (if (not (ad-get-orig-definition function)) - (error "ad-deactivate: `%s' has no original definition" + (error "ad-deactivate: ‘%s’ has no original definition" function) (ad-clear-advicefunname-definition function) (ad-set-advice-info-field function 'active nil) diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 1a34fa7..490d9a8 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -255,11 +255,11 @@ (cdr (assq name byte-compile-function-environment))))) (pcase fn (`nil - (byte-compile-warn "attempt to inline `%s' before it was defined" + (byte-compile-warn "attempt to inline ‘%s’ before it was defined" name) form) (`(autoload . ,_) - (error "File `%s' didn't define `%s'" (nth 1 fn) name)) + (error "File ‘%s’ didn't define ‘%s’" (nth 1 fn) name)) ((and (pred symbolp) (guard (not (eq fn t)))) ;A function alias. (byte-compile-inline-expand (cons fn (cdr form)))) ((pred byte-code-function-p) @@ -336,7 +336,7 @@ bindings) values nil)) ((and (not optionalp) (null values)) - (byte-compile-warn "attempt to open-code `%s' with too few arguments" name) + (byte-compile-warn "attempt to open-code ‘%s’ with too few arguments" name) (setq arglist nil values 'too-few)) (t (setq bindings (cons (list (car arglist) (car values)) @@ -347,7 +347,7 @@ (progn (or (eq values 'too-few) (byte-compile-warn - "attempt to open-code `%s' with too many arguments" name)) + "attempt to open-code ‘%s’ with too many arguments" name)) form) ;; The following leads to infinite recursion when loading a @@ -383,7 +383,7 @@ form)) ((eq fn 'quote) (if (cdr (cdr form)) - (byte-compile-warn "malformed quote form: `%s'" + (byte-compile-warn "malformed quote form: ‘%s’" (prin1-to-string form))) ;; map (quote nil) to nil to simplify optimizer logic. ;; map quoted constants to nil if for-effect (just because). @@ -407,7 +407,7 @@ (if (symbolp binding) binding (if (cdr (cdr binding)) - (byte-compile-warn "malformed let binding: `%s'" + (byte-compile-warn "malformed let binding: ‘%s’" (prin1-to-string binding))) (list (car binding) (byte-optimize-form (nth 1 binding) nil)))) @@ -420,7 +420,7 @@ (cons (byte-optimize-form (car clause) nil) (byte-optimize-body (cdr clause) for-effect)) - (byte-compile-warn "malformed cond form: `%s'" + (byte-compile-warn "malformed cond form: ‘%s’" (prin1-to-string clause)) clause)) (cdr form)))) @@ -457,7 +457,7 @@ ((eq fn 'if) (when (< (length form) 3) - (byte-compile-warn "too few arguments for `if'")) + (byte-compile-warn "too few arguments for ‘if’")) (cons fn (cons (byte-optimize-form (nth 1 form) nil) (cons @@ -485,7 +485,7 @@ (cons fn (mapcar 'byte-optimize-form (cdr form))))) ((eq fn 'interactive) - (byte-compile-warn "misplaced interactive spec: `%s'" + (byte-compile-warn "misplaced interactive spec: ‘%s’" (prin1-to-string form)) nil) @@ -539,7 +539,7 @@ (cons fn (mapcar #'byte-optimize-form (cdr form)))) ((not (symbolp fn)) - (byte-compile-warn "`%s' is a malformed function" + (byte-compile-warn "‘%s’ is a malformed function" (prin1-to-string fn)) form) @@ -1054,7 +1054,7 @@ (defun byte-optimize-while (form) (when (< (length form) 2) - (byte-compile-warn "too few arguments for `while'")) + (byte-compile-warn "too few arguments for ‘while’")) (if (nth 1 form) form)) @@ -1090,7 +1090,7 @@ (nconc (list 'funcall fn) butlast (mapcar (lambda (x) (list 'quote x)) (nth 1 last)))) (byte-compile-warn - "last arg to apply can't be a literal atom: `%s'" + "last arg to apply can't be a literal atom: ‘%s’" (prin1-to-string last)) nil)) form))) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 197df3b..0ae7824 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -814,7 +814,7 @@ CONST2 may be evaluated multiple times." off (cdr lap-entry)) (cond ((not (symbolp op)) - (error "Non-symbolic opcode `%s'" op)) + (error "Non-symbolic opcode ‘%s’" op)) ((eq op 'TAG) (setcar off pc)) (t @@ -1120,7 +1120,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." pt) (when dir (unless was-same - (insert (format "Leaving directory `%s'\n" default-directory)))) + (insert (format "Leaving directory ‘%s’\n" default-directory)))) (unless (bolp) (insert "\n")) (setq pt (point-marker)) @@ -1135,7 +1135,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (when dir (setq default-directory dir) (unless was-same - (insert (format "Entering directory `%s'\n" + (insert (format "Entering directory ‘%s’\n" default-directory)))) (setq byte-compile-last-logged-file byte-compile-current-file byte-compile-last-warned-form nil) @@ -1338,7 +1338,7 @@ extra args." (nargs (- (length form) 2))) (unless (= nargs nfields) (byte-compile-warn - "`%s' called with %d args to fill %d format field(s)" (car form) + "‘%s’ called with %d args to fill %d format field(s)" (car form) nargs nfields))))) (dolist (elt '(format message error)) @@ -1358,7 +1358,7 @@ extra args." (plist-get keyword-args :group) (not (and (consp name) (eq (car name) 'quote))) (byte-compile-warn - "%s for `%s' fails to specify containing group" + "%s for ‘%s’ fails to specify containing group" (cdr (assq (car form) '((custom-declare-group . defgroup) (custom-declare-face . defface) @@ -1377,7 +1377,7 @@ extra args." (let ((calls (assq name byte-compile-unresolved-functions)) nums sig min max) (when (and calls macrop) - (byte-compile-warn "macro `%s' defined too late" name)) + (byte-compile-warn "macro ‘%s’ defined too late" name)) (setq byte-compile-unresolved-functions (delq calls byte-compile-unresolved-functions)) (setq calls (delq t calls)) ;Ignore higher-order uses of the function. @@ -1385,7 +1385,7 @@ extra args." (when (and (symbolp name) (eq (function-get name 'byte-optimizer) 'byte-compile-inline-expand)) - (byte-compile-warn "defsubst `%s' was used before it was defined" + (byte-compile-warn "defsubst ‘%s’ was used before it was defined" name)) (setq sig (byte-compile-arglist-signature arglist) nums (sort (copy-sequence (cdr calls)) (function <)) @@ -1464,7 +1464,7 @@ extra args." ;; so don't warn about them. macroexpand cl--compiling-file)))) - (byte-compile-warn "function `%s' from cl package called at runtime" + (byte-compile-warn "function ‘%s’ from cl package called at runtime" func))) form) @@ -1506,12 +1506,12 @@ extra args." (if (fboundp f) (push f noruntime) (push f unresolved))) ;; Complain about the no-run-time functions (byte-compile-print-syms - "the function `%s' might not be defined at runtime." + "the function ‘%s’ might not be defined at runtime." "the following functions might not be defined at runtime:" noruntime) ;; Complain about the unresolved functions (byte-compile-print-syms - "the function `%s' is not known to be defined." + "the function ‘%s’ is not known to be defined." "the following functions are not known to be defined:" unresolved))) nil) @@ -1813,11 +1813,11 @@ The value is non-nil if there were no errors, nil if errors." ;; compile this file. (if (with-current-buffer input-buffer no-byte-compile) (progn - ;; (message "%s not compiled because of `no-byte-compile: %s'" + ;; (message "%s not compiled because of ‘no-byte-compile: %s’" ;; (byte-compile-abbreviate-file filename) ;; (with-current-buffer input-buffer no-byte-compile)) (when (file-exists-p target-file) - (message "%s deleted because of `no-byte-compile: %s'" + (message "%s deleted because of ‘no-byte-compile: %s’" (byte-compile-abbreviate-file target-file) (buffer-local-value 'no-byte-compile input-buffer)) (condition-case nil (delete-file target-file) (error nil))) @@ -2014,7 +2014,7 @@ and will be removed soon. See (elisp)Backquote in the manual.")) (format " (string-lessp emacs-version \"%s\")\n" minimum-version) ;; Because the header must fit in a fixed width, we cannot ;; insert arbitrary-length file names (Bug#11585). - " (error \"`%s' was compiled for " + " (error \"'%s' was compiled for " (format "Emacs %s or later\" #$))\n\n" minimum-version)) ;; Now compensate for any change in size, to make sure all ;; positions in the file remain valid. @@ -2300,12 +2300,12 @@ list that represents a doc string reference. (when (and (symbolp sym) (not (string-match "[-*/:$]" (symbol-name sym))) (byte-compile-warning-enabled-p 'lexical)) - (byte-compile-warn "global/dynamic var `%s' lacks a prefix" + (byte-compile-warn "global/dynamic var ‘%s’ lacks a prefix" sym)) (when (memq sym byte-compile-lexical-variables) (setq byte-compile-lexical-variables (delq sym byte-compile-lexical-variables)) - (byte-compile-warn "Variable `%S' declared after its first use" sym)) + (byte-compile-warn "Variable ‘%S’ declared after its first use" sym)) (push sym byte-compile-bound-variables)) (defun byte-compile-file-form-defvar (form) @@ -2422,7 +2422,7 @@ not to take responsibility for the actual compilation of the code." ;; Don't warn when compiling the stubs in byte-run... (not (assq name byte-compile-initial-macro-environment))) (byte-compile-warn - "`%s' defined multiple times, as both function and macro" + "‘%s’ defined multiple times, as both function and macro" name)) (setcdr that-one nil)) (this-one @@ -2430,13 +2430,13 @@ not to take responsibility for the actual compilation of the code." ;; Hack: Don't warn when compiling the magic internal ;; byte-compiler macros in byte-run.el... (not (assq name byte-compile-initial-macro-environment))) - (byte-compile-warn "%s `%s' defined multiple times in this file" + (byte-compile-warn "%s ‘%s’ defined multiple times in this file" (if macro "macro" "function") name))) ((eq (car-safe (symbol-function name)) (if macro 'lambda 'macro)) (when (byte-compile-warning-enabled-p 'redefine) - (byte-compile-warn "%s `%s' being redefined as a %s" + (byte-compile-warn "%s ‘%s’ being redefined as a %s" (if macro "function" "macro") name (if macro "macro" "function"))) @@ -2453,7 +2453,7 @@ not to take responsibility for the actual compilation of the code." (stringp (car-safe (cdr-safe (cdr-safe body))))) ;; FIXME: We've done that already just above, so this looks wrong! ;;(byte-compile-set-symbol-position name) - (byte-compile-warn "probable `\"' without `\\' in doc string of %s" + (byte-compile-warn "probable ‘\"’ without ‘\\’ in doc string of %s" name)) (if (not (listp body)) @@ -2979,19 +2979,19 @@ for symbols generated by the byte compiler itself." (`(',var . ,_) (when (assq var byte-compile-lexical-variables) (byte-compile-log-warning - (format "%s cannot use lexical var `%s'" fn var) + (format "%s cannot use lexical var ‘%s’" fn var) nil :error))))) (when (macroexp--const-symbol-p fn) - (byte-compile-warn "`%s' called as a function" fn)) + (byte-compile-warn "‘%s’ called as a function" fn)) (when (and (byte-compile-warning-enabled-p 'interactive-only) interactive-only) - (byte-compile-warn "`%s' is for interactive use only%s" + (byte-compile-warn "‘%s’ is for interactive use only%s" fn (cond ((stringp interactive-only) (format "; %s" interactive-only)) ((and (symbolp 'interactive-only) (not (eq interactive-only t))) - (format "; use `%s' instead." + (format "; use ‘%s’ instead." interactive-only)) (t ".")))) (if (eq (car-safe (symbol-function (car form))) 'macro) @@ -3036,7 +3036,7 @@ for symbols generated by the byte compiler itself." (byte-compile-warning-enabled-p 'mapcar)) (byte-compile-set-symbol-position 'mapcar) (byte-compile-warn - "`mapcar' called for effect; use `mapc' or `dolist' instead")) + "‘mapcar’ called for effect; use ‘mapc’ or ‘dolist’ instead")) (byte-compile-push-constant (car form)) (mapc 'byte-compile-form (cdr form)) ; wasteful, but faster. (byte-compile-out 'byte-call (length (cdr form)))) @@ -3124,8 +3124,8 @@ for symbols generated by the byte compiler itself." (cond ((or (not (symbolp var)) (macroexp--const-symbol-p var)) (when (byte-compile-warning-enabled-p 'constants) (byte-compile-warn (if (eq access-type 'let-bind) - "attempt to let-bind %s `%s`" - "variable reference to %s `%s'") + "attempt to let-bind %s ‘%s’" + "variable reference to %s ‘%s’") (if (symbolp var) "constant" "nonvariable") (prin1-to-string var)))) ((let ((od (get var 'byte-obsolete-variable))) @@ -3163,7 +3163,7 @@ for symbols generated by the byte compiler itself." (boundp var) (memq var byte-compile-bound-variables) (memq var byte-compile-free-references)) - (byte-compile-warn "reference to free variable `%S'" var) + (byte-compile-warn "reference to free variable ‘%S’" var) (push var byte-compile-free-references)) (byte-compile-dynamic-variable-op 'byte-varref var)))) @@ -3179,7 +3179,7 @@ for symbols generated by the byte compiler itself." (boundp var) (memq var byte-compile-bound-variables) (memq var byte-compile-free-assignments)) - (byte-compile-warn "assignment to free variable `%s'" var) + (byte-compile-warn "assignment to free variable ‘%s’" var) (push var byte-compile-free-assignments)) (byte-compile-dynamic-variable-op 'byte-varset var)))) @@ -3360,7 +3360,7 @@ If it is nil, then the handler is \"byte-compile-SYMBOL.\"" (defun byte-compile-subr-wrong-args (form n) (byte-compile-set-symbol-position (car form)) - (byte-compile-warn "`%s' called with %d arg%s, but requires %s" + (byte-compile-warn "‘%s’ called with %d arg%s, but requires %s" (car form) (length (cdr form)) (if (= 1 (length (cdr form))) "" "s") n) ;; Get run-time wrong-number-of-args error. @@ -3728,7 +3728,7 @@ discarding." (macroexp--const-symbol-p var t)) (byte-compile-warning-enabled-p 'constants) (byte-compile-warn - "variable assignment to %s `%s'" + "variable assignment to %s ‘%s’" (if (symbolp var) "constant" "nonvariable") (prin1-to-string var))) (byte-compile-normal-call `(set-default ',var ,@(cdr form))))))) @@ -4102,7 +4102,7 @@ binding slots have been popped." (list 'not (cons (or (get (car form) 'byte-compile-negated-op) (error - "Compiler error: `%s' has no `byte-compile-negated-op' property" + "Compiler error: ‘%s’ has no ‘byte-compile-negated-op’ property" (car form))) (cdr form)))) @@ -4165,7 +4165,7 @@ binding slots have been popped." (byte-compile-set-symbol-position 'condition-case) (unless (symbolp var) (byte-compile-warn - "`%s' is not a variable-name or nil (in condition-case)" var)) + "‘%s’ is not a variable-name or nil (in condition-case)" var)) (if fun-bodies (setq var (make-symbol "err"))) (byte-compile-push-constant var) (if fun-bodies @@ -4184,14 +4184,14 @@ binding slots have been popped." (setq ok nil))) ok)))) (byte-compile-warn - "`%S' is not a condition name or list of such (in condition-case)" + "‘%S’ is not a condition name or list of such (in condition-case)" condition)) ;; (not (or (eq condition 't) ;; (and (stringp (get condition 'error-message)) ;; (consp (get condition ;; 'error-conditions))))) ;; (byte-compile-warn - ;; "`%s' is not a known condition name + ;; "‘%s’ is not a known condition name ;; (in condition-case)" ;; condition)) ) @@ -4217,7 +4217,7 @@ binding slots have been popped." (byte-compile-set-symbol-position 'condition-case) (unless (symbolp var) (byte-compile-warn - "`%s' is not a variable-name or nil (in condition-case)" var)) + "‘%s’ is not a variable-name or nil (in condition-case)" var)) (dolist (clause (reverse clauses)) (let ((condition (nth 1 clause))) @@ -4225,12 +4225,12 @@ binding slots have been popped." (dolist (c condition) (unless (and c (symbolp c)) (byte-compile-warn - "`%S' is not a condition name (in condition-case)" c)) + "‘%S’ is not a condition name (in condition-case)" c)) ;; In reality, the `error-conditions' property is only required ;; for the argument to `signal', not to `condition-case'. ;;(unless (consp (get c 'error-conditions)) ;; (byte-compile-warn - ;; "`%s' is not a known condition name (in condition-case)" + ;; "‘%s’ is not a known condition name (in condition-case)" ;; c)) ) (byte-compile-push-constant condition)) @@ -4267,7 +4267,7 @@ binding slots have been popped." (if (and (eq 'set-buffer (car-safe (car-safe (cdr form)))) (byte-compile-warning-enabled-p 'suspicious)) (byte-compile-warn - "Use `with-current-buffer' rather than save-excursion+set-buffer")) + "Use ‘with-current-buffer’ rather than save-excursion+set-buffer")) (byte-compile-out 'byte-save-excursion 0) (byte-compile-body-do-effect (cdr form)) (byte-compile-out 'byte-unbind 1)) @@ -4307,7 +4307,7 @@ binding slots have been popped." (when (and (symbolp (nth 1 form)) (not (string-match "[-*/:$]" (symbol-name (nth 1 form)))) (byte-compile-warning-enabled-p 'lexical)) - (byte-compile-warn "global/dynamic var `%s' lacks a prefix" + (byte-compile-warn "global/dynamic var ‘%s’ lacks a prefix" (nth 1 form))) (let ((fun (nth 0 form)) (var (nth 1 form)) @@ -4318,7 +4318,7 @@ binding slots have been popped." (and (eq fun 'defconst) (null (cddr form)))) (let ((ncall (length (cdr form)))) (byte-compile-warn - "`%s' called with %d argument%s, but %s %s" + "‘%s’ called with %d argument%s, but %s %s" fun ncall (if (= 1 ncall) "" "s") (if (< ncall 2) "requires" "accepts only") @@ -4327,7 +4327,7 @@ binding slots have been popped." (if (eq fun 'defconst) (push var byte-compile-const-variables)) (when (and string (not (stringp string))) - (byte-compile-warn "third arg to `%s %s' is not a string: %s" + (byte-compile-warn "third arg to ‘%s %s’ is not a string: %s" fun var string)) (byte-compile-form-do-effect (if (cddr form) ; `value' provided @@ -4350,7 +4350,7 @@ binding slots have been popped." (not (fboundp (eval (nth 1 form)))) (byte-compile-warn "The compiler ignores `autoload' except at top level. You should - probably put the autoload of the macro `%s' at top-level." + probably put the autoload of the macro ‘%s’ at top-level." (eval (nth 1 form)))) (byte-compile-normal-call form)) @@ -4358,7 +4358,7 @@ binding slots have been popped." ;; The ones that remain are errors. (defun byte-compile-lambda-form (_form) (byte-compile-set-symbol-position 'lambda) - (error "`lambda' used as function name is invalid")) + (error "‘lambda’ used as function name is invalid")) ;; Compile normally, but deal with warnings for the function being defined. (put 'defalias 'byte-hunk-handler 'byte-compile-file-form-defalias) @@ -4430,7 +4430,7 @@ binding slots have been popped." (if (and (eq (car-safe (car-safe (cdr-safe form))) 'quote) (byte-compile-warning-enabled-p 'make-local)) (byte-compile-warn - "`make-variable-buffer-local' not called at toplevel")) + "‘make-variable-buffer-local’ not called at toplevel")) (byte-compile-normal-call form)) (put 'make-variable-buffer-local 'byte-hunk-handler 'byte-compile-form-make-variable-buffer-local) @@ -4562,7 +4562,7 @@ invoked interactively." (length (nth 2 y)))))) (`name (lambda (x y) (string< (car x) (car y)))) - (_ (error "`byte-compile-call-tree-sort': `%s' - unknown sort mode" + (_ (error "‘byte-compile-call-tree-sort’: ‘%s’ - unknown sort mode" byte-compile-call-tree-sort)))))) (message "Generating call tree...") (let ((rest byte-compile-call-tree) @@ -4675,7 +4675,7 @@ already up-to-date." ;; startup.el. (defvar command-line-args-left) ;Avoid 'free variable' warning (if (not noninteractive) - (error "`batch-byte-compile' is to be used only with -batch")) + (error "‘batch-byte-compile’ is to be used only with -batch")) (let ((error nil)) (while command-line-args-left (if (file-directory-p (expand-file-name (car command-line-args-left))) diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index fa82407..ac5144c 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el @@ -300,7 +300,7 @@ places where they originally did not directly appear." (prog1 binder (setq binder (list binder))) (when (cddr binder) (byte-compile-log-warning - (format "Malformed `%S' binding: %S" letsym binder))) + (format "Malformed ‘%S’ binding: %S" letsym binder))) (setq value (cadr binder)) (car binder))) (new-val @@ -545,7 +545,7 @@ FORM is the parent form that binds this var." (`((,(and var (guard (eq ?_ (aref (symbol-name var) 0)))) . ,_) ,_ ,_ ,_ ,_) (byte-compile-log-warning - (format "%s `%S' not left unused" varkind var)))) + (format "%s ‘%S’ not left unused" varkind var)))) (pcase vardata (`((,var . ,_) nil ,_ ,_ nil) ;; FIXME: This gives warnings in the wrong order, with imprecise line @@ -557,7 +557,7 @@ FORM is the parent form that binds this var." (eq ?_ (aref (symbol-name var) 0)) ;; As a special exception, ignore "ignore". (eq var 'ignored)) - (byte-compile-log-warning (format "Unused lexical %s `%S'" + (byte-compile-log-warning (format "Unused lexical %s ‘%S’" varkind var)))) ;; If it's unused, there's no point converting it into a cons-cell, even if ;; it's captured and mutated. @@ -678,7 +678,7 @@ and updates the data stored in ENV." ;; ((and `(quote ,v . ,_) (guard (assq v env))) ;; (byte-compile-log-warning - ;; (format "Possible confusion variable/symbol for `%S'" v))) + ;; (format "Possible confusion variable/symbol for ‘%S’" v))) (`(quote . ,_) nil) ; quote form (`(function . ,_) nil) ; same as quote diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index 0660125..d972879 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el @@ -652,7 +652,7 @@ SORT-PRED if desired." (set-buffer b) (erase-buffer) (insert "cd " d ";du -sk * \n") - (message "Running `cd %s;du -sk *'..." d) + (message "Running ‘cd %s;du -sk *’..." d) (call-process-region (point-min) (point-max) shell-file-name t (current-buffer) nil) (goto-char (point-min)) diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el index ea865f2..2c2f684 100644 --- a/lisp/emacs-lisp/check-declare.el +++ b/lisp/emacs-lisp/check-declare.el @@ -106,7 +106,7 @@ don't know how to recognize (e.g. some macros)." (symbolp (setq fileonly (nth 4 form)))) (setq alist (cons (list fnfile fn arglist fileonly) alist)) ;; FIXME make this more noticeable. - (if form (message "Malformed declaration for `%s'" (cadr form)))))) + (if form (message "Malformed declaration for ‘%s’" (cadr form)))))) (message "%sdone" m) alist)) @@ -279,7 +279,7 @@ TYPE is a string giving the nature of the error. Warning is displayed in entry)) (warning-fill-prefix " ")) (display-warning 'check-declare - (format "said `%s' was defined in %s: %s" + (format "said ‘%s’ was defined in %s: %s" fn (file-name-nondirectory fnfile) type) nil check-declare-warning-buffer))) @@ -318,7 +318,7 @@ Return a list of any errors found." See `check-declare-directory' for more information." (interactive "fFile to check: ") (or (file-exists-p file) - (error "File `%s' not found" file)) + (error "File ‘%s’ not found" file)) (let ((m (format "Checking %s..." file)) errlist) (message "%s" m) @@ -332,8 +332,8 @@ See `check-declare-directory' for more information." Returns non-nil if any false statements are found." (interactive "DDirectory to check: ") (or (file-directory-p (setq root (expand-file-name root))) - (error "Directory `%s' not found" root)) - (let ((m "Checking `declare-function' statements...") + (error "Directory ‘%s’ not found" root)) + (let ((m "Checking ‘declare-function’ statements...") (m2 "Finding files with declarations...") errlist files) (message "%s" m) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index c22aff4..14c2a1b 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1663,7 +1663,7 @@ function,command,variable,option or symbol." ms1)))))) ;; (concat "\\<" (regexp-quote (car fp)) "\\>") ;; newname)) ;; (checkdoc-create-error - ;; "Flag variable names should normally end in `-flag'" s + ;; "Flag variable names should normally end in ‘-flag’" s ;; (marker-position e))))) ;; Done with variables )) @@ -1715,7 +1715,7 @@ function,command,variable,option or symbol." ms1)))))) (if (checkdoc-autofix-ask-replace (match-beginning 1) (match-end 1) (format - "If this is the argument `%s', it should appear as %s. Fix? " + "If this is the argument ‘%s’, it should appear as %s. Fix? " (car args) (upcase (car args))) (upcase (car args)) t) (setq found (match-beginning 1)))))) @@ -1741,7 +1741,7 @@ function,command,variable,option or symbol." ms1)))))) nil) (checkdoc-create-error (format - "Argument `%s' should appear (as %s) in the doc string" + "Argument ‘%s’ should appear (as %s) in the doc string" (car args) (upcase (car args))) s (marker-position e))) (if (or (and order (eq order 'yes)) @@ -1824,7 +1824,7 @@ Replace with \"%s\"? " original replace) (setq found (intern-soft ms)) (or (boundp found) (fboundp found))) (progn - (setq msg (format "Add quotes around Lisp symbol `%s'? " + (setq msg (format "Add quotes around Lisp symbol ‘%s’? " ms)) (if (checkdoc-autofix-ask-replace (match-beginning 1) (+ (match-beginning 1) @@ -1832,7 +1832,7 @@ Replace with \"%s\"? " original replace) msg (concat "‘" ms "’") t) (setq msg nil) (setq msg - (format "Lisp symbol `%s' should appear in quotes" + (format "Lisp symbol ‘%s’ should appear in quotes" ms)))))) (if msg (checkdoc-create-error msg (match-beginning 1) @@ -1849,7 +1849,7 @@ Replace with \"%s\"? " original replace) (match-string 2) t) nil (checkdoc-create-error - "Symbols t and nil should not appear in `...' quotes" + "Symbols t and nil should not appear in ‘...’ quotes" (match-beginning 1) (match-end 1))))) ;; Here is some basic sentence formatting (checkdoc-sentencespace-region-engine (point) e) @@ -2487,22 +2487,22 @@ Argument TYPE specifies the type of question, such as `error' or `y-or-n-p'." ;; If we see a ?, then replace with "? ". (if (checkdoc-autofix-ask-replace (match-beginning 0) (match-end 0) - "`y-or-n-p' argument should end with \"? \". Fix? " + "‘y-or-n-p’ argument should end with \"? \". Fix? " "? " t) nil (checkdoc-create-error - "`y-or-n-p' argument should end with \"? \"" + "‘y-or-n-p’ argument should end with \"? \"" (match-beginning 0) (match-end 0))) (if (save-excursion (forward-sexp 1) (forward-char -2) (looking-at " ")) (if (checkdoc-autofix-ask-replace (match-beginning 0) (match-end 0) - "`y-or-n-p' argument should end with \"? \". Fix? " + "‘y-or-n-p’ argument should end with \"? \". Fix? " "? " t) nil (checkdoc-create-error - "`y-or-n-p' argument should end with \"? \"" + "‘y-or-n-p’ argument should end with \"? \"" (match-beginning 0) (match-end 0))) (if (and ;; if this isn't true, we have a problem. (save-excursion (forward-sexp 1) @@ -2510,11 +2510,11 @@ Argument TYPE specifies the type of question, such as `error' or `y-or-n-p'." (looking-at "\"")) (checkdoc-autofix-ask-replace (match-beginning 0) (match-end 0) - "`y-or-n-p' argument should end with \"? \". Fix? " + "‘y-or-n-p’ argument should end with \"? \". Fix? " "? \"" t)) nil (checkdoc-create-error - "`y-or-n-p' argument should end with \"? \"" + "‘y-or-n-p’ argument should end with \"? \"" (match-beginning 0) (match-end 0))))))) ;; Now, let's just run the spell checker on this guy. (checkdoc-ispell-docstring-engine (save-excursion (forward-sexp 1) diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 132aaa5..6f436db 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -416,7 +416,7 @@ as an integer unless JUNK-ALLOWED is non-nil." (cond ((and junk-allowed (null sum)) sum) (junk-allowed (* sign sum)) ((or (/= start end) (null sum)) - (error "Not an integer string: `%s'" string)) + (error "Not an integer string: ‘%s’" string)) (t (* sign sum))))))) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index f5e1ffb..ea77c92 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -1132,7 +1132,7 @@ For more details, see Info node `(cl)Loop Facility'. (cond ((null cl--loop-args) - (error "Malformed `cl-loop' macro")) + (error "Malformed ‘cl-loop’ macro")) ((eq word 'named) (setq cl--loop-name (pop cl--loop-args))) @@ -1140,7 +1140,7 @@ For more details, see Info node `(cl)Loop Facility'. ((eq word 'initially) (if (memq (car cl--loop-args) '(do doing)) (pop cl--loop-args)) (or (consp (car cl--loop-args)) - (error "Syntax error on `initially' clause")) + (error "Syntax error on ‘initially’ clause")) (while (consp (car cl--loop-args)) (push (pop cl--loop-args) cl--loop-initially))) @@ -1150,7 +1150,7 @@ For more details, see Info node `(cl)Loop Facility'. (or (cl--pop2 cl--loop-args) '(quote nil))) (if (memq (car cl--loop-args) '(do doing)) (pop cl--loop-args)) (or (consp (car cl--loop-args)) - (error "Syntax error on `finally' clause")) + (error "Syntax error on ‘finally’ clause")) (if (and (eq (caar cl--loop-args) 'return) (null cl--loop-name)) (setq cl--loop-result-explicit (or (nth 1 (pop cl--loop-args)) '(quote nil))) @@ -1177,7 +1177,7 @@ For more details, see Info node `(cl)Loop Facility'. above below by)) (push word cl--loop-args) (if (memq (car cl--loop-args) '(downto above)) - (error "Must specify `from' value for downward cl-loop")) + (error "Must specify ‘from’ value for downward cl-loop")) (let* ((down (or (eq (car cl--loop-args) 'downfrom) (memq (nth 2 cl--loop-args) '(downto above)))) @@ -1197,7 +1197,7 @@ For more details, see Info node `(cl)Loop Facility'. (step-var (and (not (macroexp-const-p step)) (make-symbol "--cl-var--")))) (and step (numberp step) (<= step 0) - (error "Loop `by' value is not positive: %s" step)) + (error "Loop ‘by’ value is not positive: %s" step)) (push (list var (or start 0)) loop-for-bindings) (if end-var (push (list end-var end) loop-for-bindings)) (if step-var (push (list step-var step) @@ -1276,7 +1276,7 @@ For more details, see Info node `(cl)Loop Facility'. ((memq word '(element elements)) (let ((ref (or (memq (car cl--loop-args) '(in-ref of-ref)) (and (not (memq (car cl--loop-args) '(in of))) - (error "Expected `of'")))) + (error "Expected ‘of’")))) (seq (cl--pop2 cl--loop-args)) (temp-seq (make-symbol "--cl-seq--")) (temp-idx @@ -1284,7 +1284,7 @@ For more details, see Info node `(cl)Loop Facility'. (if (and (= (length (cadr cl--loop-args)) 2) (eq (cl-caadr cl--loop-args) 'index)) (cadr (cl--pop2 cl--loop-args)) - (error "Bad `using' clause")) + (error "Bad ‘using’ clause")) (make-symbol "--cl-idx--")))) (push (list temp-seq seq) loop-for-bindings) (push (list temp-idx 0) loop-for-bindings) @@ -1309,7 +1309,7 @@ For more details, see Info node `(cl)Loop Facility'. ((memq word hash-types) (or (memq (car cl--loop-args) '(in of)) - (error "Expected `of'")) + (error "Expected ‘of’")) (let* ((table (cl--pop2 cl--loop-args)) (other (if (eq (car cl--loop-args) 'using) @@ -1317,7 +1317,7 @@ For more details, see Info node `(cl)Loop Facility'. (memq (cl-caadr cl--loop-args) hash-types) (not (eq (cl-caadr cl--loop-args) word))) (cadr (cl--pop2 cl--loop-args)) - (error "Bad `using' clause")) + (error "Bad ‘using’ clause")) (make-symbol "--cl-var--")))) (if (memq word '(hash-value hash-values)) (setq var (prog1 other (setq other var)))) @@ -1372,7 +1372,7 @@ For more details, see Info node `(cl)Loop Facility'. ((memq word key-types) (or (memq (car cl--loop-args) '(in of)) - (error "Expected `of'")) + (error "Expected ‘of’")) (let ((cl-map (cl--pop2 cl--loop-args)) (other (if (eq (car cl--loop-args) 'using) @@ -1380,7 +1380,7 @@ For more details, see Info node `(cl)Loop Facility'. (memq (cl-caadr cl--loop-args) key-types) (not (eq (cl-caadr cl--loop-args) word))) (cadr (cl--pop2 cl--loop-args)) - (error "Bad `using' clause")) + (error "Bad ‘using’ clause")) (make-symbol "--cl-var--")))) (if (memq word '(key-binding key-bindings)) (setq var (prog1 other (setq other var)))) @@ -1430,7 +1430,7 @@ For more details, see Info node `(cl)Loop Facility'. (get word 'cl-loop-for-handler)))) (if handler (funcall handler var) - (error "Expected a `for' preposition, found %s" word))))) + (error "Expected a ‘for’ preposition, found %s" word))))) (eq (car cl--loop-args) 'and)) (setq ands t) (pop cl--loop-args)) @@ -1569,7 +1569,7 @@ For more details, see Info node `(cl)Loop Facility'. ((memq word '(do doing)) (let ((body nil)) - (or (consp (car cl--loop-args)) (error "Syntax error on `do' clause")) + (or (consp (car cl--loop-args)) (error "Syntax error on ‘do’ clause")) (while (consp (car cl--loop-args)) (push (pop cl--loop-args) body)) (push (cons 'progn (nreverse (cons t body))) cl--loop-body))) @@ -1802,7 +1802,7 @@ Labels have lexical scope and dynamic extent." `((go . ,(lambda (label) (let ((catch-tag (cdr (assq label cl--tagbody-alist)))) (unless catch-tag - (error "Unknown cl-tagbody go label `%S'" label)) + (error "Unknown cl-tagbody go label ‘%S’" label)) `(throw ',catch-tag ',label)))) ,@macroexpand-all-environment))))) @@ -2101,7 +2101,7 @@ by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...). macroexpand-all-environment)))) (if (or (null (cdar bindings)) (cl-cddar bindings)) (macroexp--warn-and-return - (format "Malformed `cl-symbol-macrolet' binding: %S" + (format "Malformed ‘cl-symbol-macrolet’ binding: %S" (car bindings)) expansion) expansion))) diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index c966ace..38deeae 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -86,7 +86,7 @@ (defun cl-unload-function () "Stop unloading of the Common Lisp extensions." - (message "Cannot unload the feature `cl'") + (message "Cannot unload the feature ‘cl’") ;; Stop standard unloading! t) @@ -459,15 +459,15 @@ definitions, or lack thereof). (if (or (and (fboundp (car x)) (eq (car-safe (symbol-function (car x))) 'macro)) (cdr (assq (car x) macroexpand-all-environment))) - (error "Use `labels', not `flet', to rebind macro names")) + (error "Use ‘labels’, not ‘flet’, to rebind macro names")) (let ((func `(cl-function (lambda ,(cadr x) (cl-block ,(car x) ,@(cddr x)))))) (when (cl--compiling-file) ;; Bug#411. It would be nice to fix this. (and (get (car x) 'byte-compile) - (error "Byte-compiling a redefinition of `%s' \ -will not work - use `labels' instead" (symbol-name (car x)))) + (error "Byte-compiling a redefinition of ‘%s’ \ +will not work - use ‘labels’ instead" (symbol-name (car x)))) ;; FIXME This affects the rest of the file, when it ;; should be restricted to the flet body. (and (boundp 'byte-compile-function-environment) diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 1317d69..ece6883 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -350,7 +350,7 @@ independently replaces consecutive years with a range." (or (getenv "ORGANIZATION") str) '(if (copyright-offset-too-large-p) - (message "Copyright extends beyond `copyright-limit' and won't be updated automatically.")) + (message "Copyright extends beyond ‘copyright-limit’ and won't be updated automatically.")) comment-end \n) ;; TODO: recurse, exclude COPYING etc. @@ -361,7 +361,7 @@ If FIX is non-nil, run `copyright-fix-years' instead." (interactive "DDirectory: \nMFilenames matching (regexp): ") (dolist (file (directory-files directory t match nil)) (unless (file-directory-p file) - (message "Updating file `%s'" file) + (message "Updating file ‘%s’" file) ;; FIXME we should not use find-file+save+kill. (let ((enable-local-variables :safe) (enable-local-eval nil)) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index b5b68d2..d7e3903 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -880,7 +880,7 @@ Maybe clear the markers and delete the symbol's edebug property?" (setq dotted-form (edebug-read-storing-offsets stream)) elements (nconc elements dotted-form) (if (not (eq (edebug-next-token-class) 'rparen)) - (edebug-syntax-error "Expected `)'")) + (edebug-syntax-error "Expected ‘)’")) (setq edebug-read-dotted-list (listp dotted-form)) )) elements) diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el index 400bdb9..e1051b2 100644 --- a/lisp/emacs-lisp/eieio-base.el +++ b/lisp/emacs-lisp/eieio-base.el @@ -218,7 +218,7 @@ for CLASS. Optional ALLOW-SUBCLASS says that it is ok for `eieio-persistent-read' to load in subclasses of class instead of being pedantic." (unless class - (message "Unsafe call to `eieio-persistent-read'.")) + (message "Unsafe call to ‘eieio-persistent-read’.")) (when class (cl-check-type class class)) (let ((ret nil) (buffstr nil)) diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 7fcf85c..2ecf412 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -544,7 +544,7 @@ If SKIPNIL is non-nil, then if default value is nil return t instead." (if (not (eq type t)) (if (not (equal type tp)) (error - "Child slot type `%s' does not match inherited type `%s' for `%s'" + "Child slot type ‘%s’ does not match inherited type ‘%s’ for ‘%s’" type tp a)) (setf (cl--slot-descriptor-type new) tp)) ;; If we have a repeat, only update the initarg... @@ -564,7 +564,7 @@ If SKIPNIL is non-nil, then if default value is nil return t instead." (let ((super-prot (alist-get :protection oprops)) (prot (alist-get :protection nprops))) (if (not (eq prot super-prot)) - (error "Child slot protection `%s' does not match inherited protection `%s' for `%s'" + (error "Child slot protection ‘%s’ does not match inherited protection ‘%s’ for ‘%s’" prot super-prot a))) ;; End original PLN @@ -733,7 +733,7 @@ Argument FN is the function calling this verifier." ((and (or `',name (and name (pred keywordp))) (guard (not (memq name eieio--known-slot-names)))) (macroexp--warn-and-return - (format "Unknown slot `%S'" name) exp 'compile-only)) + (format "Unknown slot ‘%S’" name) exp 'compile-only)) (_ exp))))) (cl-check-type slot symbol) (cl-check-type obj (or eieio-object class)) @@ -847,7 +847,7 @@ Fills in the default value in CLASS' in SLOT with VALUE." ;; gnus/registry.el, so it might be used elsewhere as well, so let's ;; keep it for now. ;; FIXME: Generate a compile-time warning for it! - ;; (error "Can't `oset-default' an instance-allocated slot: %S of %S" + ;; (error "Can't ‘oset-default’ an instance-allocated slot: %S of %S" ;; slot class) (eieio--validate-slot-value class c value slot) ;; Set this into the storage for defaults. diff --git a/lisp/emacs-lisp/eieio-speedbar.el b/lisp/emacs-lisp/eieio-speedbar.el index a1eabcf..ac8124a 100644 --- a/lisp/emacs-lisp/eieio-speedbar.el +++ b/lisp/emacs-lisp/eieio-speedbar.el @@ -323,7 +323,7 @@ Argument DEPTH is the depth at which the tag line is inserted." (cl-defmethod eieio-speedbar-child-make-tag-lines ((object eieio-speedbar) _depth) "Base method for creating tag lines for non-object children." - (error "You must implement `eieio-speedbar-child-make-tag-lines' for %s" + (error "You must implement ‘eieio-speedbar-child-make-tag-lines’ for %s" (eieio-object-name object))) (cl-defmethod eieio-speedbar-expand ((object eieio-speedbar) depth) @@ -364,7 +364,7 @@ TOKEN is the object. INDENT is the current indentation level." (cl-defmethod eieio-speedbar-child-description ((obj eieio-speedbar)) "Return a description for a child of OBJ which is not an object." - (error "You must implement `eieio-speedbar-child-description' for %s" + (error "You must implement ‘eieio-speedbar-child-description’ for %s" (eieio-object-name obj))) (defun eieio-speedbar-item-info () diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index 70a7c5c..96de2a4 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -114,10 +114,10 @@ and reference them using the function `class-option'." (cond ((and (stringp (car options-and-doc)) (/= 1 (% (length options-and-doc) 2))) - (error "Too many arguments to `defclass'")) + (error "Too many arguments to ‘defclass’")) ((and (symbolp (car options-and-doc)) (/= 0 (% (length options-and-doc) 2))) - (error "Too many arguments to `defclass'"))) + (error "Too many arguments to ‘defclass’"))) (if (stringp (car options-and-doc)) (setq options-and-doc @@ -941,7 +941,7 @@ this object." "Change the class of OBJ to type CLASS. This may create or delete slots, but does not affect the return value of `eq'." - (error "EIEIO: `change-class' is unimplemented")) + (error "EIEIO: ‘change-class’ is unimplemented")) ;; Hook ourselves into help system for describing classes and methods. ;; FIXME: This is not actually needed any more since we can click on the diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el index fc66c82..3365a85 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/emacs-lisp/elint.el @@ -249,9 +249,9 @@ This environment can be passed to `macroexpand'." (elint-set-mode-line t) (with-current-buffer elint-log-buffer (unless (string-equal default-directory dir) - (elint-log-message (format " \nLeaving directory `%s'" + (elint-log-message (format " \nLeaving directory ‘%s’" default-directory) t) - (elint-log-message (format "Entering directory `%s'" dir) t) + (elint-log-message (format "Entering directory ‘%s’" dir) t) (setq default-directory dir)))) (let ((str (format "Linting file %s" file))) (message "%s..." str) @@ -374,7 +374,7 @@ Returns the forms." ;; quoted check cannot be elsewhere, since quotes skipped. (if (looking-back "'" (1- (point))) ;; Eg cust-print.el uses ' as a comment syntax. - (elint-warning "Skipping quoted form `'%.20s...'" + (elint-warning "Skipping quoted form ‘'%.20s...’" (read (current-buffer))) (condition-case nil (setq tops (cons @@ -401,7 +401,7 @@ Return nil if there are no more forms, t otherwise." (cond ;; Eg nnmaildir seems to use [] as a form of comment syntax. ((not (listp form)) - (elint-warning "Skipping non-list form `%s'" form)) + (elint-warning "Skipping non-list form ‘%s’" form)) ;; Add defined variable ((memq (car form) '(defvar defconst defcustom)) (setq elint-env (elint-env-add-var elint-env (cadr form)))) @@ -432,7 +432,7 @@ Return nil if there are no more forms, t otherwise." (if (or (< (length form) 4) (eq (nth 3 form) t) (unless (stringp (nth 2 form)) - (elint-error "Malformed declaration for `%s'" + (elint-error "Malformed declaration for ‘%s’" (cadr form)) t)) 'unknown @@ -758,7 +758,7 @@ CODE can be a lambda expression, a macro, or byte-compiled code." (and (eq (car-safe alias) 'quote) (eq (car-safe target) 'quote) (eq (elint-get-args (cadr target) env) 'undefined) - (elint-warning "Alias `%s' has unknown target `%s'" + (elint-warning "Alias ‘%s’ has unknown target ‘%s’" (cadr alias) (cadr target)))) (elint-form form env t)) @@ -796,7 +796,7 @@ CODE can be a lambda expression, a macro, or byte-compiled code." (setq newenv (elint-env-add-var newenv (car s)))) (t (elint-error - "Malformed `let' declaration: %s" s)))) + "Malformed ‘let’ declaration: %s" s)))) varlist) ;; Lint the body forms diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 99c5ede..91fc157 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -121,7 +121,7 @@ Emacs bug 6581 at URL `http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6581'." (defun ert-get-test (symbol) "If SYMBOL names a test, return that. Signal an error otherwise." - (unless (ert-test-boundp symbol) (error "No test named `%S'" symbol)) + (unless (ert-test-boundp symbol) (error "No test named ‘%S’" symbol)) (get symbol 'ert--test)) (defun ert-set-test (symbol definition) diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 4dc0596..3b103e0 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -296,7 +296,7 @@ Otherwise, TYPE specifies the kind of definition, and it is interpreted via `find-function-regexp-alist'. The search is done in the source for library LIBRARY." (if (null library) - (error "Don't know where `%s' is defined" symbol)) + (error "Don't know where ‘%s’ is defined" symbol)) ;; Some functions are defined as part of the construct ;; that defines something else. (while (and (symbolp symbol) (get symbol 'definition-name)) @@ -367,9 +367,9 @@ message about the whole chain of aliases." (not verbose) (setq aliases (if aliases (concat aliases - (format ", which is an alias for `%s'" + (format ", which is an alias for ‘%s’" (symbol-name def))) - (format "`%s' is an alias for `%s'" + (format "‘%s’ is an alias for ‘%s’" function (symbol-name def))))) (setq function (find-function-advised-original function) def (find-function-advised-original function))) diff --git a/lisp/emacs-lisp/generator.el b/lisp/emacs-lisp/generator.el index 123f64b..79e760d 100644 --- a/lisp/emacs-lisp/generator.el +++ b/lisp/emacs-lisp/generator.el @@ -661,7 +661,7 @@ The caller of `iter-next' receives VALUE, and the next call to `iter-next' resumes execution at the previous `iter-yield' point." (identity value) - (error "`iter-yield' used outside a generator")) + (error "‘iter-yield’ used outside a generator")) (defmacro iter-yield-from (value) "When used inside a generator function, delegate to a sub-iterator. diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index e67888c..bed9024 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -239,7 +239,7 @@ instead the assignment is turned into something equivalent to so as to preserve the semantics of `setf'." (declare (debug (sexp (&or symbolp lambda-expr) &optional sexp))) (when (eq 'lambda (car-safe setter)) - (message "Use `gv-define-setter' or name %s's setter function" name)) + (message "Use ‘gv-define-setter’ or name %s's setter function" name)) `(gv-define-setter ,name (val &rest args) ,(if fix-return `(macroexp-let2 nil v val diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index 01ba656..b37d013 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -542,15 +542,15 @@ copyright notice is allowed." ((null name) "Can't find package name") ((not (lm-authors)) - "`Author:' tag missing") + "‘Author:’ tag missing") ((not (lm-maintainer)) - "`Maintainer:' tag missing") + "‘Maintainer:’ tag missing") ((not (lm-summary)) "Can't find the one-line summary description") ((not (lm-keywords)) - "`Keywords:' tag missing") + "‘Keywords:’ tag missing") ((not (lm-keywords-finder-p)) - "`Keywords:' has no valid finder keywords (see `finder-known-keywords')") + "‘Keywords:’ has no valid finder keywords (see ‘finder-known-keywords’)") ((not (lm-commentary-mark)) "Can't find a 'Commentary' section marker") ((not (lm-history-mark)) diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el index 81d0b83..608bf73 100644 --- a/lisp/emacs-lisp/package-x.el +++ b/lisp/emacs-lisp/package-x.el @@ -296,7 +296,7 @@ destination, prompt for one." ((string-match "\\.tar\\'" file) (tar-mode) (package-tar-file-info)) ((string-match "\\.el\\'" file) (package-buffer-info)) - (t (error "Unrecognized extension `%s'" + (t (error "Unrecognized extension ‘%s’" (file-name-extension file)))))) (package-upload-buffer-internal pkg-desc (file-name-extension file))))) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 4ff6e07..f7cd6a1 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -456,13 +456,13 @@ This is, approximately, the inverse of `version-to-list'. (push (int-to-string num) str-list) (push "." str-list)) ((< num -4) - (error "Invalid version list `%s'" vlist)) + (error "Invalid version list ‘%s’" vlist)) (t ;; pre, or beta, or alpha (cond ((equal "." (car str-list)) (pop str-list)) ((not (string-match "[0-9]+" (car str-list))) - (error "Invalid version list `%s'" vlist))) + (error "Invalid version list ‘%s’" vlist))) (push (cond ((= num -1) "pre") ((= num -2) "beta") ((= num -3) "alpha") @@ -623,7 +623,7 @@ Return the max version (as a string) if the package is held at a lower version." ((stringp force) ; held (unless (version-list-= version (version-to-list force)) force)) - (t (error "Invalid element in `package-load-list'"))))) + (t (error "Invalid element in ‘package-load-list’"))))) (defun package-built-in-p (package &optional min-version) "Return true if PACKAGE is built-in to Emacs. @@ -651,7 +651,7 @@ correspond to previously loaded files (those returned by (pkg-dir (package-desc-dir pkg-desc)) (pkg-dir-dir (file-name-as-directory pkg-dir))) (unless pkg-dir - (error "Internal error: unable to find directory for `%s'" + (error "Internal error: unable to find directory for ‘%s’" (package-desc-full-name pkg-desc))) ;; Add to load path, add autoloads, and activate the package. (let* ((old-lp load-path) @@ -754,8 +754,8 @@ Newer versions are always activated, regardless of FORCE." (unless (package-activate (car req)) (throw 'dep-failure req)))))) (if fail - (warn "Unable to activate package `%s'. -Required package `%s-%s' is unavailable" + (warn "Unable to activate package ‘%s’. +Required package ‘%s-%s’ is unavailable" package (car fail) (package-version-join (cadr fail))) ;; If all goes well, activate the package itself. (package-activate-1 pkg-vec force))))))) @@ -1465,7 +1465,7 @@ similar to an entry in `package-alist'. Save the cached copy to ;; Even if the sig fails, this download is done, so ;; remove it from the in-progress list. (package--update-downloads-in-progress archive) - (error "Unsigned archive `%s'" name)) + (error "Unsigned archive ‘%s’" name)) ;; Write out the archives file. (write-region content nil local-file nil 'silent) ;; Write out good signatures into archive-contents.signed file. @@ -1495,7 +1495,7 @@ perform the downloads asynchronously." (when async ;; The t at the end means to propagate connection errors. (lambda () (package--update-downloads-in-progress archive) t))) - (error (message "Failed to download `%s' archive." + (error (message "Failed to download ‘%s’ archive." (car archive)))))) ;;;###autoload @@ -1564,7 +1564,7 @@ SEEN is used internally to detect infinite recursion." (package-desc-full-name already)) (setq packages (delq already packages)) (setq already nil)) - (error "Need package `%s-%s', but only %s is being installed" + (error "Need package ‘%s-%s’, but only %s is being installed" next-pkg (package-version-join next-version) (package-version-join (package-desc-version already))))) (cond @@ -1592,20 +1592,20 @@ SEEN is used internally to detect infinite recursion." (unless problem (setq problem (if (stringp disabled) - (format "Package `%s' held at version %s, but version %s required" + (format "Package ‘%s’ held at version %s, but version %s required" next-pkg disabled (package-version-join next-version)) - (format "Required package '%s' is disabled" + (format "Required package ‘%s’ is disabled" next-pkg))))) (t (setq found pkg-desc))))) (unless found (cond (problem (error "%s" problem)) (found-something - (error "Need package `%s-%s', but only %s is available" + (error "Need package ‘%s-%s’, but only %s is available" next-pkg (package-version-join next-version) found-something)) - (t (error "Package `%s-%s' is unavailable" + (t (error "Package ‘%s-%s’ is unavailable" next-pkg (package-version-join next-version))))) (setq packages (package-compute-transaction (cons found packages) @@ -1765,7 +1765,7 @@ if all the in-between dependencies are also in PACKAGE-LIST." (unless (or good-sigs (eq package-check-signature 'allow-unsigned)) ;; Even if the sig fails, this download is done, so ;; remove it from the in-progress list. - (error "Unsigned package: `%s'" + (error "Unsigned package: ‘%s’" (package-desc-name pkg-desc))) ;; Signature checked, unpack now. (with-temp-buffer (insert content) @@ -1906,7 +1906,7 @@ to install it but still mark it as selected." (package-desc-reqs pkg))) (package-compute-transaction () (list (list pkg)))))) (package-download-transaction transaction) - (message "`%s' is already installed" (package-desc-full-name pkg)))) + (message "‘%s’ is already installed" (package-desc-full-name pkg)))) (defun package-strip-rcs-id (str) "Strip RCS version ID from the version string STR. @@ -1981,7 +1981,7 @@ If some packages are not installed propose to install them." ;; using here, because the outcome is the same either way (nothing ;; gets installed). (if (not package-selected-packages) - (message "`package-selected-packages' is empty, nothing to install") + (message "‘package-selected-packages’ is empty, nothing to install") (cl-loop for p in package-selected-packages unless (package-installed-p p) collect p into lst @@ -2046,13 +2046,13 @@ If NOSAVE is non-nil, the package is not removed from (expand-file-name package-user-dir)) (expand-file-name dir))) ;; Don't delete "system" packages. - (error "Package `%s' is a system package, not deleting" + (error "Package ‘%s’ is a system package, not deleting" (package-desc-full-name pkg-desc))) ((and (null force) (setq pkg-used-elsewhere-by (package--used-elsewhere-p pkg-desc))) ;; Don't delete packages used as dependency elsewhere. - (error "Package `%s' is used by `%s' as dependency, not deleting" + (error "Package ‘%s’ is used by ‘%s’ as dependency, not deleting" (package-desc-full-name pkg-desc) (package-desc-name pkg-used-elsewhere-by))) (t @@ -2067,7 +2067,7 @@ If NOSAVE is non-nil, the package is not removed from (delete pkg-desc pkgs) (unless (cdr pkgs) (setq package-alist (delq pkgs package-alist)))) - (message "Package `%s' deleted." (package-desc-full-name pkg-desc)))))) + (message "Package ‘%s’ deleted." (package-desc-full-name pkg-desc)))))) ;;;###autoload (defun package-reinstall (pkg) @@ -2096,7 +2096,7 @@ will be deleted." ;; do absolutely nothing. (when (or package-selected-packages (yes-or-no-p - "`package-selected-packages' is empty! Really remove ALL packages? ")) + "‘package-selected-packages’ is empty! Really remove ALL packages? ")) (let ((removable (package--removable-packages))) (if removable (when (y-or-n-p @@ -2364,7 +2364,7 @@ Otherwise no newline is inserted." (defun package-install-button-action (button) (let ((pkg-desc (button-get button 'package-desc))) - (when (y-or-n-p (format "Install package `%s'? " + (when (y-or-n-p (format "Install package ‘%s’? " (package-desc-full-name pkg-desc))) (package-install pkg-desc nil) (revert-buffer nil t) @@ -2372,7 +2372,7 @@ Otherwise no newline is inserted." (defun package-delete-button-action (button) (let ((pkg-desc (button-get button 'package-desc))) - (when (y-or-n-p (format "Delete package `%s'? " + (when (y-or-n-p (format "Delete package ‘%s’? " (package-desc-full-name pkg-desc))) (package-delete pkg-desc) (revert-buffer nil t) @@ -2891,8 +2891,8 @@ If optional arg BUTTON is non-nil, describe its associated package." (cl-remove-if-not (lambda (e) (string-match re (symbol-name (car e)))) package-archive-contents))) (message (substitute-command-keys - (concat "Hiding %s packages, type `\\[package-menu-toggle-hiding]'" - " to toggle or `\\[customize-variable] RET package-hidden-regexps'" + (concat "Hiding %s packages, type ‘\\[package-menu-toggle-hiding]’" + " to toggle or ‘\\[customize-variable] RET package-hidden-regexps’" " to customize it")) (length hidden))))) @@ -3076,7 +3076,7 @@ prompt (see `package-menu--prompt-transaction-p')." (length packages) (mapconcat #'package-desc-full-name packages ", "))) ;; Exactly 1 - (t (format "package `%s'" + (t (format "package ‘%s’" (package-desc-full-name (car packages)))))) (defun package-menu--prompt-transaction-p (delete install upgrade) @@ -3132,7 +3132,7 @@ objects removed." (condition-case-unless-debug err (let ((inhibit-message package-menu-async)) (package-delete elt nil 'nosave)) - (error (message "Error trying to delete `%s': %S" + (error (message "Error trying to delete ‘%s’: %S" (package-desc-full-name elt) err)))))) @@ -3263,7 +3263,7 @@ Store this list in `package-menu--new-package-list'." (defun package-menu--find-and-notify-upgrades () "Notify the user of upgradable packages." (when-let ((upgrades (package-menu--find-upgrades))) - (message "%d package%s can be upgraded; type `%s' to mark %s for upgrading." + (message "%d package%s can be upgraded; type ‘%s’ to mark %s for upgrading." (length upgrades) (if (= (length upgrades) 1) "" "s") (substitute-command-keys "\\[package-menu-mark-upgrades]") diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 50a2507..7268457 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -197,7 +197,7 @@ Currently, the following patterns are provided this way:" (pcase--dontwarn-upats (cons x pcase--dontwarn-upats))) (pcase--expand ;; FIXME: Could we add the FILE:LINE data in the error message? - exp (append cases `((,x (error "No clause matching `%S'" ,x))))))) + exp (append cases `((,x (error "No clause matching ‘%S’" ,x))))))) ;;;###autoload (defmacro pcase-lambda (lambda-list &rest body) @@ -775,7 +775,7 @@ Otherwise, it defers to REST which is a list of branches of the form (let ((code (pcase--u1 matches code vars rest))) (if (eq upat '_) code (macroexp--warn-and-return - "Pattern t is deprecated. Use `_' instead" + "Pattern t is deprecated. Use ‘_’ instead" code)))) ((eq upat 'pcase--dontcare) :pcase--dontcare) ((memq (car-safe upat) '(guard pred)) @@ -860,7 +860,7 @@ Otherwise, it defers to REST which is a list of branches of the form (pcase--u rest)) vars (list `((and . ,matches) ,code . ,vars)))) - (t (error "Unknown pattern `%S'" upat))))) + (t (error "Unknown pattern ‘%S’" upat))))) (t (error "Incorrect MATCH %S" (car matches))))) (def-edebug-spec diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index a499b03..de1f6d1 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -458,7 +458,7 @@ matching parts of the target buffer will be highlighted." (setq reb-subexp-mode t) (reb-update-modestring) (use-local-map reb-subexp-mode-map) - (message "`0'-`9' to display subexpressions `q' to quit subexp mode")) + (message "‘0’-‘9’ to display subexpressions ‘q’ to quit subexp mode")) (defun reb-show-subexp (subexp &optional pause) "Visually show limit of subexpression SUBEXP of recent search. diff --git a/lisp/emacs-lisp/ring.el b/lisp/emacs-lisp/ring.el index 2447dfa..8badac3 100644 --- a/lisp/emacs-lisp/ring.el +++ b/lisp/emacs-lisp/ring.el @@ -175,14 +175,14 @@ Comparison is done via `equal'. The index is 0-based." "Return the next item in the RING, after ITEM. Raise error if ITEM is not in the RING." (let ((curr-index (ring-member ring item))) - (unless curr-index (error "Item is not in the ring: `%s'" item)) + (unless curr-index (error "Item is not in the ring: ‘%s’" item)) (ring-ref ring (ring-plus1 curr-index (ring-length ring))))) (defun ring-previous (ring item) "Return the previous item in the RING, before ITEM. Raise error if ITEM is not in the RING." (let ((curr-index (ring-member ring item))) - (unless curr-index (error "Item is not in the ring: `%s'" item)) + (unless curr-index (error "Item is not in the ring: ‘%s’" item)) (ring-ref ring (ring-minus1 curr-index (ring-length ring))))) (defun ring-extend (ring x) diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 5202106..0129d93 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -324,7 +324,7 @@ a standalone symbol." (defun rx-check (form) "Check FORM according to its car's parsing info." (unless (listp form) - (error "rx `%s' needs argument(s)" form)) + (error "rx ‘%s’ needs argument(s)" form)) (let* ((rx (rx-info (car form) 'head)) (nargs (1- (length form))) (min-args (nth 1 rx)) @@ -332,16 +332,16 @@ a standalone symbol." (type-pred (nth 3 rx))) (when (and (not (null min-args)) (< nargs min-args)) - (error "rx form `%s' requires at least %d args" + (error "rx form ‘%s’ requires at least %d args" (car form) min-args)) (when (and (not (null max-args)) (> nargs max-args)) - (error "rx form `%s' accepts at most %d args" + (error "rx form ‘%s’ accepts at most %d args" (car form) max-args)) (when (not (null type-pred)) (dolist (sub-form (cdr form)) (unless (funcall type-pred sub-form) - (error "rx form `%s' requires args satisfying `%s'" + (error "rx form ‘%s’ requires args satisfying ‘%s’" (car form) type-pred)))))) @@ -395,7 +395,7 @@ FORM is of the form `(and FORM1 ...)'." (defun rx-anything (form) "Match any character." (if (consp form) - (error "rx `anything' syntax error: %s" form)) + (error "rx ‘anything’ syntax error: %s" form)) (rx-or (list 'or 'not-newline ?\n))) @@ -452,7 +452,7 @@ Only both edges of each range is checked." (let ((i 0) c1 c2 l) (if (= 0 (length str)) - (error "String arg for Rx `any' must not be empty")) + (error "String arg for Rx ‘any’ must not be empty")) (while (string-match ".-." str i) ;; string before range: convert it to characters (if (< i (match-beginning 0)) @@ -482,13 +482,13 @@ Only both edges of each range is checked." (error nil)))) (if (or (null translation) (null (string-match "\\`\\[\\[:[-a-z]+:\\]\\]\\'" translation))) - (error "Invalid char class `%s' in Rx `any'" arg)) + (error "Invalid char class ‘%s’ in Rx ‘any’" arg)) (list (substring translation 1 -1)))) ; strip outer brackets ((and (integerp (car-safe arg)) (integerp (cdr-safe arg))) (list arg)) ((stringp arg) (rx-check-any-string arg)) ((error - "rx `any' requires string, character, char pair or char class args")))) + "rx ‘any’ requires string, character, char pair or char class args")))) (defun rx-any (form) @@ -581,7 +581,7 @@ ARG is optional." (eq arg 'word-boundary) (and (consp arg) (memq (car arg) '(not any in syntax category)))) - (error "rx `not' syntax error: %s" arg)) + (error "rx ‘not’ syntax error: %s" arg)) t) @@ -640,7 +640,7 @@ If SKIP is non-nil, allow that number of items after the head, i.e. (setq form (rx-trans-forms form 1)) (unless (and (integerp (nth 1 form)) (> (nth 1 form) 0)) - (error "rx `=' requires positive integer first arg")) + (error "rx ‘=’ requires positive integer first arg")) (format "%s\\{%d\\}" (rx-form (nth 2 form) '*) (nth 1 form))) @@ -650,7 +650,7 @@ If SKIP is non-nil, allow that number of items after the head, i.e. (setq form (rx-trans-forms form 1)) (unless (and (integerp (nth 1 form)) (> (nth 1 form) 0)) - (error "rx `>=' requires positive integer first arg")) + (error "rx ‘>=’ requires positive integer first arg")) (format "%s\\{%d,\\}" (rx-form (nth 2 form) '*) (nth 1 form))) @@ -671,14 +671,14 @@ FORM is either `(repeat N FORM1)' or `(repeat N M FORMS...)'." (cond ((= (length form) 3) (unless (and (integerp (nth 1 form)) (> (nth 1 form) 0)) - (error "rx `repeat' requires positive integer first arg")) + (error "rx ‘repeat’ requires positive integer first arg")) (format "%s\\{%d\\}" (rx-form (nth 2 form) '*) (nth 1 form))) ((or (not (integerp (nth 2 form))) (< (nth 2 form) 0) (not (integerp (nth 1 form))) (< (nth 1 form) 0) (< (nth 2 form) (nth 1 form))) - (error "rx `repeat' range error")) + (error "rx ‘repeat’ range error")) (t (format "%s\\{%d,%d\\}" (rx-form (nth 3 form) '*) (nth 1 form) (nth 2 form))))) @@ -713,7 +713,7 @@ FORM is either `(repeat N FORM1)' or `(repeat N M FORMS...)'." (defun rx-check-backref (arg) "Check arg ARG for Rx `backref'." (or (and (integerp arg) (>= arg 1) (<= arg 9)) - (error "rx `backref' requires numeric 1<=arg<=9: %s" arg))) + (error "rx ‘backref’ requires numeric 1<=arg<=9: %s" arg))) (defun rx-kleene (form) "Parse and produce code from FORM. @@ -786,7 +786,7 @@ of all atomic regexps." (if (= 1 (length name)) (setq syntax (aref name 0)))))) (unless syntax - (error "Unknown rx syntax `%s'" sym))) + (error "Unknown rx syntax ‘%s’" sym))) (format "\\s%c" syntax))) @@ -794,7 +794,7 @@ of all atomic regexps." "Check the argument FORM of a `(category FORM)'." (unless (or (integerp form) (cdr (assq form rx-categories))) - (error "Unknown category `%s'" form)) + (error "Unknown category ‘%s’" form)) t) @@ -846,16 +846,16 @@ shy groups around the result and some more in other functions." (cond ((stringp info) info) ((null info) - (error "Unknown rx form `%s'" form)) + (error "Unknown rx form ‘%s’" form)) (t (funcall (nth 0 info) form))))) ((consp form) (let ((info (rx-info (car form) 'head))) (unless (consp info) - (error "Unknown rx form `%s'" (car form))) + (error "Unknown rx form ‘%s’" (car form))) (funcall (nth 0 info) form))) (t - (error "rx syntax error at `%s'" form)))) + (error "rx syntax error at ‘%s’" form)))) ;;;###autoload diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 0c24f79..9678cfa 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el @@ -2213,13 +2213,13 @@ One way to generate local rules is the command `smie-config-guess'." (let* ((existing (assq major-mode smie-config)) (config (cond ((null existing) - (message "Local rules saved in `smie-config'") + (message "Local rules saved in ‘smie-config’") smie-config--buffer-local) ((y-or-n-p "Replace the existing mode's config? ") - (message "Mode rules replaced in `smie-config'") + (message "Mode rules replaced in ‘smie-config’") smie-config--buffer-local) ((y-or-n-p "Merge with existing mode's config? ") - (message "Mode rules adjusted in `smie-config'") + (message "Mode rules adjusted in ‘smie-config’") (append smie-config--buffer-local (cdr existing))) (t (error "Abort"))))) (if existing diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index e6d451a..9637e42 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -90,7 +90,7 @@ threading." (when (> (length binding) 2) (signal 'error - (cons "`let' bindings can have only one value-form" binding))) + (cons "‘let’ bindings can have only one value-form" binding))) binding) (defsubst internal--build-binding-value-form (binding prev-var) diff --git a/lisp/emacs-lisp/testcover.el b/lisp/emacs-lisp/testcover.el index 110c63f..3e6039e 100644 --- a/lisp/emacs-lisp/testcover.el +++ b/lisp/emacs-lisp/testcover.el @@ -475,7 +475,7 @@ same value during coverage testing." (aset testcover-vector idx (cons '1value val))) ((not (and (eq (car-safe (aref testcover-vector idx)) '1value) (equal (cdr (aref testcover-vector idx)) val))) - (error "Value of form marked with `1value' does vary: %s" val))) + (error "Value of form marked with ‘1value’ does vary: %s" val))) val) commit 66081ad6f4dba44b64c809cde5f4a904b0f381fb Author: Fabián Ezequiel Gallina Date: Fri Aug 21 23:42:01 2015 -0300 ; python.el: Fix previous commit for Emacs<24.3 compatibility diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 7d7122a..d442dae 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2105,6 +2105,10 @@ appends `python-shell-remote-exec-path' instead of `exec-path'." ;; Emacs<24.4 compat. (list (tramp-get-remote-locale vec))) (copy-sequence env))) + (tramp-end-of-heredoc + (if (boundp 'tramp-end-of-heredoc) + tramp-end-of-heredoc + (md5 tramp-end-of-output))) unset vars item) (while env (setq item (tramp-compat-split-string (car env) "=")) commit cf42b9fe8dade8da417f49bf0d13b85614eec076 Author: Fabián Ezequiel Gallina Date: Fri Aug 21 23:26:44 2015 -0300 ; python.el: Fix previous commit for Emacs<24.3 compatibility diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 9c4a0f1..7d7122a 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2101,7 +2101,9 @@ appends `python-shell-remote-exec-path' instead of `exec-path'." (defun python-shell-tramp-refresh-process-environment (vec env) "Update VEC's process environment with ENV." ;; Stolen from `tramp-open-connection-setup-interactive-shell'. - (let ((env (append `(,(tramp-get-remote-locale vec)) + (let ((env (append (when (fboundp #'tramp-get-remote-locale) + ;; Emacs<24.4 compat. + (list (tramp-get-remote-locale vec))) (copy-sequence env))) unset vars item) (while env commit e2a5e3f87aba493623734dcf9b872e10c6077496 Author: Fabián Ezequiel Gallina Date: Fri Aug 21 22:34:39 2015 -0300 python.el: Ensure remote process-environment on non-interactive processes * lisp/progmodes/python.el (python-shell-tramp-refresh-process-environment): New function. (python-shell-with-environment): Use it. * test/automated/python-tests.el (python-shell-with-environment-2): Update. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index b5bfe67..9c4a0f1 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2098,7 +2098,30 @@ appends `python-shell-remote-exec-path' instead of `exec-path'." (tramp-set-connection-property vec "remote-path" remote-path) (tramp-set-remote-path vec)))) -(defvar python-shell--with-environment-wrapped nil) +(defun python-shell-tramp-refresh-process-environment (vec env) + "Update VEC's process environment with ENV." + ;; Stolen from `tramp-open-connection-setup-interactive-shell'. + (let ((env (append `(,(tramp-get-remote-locale vec)) + (copy-sequence env))) + unset vars item) + (while env + (setq item (tramp-compat-split-string (car env) "=")) + (setcdr item (mapconcat 'identity (cdr item) "=")) + (if (and (stringp (cdr item)) (not (string-equal (cdr item) ""))) + (push (format "%s %s" (car item) (cdr item)) vars) + (push (car item) unset)) + (setq env (cdr env))) + (when vars + (tramp-send-command + vec + (format "while read var val; do export $var=$val; done <<'%s'\n%s\n%s" + tramp-end-of-heredoc + (mapconcat 'identity vars "\n") + tramp-end-of-heredoc) + t)) + (when unset + (tramp-send-command + vec (format "unset %s" (mapconcat 'identity unset " ")) t)))) (defmacro python-shell-with-environment (&rest body) "Modify shell environment during execution of BODY. @@ -2109,34 +2132,39 @@ machine then modifies `tramp-remote-process-environment' and (declare (indent 0) (debug (body))) (let ((vec (make-symbol "vec"))) `(progn - (if python-shell--with-environment-wrapped - ,(macroexp-progn body) - (let* ((,vec - (when (file-remote-p default-directory) - (ignore-errors - (tramp-dissect-file-name default-directory 'noexpand)))) - (process-environment - (if ,vec - process-environment - (python-shell-calculate-process-environment))) - (exec-path - (if ,vec - exec-path - (python-shell-calculate-exec-path))) - (tramp-remote-process-environment - (if ,vec - (python-shell-calculate-process-environment) - tramp-remote-process-environment)) - (python-shell--with-environment-wrapped t)) - (when (tramp-get-connection-process ,vec) - ;; For already existing connections, modified env vars must - ;; be re-set again. This is a normal thing to happen when - ;; remote dir-locals are read from remote and *then* - ;; processes should be started within the same connection - ;; with env vars calculated from them. - (python-shell-tramp-refresh-remote-path - ,vec (python-shell-calculate-exec-path))) - ,(macroexp-progn body)))))) + (let* ((,vec + (when (file-remote-p default-directory) + (ignore-errors + (tramp-dissect-file-name default-directory 'noexpand)))) + (process-environment + (if ,vec + process-environment + (python-shell-calculate-process-environment))) + (exec-path + (if ,vec + exec-path + (python-shell-calculate-exec-path))) + (tramp-remote-process-environment + (if ,vec + (python-shell-calculate-process-environment) + tramp-remote-process-environment))) + (when (tramp-get-connection-process ,vec) + ;; For already existing connections, the new exec path must + ;; be re-set, otherwise it won't take effect. One example + ;; of such case is when remote dir-locals are read and + ;; *then* subprocesses are triggered within the same + ;; connection. + (python-shell-tramp-refresh-remote-path + ,vec (python-shell-calculate-exec-path)) + ;; The `tramp-remote-process-environment' variable is only + ;; effective when the started process is an interactive + ;; shell, otherwise (like in the case of processes started + ;; with `process-file') the environment is not changed. + ;; This makes environment modifications effective + ;; inconditionally. + (python-shell-tramp-refresh-process-environment + ,vec tramp-remote-process-environment)) + ,(macroexp-progn body))))) (defvar python-shell--prompt-calculated-input-regexp nil "Calculated input prompt regexp for inferior python shell. diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index 1f8533f..e792b0f 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el @@ -2606,9 +2606,10 @@ Using `python-shell-interpreter' and (python-shell-with-environment (should (equal (python-shell-calculate-exec-path) '("/env/bin" "/path1" "/path2" "/remote1" "/remote2"))) - (let ((process-environment tramp-remote-process-environment)) + (let ((process-environment (python-shell-calculate-process-environment))) (should (not (getenv "PYTHONHOME"))) - (should (string= (getenv "VIRTUAL_ENV") "/env")))) + (should (string= (getenv "VIRTUAL_ENV") "/env")) + (should (equal tramp-remote-process-environment process-environment)))) (should (equal tramp-remote-process-environment original-process-environment)))) (ert-deftest python-shell-with-environment-3 () commit 49071a4afcc4e8b12a407d977cfad1db4d49f629 Author: Fabián Ezequiel Gallina Date: Fri Aug 21 19:36:01 2015 -0300 ; python.el: Bump version to 25.1 Also update author email and add Package-Require header to allow installation from Emacs 24.x. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index e6592fb..b5bfe67 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2,9 +2,10 @@ ;; Copyright (C) 2003-2015 Free Software Foundation, Inc. -;; Author: Fabián E. Gallina +;; Author: Fabián E. Gallina ;; URL: https://github.com/fgallina/python.el -;; Version: 0.24.5 +;; Version: 0.25.1 +;; Package-Requires: ((emacs "24.1") (cl-lib "1.0")) ;; Maintainer: emacs-devel@gnu.org ;; Created: Jul 2010 ;; Keywords: languages commit 4150b563e7877a0c65233c9e7bd3fa64a7a14342 Author: Fabián Ezequiel Gallina Date: Fri Aug 21 19:06:57 2015 -0300 python.el: Enhancements to process environment setup. * lisp/progmodes/python.el (python-shell-process-environment) (python-shell-extra-pythonpaths, python-shell-exec-path) (python-shell-virtualenv-root): Update docstring. Remove :safe. (python-shell-setup-codes): Remove :safe. (python-shell-remote-exec-path): New defcustom. (python-shell--add-to-path-with-priority): New macro. (python-shell-calculate-pythonpath): Give priority to python-shell-extra-pythonpaths. Update docstring. (python-shell-calculate-process-environment): Give priority to python-shell-process-environment. Update docstring. (python-shell-calculate-exec-path): Give priority to python-shell-exec-path and calculated virtualenv bin directory. Update docstring. (python-shell-tramp-refresh-remote-path): New function. (python-shell-with-environment): Use it when working remotely and do not modify tramp-remote-path. Allow nesting. (python-shell-calculate-command): Remove useless python-shell-with-environment call. * test/automated/python-tests.el (python-shell-calculate-pythonpath-1) (python-shell-calculate-pythonpath-2) (python-shell-calculate-process-environment-6) (python-shell-calculate-process-environment-7) (python-shell-calculate-process-environment-8) (python-shell-calculate-exec-path-3) (python-shell-calculate-exec-path-4) (python-shell-calculate-exec-path-5) (python-shell-calculate-exec-path-6) (python-shell-with-environment-3): New tests. (python-shell-calculate-process-environment-2) (python-shell-calculate-process-environment-3) (python-shell-calculate-process-environment-4) (python-shell-calculate-process-environment-5) (python-shell-calculate-exec-path-1) (python-shell-calculate-exec-path-2) (python-shell-with-environment-1) (python-shell-with-environment-2): Update and simplify. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 189cd37..e6592fb 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1957,42 +1957,52 @@ Python shell. See commentary for details." :safe 'booleanp) (defcustom python-shell-process-environment nil - "List of environment variables for Python shell. -This variable follows the same rules as `process-environment' -since it merges with it before the process creation routines are -called. When this variable is nil, the Python shell is run with -the default `process-environment'." + "List of overridden environment variables for subprocesses to inherit. +Each element should be a string of the form ENVVARNAME=VALUE. +When this variable is non-nil, values are exported into the +process environment before starting it. Any variables already +present in the current environment are superseded by variables +set here." :type '(repeat string) - :group 'python - :safe 'listp) + :group 'python) (defcustom python-shell-extra-pythonpaths nil "List of extra pythonpaths for Python shell. -The values of this variable are added to the existing value of -PYTHONPATH in the `process-environment' variable." +When this variable is non-nil, values added at the beginning of +the PYTHONPATH before starting processes. Any values present +here that already exists in PYTHONPATH are moved to the beginning +of the list so that they are prioritized when looking for +modules." :type '(repeat string) - :group 'python - :safe 'listp) + :group 'python) (defcustom python-shell-exec-path nil - "List of path to search for binaries. -This variable follows the same rules as `exec-path' since it -merges with it before the process creation routines are called. -When this variable is nil, the Python shell is run with the -default `exec-path'." + "List of paths for searching executables. +When this variable is non-nil, values added at the beginning of +the PATH before starting processes. Any values present here that +already exists in PATH are moved to the beginning of the list so +that they are prioritized when looking for executables." :type '(repeat string) - :group 'python - :safe 'listp) + :group 'python) + +(defcustom python-shell-remote-exec-path nil + "List of paths to be ensured remotely for searching executables. +When this variable is non-nil, values are exported into remote +hosts PATH before starting processes. Values defined in +`python-shell-exec-path' will take precedence to paths defined +here. Normally you wont use this variable directly unless you +plan to ensure a particular set of paths to all Python shell +executed through tramp connections." + :type '(repeat string) + :group 'python) (defcustom python-shell-virtualenv-root nil "Path to virtualenv root. -This variable, when set to a string, makes the values stored in -`python-shell-process-environment' and `python-shell-exec-path' -to be modified properly so shells are started with the specified +This variable, when set to a string, makes the environment to be +modified such that shells are started within the specified virtualenv." :type '(choice (const nil) string) - :group 'python - :safe 'stringp) + :group 'python) (define-obsolete-variable-alias 'python-shell-virtualenv-path 'python-shell-virtualenv-root "25.1") @@ -2002,8 +2012,7 @@ virtualenv." python-eldoc-setup-code) "List of code run by `python-shell-send-setup-codes'." :type '(repeat symbol) - :group 'python - :safe 'listp) + :group 'python) (defcustom python-shell-compilation-regexp-alist `((,(rx line-start (1+ (any " \t")) "File \"" @@ -2020,22 +2029,37 @@ virtualenv." :type '(alist string) :group 'python) +(defmacro python-shell--add-to-path-with-priority (pathvar paths) + "Modify PATHVAR and ensure PATHS are added only once at beginning." + `(dolist (path (reverse ,paths)) + (cl-delete path ,pathvar :test #'string=) + (cl-pushnew path ,pathvar :test #'string=))) + +(defun python-shell-calculate-pythonpath () + "Calculate the PYTHONPATH using `python-shell-extra-pythonpaths'." + (let ((pythonpath + (tramp-compat-split-string + (or (getenv "PYTHONPATH") "") path-separator))) + (python-shell--add-to-path-with-priority + pythonpath python-shell-extra-pythonpaths) + (mapconcat 'identity pythonpath path-separator))) + (defun python-shell-calculate-process-environment () "Calculate `process-environment' or `tramp-remote-process-environment'. -Pre-appends `python-shell-process-environment', sets extra +Prepends `python-shell-process-environment', sets extra pythonpaths from `python-shell-extra-pythonpaths' and sets a few virtualenv related vars. If `default-directory' points to a -remote machine, the returned value is intended for +remote host, the returned value is intended for `tramp-remote-process-environment'." (let* ((remote-p (file-remote-p default-directory)) - (process-environment (append - python-shell-process-environment - (if remote-p - tramp-remote-process-environment - process-environment) nil)) - (virtualenv (if python-shell-virtualenv-root - (directory-file-name python-shell-virtualenv-root) - nil))) + (process-environment (if remote-p + tramp-remote-process-environment + process-environment)) + (virtualenv (when python-shell-virtualenv-root + (directory-file-name python-shell-virtualenv-root)))) + (dolist (env python-shell-process-environment) + (pcase-let ((`(,key ,value) (split-string env "="))) + (setenv key value))) (when python-shell-unbuffered (setenv "PYTHONUNBUFFERED" "1")) (when python-shell-extra-pythonpaths @@ -2047,50 +2071,71 @@ remote machine, the returned value is intended for process-environment)) (defun python-shell-calculate-exec-path () - "Calculate `exec-path' or `tramp-remote-path'. -Pre-appends `python-shell-exec-path' and adds the binary -directory for virtualenv if `python-shell-virtualenv-root' is -set. If `default-directory' points to a remote machine, the -returned value is intended for `tramp-remote-path'." - (let ((path (append - ;; Use nil as the tail so that the list is a full copy, - ;; this is a paranoid safeguard for side-effects. - python-shell-exec-path - (if (file-remote-p default-directory) - tramp-remote-path - exec-path) - nil))) + "Calculate `exec-path'. +Prepends `python-shell-exec-path' and adds the binary directory +for virtualenv if `python-shell-virtualenv-root' is set. If +`default-directory' points to a remote host, the returned value +appends `python-shell-remote-exec-path' instead of `exec-path'." + (let ((new-path (copy-sequence + (if (file-remote-p default-directory) + python-shell-remote-exec-path + exec-path)))) + (python-shell--add-to-path-with-priority + new-path python-shell-exec-path) (if (not python-shell-virtualenv-root) - path - (cons (expand-file-name "bin" python-shell-virtualenv-root) - path)))) + new-path + (python-shell--add-to-path-with-priority + new-path + (list (expand-file-name "bin" python-shell-virtualenv-root))) + new-path))) + +(defun python-shell-tramp-refresh-remote-path (vec paths) + "Update VEC's remote-path giving PATHS priority." + (let ((remote-path (tramp-get-connection-property vec "remote-path" nil))) + (when remote-path + (python-shell--add-to-path-with-priority remote-path paths) + (tramp-set-connection-property vec "remote-path" remote-path) + (tramp-set-remote-path vec)))) + +(defvar python-shell--with-environment-wrapped nil) (defmacro python-shell-with-environment (&rest body) "Modify shell environment during execution of BODY. Temporarily sets `process-environment' and `exec-path' during execution of body. If `default-directory' points to a remote machine then modifies `tramp-remote-process-environment' and -`tramp-remote-path' instead." +`python-shell-remote-exec-path' instead." (declare (indent 0) (debug (body))) - (let ((remote-p (make-symbol "remote-p"))) - `(let* ((,remote-p (file-remote-p default-directory)) - (process-environment - (if ,remote-p - process-environment - (python-shell-calculate-process-environment))) - (tramp-remote-process-environment - (if ,remote-p - (python-shell-calculate-process-environment) - tramp-remote-process-environment)) - (exec-path - (if ,remote-p - exec-path - (python-shell-calculate-exec-path))) - (tramp-remote-path - (if ,remote-p - (python-shell-calculate-exec-path) - tramp-remote-path))) - ,(macroexp-progn body)))) + (let ((vec (make-symbol "vec"))) + `(progn + (if python-shell--with-environment-wrapped + ,(macroexp-progn body) + (let* ((,vec + (when (file-remote-p default-directory) + (ignore-errors + (tramp-dissect-file-name default-directory 'noexpand)))) + (process-environment + (if ,vec + process-environment + (python-shell-calculate-process-environment))) + (exec-path + (if ,vec + exec-path + (python-shell-calculate-exec-path))) + (tramp-remote-process-environment + (if ,vec + (python-shell-calculate-process-environment) + tramp-remote-process-environment)) + (python-shell--with-environment-wrapped t)) + (when (tramp-get-connection-process ,vec) + ;; For already existing connections, modified env vars must + ;; be re-set again. This is a normal thing to happen when + ;; remote dir-locals are read from remote and *then* + ;; processes should be started within the same connection + ;; with env vars calculated from them. + (python-shell-tramp-refresh-remote-path + ,vec (python-shell-calculate-exec-path))) + ,(macroexp-progn body)))))) (defvar python-shell--prompt-calculated-input-regexp nil "Calculated input prompt regexp for inferior python shell. @@ -2271,28 +2316,14 @@ the `buffer-name'." (defun python-shell-calculate-command () "Calculate the string used to execute the inferior Python process." - (python-shell-with-environment - ;; `exec-path' gets tweaked so that virtualenv's specific - ;; `python-shell-interpreter' absolute path can be found by - ;; `executable-find'. - (format "%s %s" - (shell-quote-argument python-shell-interpreter) - python-shell-interpreter-args))) + (format "%s %s" + (shell-quote-argument python-shell-interpreter) + python-shell-interpreter-args)) (define-obsolete-function-alias 'python-shell-parse-command #'python-shell-calculate-command "25.1") -(defun python-shell-calculate-pythonpath () - "Calculate the PYTHONPATH using `python-shell-extra-pythonpaths'." - (let ((pythonpath (getenv "PYTHONPATH")) - (extra (mapconcat 'identity - python-shell-extra-pythonpaths - path-separator))) - (if pythonpath - (concat extra path-separator pythonpath) - extra))) - (defvar python-shell--package-depth 10) (defun python-shell-package-enable (directory package) diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index d490f7f..1f8533f 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el @@ -2440,107 +2440,190 @@ Using `python-shell-interpreter' and python-shell-interpreter-args) (python-shell-calculate-command))))) +(ert-deftest python-shell-calculate-pythonpath-1 () + "Test PYTHONPATH calculation." + (let ((process-environment '("PYTHONPATH=/path0")) + (python-shell-extra-pythonpaths '("/path1" "/path2"))) + (should (string= (python-shell-calculate-pythonpath) + "/path1:/path2:/path0")))) + +(ert-deftest python-shell-calculate-pythonpath-2 () + "Test existing paths are moved to front." + (let ((process-environment '("PYTHONPATH=/path0:/path1")) + (python-shell-extra-pythonpaths '("/path1" "/path2"))) + (should (string= (python-shell-calculate-pythonpath) + "/path1:/path2:/path0")))) + (ert-deftest python-shell-calculate-process-environment-1 () "Test `python-shell-process-environment' modification." (let* ((python-shell-process-environment '("TESTVAR1=value1" "TESTVAR2=value2")) - (process-environment - (python-shell-calculate-process-environment))) + (process-environment (python-shell-calculate-process-environment))) (should (equal (getenv "TESTVAR1") "value1")) (should (equal (getenv "TESTVAR2") "value2")))) (ert-deftest python-shell-calculate-process-environment-2 () "Test `python-shell-extra-pythonpaths' modification." (let* ((process-environment process-environment) - (original-pythonpath (setenv "PYTHONPATH" "path3")) - (paths '("path1" "path2")) - (python-shell-extra-pythonpaths paths) - (process-environment - (python-shell-calculate-process-environment))) - (should (equal (getenv "PYTHONPATH") - (concat - (mapconcat 'identity paths path-separator) - path-separator original-pythonpath))))) + (original-pythonpath (setenv "PYTHONPATH" "/path0")) + (python-shell-extra-pythonpaths '("/path1" "/path2")) + (process-environment (python-shell-calculate-process-environment))) + (should (equal (getenv "PYTHONPATH") "/path1:/path2:/path0")))) (ert-deftest python-shell-calculate-process-environment-3 () "Test `python-shell-virtualenv-root' modification." - (let* ((python-shell-virtualenv-root - (directory-file-name user-emacs-directory)) + (let* ((python-shell-virtualenv-root "/env") (process-environment - (python-shell-calculate-process-environment))) + (let (process-environment process-environment) + (setenv "PYTHONHOME" "/home") + (setenv "VIRTUAL_ENV") + (python-shell-calculate-process-environment)))) (should (not (getenv "PYTHONHOME"))) - (should (string= (getenv "VIRTUAL_ENV") python-shell-virtualenv-root)))) + (should (string= (getenv "VIRTUAL_ENV") "/env")))) (ert-deftest python-shell-calculate-process-environment-4 () - "Test `python-shell-unbuffered' modification." - (setenv "PYTHONUNBUFFERED") - (let* ((process-environment - (python-shell-calculate-process-environment))) - ;; Defaults to t - (should python-shell-unbuffered) + "Test PYTHONUNBUFFERED when `python-shell-unbuffered' is non-nil." + (let* ((python-shell-unbuffered t) + (process-environment + (let ((process-environment process-environment)) + (setenv "PYTHONUNBUFFERED") + (python-shell-calculate-process-environment)))) (should (string= (getenv "PYTHONUNBUFFERED") "1")))) (ert-deftest python-shell-calculate-process-environment-5 () - (setenv "PYTHONUNBUFFERED") - "Test `python-shell-unbuffered' modification." + "Test PYTHONUNBUFFERED when `python-shell-unbuffered' is nil." (let* ((python-shell-unbuffered nil) (process-environment - (python-shell-calculate-process-environment))) + (let ((process-environment process-environment)) + (setenv "PYTHONUNBUFFERED") + (python-shell-calculate-process-environment)))) (should (not (getenv "PYTHONUNBUFFERED"))))) +(ert-deftest python-shell-calculate-process-environment-6 () + "Test PYTHONUNBUFFERED=1 when `python-shell-unbuffered' is nil." + (let* ((python-shell-unbuffered nil) + (process-environment + (let ((process-environment process-environment)) + (setenv "PYTHONUNBUFFERED" "1") + (python-shell-calculate-process-environment)))) + ;; User default settings must remain untouched: + (should (string= (getenv "PYTHONUNBUFFERED") "1")))) + +(ert-deftest python-shell-calculate-process-environment-7 () + "Test no side-effects on `process-environment'." + (let* ((python-shell-process-environment + '("TESTVAR1=value1" "TESTVAR2=value2")) + (python-shell-virtualenv-root "/env") + (python-shell-unbuffered t) + (python-shell-extra-pythonpaths'("/path1" "/path2")) + (original-process-environment (copy-sequence process-environment))) + (python-shell-calculate-process-environment) + (should (equal process-environment original-process-environment)))) + +(ert-deftest python-shell-calculate-process-environment-8 () + "Test no side-effects on `tramp-remote-process-environment'." + (let* ((default-directory "/ssh::/example/dir/") + (python-shell-process-environment + '("TESTVAR1=value1" "TESTVAR2=value2")) + (python-shell-virtualenv-root "/env") + (python-shell-unbuffered t) + (python-shell-extra-pythonpaths'("/path1" "/path2")) + (original-process-environment + (copy-sequence tramp-remote-process-environment))) + (python-shell-calculate-process-environment) + (should (equal tramp-remote-process-environment original-process-environment)))) + (ert-deftest python-shell-calculate-exec-path-1 () "Test `python-shell-exec-path' modification." - (let* ((original-exec-path exec-path) - (python-shell-exec-path '("path1" "path2")) - (exec-path (python-shell-calculate-exec-path))) - (should (equal - exec-path - (append python-shell-exec-path - original-exec-path))))) + (let* ((exec-path '("/path0")) + (python-shell-exec-path '("/path1" "/path2")) + (new-exec-path (python-shell-calculate-exec-path))) + (should (equal new-exec-path '("/path1" "/path2" "/path0"))))) (ert-deftest python-shell-calculate-exec-path-2 () "Test `python-shell-virtualenv-root' modification." - (let* ((original-exec-path exec-path) - (python-shell-virtualenv-root - (directory-file-name (expand-file-name user-emacs-directory))) - (exec-path (python-shell-calculate-exec-path))) - (should (equal - exec-path - (append (cons - (format "%s/bin" python-shell-virtualenv-root) - original-exec-path)))))) + (let* ((exec-path '("/path0")) + (python-shell-virtualenv-root "/env") + (new-exec-path (python-shell-calculate-exec-path))) + (should (equal new-exec-path '("/env/bin" "/path0"))))) + +(ert-deftest python-shell-calculate-exec-path-3 () + "Test complete `python-shell-virtualenv-root' modification." + (let* ((exec-path '("/path0")) + (python-shell-exec-path '("/path1" "/path2")) + (python-shell-virtualenv-root "/env") + (new-exec-path (python-shell-calculate-exec-path))) + (should (equal new-exec-path '("/env/bin" "/path1" "/path2" "/path0"))))) + +(ert-deftest python-shell-calculate-exec-path-4 () + "Test complete `python-shell-virtualenv-root' with remote." + (let* ((default-directory "/ssh::/example/dir/") + (python-shell-remote-exec-path '("/path0")) + (python-shell-exec-path '("/path1" "/path2")) + (python-shell-virtualenv-root "/env") + (new-exec-path (python-shell-calculate-exec-path))) + (should (equal new-exec-path '("/env/bin" "/path1" "/path2" "/path0"))))) + +(ert-deftest python-shell-calculate-exec-path-5 () + "Test no side-effects on `exec-path'." + (let* ((exec-path '("/path0")) + (python-shell-exec-path '("/path1" "/path2")) + (python-shell-virtualenv-root "/env") + (original-exec-path (copy-sequence exec-path))) + (python-shell-calculate-exec-path) + (should (equal exec-path original-exec-path)))) + +(ert-deftest python-shell-calculate-exec-path-6 () + "Test no side-effects on `python-shell-remote-exec-path'." + (let* ((default-directory "/ssh::/example/dir/") + (python-shell-remote-exec-path '("/path0")) + (python-shell-exec-path '("/path1" "/path2")) + (python-shell-virtualenv-root "/env") + (original-exec-path (copy-sequence python-shell-remote-exec-path))) + (python-shell-calculate-exec-path) + (should (equal python-shell-remote-exec-path original-exec-path)))) (ert-deftest python-shell-with-environment-1 () - "Test with local `default-directory'." - (let* ((original-exec-path exec-path) - (python-shell-virtualenv-root - (directory-file-name (expand-file-name user-emacs-directory)))) + "Test environment with local `default-directory'." + (let* ((exec-path '("/path0")) + (python-shell-exec-path '("/path1" "/path2")) + (original-exec-path exec-path) + (python-shell-virtualenv-root "/env")) (python-shell-with-environment - (should (equal - exec-path - (append (cons - (format "%s/bin" python-shell-virtualenv-root) - original-exec-path)))) + (should (equal exec-path '("/env/bin" "/path1" "/path2" "/path0"))) (should (not (getenv "PYTHONHOME"))) - (should (string= (getenv "VIRTUAL_ENV") python-shell-virtualenv-root))))) + (should (string= (getenv "VIRTUAL_ENV") "/env"))) + (should (equal exec-path original-exec-path)))) (ert-deftest python-shell-with-environment-2 () - "Test with remote `default-directory'." + "Test environment with remote `default-directory'." (let* ((default-directory "/ssh::/example/dir/") - (original-exec-path tramp-remote-path) - (original-process-environment tramp-remote-process-environment) - (python-shell-virtualenv-root - (directory-file-name (expand-file-name user-emacs-directory)))) + (python-shell-remote-exec-path '("/remote1" "/remote2")) + (python-shell-exec-path '("/path1" "/path2")) + (tramp-remote-process-environment '("EMACS=t")) + (original-process-environment (copy-sequence tramp-remote-process-environment)) + (python-shell-virtualenv-root "/env")) (python-shell-with-environment - (should (equal - tramp-remote-path - (append (cons - (format "%s/bin" python-shell-virtualenv-root) - original-exec-path)))) + (should (equal (python-shell-calculate-exec-path) + '("/env/bin" "/path1" "/path2" "/remote1" "/remote2"))) (let ((process-environment tramp-remote-process-environment)) (should (not (getenv "PYTHONHOME"))) - (should (string= (getenv "VIRTUAL_ENV") - python-shell-virtualenv-root)))))) + (should (string= (getenv "VIRTUAL_ENV") "/env")))) + (should (equal tramp-remote-process-environment original-process-environment)))) + +(ert-deftest python-shell-with-environment-3 () + "Test `python-shell-with-environment' is idempotent." + (let* ((python-shell-extra-pythonpaths '("/example/dir/")) + (python-shell-exec-path '("path1" "path2")) + (python-shell-virtualenv-root "/home/user/env") + (single-call + (python-shell-with-environment + (list exec-path process-environment))) + (nested-call + (python-shell-with-environment + (python-shell-with-environment + (list exec-path process-environment))))) + (should (equal single-call nested-call)))) (ert-deftest python-shell-make-comint-1 () "Check comint creation for global shell buffer." commit c1cacb09948928287bfc32745f2a92604d3291c4 Author: Paul Eggert Date: Fri Aug 21 14:08:47 2015 -0700 Avoid hard-coding "M-x command" in docstrings * lisp/calendar/todo-mode.el (todo-mode): * lisp/desktop.el (desktop-save-mode): * lisp/edmacro.el (edit-kbd-macro): * lisp/emacs-lisp/package.el (package-menu-execute): * lisp/emulation/viper-cmd.el (viper-ask-level): * lisp/emulation/viper-init.el (viper-expert-level): * lisp/filesets.el (filesets-add-buffer): * lisp/follow.el (follow-mode): * lisp/gnus/auth-source.el (auth-sources): * lisp/international/ogonek.el (ogonek-informacja) (ogonek-information): * lisp/net/tramp.el (tramp-process-actions): * lisp/org/org-gnus.el (org-gnus-no-new-news): * lisp/org/org.el (org-ellipsis): * lisp/progmodes/python.el (python-shell-get-process-or-error): * lisp/progmodes/vhdl-mode.el (vhdl-mode): * lisp/server.el (server-start): * lisp/type-break.el (type-break-noninteractive-query): * lisp/userlock.el (ask-user-about-supersession-help): * lisp/whitespace.el (whitespace-report-region): Prefer (substitute-command-keys "`\\[foo-command]'") to "`M-x foo-command'" in docstrings and the like. diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index e780e4e..925d008 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -6598,7 +6598,9 @@ Added to `window-configuration-change-hook' in Todo mode." \\{todo-mode-map}" (if (called-interactively-p 'any) - (message "Type ‘M-x todo-show’ to enter Todo mode") + (message "%s" + (substitute-command-keys + "Type ‘\\[todo-show]’ to enter Todo mode")) (todo-modes-set-1) (todo-modes-set-2) (todo-modes-set-3) diff --git a/lisp/desktop.el b/lisp/desktop.el index c168f9c..9d023e3 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -165,8 +165,8 @@ one session to another. In particular, Emacs will save the desktop when it exits (this may prompt you; see the option `desktop-save'). The next time Emacs starts, if this mode is active it will restore the desktop. -To manually save the desktop at any time, use the command `M-x desktop-save'. -To load it, use `M-x desktop-read'. +To manually save the desktop at any time, use the command `\\[desktop-save]'. +To load it, use `\\[desktop-read]'. Once a desktop file exists, Emacs will auto-save it according to the option `desktop-auto-save-timeout'. diff --git a/lisp/edmacro.el b/lisp/edmacro.el index 84dfd4f..acbd1e2 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el @@ -89,7 +89,7 @@ Default nil means to write characters above \\177 in octal notation." "Edit a keyboard macro. At the prompt, type any key sequence which is bound to a keyboard macro. Or, type `C-x e' or RET to edit the last keyboard macro, `C-h l' to edit -the last 300 keystrokes as a keyboard macro, or `M-x' to edit a macro by +the last 300 keystrokes as a keyboard macro, or `\\[execute-extended-command]' to edit a macro by its command name. With a prefix argument, format the macro in a more concise way." (interactive "kKeyboard macro to edit (C-x e, M-x, C-h l, or keys): \nP") diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 863a02d..4ff6e07 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -3193,7 +3193,8 @@ Optional argument NOQUERY non-nil means do not ask the user to confirm." (if-let ((removable (package--removable-packages))) (message "Package menu: Operation finished. %d packages %s" (length removable) - "are no longer needed, type `M-x package-autoremove' to remove them") + (substitute-command-keys + "are no longer needed, type `\\[package-autoremove]' to remove them")) (message (replace-regexp-in-string "__" "ed" message-template) "finished")))))))) diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 5e1620d..40a37c7 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -4782,10 +4782,10 @@ sensitive for VI-style look-and-feel." (setq repeated t)) (setq dont-change-unless t level-changed t) - (insert " + (insert (substitute-command-keys " Please specify your level of familiarity with the venomous VI PERil \(and the VI Plan for Emacs Rescue). -You can change it at any time by typing `M-x viper-set-expert-level RET' +You can change it at any time by typing `\\[viper-set-expert-level]' 1 -- BEGINNER: Almost all Emacs features are suppressed. Feels almost like straight Vi. File name completion and @@ -4803,7 +4803,7 @@ You can change it at any time by typing `M-x viper-set-expert-level RET' viper-electric-mode, viper-want-ctl-h-help, viper-want-emacs-keys-in-vi, and viper-want-emacs-keys-in-insert. Adjust these to your taste. -Please, specify your level now: ") +Please, specify your level now: ")) (setq viper-expert-level (- (viper-read-char-exclusive) ?0)) ) ; end while diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el index e575eee..d03d703 100644 --- a/lisp/emulation/viper-init.el +++ b/lisp/emulation/viper-init.el @@ -279,7 +279,7 @@ The minor mode viper-vi-diehard-minor-mode is in effect when viper-expert-level is 1 or 2 or when viper-want-emacs-keys-in-vi is t. The minor mode viper-insert-diehard-minor-mode is in effect when viper-expert-level is 1 or 2 or if viper-want-emacs-keys-in-insert is t. -Use `M-x viper-set-expert-level' to change this.") +Use `\\[viper-set-expert-level]' to change this.") ;; Max expert level supported by Viper. This is NOT a user option. ;; It is here to make it hard for the user from resetting it. diff --git a/lisp/filesets.el b/lisp/filesets.el index f990333..a30c187 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -1808,7 +1808,8 @@ User will be queried, if no fileset name is provided." (progn (add-to-list 'filesets-data (list name '(:files))) (message - "Fileset %s created. Call `M-x filesets-save-config' to save." + (substitute-command-keys + "Fileset %s created. Call `\\[filesets-save-config]' to save.") name) (car filesets-data)))))) (if entry diff --git a/lisp/follow.el b/lisp/follow.el index abb874e..d62d557 100644 --- a/lisp/follow.el +++ b/lisp/follow.el @@ -405,7 +405,7 @@ mileage may vary). To split one large window into two side-by-side windows, the commands `\\[split-window-right]' or \ -`M-x follow-delete-other-windows-and-split' can be used. +`\\[follow-delete-other-windows-and-split]' can be used. Only windows displayed in the same frame follow each other. diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index d502a3b..0c0e63b 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el @@ -242,7 +242,7 @@ EPA/EPG set up, the file will be encrypted and decrypted automatically. See Info node `(epa)Encrypting/decrypting gpg files' for details. -It's best to customize this with `M-x customize-variable' because the choices +It's best to customize this with `\\[customize-variable]' because the choices can get pretty complex." :group 'auth-source :version "24.1" ;; No Gnus diff --git a/lisp/international/ogonek.el b/lisp/international/ogonek.el index 27ac17c..9e5a450 100644 --- a/lisp/international/ogonek.el +++ b/lisp/international/ogonek.el @@ -75,7 +75,7 @@ are given in the following order: Je/sli czytasz ten tekst, to albo przegl/adasz plik /xr/od/lowy biblioteki `ogonek.el', albo wywo/la/le/s polecenie `ogonek-jak'. W drugim przypadku mo/zesz usun/a/c tekst z ekranu, stosuj/ac -polecenie `M-x kill-buffer'. +polecenie `\\[kill-buffer]'. Niniejsza biblioteka dostarcza funkcji do zmiany kodowania polskich znak/ow diakrytycznych. Funkcje te mo/zna pogrupowa/c nast/epuj/aco. @@ -174,7 +174,7 @@ znak/ow diakrytycznych. Funkcje te mo/zna pogrupowa/c nast/epuj/aco. If you read this text then you are either looking at the library's source text or you have called the `ogonek-how' command. In the -latter case you may remove this text using `M-x kill-buffer'. +latter case you may remove this text using `\\[kill-buffer]'. The library provides functions for changing the encoding of Polish diacritic characters, the ones with an `ogonek' below or above them. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index e534b58..193d70b 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3594,9 +3594,10 @@ connection buffer." (cond ((eq exit 'permission-denied) "Permission denied") ((eq exit 'process-died) - (concat - "Tramp failed to connect. If this happens repeatedly, try\n" - " `M-x tramp-cleanup-this-connection'")) + (substitute-command-keys + (concat + "Tramp failed to connect. If this happens repeatedly, try\n" + " `\\[tramp-cleanup-this-connection]'"))) ((eq exit 'timeout) (format "Timeout reached, see buffer `%s' for details" diff --git a/lisp/org/org-gnus.el b/lisp/org/org-gnus.el index 8b616f0..06f00a4 100644 --- a/lisp/org/org-gnus.el +++ b/lisp/org/org-gnus.el @@ -291,7 +291,7 @@ If `org-store-link' was called with a prefix arg the meaning of (group (gnus-group-jump-to-group group)))) (defun org-gnus-no-new-news () - "Like `M-x gnus' but doesn't check for new news." + "Like `\\[gnus]' but doesn't check for new news." (if (not (gnus-alive-p)) (if org-gnus-no-server (gnus-no-server) (gnus)))) (provide 'org-gnus) diff --git a/lisp/org/org.el b/lisp/org/org.el index 0cc185c..326fb96 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -827,7 +827,7 @@ When nil, just use the standard three dots. When a string, use that string instead. When a face, use the standard 3 dots, but with the specified face. The change affects only Org-mode (which will then use its own display table). -Changing this requires executing `M-x org-mode RET' in a buffer to become +Changing this requires executing `\\[org-mode]' in a buffer to become effective." :group 'org-startup :type '(choice (const :tag "Default" nil) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 0b7b9b7..189cd37 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2720,7 +2720,8 @@ of `error' with a user-friendly message." (or (python-shell-get-process) (if interactivep (user-error - "Start a Python process first with `M-x run-python' or `%s'." + "Start a Python process first with ‘%s’ or ‘%s’." + (substitute-command-keys "\\[run-python]") ;; Get the binding. (key-description (where-is-internal diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 2edacf4..451acd2 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -4421,7 +4421,7 @@ Usage: according to option `vhdl-argument-list-indent'. If option `vhdl-indent-tabs-mode' is nil, spaces are used instead of - tabs. `M-x tabify' and `M-x untabify' allow to convert spaces to tabs + tabs. `\\[tabify]' and `\\[untabify]' allow to convert spaces to tabs and vice versa. Syntax-based indentation can be very slow in large files. Option @@ -4732,7 +4732,7 @@ Usage: `vhdl-highlight-translate-off' is non-nil. For documentation and customization of the used colors see - customization group `vhdl-highlight-faces' (`M-x customize-group'). For + customization group `vhdl-highlight-faces' (`\\[customize-group]'). For highlighting of matching parenthesis, see customization group `paren-showing'. Automatic buffer highlighting is turned on/off by option `global-font-lock-mode' (`font-lock-auto-fontify' in XEmacs). @@ -4792,14 +4792,14 @@ Usage: sessions using the \"Save Options\" menu entry. Options and their detailed descriptions can also be accessed by using - the \"Customize\" menu entry or the command `M-x customize-option' (`M-x - customize-group' for groups). Some customizations only take effect + the \"Customize\" menu entry or the command `\\[customize-option]' + (`\\[customize-group]' for groups). Some customizations only take effect after some action (read the NOTE in the option documentation). Customization can also be done globally (i.e. site-wide, read the INSTALL file). Not all options are described in this documentation, so go and see - what other useful user options there are (`M-x vhdl-customize' or menu)! + what other useful user options there are (`\\[vhdl-customize]' or menu)! FILE EXTENSIONS: @@ -4828,7 +4828,7 @@ Usage: Maintenance: ------------ -To submit a bug report, enter `M-x vhdl-submit-bug-report' within VHDL Mode. +To submit a bug report, enter `\\[vhdl-submit-bug-report]' within VHDL Mode. Add a description of the problem and include a reproducible test case. Questions and enhancement requests can be sent to . diff --git a/lisp/server.el b/lisp/server.el index b6b0e97..bcadcc4 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -624,8 +624,9 @@ To force-start a server, do \\[server-force-delete] and then (concat "Unable to start the Emacs server.\n" (format "There is an existing Emacs server, named %S.\n" server-name) - "To start the server in this Emacs process, stop the existing -server or call `M-x server-force-delete' to forcibly disconnect it.") + (substitute-command-keys + "To start the server in this Emacs process, stop the existing +server or call `\\[server-force-delete]' to forcibly disconnect it.")) :warning) (setq leave-dead t)) ;; If this Emacs already had a server, clear out associated status. diff --git a/lisp/type-break.el b/lisp/type-break.el index 5a12f02..c7043b5 100644 --- a/lisp/type-break.el +++ b/lisp/type-break.el @@ -803,8 +803,9 @@ this or ask the user to start one right now." (type-break-mode-line-message-mode) (t (beep t) - (message "%sYou should take a typing break now. Do `M-x type-break'." - (type-break-time-stamp)) + (message "%sYou should take a typing break now. Do ‘%s’." + (type-break-time-stamp) + (substitute-command-keys "\\[type-break]")) (sit-for 1) (beep t) ;; return nil so query caller knows to reset reminder, as if user diff --git a/lisp/userlock.el b/lisp/userlock.el index c47bc4c9..781023c 100644 --- a/lisp/userlock.el +++ b/lisp/userlock.el @@ -142,7 +142,7 @@ If you say `r' to revert, the contents of the buffer are refreshed from the file on disk. If you say `n', the change you started to make will be aborted. -Usually, you should type `n' and then `M-x revert-buffer', +Usually, you should type `n' and then `\\[revert-buffer]', to get the latest version of the file, then make the change again.") (with-current-buffer standard-output (help-mode)))) diff --git a/lisp/whitespace.el b/lisp/whitespace.el index a1a6c3c..ddc37f1 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -1866,9 +1866,11 @@ cleaning up these problems." (whitespace-insert-value ws-tab-width) (when has-bogus (goto-char (point-max)) - (insert " Type `M-x whitespace-cleanup'" + (insert (substitute-command-keys + " Type ‘\\[whitespace-cleanup]’") " to cleanup the buffer.\n\n" - " Type `M-x whitespace-cleanup-region'" + (substitute-command-keys + " Type ‘\\[whitespace-cleanup-region]’") " to cleanup a region.\n\n")) (whitespace-display-window (current-buffer))))) has-bogus)))) commit 59f7943043fa4afb922f4553c9994e20c534fc57 Author: Simen Heggestøyl Date: Fri Aug 21 20:54:49 2015 +0200 ; Fix minor typo in Elisp manual diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index fb2e1bc..17d5c26 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -372,7 +372,7 @@ More specifically, a Q-pattern can take the following forms: @table @code @item (@var{qpattern1} . @var{qpattern2}) This pattern matches any cons cell whose @code{car} matches @var{qpattern1} and -whose @code{cdr} matches @var{pattern2}. +whose @code{cdr} matches @var{qpattern2}. @item [@var{qpattern1} @var{qpattern2} @dots{} @var{qpatternm}] This pattern matches a vector of length @var{M} whose 0..(@var{M}-1)th elements match @var{qpattern1}, @var{qpattern2} @dots{} @var{qpatternm}, commit 2649105ae30edf97ac5f543b269886103c42c91c Author: Tassilo Horn Date: Fri Aug 21 20:18:34 2015 +0200 Use add-function for prettify-symbols-compose-predicate * lisp/textmodes/tex-mode.el (tex-common-initialization): Set prettify-symbols-compose-predicate in terms of add-function. * etc/NEWS: Mention prettify-symbols-compose-predicate and prettify-symbols-mode support in tex-mode. diff --git a/etc/NEWS b/etc/NEWS index 17a6c3a..72af95e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -301,6 +301,13 @@ standards. ** Prog mode has some support for multi-mode indentation. See `prog-indentation-context' and `prog-widen'. +** Prettify Symbols mode supports custom composition predicates. By +overriding the default `prettify-symbols-compose-predicate', modes can +specify in which contexts a symbol map be composed to some unicode +character. `prettify-symbols-default-compose-p' is the default which +is suitable for most programming languages such as C or Lisp (but not +(La)TeX). + ** New `xterm-screen-extra-capabilities' config. ** The `save-place' variable is replaced by a `save-place-mode'. @@ -694,6 +701,10 @@ name patterns (e.x. all "FOR_DOXYGEN_ONLY_*") to be excluded. *** New custom variable `tex-print-file-extension' to help users who use PDF instead of DVI. +*** TeX mode now supports Prettify Symbols mode. When enabling +`prettify-symbols-mode' in a tex-mode buffer, \alpha ... \omega, and +many other math macros are displayed using unicode characters. + ** whitespace-mode: new 'big-indent style highlighting too much indentation. By default, 32 spaces and four TABs are considered to be too much but `whitespace-big-indent-regexp' can be configured to change that. diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 8f68c71..78cfbea 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -1256,7 +1256,8 @@ Entering SliTeX mode runs the hook `text-mode-hook', then the hook (font-lock-unfontify-region-function . tex-font-lock-unfontify-region))) (setq-local prettify-symbols-alist tex--prettify-symbols-alist) - (setq-local prettify-symbols-compose-predicate #'tex--prettify-symbols-compose-p) + (add-function :override (local 'prettify-symbols-compose-predicate) + #'tex--prettify-symbols-compose-p) (setq-local syntax-propertize-function (syntax-propertize-rules latex-syntax-propertize-rules)) ;; TABs in verbatim environments don't do what you think. commit 74881b6e068e209725527b3776aaaa7955d4fb4a Author: Stefan Monnier Date: Fri Aug 21 14:13:05 2015 -0400 * lisp/emacs-lisp/smie.el (smie-indent-current-column): New fun (smie-indent-exps, smie-indent-keyword): Use it. * test/indent/css-mode.css: Test alignment with leading comment. diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 1bc5eb2..0c24f79 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el @@ -1198,6 +1198,21 @@ Comments are treated as spaces." (forward-comment (- (point))) (<= (point) bol)))) +(defun smie-indent--current-column () + "Like `current-column', but if there's a comment before us, use that." + ;; This is used, so that when we align elements, we don't get + ;; toto = { /* foo, */ a, + ;; b } + ;; but + ;; toto = { /* foo, */ a, + ;; b } + (let ((pos (point)) + (lbp (line-beginning-position))) + (save-excursion + (unless (and (forward-comment -1) (>= (point) lbp)) + (goto-char pos)) + (current-column)))) + ;; Dynamically scoped. (defvar smie--parent) (defvar smie--after) (defvar smie--token) @@ -1577,7 +1592,9 @@ should not be computed on the basis of the following token." ;; So we use a heuristic here, which is that we only use virtual ;; if the parent is tightly linked to the child token (they're ;; part of the same BNF rule). - (if (car parent) (current-column) (smie-indent-virtual))))))))))) + (if (car parent) + (smie-indent--current-column) + (smie-indent-virtual))))))))))) (defun smie-indent-comment () "Compute indentation of a comment." @@ -1707,12 +1724,12 @@ should not be computed on the basis of the following token." ;; There's a previous element, and it's not special (it's not ;; the function), so let's just align with that one. (goto-char (car positions)) - (current-column)) + (smie-indent--current-column)) ((cdr positions) ;; We skipped some args plus the function and bumped into something. ;; Align with the first arg. (goto-char (cadr positions)) - (current-column)) + (smie-indent--current-column)) (positions ;; We're the first arg. (goto-char (car positions)) @@ -1720,7 +1737,7 @@ should not be computed on the basis of the following token." ;; We used to use (smie-indent-virtual), but that ;; doesn't seem right since it might then indent args less than ;; the function itself. - (current-column))))))) + (smie-indent--current-column))))))) (defvar smie-indent-functions '(smie-indent-fixindent smie-indent-bob smie-indent-close diff --git a/test/indent/css-mode.css b/test/indent/css-mode.css index faf9153..67a6b1e 100644 --- a/test/indent/css-mode.css +++ b/test/indent/css-mode.css @@ -29,7 +29,7 @@ a.b:c,d.e:f,g[h]:i,j[k]:l,.m.n:o,.p.q:r,.s[t]:u,.v[w]:x { /* bug:20282 */ } .x2 { - foo: bar; + /* foo: bar; */ foo2: bar2; bar: baz; } commit e967f17e5d7f3a0b12ad5526a0025037fd69d876 Author: Paul Eggert Date: Fri Aug 21 09:46:15 2015 -0700 Respect text-quoting-style in (*Finder*) menus * lisp/info.el (info--prettify-description): Treat description as a docstring, so that it's requoted as per text-quoting-style. diff --git a/lisp/info.el b/lisp/info.el index 1b02c35..8a43a81 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -3664,7 +3664,7 @@ Build a menu of the possible matches." (defun info--prettify-description (desc) (if (stringp desc) (with-temp-buffer - (insert desc) + (insert (substitute-command-keys desc)) (if (equal ?. (char-before)) (delete-char -1)) (goto-char (point-min)) commit 3ea059852617b4b419080024852ed69b0ffa2620 Author: Martin Rudalics Date: Fri Aug 21 17:54:10 2015 +0200 Document `window-use-time' in Elisp manual * doc/lispref/windows.texi (Selecting Windows): Document `window-use-time'. diff --git a/ChangeLog.2 b/ChangeLog.2 index 4803ff9..3a93fda 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -1353,7 +1353,6 @@ Fix customization type of `even-window-sizes'. * lisp/window.el (even-window-sizes): Fix customization type. - 2015-07-22 Martin Rudalics Optionally even widths of `display-buffer' windows. (Bug#21100) * lisp/window.el (quit-restore-window): Restore width if requested. diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 6814b4f..e53edb3 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -1725,6 +1725,16 @@ function does not alter the list of most recently selected windows, nor the buffer list. @end defun +@cindex window use time +@cindex use time of window +@defun window-use-time &optional window +This functions returns the @dfn{use time} of window @var{window}. +@var{window} must be a live window and defaults to the selected one. +The window with the lowest use time is the least recently selected one. +The window with the highest use time is the most recently selected one. +@end defun + + @node Cyclic Window Ordering @section Cyclic Ordering of Windows @cindex cyclic ordering of windows commit 8583c215a24e31974bb47dccf56f9d3933f17c55 Author: Eli Zaretskii Date: Fri Aug 21 17:45:41 2015 +0300 A better fix for bug#21303 * src/w32uniscribe.c (_WIN32_WINNT): Define to 0x0600. This is a cleaner fix for Bug#21260 than the previous change. diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index 0e4177d..ec14dbe 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -18,22 +18,15 @@ along with GNU Emacs. If not, see . */ #include -/* Override API version - Uniscribe is only available as standard since - Windows 2000, though most users of older systems will have it +/* Override API version - Uniscribe is only available as standard + since Windows 2000, though most users of older systems will have it since it installs with Internet Explorer 5.0 and other software. - We only enable the feature if it is available, so there is no chance - of calling non-existent functions. */ + Also, MinGW64 w32api headers by default define OPENTYPE_TAG typedef + only if _WIN32_WINNT >= 0x0600. We only use the affected APIs if + they are available, so there is no chance of calling non-existent + functions. */ #undef _WIN32_WINNT -#define _WIN32_WINNT 0x500 -/* MinGW64 w32api headers by default define OPENTYPE_TAG typedef only - if _WIN32_WINNT >= 0x0600; defining UNISCRIBE_OPENTYPE as below - makes that typedef visible even for lower values of _WIN32_WINNT. - Mingw.org's w32api headers don't use UNISCRIBE_OPENTYPE at all, and - the OPENTYPE_TAG typedef is defined unconditionally there. */ -#ifdef UNISCRIBE_OPENTYPE -# undef UNISCRIBE_OPENTYPE -#endif -#define UNISCRIBE_OPENTYPE 0x0100 +#define _WIN32_WINNT 0x0600 #include #include commit 1c671d650ce8da0b09494fb43987c9449331ed63 Merge: c1402c5 1a38259 Author: Eli Zaretskii Date: Fri Aug 21 16:33:46 2015 +0300 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit 1a38259bbc5aea962a295e49c4d79f89ddeda709 Author: Paul Eggert Date: Fri Aug 21 06:31:54 2015 -0700 Respect text-quoting-style in calc In calc, tespect text-quoting-style preference in diagnostic formats and fix a few similar problems in docstrings. * lisp/calc/calc-aent.el (math-read-factor): * lisp/calc/calc-embed.el (calc-do-embedded): * lisp/calc/calc-ext.el (calc-user-function-list) * lisp/calc/calc-graph.el (calc-graph-show-dumb): * lisp/calc/calc-help.el (calc-describe-key) (calc-describe-thing): * lisp/calc/calc-lang.el (calc-c-language) (math-parse-fortran-vector-end, math-parse-tex-sum) (math-parse-eqn-matrix, math-parse-eqn-prime) (calc-yacas-language, calc-maxima-language, calc-giac-language) (math-read-big-rec, math-read-big-balance): * lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes) (calc-auto-recompute): * lisp/calc/calc-prog.el (calc-user-define-invocation) (math-do-arg-check): * lisp/calc/calc-store.el (calc-edit-variable): * lisp/calc/calc-units.el (math-build-units-table-buffer): * lisp/calc/calc-vec.el (math-read-brackets): * lisp/calc/calc-yank.el (calc-edit-mode): * lisp/calc/calc.el (calc, calc-do, calc-user-invocation): Use curved quotes in diagnostic format strings. * lisp/calc/calc-help.el (calc-describe-thing): Format docstrings with substitute-command-keys. * lisp/calc/calc-help.el (calc-j-prefix-help): * lisp/calc/calc-misc.el (calc-help): * lisp/calc/calc-ext.el (calc-shift-Z-prefix-help): Escape a docstring "`". diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index cc048eb..2fa8f19 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -1121,7 +1121,7 @@ If the current Calc language does not use placeholders, return nil." (math-read-expr-list)))) (if (not (or (equal math-expr-data calc-function-close) (eq math-exp-token 'end))) - (throw 'syntax "Expected `)'")) + (throw 'syntax "Expected ‘)’")) (math-read-token) (if (and (memq calc-language calc-lang-parens-are-subscripts) @@ -1246,7 +1246,7 @@ If the current Calc language does not use placeholders, return nil." (if (not (or (equal math-expr-data ")") (and (equal math-expr-data "]") (eq (car-safe exp) 'intv)) (eq math-exp-token 'end))) - (throw 'syntax "Expected `)'")) + (throw 'syntax "Expected ‘)’")) (math-read-token) exp)) ((eq math-exp-token 'string) diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el index fcb4b03..3f6e83e 100644 --- a/lisp/calc/calc-embed.el +++ b/lisp/calc/calc-embed.el @@ -330,10 +330,12 @@ (if calc-embedded-firsttime-formula (run-hooks 'calc-embedded-new-formula-hook)) (or (eq calc-embedded-quiet t) - (message "Embedded Calc mode enabled; %s to return to normal" - (if calc-embedded-quiet - "Type `C-x * x'" - "Give this command again"))))) + (message (concat + "Embedded Calc mode enabled; " + (if calc-embedded-quiet + "Type ‘C-x * x’" + "Give this command again") + " to return to normal"))))) (scroll-down 0)) ; fix a bug which occurs when truncate-lines is changed. diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 67d0c27..1c40188 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1097,10 +1097,10 @@ calc-tan calc-tanh calc-to-degrees calc-to-radians) ("calc-mode" calc-alg-simplify-mode calc-algebraic-mode calc-always-load-extensions calc-auto-recompute calc-auto-why -calc-basic-simplify-mode calc-bin-simplify-mode calc-break-vectors -calc-center-justify calc-default-simplify-mode calc-display-raw -calc-eng-notation calc-ext-simplify-mode calc-fix-notation -calc-full-trail-vectors calc-full-vectors calc-get-modes calc-group-char +calc-basic-simplify-mode calc-bin-simplify-mode calc-break-vectors +calc-center-justify calc-default-simplify-mode calc-display-raw +calc-eng-notation calc-ext-simplify-mode calc-fix-notation +calc-full-trail-vectors calc-full-vectors calc-get-modes calc-group-char calc-group-digits calc-infinite-mode calc-left-justify calc-left-label calc-line-breaking calc-line-numbering calc-matrix-brackets calc-matrix-center-justify calc-matrix-left-justify calc-matrix-mode @@ -1177,7 +1177,7 @@ calc-trail-scroll-right calc-trail-yank) ("calc-undo" calc-last-args calc-redo) ("calc-units" calc-autorange-units calc-base-units -calc-convert-temperature calc-convert-units +calc-convert-temperature calc-convert-units calc-convert-exact-units calc-define-unit calc-enter-units-table calc-explain-units calc-extract-units calc-get-unit-definition calc-permanent-units calc-quick-units @@ -1957,7 +1957,7 @@ calc-kill calc-kill-region calc-yank)))) (desc (if (symbolp func) (if (= (logand kind 3) 0) - (format "`%c' = %s" key name) + (format "‘%c’ = %s" key name) (if pos (format "%s%c%s" (downcase (substring name 0 pos)) @@ -1988,7 +1988,7 @@ calc-kill calc-kill-region calc-yank)))) "kbd-macros: [ (if), : (else), | (else-if), ] (end-if)" "kbd-macros: < > (repeat), ( ) (for), { } (loop)" "kbd-macros: / (break)" - "kbd-macros: ` (save), ' (restore)") + "kbd-macros: \\=` (save), ' (restore)") "user" ?Z)) diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el index 20b0249..8378b23 100644 --- a/lisp/calc/calc-graph.el +++ b/lisp/calc/calc-graph.el @@ -958,7 +958,7 @@ This \"dumb\" driver will be present in Gnuplot 3.0." (define-key calc-dumb-map "\C-c\C-c" 'exit-recursive-edit))) (use-local-map calc-dumb-map) (setq truncate-lines t) - (message "Type `q' or `C-c C-c' to return to Calc") + (message "Type ‘q’ or ‘C-c C-c’ to return to Calc") (recursive-edit) (bury-buffer "*Gnuplot Trail*"))) diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index 7a1a983..01ab495 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -240,7 +240,7 @@ C-w Describe how there is no warranty for Calc." (if (string-match "\\` +" prompts) (setq prompts (substring prompts (match-end 0)))) (setq msg (format - "%s: %s%s`%s'%s%s %s%s" + "%s: %s%s‘%s’%s%s %s%s" (if (string-match "\\`\\(calc-[-a-zA-Z0-9]+\\) *\\(.*\\)\\'" cmd) @@ -345,7 +345,7 @@ C-w Describe how there is no warranty for Calc." (calc-describe-thing var "Variable Index")) (defun calc-describe-thing (thing where &optional target not-quoted) - (message "Looking for `%s' in %s..." thing where) + (message "Looking for ‘%s’ in %s..." thing where) (let ((savewin (current-window-configuration))) (calc-info-goto-node where) (or (let ((case-fold-search nil)) @@ -361,7 +361,7 @@ C-w Describe how there is no warranty for Calc." (if Info-history (Info-last)) (set-window-configuration savewin) - (error "Can't find `%s' in %s" thing where))) + (error "Can't find ‘%s’ in %s" thing where))) (let (Info-history) (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1)))) (let* ((string-target (or target thing)) @@ -380,7 +380,7 @@ C-w Describe how there is no warranty for Calc." (re-search-forward quoted nil t) (search-forward string-target nil t))))) (beginning-of-line) - (message "Found `%s' in %s" thing where))) + (message "Found ‘%s’ in %s" thing where))) (defun calc-view-news () (interactive) @@ -400,11 +400,13 @@ C-w Describe how there is no warranty for Calc." (princ "GNU Emacs Calculator.\n") (princ " By Dave Gillespie.\n") (princ (format " %s\n\n" emacs-copyright)) - (princ "Type `h s' for a more detailed summary.\n") - (princ "Or type `h i' to read the full Calc manual on-line.\n\n") + (princ (format "Type ‘h s’ for a more detailed summary.\n")) + (princ (format "Or type ‘h i’ to read the full Calc manual on-line.\n\n")) (princ "Basic keys:\n") (let* ((calc-full-help-flag t)) - (mapc (function (lambda (x) (princ (format " %s\n" x)))) + (mapc (function (lambda (x) (princ (format + " %s\n" + (substitute-command-keys x))))) (nreverse (cdr (reverse (cdr (calc-help)))))) (mapc (function (lambda (prefix) (let ((msgs (condition-case err @@ -413,18 +415,22 @@ C-w Describe how there is no warranty for Calc." (if (car msgs) (princ (if (eq (nth 2 msgs) ?v) - "\n`v' or `V' prefix (vector/matrix) keys: \n" + (format + "\n‘v’ or ‘V’ prefix (vector/matrix) keys: \n") (if (nth 2 msgs) (format - "\n`%c' prefix (%s) keys:\n" + "\n‘%c’ prefix (%s) keys:\n" (nth 2 msgs) (or (cdr (assq (nth 2 msgs) calc-help-long-names)) (nth 1 msgs))) (format "\n%s-modified keys:\n" (capitalize (nth 1 msgs))))))) - (mapcar (function (lambda (x) - (princ (format " %s\n" x)))) + (mapcar (function + (lambda (x) + (princ (format + " %s\n" + (substitute-command-keys x))))) (car msgs))))) '(calc-inverse-prefix-help calc-hyperbolic-prefix-help @@ -539,7 +545,7 @@ C-w Describe how there is no warranty for Calc." '("Select, Additional, Once; eVal, Formula; Rewrite" "More, Less, 1-9, Next, Previous" "Unselect, Clear; Display; Enable; Breakable" - "' (replace), ` (edit), +, -, *, /, RET (grab), DEL" + "' (replace), \\=` (edit), +, -, *, /, RET (grab), DEL" "SHIFT + swap: Left, Right; maybe: Select, Once" "SHIFT + Commute, Merge, Distrib, jump-Eqn, Isolate" "SHIFT + Negate, & (invert); Unpack") diff --git a/lisp/calc/calc-lang.el b/lisp/calc/calc-lang.el index 066d781..9d5020d 100644 --- a/lisp/calc/calc-lang.el +++ b/lisp/calc/calc-lang.el @@ -94,7 +94,7 @@ (interactive) (calc-wrapper (calc-set-language 'c) - (message "`C' language mode"))) + (message "‘C’ language mode"))) (put 'c 'math-oper-table '( ( "u!" calcFunc-lnot -1 1000 ) @@ -387,7 +387,7 @@ math-exp-token 'end math-expr-data "\000") x) - (throw 'syntax "Unmatched closing `/'"))) + (throw 'syntax "Unmatched closing ‘/’"))) (defun math-parse-fortran-subscr (sym args) (setq sym (math-build-var-name sym)) @@ -695,7 +695,7 @@ (defun math-parse-tex-sum (f val) (let (low high save) - (or (equal math-expr-data "_") (throw 'syntax "Expected `_'")) + (or (equal math-expr-data "_") (throw 'syntax "Expected ‘_’")) (math-read-token) (setq save math-exp-old-pos) (setq low (math-read-factor)) @@ -703,7 +703,7 @@ (progn (setq math-exp-old-pos (1+ save)) (throw 'syntax "Expected equation"))) - (or (equal math-expr-data "^") (throw 'syntax "Expected `^'")) + (or (equal math-expr-data "^") (throw 'syntax "Expected ‘^’")) (math-read-token) (setq high (math-read-factor)) (list (nth 2 f) (math-read-factor) (nth 1 low) (nth 2 low) high))) @@ -1165,14 +1165,14 @@ (while (assoc math-expr-data '(("ccol") ("lcol") ("rcol"))) (math-read-token) (or (equal math-expr-data calc-function-open) - (throw 'syntax "Expected `{'")) + (throw 'syntax "Expected ‘{’")) (math-read-token) (setq vec (cons (cons 'vec (math-read-expr-list)) vec)) (or (equal math-expr-data calc-function-close) - (throw 'syntax "Expected `}'")) + (throw 'syntax "Expected ‘}’")) (math-read-token)) (or (equal math-expr-data calc-function-close) - (throw 'syntax "Expected `}'")) + (throw 'syntax "Expected ‘}’")) (math-read-token) (math-transpose (cons 'vec (nreverse vec))))) @@ -1187,7 +1187,7 @@ (math-read-expr-list)))) (if (not (or (equal math-expr-data calc-function-close) (eq math-exp-token 'end))) - (throw 'syntax "Expected `)'")) + (throw 'syntax "Expected ‘)’")) (math-read-token) (cons (intern (format "calcFunc-%s'" (nth 1 x))) args))) (list 'var @@ -1211,7 +1211,7 @@ (interactive) (calc-wrapper (calc-set-language 'yacas) - (message "`Yacas' language mode"))) + (message "‘Yacas’ language mode"))) (put 'yacas 'math-vector-brackets "{}") @@ -1427,7 +1427,7 @@ (interactive) (calc-wrapper (calc-set-language 'maxima) - (message "`Maxima' language mode"))) + (message "‘Maxima’ language mode"))) (put 'maxima 'math-oper-table '(("+" + 100 100) @@ -1625,7 +1625,7 @@ (interactive) (calc-wrapper (calc-set-language 'giac) - (message "`Giac' language mode"))) + (message "‘Giac’ language mode"))) (put 'giac 'math-oper-table '( ( "[" (math-read-giac-subscr) 250 -1 ) @@ -2237,7 +2237,7 @@ order to Calc's." (if (= sep ?\.) (setq h (1+ h))) (if (= sep ?\]) - (math-read-big-error (1- h) v "Expected `)'")) + (math-read-big-error (1- h) v "Expected ‘)’")) (if (= sep ?\)) (setq p (math-read-big-rec (1+ math-rb-h1) math-rb-v1 (1- h) math-rb-v2 v)) @@ -2252,7 +2252,7 @@ order to Calc's." 0 1) p)))) ((= (math-read-big-char (1- h) v) ?\]) - (math-read-big-error (1- h) v "Expected `)'")) + (math-read-big-error (1- h) v "Expected ‘)’")) ((= sep ?\,) (or (and (math-realp (car p)) (math-realp (nth 1 p))) (math-read-big-error @@ -2280,7 +2280,7 @@ order to Calc's." (setq h (math-read-big-balance (1+ hleft) v "[")) (if hright (or (= h hright) - (math-read-big-error hright v "Expected `]'")) + (math-read-big-error hright v "Expected ‘]’")) (setq hright h)) (setq p (cons (math-read-big-rec hleft v h (1+ v)) p)) @@ -2293,7 +2293,7 @@ order to Calc's." (setq h (1+ h))) (and (= (math-read-big-char h v) ?\]) (setq h (1+ h)))) - (math-read-big-error (1- h) v "Expected `]'")) + (math-read-big-error (1- h) v "Expected ‘]’")) (if (= (math-read-big-char h vtop) ?\,) (setq h (1+ h))) (math-read-big-emptyp math-rb-h1 (1+ v) (1- h) math-rb-v2 nil t) @@ -2317,7 +2317,7 @@ order to Calc's." (setq widest (math-read-big-char (1- h) v)) (if (or (memq widest '(?\; ?\))) (and (eq widest ?\.) (cdr p))) - (math-read-big-error (1- h) v "Expected `]'")) + (math-read-big-error (1- h) v "Expected ‘]’")) (if (= widest ?\.) (setq h (1+ h) widest (math-read-big-balance h v "[") @@ -2369,7 +2369,7 @@ order to Calc's." h widest) (= (math-read-big-char (1- h) v) ?\,))) (or (= (math-read-big-char (1- h) v) ?\)) - (math-read-big-error (1- h) v "Expected `)'")) + (math-read-big-error (1- h) v "Expected ‘)’")) (setq p (cons line (nreverse p)))) (setq p (list 'var (intern (math-remove-dashes p)) @@ -2432,7 +2432,8 @@ order to Calc's." (let ((y (math-read-big-rec h math-rb-v1 math-rb-h2 math-rb-v2 baseline nil t))) (or (= (math-read-big-char math-read-big-h2 baseline) ?\:) - (math-read-big-error math-read-big-h2 baseline "Expected `:'")) + (math-read-big-error math-read-big-h2 baseline + "Expected ‘:’")) (setq p (list (nth 1 widest) p y (math-read-big-rec (1+ math-read-big-h2) math-rb-v1 math-rb-h2 math-rb-v2 @@ -2507,7 +2508,7 @@ order to Calc's." (while (> count 0) (if (>= h len) (if what - (math-read-big-error nil v (format "Unmatched `%s'" what)) + (math-read-big-error nil v (format "Unmatched ‘%s’" what)) (setq count 0)) (if (memq (aref line h) '(?\( ?\[)) (setq count (1+ count)) diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el index 5d5f4ce..e5d4b6b 100644 --- a/lisp/calc/calc-misc.el +++ b/lisp/calc/calc-misc.el @@ -225,7 +225,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C). "Letter keys: SHIFT + Num-eval; More-recn; eXec-kbd-macro; Keep-args" "Other keys: +, -, *, /, ^, \\ (int div), : (frac div)" "Other keys: & (1/x), | (concat), % (modulo), ! (factorial)" - "Other keys: ' (alg-entry), = (eval), ` (edit); M-RET (last-args)" + "Other keys: ' (alg-entry), = (eval), \\=` (edit); M-RET (last-args)" "Other keys: SPC/RET (enter/dup), LFD (over); < > (scroll horiz)" "Other keys: DEL (drop), M-DEL (drop-above); { } (scroll vert)" "Other keys: TAB (swap/roll-dn), M-TAB (roll-up)" diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el index be18dcd..605084e 100644 --- a/lisp/calc/calc-mode.el +++ b/lisp/calc/calc-mode.el @@ -110,11 +110,11 @@ (setq n (and (not (eq calc-auto-why t)) (if calc-auto-why t 1)))) (calc-change-mode 'calc-auto-why n nil) (cond ((null n) - (message "User must press `w' to explain unsimplified results")) + (message "User must press ‘w’ to explain unsimplified results")) ((eq n t) - (message "Automatically doing `w' to explain unsimplified results")) + (message "Automatically doing ‘w’ to explain unsimplified results")) (t - (message "Automatically doing `w' only for unusual messages"))))) + (message "Automatically doing ‘w’ only for unusual messages"))))) (defun calc-group-digits (n) (interactive "P") @@ -272,7 +272,7 @@ (vals (mapcar (function (lambda (v) (symbol-value (car v)))) calc-mode-var-list))) (unless calc-settings-file - (error "No `calc-settings-file' specified")) + (error "No ‘calc-settings-file’ specified")) (set-buffer (find-file-noselect (substitute-in-file-name calc-settings-file))) (goto-char (point-min)) @@ -410,7 +410,7 @@ ((= n 4) 'global) ((= n 5) 'save) (t 'local))) - (message "%s" + (message "%s" (cond ((and (eq calc-mode-save-mode 'local) calc-embedded-info) "Recording mode changes with [calc-mode: ...]") ((eq calc-mode-save-mode 'edit) @@ -478,7 +478,7 @@ (cond ((eq arg 0) 'scalar) ((< (prefix-numeric-value arg) 1) (and (< (prefix-numeric-value arg) -1) 'matrix)) - (arg + (arg (if (consp arg) 'sqmatrix (prefix-numeric-value arg))) ((eq calc-matrix-mode 'matrix) 'scalar) @@ -572,8 +572,8 @@ (calc-change-mode 'calc-auto-recompute arg nil t) (calc-refresh-evaltos) (message (if calc-auto-recompute - "Automatically recomputing `=>' forms when necessary" - "Not recomputing `=>' forms automatically")))) + "Automatically recomputing ‘=>’ forms when necessary" + "Not recomputing ‘=>’ forms automatically")))) (defun calc-working (n) (interactive "P") diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index 2711407..df2eb76 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -673,7 +673,7 @@ (or last-kbd-macro (error "No keyboard macro defined")) (setq calc-invocation-macro last-kbd-macro) - (message "Use `C-x * Z' to invoke this macro")) + (message "Use ‘C-x * Z’ to invoke this macro")) (defun calc-user-define-edit () (interactive) ; but no calc-wrapper! @@ -1899,7 +1899,7 @@ Redefine the corresponding command." `((and (,chk ,var) (math-reject-arg ,var ',qual))))) - (error "Unknown qualifier `%s'" qual-name)))))))) + (error "Unknown qualifier ‘%s’" qual-name)))))))) (defun math-do-arg-list-check (args is-opt is-rest) (cond ((null args) nil) diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el index 91b927a..43dc602 100644 --- a/lisp/calc/calc-store.el +++ b/lisp/calc/calc-store.el @@ -442,7 +442,7 @@ (setq calc-last-edited-variable var) (calc-edit-mode (list 'calc-finish-stack-edit (list 'quote var)) t - (concat "Editing variable `" (calc-var-name var) "'. ")) + (format "Editing variable ‘%s’" (calc-var-name var))) (and value (insert (math-format-nice-expr value (frame-width)) "\n"))))) (calc-show-edit-buffer)) diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index f3d0234..d95af94 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -422,7 +422,7 @@ If EXPR is nil, return nil." "Put the units in EXPR in the default units table. If COMP or STD is non-nil, put that in the units table instead." (let* ((new-units (or comp std (math-get-units expr))) - (standard-units (math-get-standard-units + (standard-units (math-get-standard-units (cond (comp (math-simplify-units expr)) (std expr) @@ -457,9 +457,9 @@ If COMP or STD is non-nil, put that in the units table instead." (eq (math-get-standard-units expr) 1)))) (let ((uold (or old-units (progn - (setq uoldname + (setq uoldname (if unitscancel - (read-string + (read-string "(The expression is unitless when simplified) Old Units: ") (read-string "Old units: "))) (if (equal uoldname "") @@ -1621,11 +1621,14 @@ If COMP or STD is non-nil, put that in the units table instead." (insert " " (nth 2 u) "\n") (while (eq (car (car (setq uptr (cdr uptr)))) 0))) (insert "\n\n") - (insert "(**) When in TeX or LaTeX display mode, the TeX specific unit\n" - "names will not use the `tex' prefix; the unit name for a\n" - "TeX point will be `pt' instead of `texpt', for example.\n" - "To avoid conflicts, the unit names for pint and parsec will\n" - "be `pint' and `parsec' instead of `pt' and `pc'.")) + (insert + (format + (concat + "(**) When in TeX or LaTeX display mode, the TeX specific unit\n" + "names will not use the ‘tex’ prefix; the unit name for a\n" + "TeX point will be ‘pt’ instead of ‘texpt’, for example.\n" + "To avoid conflicts, the unit names for pint and parsec will\n" + "be ‘pint’ and ‘parsec’ instead of ‘pt’ and ‘pc’.")))) (view-mode) (message "Formatting units table...done")) (setq math-units-table-buffer-valid t) diff --git a/lisp/calc/calc-vec.el b/lisp/calc/calc-vec.el index c1ef895..c7a3e716 100644 --- a/lisp/calc/calc-vec.el +++ b/lisp/calc/calc-vec.el @@ -1107,7 +1107,7 @@ (cons 'vec (nreverse (sort (copy-sequence (cdr vec)) 'math-beforep))) (math-reject-arg vec 'vectorp))) -;; The variable math-grade-vec is local to calcFunc-grade and +;; The variable math-grade-vec is local to calcFunc-grade and ;; calcFunc-rgrade, but is used by math-grade-beforep, which is called ;; by calcFunc-grade and calcFunc-rgrade. (defvar math-grade-vec) @@ -1149,7 +1149,7 @@ (setq bin (math-floor bin))) (and (natnump bin) (< bin n) - (aset res bin + (aset res bin (math-add (aref res bin) (if wvec (car (setq wp (cdr wp))) wts))))) (cons 'vec (append res nil)))) @@ -1167,7 +1167,7 @@ (while (and tbds (Math-lessp (car tbds) num)) (setq i (1+ i)) (setq tbds (cdr tbds))) - (aset res i + (aset res i (math-add (aref res i) (if wvec (car (setq wp (cdr wp))) wts)))) (setq vp (cdr vp))) @@ -1550,7 +1550,7 @@ of two matrices is a matrix." ;; indirectly) by math-read-brackets. (defvar math-rb-close) -;; The next few variables are local to math-read-exprs in calc-aent.el +;; The next few variables are local to math-read-exprs in calc-aent.el ;; and math-read-expr in calc-ext.el, but are set in functions they call. (defvar math-exp-pos) (defvar math-exp-str) @@ -1618,13 +1618,13 @@ of two matrices is a matrix." (if (not (or (equal math-expr-data math-rb-close) (equal math-expr-data ")") (eq math-exp-token 'end))) - (throw 'syntax "Expected `]'"))) + (throw 'syntax "Expected ‘]’"))) (if (equal math-expr-data ";") (let ((math-exp-keep-spaces space-sep)) (setq vals (cons 'vec (math-read-matrix (list vals)))))) (if (not (or (equal math-expr-data math-rb-close) (eq math-exp-token 'end))) - (throw 'syntax "Expected `]'"))) + (throw 'syntax "Expected ‘]’"))) (or (eq math-exp-token 'end) (math-read-token)) vals))) diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index 923df5d..d4be8ad 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -603,9 +603,9 @@ To cancel the edit, simply kill the *Calc Edit* buffer." (insert (propertize (concat (or title title "Calc Edit Mode. ") - "Press `C-c C-c'" + (format "Press ‘C-c C-c’") (if allow-ret "" " or RET") - " to finish, `C-x k RET' to cancel.\n\n") + (format " to finish, ‘C-x k RET’ to cancel.\n\n")) 'font-lock-face 'italic 'read-only t 'rear-nonsticky t 'front-sticky t)) (make-local-variable 'calc-edit-top) (setq calc-edit-top (point)))) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 52ed5d7..b0046dc 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -1474,7 +1474,7 @@ commands given here will actually operate on the *Calculator* stack." (and calc-display-trail (= (window-width) (frame-width)) (calc-trail-display 1 t))) - (message "Welcome to the GNU Emacs Calculator! Press `?' or `h' for help, `q' to quit") + (message "Welcome to the GNU Emacs Calculator! Press ‘?’ or ‘h’ for help, ‘q’ to quit") (run-hooks 'calc-start-hook) (and (windowp full-display) (window-point full-display) @@ -1622,7 +1622,7 @@ See calc-keypad for details." (stringp (nth 1 err)) (string-match "max-specpdl-size\\|max-lisp-eval-depth" (nth 1 err))) - (error "Computation got stuck or ran too long. Type `M' to increase the limit") + (error "Computation got stuck or ran too long. Type ‘M’ to increase the limit") (setq calc-aborted-prefix nil) (signal (car err) (cdr err))))) (when calc-aborted-prefix @@ -2303,7 +2303,7 @@ the United States." (calc-delete-selection 1) (calc-pop-stack nn)))))) (if calc-context-sensitive-enter (calc-cursor-stack-index (1- num))))) - + @@ -3856,7 +3856,7 @@ Also looks for the equivalent TeX words, \\gets and \\evalto." (defun calc-user-invocation () (interactive) (unless calc-invocation-macro - (error "Use `Z I' inside Calc to define a `C-x * Z' keyboard macro")) + (error "Use ‘Z I’ inside Calc to define a ‘C-x * Z’ keyboard macro")) (execute-kbd-macro calc-invocation-macro nil)) ;;; User-programmability. commit c1402c58710c62b07aaa1e6cdee34ff20dfd4e8a Author: Eli Zaretskii Date: Fri Aug 21 16:32:29 2015 +0300 Fix documentation of 'menu-set-font' and 'set-frame-font' * lisp/menu-bar.el (menu-set-font): Doc fix. (Bug#21303) * doc/lispref/frames.texi (Frame Font): Document that set-frame-font with the last argument 't' will also make the font the default for the future GUI frames. diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 91c512c..65eeec6 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -744,7 +744,7 @@ frame fixed by adjusting the number of lines and columns. If the optional argument @var{frames} is @code{nil}, this applies the font to the selected frame only. If @var{frames} is non-@code{nil}, it should be a list of frames to act upon, or @code{t} meaning all existing -graphical frames. +and all future graphical frames. @end deffn diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 6a2ff63..d57ba74 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -652,7 +652,9 @@ by \"Save Options\" in Custom buffers.") ;; Function for setting/saving default font. (defun menu-set-font () - "Interactively select a font and make it the default on all existing frames." + "Interactively select a font and make it the default on all frames. + +The selected font will be the default on both the existing and futire frames." (interactive) (set-frame-font (if (fboundp 'x-select-font) (x-select-font) commit 88f18ca334600a8d867b7c158a3abdeb6004c08e Author: Eli Zaretskii Date: Fri Aug 21 16:17:47 2015 +0300 Document '--create-frame' option to emacsclient * doc/emacs/misc.texi (emacsclient Options): Document the '--create-frame' option. (Bug#21308) diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index cb15a3b..db096c7 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -1675,6 +1675,7 @@ precedence. @cindex client frame @item -c +@itemx --create-frame Create a new graphical @dfn{client frame}, instead of using an existing Emacs frame. See below for the special behavior of @kbd{C-x C-c} in a client frame. If Emacs cannot create a new graphical frame commit b67928e650803efc0875fbb16e23b29dca6e06b7 Merge: a55c75c 9f31fb2 Author: Eli Zaretskii Date: Fri Aug 21 16:06:21 2015 +0300 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit 9f31fb2a660a26ba510568fae102afc68db8f385 Author: Stefan Monnier Date: Fri Aug 21 09:03:52 2015 -0400 * lisp/progmodes/js.el (js-mode): Don't eagerly syntax propertize. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 40a4a10..98a22dd 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3560,9 +3560,10 @@ If one hasn't been set, or if it's stale, prompt for a new one." ;; the buffer containing the problem, JIT-lock will apply the ;; correct syntax to the regular expression literal and the problem ;; will mysteriously disappear. - ;; FIXME: We should actually do this fontification lazily by adding + ;; FIXME: We should instead do this fontification lazily by adding ;; calls to syntax-propertize wherever it's really needed. - (syntax-propertize (point-max))) + ;;(syntax-propertize (point-max)) + ) ;;;###autoload (defalias 'javascript-mode 'js-mode) commit a55c75ccfe0a47db3eea8989bf4230ff702c6bde Author: Eli Zaretskii Date: Fri Aug 21 16:03:18 2015 +0300 Document 'get-mru-window' in the ELisp manual * doc/lispref/windows.texi (Cyclic Window Ordering): Document 'get-mru-window'. (Bug#21306) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 9cd59d7..6814b4f 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -1858,6 +1858,13 @@ the optional argument @var{not-selected} is non-@code{nil}, this function returns @code{nil} in that case. @end defun +@cindex most recently used window +@defun get-mru-window &optional all-frames dedicated not-selected +This function is like @code{get-lru-window}, but it returns the ``most +recently used'' window instead. The meaning of the arguments is the +same as described for @code{get-lru-window}. +@end defun + @cindex largest window @defun get-largest-window &optional all-frames dedicated not-selected This function returns the window with the largest area (height times commit 2f5e8090824d7d1ca8894c12a1e51e2ad340c012 Author: Eli Zaretskii Date: Fri Aug 21 15:55:05 2015 +0300 Clarify documentation of 'get-buffer-window-list' * doc/lispref/windows.texi (Buffers and Windows): Mention that the current window, if relevant, will be the first in the list returned by 'get-buffer-window-list'. * lisp/window.el (get-buffer-window-list): Doc fix. (Bug#21305) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index f809678..9cd59d7 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -1984,7 +1984,9 @@ to eliminate this discrepancy. This function returns a list of all windows currently displaying @var{buffer-or-name}. @var{buffer-or-name} should be a buffer or the name of an existing buffer. If omitted or @code{nil}, it defaults to -the current buffer. +the current buffer. If the currently selected window displays +@var{buffer-or-name}, it will be the first in the list returned by +this function. The arguments @var{minibuf} and @var{all-frames} have the same meanings as in the function @code{next-window} (@pxref{Cyclic Window diff --git a/lisp/window.el b/lisp/window.el index c783b0d..d39c701 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -2299,8 +2299,8 @@ selected frame and no others." (defun get-buffer-window-list (&optional buffer-or-name minibuf all-frames) "Return list of all windows displaying BUFFER-OR-NAME, or nil if none. BUFFER-OR-NAME may be a buffer or the name of an existing buffer -and defaults to the current buffer. Windows are scanned starting -with the selected window. +and defaults to the current buffer. If the selected window displays +BUFFER-OR-NAME, it will be the first in the resulting list. MINIBUF t means include the minibuffer window even if the minibuffer is not active. MINIBUF nil or omitted means include commit eb022c1e742eb56cf442c1e649cce3e45c18aa29 Author: Vasilij Schneidermann Date: Fri Aug 21 14:19:49 2015 +0200 In `ielm' use `pop-to-buffer-same-window' instead of `switch-to-buffer' * lisp/ielm.el (ielm): Use `pop-to-buffer-same-window' instead of `switch-to-buffer'. diff --git a/lisp/ielm.el b/lisp/ielm.el index 3c9908a..d5b2ba8 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -615,7 +615,7 @@ See `inferior-emacs-lisp-mode' for details." (with-current-buffer (get-buffer-create "*ielm*") (unless (zerop (buffer-size)) (setq old-point (point))) (inferior-emacs-lisp-mode))) - (switch-to-buffer "*ielm*") + (pop-to-buffer-same-window "*ielm*") (when old-point (push-mark old-point)))) (provide 'ielm) commit 244a00860b6fe1d6acf92948c5c0d1ef0f8426fa Author: Kaushal Date: Fri Aug 21 14:14:20 2015 +0200 In woman.el use `display-buffer' instead of `switch-to-buffer' * lisp/woman.el (woman-really-find-file, WoMan-find-buffer): Use `display-buffer' instead of `switch-to-buffer'. Copyright-paperwork-exempt: yes diff --git a/lisp/woman.el b/lisp/woman.el index 75c3d2e..e903caa 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -1651,7 +1651,7 @@ Do not call directly!" (setq woman-frame (make-frame))))) (set-buffer (get-buffer-create bufname)) (condition-case nil - (switch-to-buffer (current-buffer)) + (display-buffer (current-buffer)) (error (pop-to-buffer (current-buffer)))) (buffer-disable-undo) (setq buffer-read-only nil) @@ -2061,14 +2061,14 @@ alist in `woman-buffer-alist' and return nil." (if (zerop woman-buffer-number) (let ((buffer (get-buffer (cdr (car woman-buffer-alist))))) (if buffer - (switch-to-buffer buffer) + (display-buffer buffer) ;; Delete alist element: (setq woman-buffer-alist (cdr woman-buffer-alist)) nil)) (let* ((prev-ptr (nthcdr (1- woman-buffer-number) woman-buffer-alist)) (buffer (get-buffer (cdr (car (cdr prev-ptr)))))) (if buffer - (switch-to-buffer buffer) + (display-buffer buffer) ;; Delete alist element: (setcdr prev-ptr (cdr (cdr prev-ptr))) (if (>= woman-buffer-number (length woman-buffer-alist)) commit 8c01e88921f00e5b5807541c8d3a8872912e79c5 Author: Paul Eggert Date: Fri Aug 21 05:02:51 2015 -0700 Follow user preference in calendar diagnostics Respect text-quoting-style preference in diagnostic formats by using curved quotes (which are translated as per text-quoting-style) instead of grave accent and apostrophe (which are not). * lisp/calendar/appt.el (appt-display-message): * lisp/calendar/diary-lib.el (diary-check-diary-file) (diary-mail-entries, diary-from-outlook): * lisp/calendar/icalendar.el (icalendar-export-region) (icalendar--convert-float-to-ical) (icalendar--convert-date-to-ical) (icalendar--convert-ical-to-diary) (icalendar--convert-recurring-to-diary) (icalendar--add-diary-entry): * lisp/calendar/time-date.el (format-seconds): * lisp/calendar/timeclock.el (timeclock-mode-line-display) (timeclock-make-hours-explicit): * lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category) (todo-item-mark, todo-check-format) (todo-insert-item--next-param, todo-edit-item--next-key) (todo-mode): Use curved quotes in diagnostic format strings. * lisp/calendar/icalendar.el (icalendar-import-format-sample): * test/automated/icalendar-tests.el (icalendar--import-format-sample): Just use straight quoting for simple test case. diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el index d5d8a40..426bb28 100644 --- a/lisp/calendar/appt.el +++ b/lisp/calendar/appt.el @@ -239,7 +239,7 @@ also calls `beep' for an audible reminder." (wrong-type-argument (if (not (listp mins)) (signal (car err) (cdr err)) - (message "Argtype error in `appt-disp-window-function' - \ + (message "Argtype error in ‘appt-disp-window-function’ - \ update it for multiple appts?") ;; Fallback to just displaying the first appt, as we used to. (funcall appt-disp-window-function diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 1cb13e4..dd06819 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -484,8 +484,8 @@ If so, return the expanded file name, otherwise signal an error." (if (and diary-file (file-exists-p diary-file)) (if (file-readable-p diary-file) diary-file - (error "Diary file `%s' is not readable" diary-file)) - (error "Diary file `%s' does not exist" diary-file))) + (error "Diary file ‘%s’ is not readable" diary-file)) + (error "Diary file ‘%s’ does not exist" diary-file))) ;;;###autoload (defun diary (&optional arg) @@ -1197,7 +1197,7 @@ ensure that all relevant variables are set. " (interactive "P") (if (string-equal diary-mail-addr "") - (user-error "You must set `diary-mail-addr' to use this command") + (user-error "You must set ‘diary-mail-addr’ to use this command") (let ((diary-display-function 'diary-fancy-display)) (diary-list-entries (calendar-current-date) (or ndays diary-mail-days))) (compose-mail diary-mail-addr @@ -2527,7 +2527,7 @@ entry is found the user is asked to confirm its addition." #'diary-from-outlook-rmail) ((memq major-mode '(gnus-summary-mode gnus-article-mode)) #'diary-from-outlook-gnus) - (t (error "Don't know how to snarf in `%s'" major-mode))))) + (t (error "Don't know how to snarf in ‘%s’" major-mode))))) (funcall func noconfirm))) (provide 'diary-lib) diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index 734462d..bced4e2 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el @@ -1118,7 +1118,7 @@ FExport diary data into iCalendar file: ") (setq found-error t) (save-current-buffer (set-buffer (get-buffer-create "*icalendar-errors*")) - (insert (format "Error in line %d -- %s: `%s'\n" + (insert (format "Error in line %d -- %s: ‘%s’\n" (count-lines (point-min) (point)) error-val entry-main)))))) @@ -1741,7 +1741,7 @@ entries. ENTRY-MAIN is the first line of the diary entry." (when day (progn (icalendar--dmsg "diary-float %s" entry-main) - (error "Don't know if or how to implement day in `diary-float'"))) + (error "Don't know if or how to implement day in ‘diary-float’"))) (cons (concat ;;Start today (yes this is an arbitrary choice): @@ -1788,7 +1788,7 @@ entries. ENTRY-MAIN is the first line of the diary entry." entry-main) (progn (icalendar--dmsg "diary-date %s" entry-main) - (error "`diary-date' is not supported yet")) + (error "‘diary-date’ is not supported yet")) ;; no match nil)) @@ -2104,7 +2104,7 @@ written into the buffer `*icalendar-errors*'." (rrule (icalendar--get-event-property e 'RRULE)) (rdate (icalendar--get-event-property e 'RDATE)) (duration (icalendar--get-event-property e 'DURATION))) - (icalendar--dmsg "%s: `%s'" start-d summary) + (icalendar--dmsg "%s: ‘%s’" start-d summary) ;; check whether start-time is missing (if (and dtstart (string= @@ -2282,7 +2282,7 @@ END-T is the event's end time in diary format." interval)))) ) (t - (message "Cannot handle COUNT attribute for `%s' events." + (message "Cannot handle COUNT attribute for ‘%s’ events." frequency))) (setq until-conv (icalendar--datetime-to-diary-date until)) (setq until-1-conv (icalendar--datetime-to-diary-date until-1)) @@ -2473,7 +2473,7 @@ SUMMARY is not nil it must be a string that gives the summary of the entry. In this case the user will be asked whether he wants to insert the entry." (when (or (not summary) - (y-or-n-p (format "Add appointment for `%s' to diary? " + (y-or-n-p (format "Add appointment for ‘%s’ to diary? " summary))) (when summary (setq non-marking @@ -2500,8 +2500,8 @@ the entry." ;; ====================================================================== (defun icalendar-import-format-sample (event) "Example function for formatting an iCalendar EVENT." - (format (concat "SUMMARY=`%s' DESCRIPTION=`%s' LOCATION=`%s' ORGANIZER=`%s' " - "STATUS=`%s' URL=`%s' CLASS=`%s'") + (format (concat "SUMMARY='%s' DESCRIPTION='%s' LOCATION='%s' ORGANIZER='%s' " + "STATUS='%s' URL='%s' CLASS='%s'") (or (icalendar--get-event-property event 'SUMMARY) "") (or (icalendar--get-event-property event 'DESCRIPTION) "") (or (icalendar--get-event-property event 'LOCATION) "") diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index bb7e97e..c13ef97 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -377,9 +377,9 @@ This function does not work for SECONDS greater than `most-positive-fixnum'." spec (match-string 1 string)) (unless (string-equal spec "%") (or (setq match (assoc (downcase spec) units)) - (error "Bad format specifier: `%s'" spec)) + (error "Bad format specifier: ‘%s’" spec)) (if (assoc (downcase spec) usedunits) - (error "Multiple instances of specifier: `%s'" spec)) + (error "Multiple instances of specifier: ‘%s’" spec)) (if (string-equal (car match) "z") (setq zeroflag t) (unless larger diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index cd79781..e9a1166 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -305,8 +305,8 @@ display (non-nil means on)." ;; on calling this function. (if display-time-mode (timeclock-update-mode-line) - (message "Activate `display-time-mode' or turn off \ -`timeclock-use-display-time' to see timeclock information")) + (message "Activate ‘display-time-mode’ or turn off \ +‘timeclock-use-display-time’ to see timeclock information")) (add-hook 'display-time-hook 'timeclock-update-mode-line)) (setq timeclock-update-timer (run-at-time nil 60 'timeclock-update-mode-line)))) @@ -575,7 +575,7 @@ relative only to the time worked today, and not to past time." OLD-DEFAULT hours are set for every day that has no number indicated." (interactive "P") (if old-default (setq old-default (prefix-numeric-value old-default)) - (error "`timelog-make-hours-explicit' requires an explicit argument")) + (error "‘timelog-make-hours-explicit’ requires an explicit argument")) (let ((extant-timelog (find-buffer-visiting timeclock-file)) current-date) (with-current-buffer (find-file-noselect timeclock-file t) @@ -589,7 +589,7 @@ OLD-DEFAULT hours are set for every day that has no number indicated." (unless (looking-at (concat "^\\([bhioO]\\) \\([0-9]+/[0-9]+/[0-9]+\\) " "\\([0-9]+:[0-9]+:[0-9]+\\)")) - (error "Can't parse `%s'" timeclock-file)) + (error "Can't parse ‘%s’" timeclock-file)) (let ((this-date (match-string 2))) (unless (or (and current-date (string= this-date current-date)) diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index 962f425..e780e4e 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -237,7 +237,7 @@ The final element is \"*\", indicating an unspecified month.") (when (string= (widget-value widget) todo-item-mark) (widget-put widget :error - "Invalid value: must be distinct from `todo-item-mark'") + "Invalid value: must be distinct from ‘todo-item-mark’") widget))) :initialize 'custom-initialize-default :set 'todo-reset-prefix @@ -1346,7 +1346,7 @@ todo or done items." "the archived category will remain\n" "after deleting the todo category. " "Do you still want to delete it\n" - "(see `todo-skip-archived-categories' " + "(see ‘todo-skip-archived-categories’ " "for another option)? "))) (t (todo-y-or-n-p (concat "Permanently remove category \"" cat @@ -1694,7 +1694,7 @@ only when no items are marked." (when (string= (widget-value widget) todo-prefix) (widget-put widget :error - "Invalid value: must be distinct from `todo-prefix'") + "Invalid value: must be distinct from ‘todo-prefix’") widget))) :set (lambda (symbol value) (custom-set-default symbol (propertize value 'face 'todo-mark))) @@ -5034,7 +5034,7 @@ but the categories sexp differs from the current value of ;; Warn user if categories sexp has changed. (unless (string= ssexp cats) (message (concat "The sexp at the beginning of the file differs " - "from the value of `todo-categories.\n" + "from the value of ‘todo-categories’.\n" "If the sexp is wrong, you can fix it with " "M-x todo-repair-categories-sexp,\n" "but note this reverts any changes you have " @@ -5531,7 +5531,7 @@ already entered and those still available." (todo-insert-item--this-key) todo-insert-item--argsleft))))))))) (setq todo-insert-item--argsleft todo-insert-item--newargsleft)) - (when prompt (message "Press a key (so far `%s'): %s" + (when prompt (message "Press a key (so far ‘%s’): %s" todo-insert-item--keys-so-far prompt)) (set-transient-map map) (setq todo-insert-item--argsleft argsleft))) @@ -5585,7 +5585,7 @@ already entered and those still available." (`delete (todo-edit-item--text 'comment-delete)) (`diary (todo-edit-item--diary-inclusion)) (`nonmarking (todo-edit-item--diary-inclusion 'nonmarking)) - (`date (let ((todo-edit-item--prompt "Press a key (so far `e d'): ")) + (`date (let ((todo-edit-item--prompt "Press a key (so far ‘e d’): ")) (todo-edit-item--next-key todo-edit-item--date-param-key-alist arg))) (`full (progn (todo-edit-item--header 'date) @@ -6598,7 +6598,7 @@ Added to `window-configuration-change-hook' in Todo mode." \\{todo-mode-map}" (if (called-interactively-p 'any) - (message "Type `M-x todo-show' to enter Todo mode") + (message "Type ‘M-x todo-show’ to enter Todo mode") (todo-modes-set-1) (todo-modes-set-2) (todo-modes-set-3) diff --git a/test/automated/icalendar-tests.el b/test/automated/icalendar-tests.el index 3614c7a..c83044c 100644 --- a/test/automated/icalendar-tests.el +++ b/test/automated/icalendar-tests.el @@ -391,8 +391,8 @@ END:VTIMEZONE (ert-deftest icalendar--import-format-sample () "Test method for `icalendar-import-format-sample'." - (should (string= (concat "SUMMARY=`a' DESCRIPTION=`b' LOCATION=`c' " - "ORGANIZER=`d' STATUS=`' URL=`' CLASS=`'") + (should (string= (concat "SUMMARY='a' DESCRIPTION='b' LOCATION='c' " + "ORGANIZER='d' STATUS='' URL='' CLASS=''") (icalendar-import-format-sample (icalendar-tests--get-ical-event "BEGIN:VEVENT DTSTAMP:20030509T043439Z commit 21c2b4ac52e2b1eb971e6f1e039db9108949e0eb Author: Michael Albinus Date: Fri Aug 21 11:40:38 2015 +0200 * src/gfilenotify.c (Fgfile_add_watch): Handle errors from g_file_monitor. diff --git a/src/gfilenotify.c b/src/gfilenotify.c index 5488fa3..5c6ebe6 100644 --- a/src/gfilenotify.c +++ b/src/gfilenotify.c @@ -150,6 +150,7 @@ will be reported only in case of the `moved' event. */) GFile *gfile; GFileMonitor *monitor; GFileMonitorFlags gflags = G_FILE_MONITOR_NONE; + GError *gerror = NULL; /* Check parameters. */ CHECK_STRING (file); @@ -172,7 +173,14 @@ will be reported only in case of the `moved' event. */) gflags |= G_FILE_MONITOR_SEND_MOVED; /* Enable watch. */ - monitor = g_file_monitor (gfile, gflags, NULL, NULL); + monitor = g_file_monitor (gfile, gflags, NULL, &gerror); + if (gerror) + { + char msg[1024]; + strcpy (msg, gerror->message); + g_error_free (gerror); + xsignal1 (Qfile_notify_error, build_string (msg)); + } if (! monitor) xsignal2 (Qfile_notify_error, build_string ("Cannot watch file"), file); commit b77bdb50ad44888d0544479f5bf74635ac9b06c1 Author: Martin Rudalics Date: Fri Aug 21 11:37:27 2015 +0200 In frames.texi use "minibuffer-less frame" instead of "non-minibuffer frame" * doc/lispref/frames.texi (Frame Layout): Use "minibuffer-less frame" instead of "non-minibuffer frame". diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index aea5204..91c512c 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -590,12 +590,12 @@ inner frame. Its edges are called the @dfn{inner edges} of the frame. The @dfn{inner width} and @dfn{inner height} specify the size of the rectangle. -@cindex non-minibuffer frame +@cindex minibuffer-less frame @cindex minibuffer-only frame As a rule, the inner frame is subdivided into the frame's root window (@pxref{Windows and Frames}) and the frame's minibuffer window (@pxref{Minibuffer Windows}). There are two notable exceptions to this -rule: A @dfn{non-minibuffer frame} contains a root window only and does +rule: A @dfn{minibuffer-less frame} contains a root window only and does not contain a minibuffer window. A @dfn{minibuffer-only frame} contains only a minibuffer window which also serves as that frame's root window. See @ref{Initial Parameters} for how to create such frame commit e656b511a882410d3e0925c8e4385022649b71cc Author: Martin Rudalics Date: Fri Aug 21 11:14:06 2015 +0200 Fix frame geometry related text * doc/lispref/frames.texi (Frame Layout): Rename `x-frame-geometry' to `frame-geometry'. * doc/lispref/frames.texi (Mouse Position): * doc/lispref/windows.texi (Coordinates and Windows): Use `set-mouse-absolute-pixel-position' instead of `x-set-mouse-absolute-pixel-position'. diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 28e6fbd..aea5204 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -623,7 +623,7 @@ visible. For a frame on a graphical terminal the following function returns the sizes of the areas described above: -@defun x-frame-geometry &optional frame +@defun frame-geometry &optional frame This function returns geometric attributes of @var{frame}. The return value is an association list of the attributes listed below. All coordinate, height and width values are integers counting pixels. @@ -2370,13 +2370,13 @@ The return value is not significant. On a graphical terminal the following two functions allow to retrieve and set the absolute position of the mouse cursor. -@defun x-mouse-absolute-pixel-position +@defun mouse-absolute-pixel-position This function returns a cons cell (@var{x} . @var{y}) of the coordinates of the mouse cursor position in pixels, relative to a position (0, 0) of the selected frame's display. @end defun -@defun x-set-mouse-absolute-pixel-position x y +@defun set-mouse-absolute-pixel-position x y This function moves the mouse cursor to the position (@var{x}, @var{y}). The coordinates @var{x} and @var{y} are interpreted in pixels relative to a position (0, 0) of the selected frame's display. diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index b55a139..f809678 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -3866,7 +3866,7 @@ relative to an origin at (0, 0) of the display of @var{window}'s frame. Calling @code{(window-absolute-body-pixel-edges window)} is equivalent to calling @code{(window-edges window t t t)}, see above. -Combined with @code{x-set-mouse-absolute-pixel-position}, this function +Combined with @code{set-mouse-absolute-pixel-position}, this function can be used to move the mouse pointer to an arbitrary buffer position visible in some window: @@ -3907,7 +3907,7 @@ point in the selected window, it's sufficient to write: @example @group (let ((position (window-absolute-pixel-position))) - (x-set-mouse-absolute-pixel-position + (set-mouse-absolute-pixel-position (car position) (cdr position))) @end group @end example diff --git a/etc/NEWS b/etc/NEWS index 3a654c8..17a6c3a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1123,12 +1123,12 @@ Horizontal scroll bars are turned off by default. `scroll-bar-height'. +++ -** New functions `x-frame-geometry' and `frame-edges' give access to a +** New functions `frame-geometry' and `frame-edges' give access to a frame's geometry. +++ -** New functions `x-mouse-absolute-pixel-position' and -`x-set-mouse-absolute-pixel-position' get/set screen coordinates of the +** New functions `mouse-absolute-pixel-position' and +`set-mouse-absolute-pixel-position' get/set screen coordinates of the mouse cursor. +++ commit df9b29eda0ba1ec7f751dfd538eefbfe56b2c043 Author: Martin Rudalics Date: Fri Aug 21 11:00:59 2015 +0200 Sanitize frame geometry related functions * src/nsfns.m (Fx_frame_geometry): Rename to Fns_frame_geometry. (Fx_frame_edges): Rename to Fns_frame_edges. * src/w32fns.c (Fx_frame_geometry): Rename to Fw32_frame_geometry. (Fx_frame_edges): Rename to Fw32_frame_edges. (Fx_mouse_absolute_pixel_position): Rename to Fw32_mouse_absolute_pixel_position. (Fx_set_mouse_absolute_pixel_position): Rename to Fw32_set_mouse_absolute_pixel_position. * lisp/frame.el (x-frame-geometry, w32-frame-geometry) (ns-frame-geometry, x-frame-edges, w32-frame-edges) (ns-frame-edges, w32-mouse-absolute-pixel-position) (x-mouse-absolute-pixel-position) (w32-set-mouse-absolute-pixel-position) (x-set-mouse-absolute-pixel-position): Declare. (frame-geometry, mouse-absolute-pixel-position) (set-mouse-absolute-pixel-position): New functions. (frame-edges): Rewrite in terms of x-/w32-/ns-frame-edges. diff --git a/lisp/frame.el b/lisp/frame.el index 391f239..3abb72c 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1312,6 +1312,80 @@ live frame and defaults to the selected one." (setq vertical default-frame-scroll-bars)) (cons vertical (and horizontal 'bottom)))) +(declare-function x-frame-geometry "xfns.c" (&optional frame)) +(declare-function w32-frame-geometry "w32fns.c" (&optional frame)) +(declare-function ns-frame-geometry "nsfns.m" (&optional frame)) + +(defun frame-geometry (&optional frame) + "Return geometric attributes of FRAME. +FRAME must be a live frame and defaults to the selected one. The return +value is an association list of the attributes listed below. All height +and width values are in pixels. + +`outer-position' is a cons of the outer left and top edges of FRAME + relative to the origin - the position (0, 0) - of FRAME's display. + +`outer-size' is a cons of the outer width and height of FRAME. The + outer size includes the title bar and the external borders as well as + any menu and/or tool bar of frame. + +`external-border-size' is a cons of the horizontal and vertical width of + FRAME's external borders as supplied by the window manager. + +`title-bar-size' is a cons of the width and height of the title bar of + FRAME as supplied by the window manager. If both of them are zero, + FRAME has no title bar. If only the width is zero, Emacs was not + able to retrieve the width information. + +`menu-bar-external', if non-nil, means the menu bar is external (never + included in the inner edges of FRAME). + +`menu-bar-size' is a cons of the width and height of the menu bar of + FRAME. + +`tool-bar-external', if non-nil, means the tool bar is external (never + included in the inner edges of FRAME). + +`tool-bar-position' tells on which side the tool bar on FRAME is and can + be one of `left', `top', `right' or `bottom'. If this is nil, FRAME + has no tool bar. + +`tool-bar-size' is a cons of the width and height of the tool bar of + FRAME. + +`internal-border-width' is the width of the internal border of + FRAME." + (let* ((frame (window-normalize-frame frame)) + (frame-type (framep-on-display frame))) + (cond + ((eq frame-type 'x) + (x-frame-geometry frame)) + ((eq frame-type 'w32) + (w32-frame-geometry frame)) + ((eq frame-type 'ns) + (ns-frame-geometry frame)) + (t + (list + '(outer-position 0 . 0) + (cons 'outer-size (cons (frame-width frame) (frame-height frame))) + '(external-border-size 0 . 0) + '(title-bar-size 0 . 0) + '(menu-bar-external . nil) + (let ((menu-bar-lines (frame-parameter frame 'menu-bar-lines))) + (cons 'menu-bar-size + (if menu-bar-lines + (cons (frame-width frame) 1) + 1 0))) + '(tool-bar-external . nil) + '(tool-bar-position . nil) + '(tool-bar-size 0 . 0) + (cons 'internal-border-width + (frame-parameter frame 'internal-border-width))))))) + +(declare-function x-frame-edges "xfns.c" (&optional frame type)) +(declare-function w32-frame-edges "w32fns.c" (&optional frame type)) +(declare-function ns-frame-edges "nsfns.m" (&optional frame type)) + (defun frame-edges (&optional frame type) "Return coordinates of FRAME's edges. FRAME must be a live frame and defaults to the selected one. The @@ -1325,10 +1399,48 @@ Optional argument TYPE specifies the type of the edges. TYPE `native-edges' (or nil) means to return the native edges of FRAME. TYPE `inner-edges' means to return the inner edges of FRAME." - (let ((frame (window-normalize-frame frame))) - (if (display-graphic-p (frame-parameter nil 'display)) - (x-frame-edges frame (or type 'native-edges)) - (list 0 0 (frame-width frame) (frame-height frame))))) + (let* ((frame (window-normalize-frame frame)) + (frame-type (framep-on-display frame))) + (cond + ((eq frame-type 'x) + (x-frame-edges frame type)) + ((eq frame-type 'w32) + (w32-frame-edges frame type)) + ((eq frame-type 'ns) + (ns-frame-edges frame type)) + (t + (list 0 0 (frame-width frame) (frame-height frame)))))) + +(declare-function w32-mouse-absolute-pixel-position "w32fns.c") +(declare-function x-mouse-absolute-pixel-position "xfns.c") + +(defun mouse-absolute-pixel-position () + "Return absolute position of mouse cursor in pixels. +The position is returned as a cons cell (X . Y) of the +coordinates of the mouse cursor position in pixels relative to a +position (0, 0) of the selected frame's terminal." + (let ((frame-type (framep-on-display))) + (cond + ((eq frame-type 'x) + (x-mouse-absolute-pixel-position)) + ((eq frame-type 'w32) + (w32-mouse-absolute-pixel-position)) + (t + (cons 0 0))))) + +(declare-function w32-set-mouse-absolute-pixel-position "w32fns.c" (x y)) +(declare-function x-set-mouse-absolute-pixel-position "xfns.c" (x y)) + +(defun set-mouse-absolute-pixel-position (x y) + "Move mouse pointer to absolute pixel position (X, Y). +The coordinates X and Y are interpreted in pixels relative to a +position (0, 0) of the selected frame's terminal." + (let ((frame-type (framep-on-display))) + (cond + ((eq frame-type 'x) + (x-set-mouse-absolute-pixel-position x y)) + ((eq frame-type 'w32) + (w32-set-mouse-absolute-pixel-position x y))))) (defun frame-monitor-attributes (&optional frame) "Return the attributes of the physical monitor dominating FRAME. diff --git a/src/nsfns.m b/src/nsfns.m index e945360..d317d48 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -2906,7 +2906,7 @@ frame_geometry (Lisp_Object frame, Lisp_Object attribute) make_number (internal_border_width))); } -DEFUN ("x-frame-geometry", Fx_frame_geometry, Sx_frame_geometry, 0, 1, 0, +DEFUN ("ns-frame-geometry", Fns_frame_geometry, Sns_frame_geometry, 0, 1, 0, doc: /* Return geometric attributes of FRAME. FRAME must be a live frame and defaults to the selected one. The return value is an association list of the attributes listed below. All height @@ -2950,7 +2950,7 @@ and width values are in pixels. return frame_geometry (frame, Qnil); } -DEFUN ("x-frame-edges", Fx_frame_edges, Sx_frame_edges, 0, 2, 0, +DEFUN ("ns-frame-edges", Fns_frame_edges, Sns_frame_edges, 0, 2, 0, doc: /* Return edge coordinates of FRAME. FRAME must be a live frame and defaults to the selected one. The return value is a list of the form (LEFT, TOP, RIGHT, BOTTOM). All values are @@ -3156,8 +3156,8 @@ be used as the image of the icon representing the frame. */); defsubr (&Sx_display_pixel_width); defsubr (&Sx_display_pixel_height); defsubr (&Sns_display_monitor_attributes_list); - defsubr (&Sx_frame_geometry); - defsubr (&Sx_frame_edges); + defsubr (&Sns_frame_geometry); + defsubr (&Sns_frame_edges); defsubr (&Sx_display_mm_width); defsubr (&Sx_display_mm_height); defsubr (&Sx_display_screens); diff --git a/src/w32fns.c b/src/w32fns.c index a47f3f9..f16bf76 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -8002,7 +8002,7 @@ This is a direct interface to the Windows API FindWindow function. */) return Qt; } -DEFUN ("x-frame-geometry", Fx_frame_geometry, Sx_frame_geometry, 0, 1, 0, +DEFUN ("w32-frame-geometry", Fw32_frame_geometry, Sw32_frame_geometry, 0, 1, 0, doc: /* Return geometric attributes of FRAME. FRAME must be a live frame and defaults to the selected one. The return value is an association list of the attributes listed below. All height @@ -8138,7 +8138,7 @@ and width values are in pixels. make_number (internal_border_width))); } -DEFUN ("x-frame-edges", Fx_frame_edges, Sx_frame_edges, 0, 2, 0, +DEFUN ("w32-frame-edges", Fw32_frame_edges, Sw32_frame_edges, 0, 2, 0, doc: /* Return edge coordinates of FRAME. FRAME must be a live frame and defaults to the selected one. The return value is a list of the form (LEFT, TOP, RIGHT, BOTTOM). All values are @@ -8213,8 +8213,8 @@ menu bar or tool bar of FRAME. */) } } -DEFUN ("x-mouse-absolute-pixel-position", Fx_mouse_absolute_pixel_position, - Sx_mouse_absolute_pixel_position, 0, 0, 0, +DEFUN ("w32-mouse-absolute-pixel-position", Fw32_mouse_absolute_pixel_position, + Sw32_mouse_absolute_pixel_position, 0, 0, 0, doc: /* Return absolute position of mouse cursor in pixels. The position is returned as a cons cell (X . Y) of the coordinates of the mouse cursor position in pixels relative to a position (0, 0) of the @@ -8230,8 +8230,8 @@ selected frame's display. */) return Fcons (make_number (pt.x), make_number (pt.y)); } -DEFUN ("x-set-mouse-absolute-pixel-position", Fx_set_mouse_absolute_pixel_position, - Sx_set_mouse_absolute_pixel_position, 2, 2, 0, +DEFUN ("w32-set-mouse-absolute-pixel-position", Fw32_set_mouse_absolute_pixel_position, + Sw32_set_mouse_absolute_pixel_position, 2, 2, 0, doc: /* Move mouse pointer to absolute pixel position (X, Y). The coordinates X and Y are interpreted in pixels relative to a position (0, 0) of the selected frame's display. */) @@ -9280,10 +9280,10 @@ This variable has effect only on Windows Vista and later. */); defsubr (&Sx_open_connection); defsubr (&Sx_close_connection); defsubr (&Sx_display_list); - defsubr (&Sx_frame_geometry); - defsubr (&Sx_frame_edges); - defsubr (&Sx_mouse_absolute_pixel_position); - defsubr (&Sx_set_mouse_absolute_pixel_position); + defsubr (&Sw32_frame_geometry); + defsubr (&Sw32_frame_edges); + defsubr (&Sw32_mouse_absolute_pixel_position); + defsubr (&Sw32_set_mouse_absolute_pixel_position); defsubr (&Sx_synchronize); /* W32 specific functions */ commit 092e17b1978d804df99fae9436f24c0ea0d7e034 Author: Eli Zaretskii Date: Fri Aug 21 11:46:07 2015 +0300 Fix MinGW64 build broken by latest w32uniscribe.c changes * src/w32uniscribe.c (UNISCRIBE_OPENTYPE): Define to 0x0100, for MinGW64. Reported by Andy Moreton . (Bug#21260) diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index b1056bc..0e4177d 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -25,6 +25,15 @@ along with GNU Emacs. If not, see . */ of calling non-existent functions. */ #undef _WIN32_WINNT #define _WIN32_WINNT 0x500 +/* MinGW64 w32api headers by default define OPENTYPE_TAG typedef only + if _WIN32_WINNT >= 0x0600; defining UNISCRIBE_OPENTYPE as below + makes that typedef visible even for lower values of _WIN32_WINNT. + Mingw.org's w32api headers don't use UNISCRIBE_OPENTYPE at all, and + the OPENTYPE_TAG typedef is defined unconditionally there. */ +#ifdef UNISCRIBE_OPENTYPE +# undef UNISCRIBE_OPENTYPE +#endif +#define UNISCRIBE_OPENTYPE 0x0100 #include #include