]> git.eshelyaron.com Git - emacs.git/commitdiff
Make functions invocation-directory and invocation-name obsolete
authorGlenn Morris <rgm@stanford.edu>
Tue, 12 Dec 2017 08:00:33 +0000 (00:00 -0800)
committerGlenn Morris <rgm@stanford.edu>
Tue, 12 Dec 2017 08:00:33 +0000 (00:00 -0800)
* lisp/subr.el (invocation-directory, invocation-name):
Mark the function versions as obsolete.  (Bug#10476)
* lisp/startup.el (tty-handle-args):
* lisp/term/common-win.el (x-handle-xrm-switch, x-handle-name-switch):
* lisp/term/ns-win.el (top-level):
* lisp/term/pc-win.el (top-level):
* lisp/term/w32-win.el (window-system-initialization):
* lisp/term/x-win.el (top-level, x-handle-parent-id)
(x-handle-smid, window-system-initialization):
* test/lisp/htmlfontify-tests.el (htmlfontify-bug25468):
Use invocation-directory and invocation-name as variables.

lisp/startup.el
lisp/subr.el
lisp/term/common-win.el
lisp/term/ns-win.el
lisp/term/pc-win.el
lisp/term/w32-win.el
lisp/term/x-win.el
test/lisp/htmlfontify-tests.el

index a39c8f0fe76004e36cad48731313ecb142dcfc09..4575f1f94d4c9b7eb80805af8f46ec8d989625c3 100644 (file)
@@ -781,7 +781,7 @@ to prepare for opening the first frame (e.g. open a connection to an X server)."
                                argval
                              (let ((case-fold-search t)
                                    i)
-                               (setq argval (invocation-name))
+                               (setq argval (copy-sequence invocation-name))
 
                                ;; Change any . or * characters in name to
                                ;; hyphens, so as to emulate behavior on X.
index 7ec727ef19cdd04d358f46b1d5f6608ea4764230..bf51c934cff0794d767bed562c05f00c72e2b3ff 100644 (file)
@@ -1438,6 +1438,10 @@ be a list of the form returned by `event-start' and `event-end'."
 (make-obsolete 'forward-point "use (+ (point) N) instead." "23.1")
 (make-obsolete 'buffer-has-markers-at nil "24.3")
 
+(make-obsolete 'invocation-directory "use the variable of the same name."
+               "27.1")
+(make-obsolete 'invocation-name "use the variable of the same name." "27.1")
+
 ;; bug#23850
 (make-obsolete 'string-to-unibyte   "use `encode-coding-string'." "26.1")
 (make-obsolete 'string-as-unibyte   "use `encode-coding-string'." "26.1")
index 2cf1e84768e3f162eed42185c6c7a6320cbef8df..691009e77573fd60bd01908b59f5a9199e7a7b31 100644 (file)
 ;; Handle the -xrm option.
 (defun x-handle-xrm-switch (switch)
   (unless (consp x-invocation-args)
-    (error "%s: missing argument to `%s' option" (invocation-name) switch))
+    (error "%s: missing argument to `%s' option" invocation-name switch))
   (setq x-command-line-resources
        (if (null x-command-line-resources)
            (pop x-invocation-args)
 ;; the initial frame, too.
 (defun x-handle-name-switch (switch)
   (or (consp x-invocation-args)
-      (error "%s: missing argument to `%s' option" (invocation-name) switch))
+      (error "%s: missing argument to `%s' option" invocation-name switch))
   (setq x-resource-name (pop x-invocation-args)
        initial-frame-alist (cons (cons 'name x-resource-name)
                                  initial-frame-alist)))
index e895d09bb4fee69a6066df0c7a917a9ecc6123eb..82041a665d5a605d0c8b49dbd2a83eff6a645060 100644 (file)
@@ -42,7 +42,7 @@
 (eval-when-compile (require 'cl-lib))
 (or (featurep 'ns)
     (error "%s: Loading ns-win.el but not compiled for GNUstep/macOS"
-           (invocation-name)))
+           invocation-name))
 
 ;; Documentation-purposes only: actually loaded in loadup.el.
 (require 'frame)
index 0355350da72ced175552d5868dce5b8650736037..0d1c843e8933486b8cceb2506068f90754e20103 100644 (file)
@@ -38,7 +38,7 @@
 
 (if (not (fboundp 'msdos-remember-default-colors))
     (error "%s: Loading pc-win.el but not compiled for MS-DOS"
-          (invocation-name)))
+          invocation-name))
 
 (declare-function msdos-remember-default-colors "msdos.c")
 (declare-function w16-set-clipboard-data "w16select.c")
index 1db90aec984b3e47547dbf08b61799549a9a56e4..737bf7fb5df58c32b74e55aad50ba6c6350c264c 100644 (file)
@@ -66,7 +66,7 @@
 ;; ../startup.el.
 
 ;; (if (not (eq window-system 'w32))
-;;     (error "%s: Loading w32-win.el but not compiled for w32" (invocation-name)))
+;;     (error "%s: Loading w32-win.el but not compiled for w32" invocation-name))
 
 (eval-when-compile (require 'cl-lib))
 (require 'frame)
@@ -310,7 +310,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
       (setq x-resource-name
             ;; Change any . or * characters in x-resource-name to hyphens,
             ;; so as not to choke when we use it in X resource queries.
-            (replace-regexp-in-string "[.*]" "-" (invocation-name))))
+            (replace-regexp-in-string "[.*]" "-" invocation-name)))
 
   (x-open-connection "w32" x-command-line-resources
                      ;; Exit with a fatal error if this fails and we
index e7b1e08b038fd8cd565f7e5f061c89f6d976522d..52ab746112acc6fd22499dd6efb1005e0aef3101 100644 (file)
@@ -69,7 +69,7 @@
 (eval-when-compile (require 'cl-lib))
 
 (if (not (fboundp 'x-create-frame))
-    (error "%s: Loading x-win.el but not compiled for X" (invocation-name)))
+    (error "%s: Loading x-win.el but not compiled for X" invocation-name))
 
 (require 'term/common-win)
 (require 'frame)
@@ -93,7 +93,7 @@
 ;; Handle the --parent-id option.
 (defun x-handle-parent-id (switch)
   (or (consp x-invocation-args)
-      (error "%s: missing argument to `%s' option" (invocation-name) switch))
+      (error "%s: missing argument to `%s' option" invocation-name switch))
   (setq initial-frame-alist (cons
                              (cons 'parent-id
                                    (string-to-number (car x-invocation-args)))
 ;; to give us back our session id we had on the previous run.
 (defun x-handle-smid (switch)
   (or (consp x-invocation-args)
-      (error "%s: missing argument to `%s' option" (invocation-name) switch))
+      (error "%s: missing argument to `%s' option" invocation-name switch))
   (setq x-session-previous-id (car x-invocation-args)
        x-invocation-args (cdr x-invocation-args)))
 
@@ -1205,7 +1205,7 @@ This returns an error if any Emacs frames are X frames."
   ;; Make sure we have a valid resource name.
   (or (stringp x-resource-name)
       (let (i)
-       (setq x-resource-name (invocation-name))
+       (setq x-resource-name (copy-sequence invocation-name))
 
        ;; Change any . or * characters in x-resource-name to hyphens,
        ;; so as not to choke when we use it in X resource queries.
index 0ad775d74a0c4c063b7a9b38c4f7263915c81a01..614f2a18d8c564537b3da6712db57dae08fa9ac6 100644 (file)
@@ -36,7 +36,7 @@ available (Bug#25468)."
   (should (equal (let ((process-environment
                         (cons "SHELL=/does/not/exist" process-environment)))
                    (call-process
-                    (expand-file-name (invocation-name) (invocation-directory))
+                    (expand-file-name invocation-name invocation-directory)
                     nil nil nil
                     "--quick" "--batch"
                     (concat "--load=" (locate-library "htmlfontify"))))