GNU bug report logs - #30149
[PATCH] remove some obsolete functions

Previous Next

Package: auctex;

Reported by: Alex Branham <alex.branham <at> gmail.com>

Date: Wed, 17 Jan 2018 19:42:02 UTC

Severity: normal

Tags: patch

Done: Mosè Giordano <mose <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30149 in the body.
You can then email your comments to 30149 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-auctex <at> gnu.org:
bug#30149; Package auctex. (Wed, 17 Jan 2018 19:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Branham <alex.branham <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-auctex <at> gnu.org. (Wed, 17 Jan 2018 19:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alex Branham <alex.branham <at> gmail.com>
To: "" <bug-auctex <at> gnu.org>
Subject: [PATCH] remove some obsolete functions
Date: Wed, 17 Jan 2018 13:41:39 -0600
[Message part 1 (text/plain, inline)]
I noticed that AuCTeX recently dropped support for Emacs older than 24; this patch removes some functions that are obsolete in Emacs 24+

From 82d89c77547d02bdbea900c5136b60d0cc59ce9f Mon Sep 17 00:00:00 2001
From: Alex Branham <branham <at> utexas.edu>
Date: Wed, 17 Jan 2018 13:23:36 -0600
Subject: [PATCH] Remove some obsolete functions

Now that AuCTeX requires GNU Emacs 24.1 or greater, we can remove some
functions that are obsolete in Emacs < 24.1
---
 font-latex.el |  2 +-
 preview.el    |  2 +-
 tex-buf.el    |  4 ++--
 tex.el        | 10 ++++------
 texmathp.el   |  2 +-
 5 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/font-latex.el b/font-latex.el
index c3dda00d..894a380c 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1048,7 +1048,7 @@ have changed."
      ((not char) 'font-lock-comment-face)
      ((eq char ?$) 'font-latex-math-face)
      (t
-      (when (char-valid-p char)
+      (when (characterp char)
 	;; This is a \verb?...? construct.  Let's find the end and mark it.
 	(save-excursion
 	  (skip-chars-forward (string ?^ char)) ;; Use `end' ?
diff --git a/preview.el b/preview.el
index f9382214..16a71dac 100644
--- a/preview.el
+++ b/preview.el
@@ -713,7 +713,7 @@ Gets the usual PROCESS and STRING parameters, see
 					 preview-gs-command-line)
 					" ") "''\n")
       (setq preview-gs-answer "")
-      (process-kill-without-query process)
+      (set-process-query-on-exit-flag process nil)
       (set-process-sentinel process #'preview-gs-sentinel)
       (set-process-filter process #'preview-gs-filter)
       (process-send-string process preview-gs-init-string)
diff --git a/tex-buf.el b/tex-buf.el
index f458651c..7911779e 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -1285,7 +1285,7 @@ With support for MS-DOS, especially when dviout is used with PC-9801 series."
       (if TeX-after-start-process-function
 	  (funcall TeX-after-start-process-function process))
       (set-process-filter process #'TeX-background-filter)
-      (process-kill-without-query process))))
+      (set-process-query-on-exit-flag process nil))))
 
 (defun TeX-run-silent (name command _file)
   "Start process with second argument."
@@ -1298,7 +1298,7 @@ With support for MS-DOS, especially when dviout is used with PC-9801 series."
 				  TeX-shell-command-option command)))
       (if TeX-after-start-process-function
 	  (funcall TeX-after-start-process-function process))
-      (process-kill-without-query process))))
+      (set-process-query-on-exit-flag process nil))))
 
 (defun TeX-run-interactive (name command file)
   "Run TeX interactively.
diff --git a/tex.el b/tex.el
index 5ee02b4c..d3aeecd2 100644
--- a/tex.el
+++ b/tex.el
@@ -1358,9 +1358,7 @@ viewer."
 	    (cond ((fboundp #'select-frame-set-input-focus)
 		   (select-frame-set-input-focus (selected-frame)))
 		  ((fboundp #'x-focus-frame)
-		   (x-focus-frame (selected-frame)))
-		  ((fboundp #'focus-frame)
-		   (focus-frame (selected-frame))))))
+		   (x-focus-frame (selected-frame))))))
       (error "Couldn't find the %s instance for %s" (capitalize app) uri))))
 
 (defun TeX-atril-sync-view ()
@@ -1904,7 +1902,7 @@ file and LINE to (+ LINE offset-of-region).  Else, return nil."
       ;; Same regexp used in `preview-parse-messages'.  XXX: XEmacs doesn't
       ;; support regexp classes, so we can't use "[:digit:]" here.
       (when (re-search-forward "!offset(\\([---0-9]+\\))" nil t)
-	(let ((offset (string-to-int (match-string-no-properties 1))))
+	(let ((offset (string-to-number (match-string-no-properties 1))))
 	  (when TeX-region-orig-buffer
 	    (list (expand-file-name (buffer-file-name TeX-region-orig-buffer))
 		  (+ line offset) col)))))))
@@ -3413,7 +3411,7 @@ is called with \\[universal-argument]."
 					      TeX-esc)
 				      (TeX-symbol-list-filtered) nil nil nil
 				      'TeX-macro-history TeX-default-macro)))
-  (when (interactive-p)
+  (when (called-interactively-p)
     (setq TeX-default-macro symbol))
   (TeX-parse-macro symbol (cdr-safe (assoc symbol (TeX-symbol-list))))
   (run-hooks 'TeX-after-insert-macro-hook))
@@ -6531,7 +6529,7 @@ NAME may be a package, a command, or a document."
 	    ;; Give up.
 	    (message "No documentation found")))
       ;; Ask the user about the package, command, or document.
-      (when (and (interactive-p)
+      (when (and (called-interactively-p)
 		 (or (not name) (string= name "")))
 	(let ((symbol (thing-at-point 'symbol))
 	      contained completions doc)
diff --git a/texmathp.el b/texmathp.el
index 23e72f8e..a1fb1f48 100644
--- a/texmathp.el
+++ b/texmathp.el
@@ -302,7 +302,7 @@ See the variable `texmathp-tex-commands' about which commands are checked."
 
     ;; Store info, show as message when interactive, and return
     (setq texmathp-why match)
-    (and (interactive-p)
+    (and (called-interactively-p)
 	 (message "math-mode is %s: %s begins at buffer position %d"
 		  (if math-on "on" "off")
 		  (or (car match) "new paragraph")
-- 
2.15.1


[0001-Remove-some-obsolete-functions.patch (text/x-patch, attachment)]

Information forwarded to bug-auctex <at> gnu.org:
bug#30149; Package auctex. (Wed, 17 Jan 2018 19:46:01 GMT) Full text and rfc822 format available.

Message #8 received at 30149 <at> debbugs.gnu.org (full text, mbox):

From: Alex Branham <alex.branham <at> gmail.com>
To: 30149 <at> debbugs.gnu.org
Subject: [Patch] incorrect patch sent
Date: Wed, 17 Jan 2018 13:45:10 -0600
[Message part 1 (text/plain, inline)]
Sorry, this is the correct patch (the other didn't correctly call called-interactively-p)

From 9fca1b1c982b26bd2054f82883d2161d294727d6 Mon Sep 17 00:00:00 2001
From: Alex Branham <branham <at> utexas.edu>
Date: Wed, 17 Jan 2018 13:23:36 -0600
Subject: [PATCH] Remove some obsolete functions

Now that AuCTeX requires GNU Emacs 24.1 or greater, we can remove some
functions that are obsolete in Emacs < 24.1
---
 font-latex.el |  2 +-
 preview.el    |  2 +-
 tex-buf.el    |  4 ++--
 tex.el        | 10 ++++------
 texmathp.el   |  2 +-
 5 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/font-latex.el b/font-latex.el
index c3dda00d..894a380c 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1048,7 +1048,7 @@ have changed."
      ((not char) 'font-lock-comment-face)
      ((eq char ?$) 'font-latex-math-face)
      (t
-      (when (char-valid-p char)
+      (when (characterp char)
 	;; This is a \verb?...? construct.  Let's find the end and mark it.
 	(save-excursion
 	  (skip-chars-forward (string ?^ char)) ;; Use `end' ?
diff --git a/preview.el b/preview.el
index f9382214..16a71dac 100644
--- a/preview.el
+++ b/preview.el
@@ -713,7 +713,7 @@ Gets the usual PROCESS and STRING parameters, see
 					 preview-gs-command-line)
 					" ") "''\n")
       (setq preview-gs-answer "")
-      (process-kill-without-query process)
+      (set-process-query-on-exit-flag process nil)
       (set-process-sentinel process #'preview-gs-sentinel)
       (set-process-filter process #'preview-gs-filter)
       (process-send-string process preview-gs-init-string)
diff --git a/tex-buf.el b/tex-buf.el
index f458651c..7911779e 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -1285,7 +1285,7 @@ With support for MS-DOS, especially when dviout is used with PC-9801 series."
       (if TeX-after-start-process-function
 	  (funcall TeX-after-start-process-function process))
       (set-process-filter process #'TeX-background-filter)
-      (process-kill-without-query process))))
+      (set-process-query-on-exit-flag process nil))))
 
 (defun TeX-run-silent (name command _file)
   "Start process with second argument."
@@ -1298,7 +1298,7 @@ With support for MS-DOS, especially when dviout is used with PC-9801 series."
 				  TeX-shell-command-option command)))
       (if TeX-after-start-process-function
 	  (funcall TeX-after-start-process-function process))
-      (process-kill-without-query process))))
+      (set-process-query-on-exit-flag process nil))))
 
 (defun TeX-run-interactive (name command file)
   "Run TeX interactively.
diff --git a/tex.el b/tex.el
index 5ee02b4c..d9f680b6 100644
--- a/tex.el
+++ b/tex.el
@@ -1358,9 +1358,7 @@ viewer."
 	    (cond ((fboundp #'select-frame-set-input-focus)
 		   (select-frame-set-input-focus (selected-frame)))
 		  ((fboundp #'x-focus-frame)
-		   (x-focus-frame (selected-frame)))
-		  ((fboundp #'focus-frame)
-		   (focus-frame (selected-frame))))))
+		   (x-focus-frame (selected-frame))))))
       (error "Couldn't find the %s instance for %s" (capitalize app) uri))))
 
 (defun TeX-atril-sync-view ()
@@ -1904,7 +1902,7 @@ file and LINE to (+ LINE offset-of-region).  Else, return nil."
       ;; Same regexp used in `preview-parse-messages'.  XXX: XEmacs doesn't
       ;; support regexp classes, so we can't use "[:digit:]" here.
       (when (re-search-forward "!offset(\\([---0-9]+\\))" nil t)
-	(let ((offset (string-to-int (match-string-no-properties 1))))
+	(let ((offset (string-to-number (match-string-no-properties 1))))
 	  (when TeX-region-orig-buffer
 	    (list (expand-file-name (buffer-file-name TeX-region-orig-buffer))
 		  (+ line offset) col)))))))
@@ -3413,7 +3411,7 @@ is called with \\[universal-argument]."
 					      TeX-esc)
 				      (TeX-symbol-list-filtered) nil nil nil
 				      'TeX-macro-history TeX-default-macro)))
-  (when (interactive-p)
+  (when (called-interactively-p 'any)
     (setq TeX-default-macro symbol))
   (TeX-parse-macro symbol (cdr-safe (assoc symbol (TeX-symbol-list))))
   (run-hooks 'TeX-after-insert-macro-hook))
@@ -6531,7 +6529,7 @@ NAME may be a package, a command, or a document."
 	    ;; Give up.
 	    (message "No documentation found")))
       ;; Ask the user about the package, command, or document.
-      (when (and (interactive-p)
+      (when (and (called-interactively-p 'any)
 		 (or (not name) (string= name "")))
 	(let ((symbol (thing-at-point 'symbol))
 	      contained completions doc)
diff --git a/texmathp.el b/texmathp.el
index 23e72f8e..a61b0ce4 100644
--- a/texmathp.el
+++ b/texmathp.el
@@ -302,7 +302,7 @@ See the variable `texmathp-tex-commands' about which commands are checked."
 
     ;; Store info, show as message when interactive, and return
     (setq texmathp-why match)
-    (and (interactive-p)
+    (and (called-interactively-p 'any)
 	 (message "math-mode is %s: %s begins at buffer position %d"
 		  (if math-on "on" "off")
 		  (or (car match) "new paragraph")
-- 
2.15.1


[0001-Remove-some-obsolete-functions.patch (text/x-patch, attachment)]

Information forwarded to bug-auctex <at> gnu.org:
bug#30149; Package auctex. (Wed, 17 Jan 2018 23:14:01 GMT) Full text and rfc822 format available.

Message #11 received at 30149 <at> debbugs.gnu.org (full text, mbox):

From: Mosè Giordano <mose <at> gnu.org>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 30149 <at> debbugs.gnu.org
Subject: Re: bug#30149: [Patch] incorrect patch sent
Date: Thu, 18 Jan 2018 00:12:52 +0100
Hi Alex,

thank you so much for your contribution, much appreciated!  I see that
you already signed copyright papers for Emacs, so there is no need to
do it again for AUCTeX.

I have only one question:

2018-01-17 20:45 GMT+01:00 Alex Branham <alex.branham <at> gmail.com>:
> diff --git a/tex.el b/tex.el
> index 5ee02b4c..d9f680b6 100644
> --- a/tex.el
> +++ b/tex.el
> @@ -1358,9 +1358,7 @@ viewer."
>             (cond ((fboundp #'select-frame-set-input-focus)
>                    (select-frame-set-input-focus (selected-frame)))
>                   ((fboundp #'x-focus-frame)
> -                  (x-focus-frame (selected-frame)))
> -                 ((fboundp #'focus-frame)
> -                  (focus-frame (selected-frame))))))
> +                  (x-focus-frame (selected-frame))))))
>        (error "Couldn't find the %s instance for %s" (capitalize app) uri))))

Why not directly using `select-frame-set-input-focus' instead of the
`cond'?  It should be always available in Emacs >= 24.1, or not?

Bye,
Mosè




Information forwarded to bug-auctex <at> gnu.org:
bug#30149; Package auctex. (Thu, 18 Jan 2018 00:23:02 GMT) Full text and rfc822 format available.

Message #14 received at 30149 <at> debbugs.gnu.org (full text, mbox):

From: Alex Branham <alex.branham <at> gmail.com>
To: Mosè Giordano <mose <at> gnu.org>
Cc: 30149 <at> debbugs.gnu.org
Subject: Re: bug#30149: [Patch] incorrect patch sent
Date: Wed, 17 Jan 2018 18:22:05 -0600
[Message part 1 (text/plain, inline)]
On Wed 17 Jan 2018 at 23:12, Mosè Giordano <mose <at> gnu.org> wrote:

> Hi Alex,
>
> thank you so much for your contribution, much appreciated!  I see that
> you already signed copyright papers for Emacs, so there is no need to
> do it again for AUCTeX.

Good to hear

> I have only one question:
>
> 2018-01-17 20:45 GMT+01:00 Alex Branham <alex.branham <at> gmail.com>:
>> diff --git a/tex.el b/tex.el
>> index 5ee02b4c..d9f680b6 100644
>> --- a/tex.el
>> +++ b/tex.el
>> @@ -1358,9 +1358,7 @@ viewer."
>>             (cond ((fboundp #'select-frame-set-input-focus)
>>                    (select-frame-set-input-focus (selected-frame)))
>>                   ((fboundp #'x-focus-frame)
>> -                  (x-focus-frame (selected-frame)))
>> -                 ((fboundp #'focus-frame)
>> -                  (focus-frame (selected-frame))))))
>> +                  (x-focus-frame (selected-frame))))))
>>        (error "Couldn't find the %s instance for %s" (capitalize app) uri))))
>
> Why not directly using `select-frame-set-input-focus' instead of the
> `cond'?  It should be always available in Emacs >= 24.1, or not?

I was just going off the warnings the byte compiler gave me and wasn't sure when select-frame-set-input-focus was introduced. Checking the git history, it looks like it was introduced in 2001, well before Emacs 24, so it should be OK to use. I've attached an updated patch.

>
> Bye,
> Mosè

From b628789e05813ec50b5df04b2844c0d1997d4b39 Mon Sep 17 00:00:00 2001
From: Alex Branham <branham <at> utexas.edu>
Date: Wed, 17 Jan 2018 13:23:36 -0600
Subject: [PATCH] Remove some obsolete functions

Now that AuCTeX requires GNU Emacs 24.1 or greater, we can remove some
functions that are obsolete in Emacs < 24.1
---
 font-latex.el |  2 +-
 preview.el    |  2 +-
 tex-buf.el    |  4 ++--
 tex.el        | 13 ++++---------
 texmathp.el   |  2 +-
 5 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/font-latex.el b/font-latex.el
index c3dda00d..894a380c 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1048,7 +1048,7 @@ have changed."
      ((not char) 'font-lock-comment-face)
      ((eq char ?$) 'font-latex-math-face)
      (t
-      (when (char-valid-p char)
+      (when (characterp char)
 	;; This is a \verb?...? construct.  Let's find the end and mark it.
 	(save-excursion
 	  (skip-chars-forward (string ?^ char)) ;; Use `end' ?
diff --git a/preview.el b/preview.el
index f9382214..16a71dac 100644
--- a/preview.el
+++ b/preview.el
@@ -713,7 +713,7 @@ Gets the usual PROCESS and STRING parameters, see
 					 preview-gs-command-line)
 					" ") "''\n")
       (setq preview-gs-answer "")
-      (process-kill-without-query process)
+      (set-process-query-on-exit-flag process nil)
       (set-process-sentinel process #'preview-gs-sentinel)
       (set-process-filter process #'preview-gs-filter)
       (process-send-string process preview-gs-init-string)
diff --git a/tex-buf.el b/tex-buf.el
index f458651c..7911779e 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -1285,7 +1285,7 @@ With support for MS-DOS, especially when dviout is used with PC-9801 series."
       (if TeX-after-start-process-function
 	  (funcall TeX-after-start-process-function process))
       (set-process-filter process #'TeX-background-filter)
-      (process-kill-without-query process))))
+      (set-process-query-on-exit-flag process nil))))
 
 (defun TeX-run-silent (name command _file)
   "Start process with second argument."
@@ -1298,7 +1298,7 @@ With support for MS-DOS, especially when dviout is used with PC-9801 series."
 				  TeX-shell-command-option command)))
       (if TeX-after-start-process-function
 	  (funcall TeX-after-start-process-function process))
-      (process-kill-without-query process))))
+      (set-process-query-on-exit-flag process nil))))
 
 (defun TeX-run-interactive (name command file)
   "Run TeX interactively.
diff --git a/tex.el b/tex.el
index 5ee02b4c..00bfe506 100644
--- a/tex.el
+++ b/tex.el
@@ -1355,12 +1355,7 @@ viewer."
 		 :int32 (1+ (current-column)))
 	   :uint32 0)
           (when TeX-view-evince-keep-focus
-	    (cond ((fboundp #'select-frame-set-input-focus)
-		   (select-frame-set-input-focus (selected-frame)))
-		  ((fboundp #'x-focus-frame)
-		   (x-focus-frame (selected-frame)))
-		  ((fboundp #'focus-frame)
-		   (focus-frame (selected-frame))))))
+            (select-frame-set-input-focus (selected-frame))))
       (error "Couldn't find the %s instance for %s" (capitalize app) uri))))
 
 (defun TeX-atril-sync-view ()
@@ -1904,7 +1899,7 @@ file and LINE to (+ LINE offset-of-region).  Else, return nil."
       ;; Same regexp used in `preview-parse-messages'.  XXX: XEmacs doesn't
       ;; support regexp classes, so we can't use "[:digit:]" here.
       (when (re-search-forward "!offset(\\([---0-9]+\\))" nil t)
-	(let ((offset (string-to-int (match-string-no-properties 1))))
+	(let ((offset (string-to-number (match-string-no-properties 1))))
 	  (when TeX-region-orig-buffer
 	    (list (expand-file-name (buffer-file-name TeX-region-orig-buffer))
 		  (+ line offset) col)))))))
@@ -3413,7 +3408,7 @@ is called with \\[universal-argument]."
 					      TeX-esc)
 				      (TeX-symbol-list-filtered) nil nil nil
 				      'TeX-macro-history TeX-default-macro)))
-  (when (interactive-p)
+  (when (called-interactively-p 'any)
     (setq TeX-default-macro symbol))
   (TeX-parse-macro symbol (cdr-safe (assoc symbol (TeX-symbol-list))))
   (run-hooks 'TeX-after-insert-macro-hook))
@@ -6531,7 +6526,7 @@ NAME may be a package, a command, or a document."
 	    ;; Give up.
 	    (message "No documentation found")))
       ;; Ask the user about the package, command, or document.
-      (when (and (interactive-p)
+      (when (and (called-interactively-p 'any)
 		 (or (not name) (string= name "")))
 	(let ((symbol (thing-at-point 'symbol))
 	      contained completions doc)
diff --git a/texmathp.el b/texmathp.el
index 23e72f8e..a61b0ce4 100644
--- a/texmathp.el
+++ b/texmathp.el
@@ -302,7 +302,7 @@ See the variable `texmathp-tex-commands' about which commands are checked."
 
     ;; Store info, show as message when interactive, and return
     (setq texmathp-why match)
-    (and (interactive-p)
+    (and (called-interactively-p 'any)
 	 (message "math-mode is %s: %s begins at buffer position %d"
 		  (if math-on "on" "off")
 		  (or (car match) "new paragraph")
-- 
2.15.1


[0002-Remove-some-obsolete-functions.patch (text/x-patch, attachment)]

Information forwarded to bug-auctex <at> gnu.org:
bug#30149; Package auctex. (Thu, 25 Jan 2018 17:24:01 GMT) Full text and rfc822 format available.

Message #17 received at 30149 <at> debbugs.gnu.org (full text, mbox):

From: Alex Branham <alex.branham <at> gmail.com>
To: Mosè Giordano <mose <at> gnu.org>
Cc: 30149 <at> debbugs.gnu.org
Subject: Re: bug#30149: [Patch] remove some obsolete functions
Date: Thu, 25 Jan 2018 11:23:33 -0600
Helpful reminder email :-)

On Wed 17 Jan 2018 at 18:22, Alex Branham <alex.branham <at> gmail.com> wrote:

> On Wed 17 Jan 2018 at 23:12, Mosè Giordano <mose <at> gnu.org> wrote:
>
>> Hi Alex,
>>
>> thank you so much for your contribution, much appreciated!  I see that
>> you already signed copyright papers for Emacs, so there is no need to
>> do it again for AUCTeX.
>
> Good to hear
>
>> I have only one question:
>>
>> 2018-01-17 20:45 GMT+01:00 Alex Branham <alex.branham <at> gmail.com>:
>>> diff --git a/tex.el b/tex.el
>>> index 5ee02b4c..d9f680b6 100644
>>> --- a/tex.el
>>> +++ b/tex.el
>>> @@ -1358,9 +1358,7 @@ viewer."
>>>             (cond ((fboundp #'select-frame-set-input-focus)
>>>                    (select-frame-set-input-focus (selected-frame)))
>>>                   ((fboundp #'x-focus-frame)
>>> -                  (x-focus-frame (selected-frame)))
>>> -                 ((fboundp #'focus-frame)
>>> -                  (focus-frame (selected-frame))))))
>>> +                  (x-focus-frame (selected-frame))))))
>>>        (error "Couldn't find the %s instance for %s" (capitalize app) uri))))
>>
>> Why not directly using `select-frame-set-input-focus' instead of the
>> `cond'?  It should be always available in Emacs >= 24.1, or not?
>
> I was just going off the warnings the byte compiler gave me and wasn't sure when select-frame-set-input-focus was introduced. Checking the git history, it looks like it was introduced in 2001, well before Emacs 24, so it should be OK to use. I've attached an updated patch.
>
>>
>> Bye,
>> Mosè
>
> From b628789e05813ec50b5df04b2844c0d1997d4b39 Mon Sep 17 00:00:00 2001
> From: Alex Branham <branham <at> utexas.edu>
> Date: Wed, 17 Jan 2018 13:23:36 -0600
> Subject: [PATCH] Remove some obsolete functions
>
> Now that AuCTeX requires GNU Emacs 24.1 or greater, we can remove some
> functions that are obsolete in Emacs < 24.1
> ---
>  font-latex.el |  2 +-
>  preview.el    |  2 +-
>  tex-buf.el    |  4 ++--
>  tex.el        | 13 ++++---------
>  texmathp.el   |  2 +-
>  5 files changed, 9 insertions(+), 14 deletions(-)
>
> diff --git a/font-latex.el b/font-latex.el
> index c3dda00d..894a380c 100644
> --- a/font-latex.el
> +++ b/font-latex.el
> @@ -1048,7 +1048,7 @@ have changed."
>       ((not char) 'font-lock-comment-face)
>       ((eq char ?$) 'font-latex-math-face)
>       (t
> -      (when (char-valid-p char)
> +      (when (characterp char)
>  	;; This is a \verb?...? construct.  Let's find the end and mark it.
>  	(save-excursion
>  	  (skip-chars-forward (string ?^ char)) ;; Use `end' ?
> diff --git a/preview.el b/preview.el
> index f9382214..16a71dac 100644
> --- a/preview.el
> +++ b/preview.el
> @@ -713,7 +713,7 @@ Gets the usual PROCESS and STRING parameters, see
>  					 preview-gs-command-line)
>  					" ") "''\n")
>        (setq preview-gs-answer "")
> -      (process-kill-without-query process)
> +      (set-process-query-on-exit-flag process nil)
>        (set-process-sentinel process #'preview-gs-sentinel)
>        (set-process-filter process #'preview-gs-filter)
>        (process-send-string process preview-gs-init-string)
> diff --git a/tex-buf.el b/tex-buf.el
> index f458651c..7911779e 100644
> --- a/tex-buf.el
> +++ b/tex-buf.el
> @@ -1285,7 +1285,7 @@ With support for MS-DOS, especially when dviout is used with PC-9801 series."
>        (if TeX-after-start-process-function
>  	  (funcall TeX-after-start-process-function process))
>        (set-process-filter process #'TeX-background-filter)
> -      (process-kill-without-query process))))
> +      (set-process-query-on-exit-flag process nil))))
>  
>  (defun TeX-run-silent (name command _file)
>    "Start process with second argument."
> @@ -1298,7 +1298,7 @@ With support for MS-DOS, especially when dviout is used with PC-9801 series."
>  				  TeX-shell-command-option command)))
>        (if TeX-after-start-process-function
>  	  (funcall TeX-after-start-process-function process))
> -      (process-kill-without-query process))))
> +      (set-process-query-on-exit-flag process nil))))
>  
>  (defun TeX-run-interactive (name command file)
>    "Run TeX interactively.
> diff --git a/tex.el b/tex.el
> index 5ee02b4c..00bfe506 100644
> --- a/tex.el
> +++ b/tex.el
> @@ -1355,12 +1355,7 @@ viewer."
>  		 :int32 (1+ (current-column)))
>  	   :uint32 0)
>            (when TeX-view-evince-keep-focus
> -	    (cond ((fboundp #'select-frame-set-input-focus)
> -		   (select-frame-set-input-focus (selected-frame)))
> -		  ((fboundp #'x-focus-frame)
> -		   (x-focus-frame (selected-frame)))
> -		  ((fboundp #'focus-frame)
> -		   (focus-frame (selected-frame))))))
> +            (select-frame-set-input-focus (selected-frame))))
>        (error "Couldn't find the %s instance for %s" (capitalize app) uri))))
>  
>  (defun TeX-atril-sync-view ()
> @@ -1904,7 +1899,7 @@ file and LINE to (+ LINE offset-of-region).  Else, return nil."
>        ;; Same regexp used in `preview-parse-messages'.  XXX: XEmacs doesn't
>        ;; support regexp classes, so we can't use "[:digit:]" here.
>        (when (re-search-forward "!offset(\\([---0-9]+\\))" nil t)
> -	(let ((offset (string-to-int (match-string-no-properties 1))))
> +	(let ((offset (string-to-number (match-string-no-properties 1))))
>  	  (when TeX-region-orig-buffer
>  	    (list (expand-file-name (buffer-file-name TeX-region-orig-buffer))
>  		  (+ line offset) col)))))))
> @@ -3413,7 +3408,7 @@ is called with \\[universal-argument]."
>  					      TeX-esc)
>  				      (TeX-symbol-list-filtered) nil nil nil
>  				      'TeX-macro-history TeX-default-macro)))
> -  (when (interactive-p)
> +  (when (called-interactively-p 'any)
>      (setq TeX-default-macro symbol))
>    (TeX-parse-macro symbol (cdr-safe (assoc symbol (TeX-symbol-list))))
>    (run-hooks 'TeX-after-insert-macro-hook))
> @@ -6531,7 +6526,7 @@ NAME may be a package, a command, or a document."
>  	    ;; Give up.
>  	    (message "No documentation found")))
>        ;; Ask the user about the package, command, or document.
> -      (when (and (interactive-p)
> +      (when (and (called-interactively-p 'any)
>  		 (or (not name) (string= name "")))
>  	(let ((symbol (thing-at-point 'symbol))
>  	      contained completions doc)
> diff --git a/texmathp.el b/texmathp.el
> index 23e72f8e..a61b0ce4 100644
> --- a/texmathp.el
> +++ b/texmathp.el
> @@ -302,7 +302,7 @@ See the variable `texmathp-tex-commands' about which commands are checked."
>  
>      ;; Store info, show as message when interactive, and return
>      (setq texmathp-why match)
> -    (and (interactive-p)
> +    (and (called-interactively-p 'any)
>  	 (message "math-mode is %s: %s begins at buffer position %d"
>  		  (if math-on "on" "off")
>  		  (or (car match) "new paragraph")
> -- 
> 2.15.1
>
>
> From b628789e05813ec50b5df04b2844c0d1997d4b39 Mon Sep 17 00:00:00 2001
> From: Alex Branham <branham <at> utexas.edu>
> Date: Wed, 17 Jan 2018 13:23:36 -0600
> Subject: [PATCH] Remove some obsolete functions
>
> Now that AuCTeX requires GNU Emacs 24.1 or greater, we can remove some
> functions that are obsolete in Emacs < 24.1
> ---
>  font-latex.el |  2 +-
>  preview.el    |  2 +-
>  tex-buf.el    |  4 ++--
>  tex.el        | 13 ++++---------
>  texmathp.el   |  2 +-
>  5 files changed, 9 insertions(+), 14 deletions(-)
>
> diff --git a/font-latex.el b/font-latex.el
> index c3dda00d..894a380c 100644
> --- a/font-latex.el
> +++ b/font-latex.el
> @@ -1048,7 +1048,7 @@ have changed."
>       ((not char) 'font-lock-comment-face)
>       ((eq char ?$) 'font-latex-math-face)
>       (t
> -      (when (char-valid-p char)
> +      (when (characterp char)
>  	;; This is a \verb?...? construct.  Let's find the end and mark it.
>  	(save-excursion
>  	  (skip-chars-forward (string ?^ char)) ;; Use `end' ?
> diff --git a/preview.el b/preview.el
> index f9382214..16a71dac 100644
> --- a/preview.el
> +++ b/preview.el
> @@ -713,7 +713,7 @@ Gets the usual PROCESS and STRING parameters, see
>  					 preview-gs-command-line)
>  					" ") "''\n")
>        (setq preview-gs-answer "")
> -      (process-kill-without-query process)
> +      (set-process-query-on-exit-flag process nil)
>        (set-process-sentinel process #'preview-gs-sentinel)
>        (set-process-filter process #'preview-gs-filter)
>        (process-send-string process preview-gs-init-string)
> diff --git a/tex-buf.el b/tex-buf.el
> index f458651c..7911779e 100644
> --- a/tex-buf.el
> +++ b/tex-buf.el
> @@ -1285,7 +1285,7 @@ With support for MS-DOS, especially when dviout is used with PC-9801 series."
>        (if TeX-after-start-process-function
>  	  (funcall TeX-after-start-process-function process))
>        (set-process-filter process #'TeX-background-filter)
> -      (process-kill-without-query process))))
> +      (set-process-query-on-exit-flag process nil))))
>  
>  (defun TeX-run-silent (name command _file)
>    "Start process with second argument."
> @@ -1298,7 +1298,7 @@ With support for MS-DOS, especially when dviout is used with PC-9801 series."
>  				  TeX-shell-command-option command)))
>        (if TeX-after-start-process-function
>  	  (funcall TeX-after-start-process-function process))
> -      (process-kill-without-query process))))
> +      (set-process-query-on-exit-flag process nil))))
>  
>  (defun TeX-run-interactive (name command file)
>    "Run TeX interactively.
> diff --git a/tex.el b/tex.el
> index 5ee02b4c..00bfe506 100644
> --- a/tex.el
> +++ b/tex.el
> @@ -1355,12 +1355,7 @@ viewer."
>  		 :int32 (1+ (current-column)))
>  	   :uint32 0)
>            (when TeX-view-evince-keep-focus
> -	    (cond ((fboundp #'select-frame-set-input-focus)
> -		   (select-frame-set-input-focus (selected-frame)))
> -		  ((fboundp #'x-focus-frame)
> -		   (x-focus-frame (selected-frame)))
> -		  ((fboundp #'focus-frame)
> -		   (focus-frame (selected-frame))))))
> +            (select-frame-set-input-focus (selected-frame))))
>        (error "Couldn't find the %s instance for %s" (capitalize app) uri))))
>  
>  (defun TeX-atril-sync-view ()
> @@ -1904,7 +1899,7 @@ file and LINE to (+ LINE offset-of-region).  Else, return nil."
>        ;; Same regexp used in `preview-parse-messages'.  XXX: XEmacs doesn't
>        ;; support regexp classes, so we can't use "[:digit:]" here.
>        (when (re-search-forward "!offset(\\([---0-9]+\\))" nil t)
> -	(let ((offset (string-to-int (match-string-no-properties 1))))
> +	(let ((offset (string-to-number (match-string-no-properties 1))))
>  	  (when TeX-region-orig-buffer
>  	    (list (expand-file-name (buffer-file-name TeX-region-orig-buffer))
>  		  (+ line offset) col)))))))
> @@ -3413,7 +3408,7 @@ is called with \\[universal-argument]."
>  					      TeX-esc)
>  				      (TeX-symbol-list-filtered) nil nil nil
>  				      'TeX-macro-history TeX-default-macro)))
> -  (when (interactive-p)
> +  (when (called-interactively-p 'any)
>      (setq TeX-default-macro symbol))
>    (TeX-parse-macro symbol (cdr-safe (assoc symbol (TeX-symbol-list))))
>    (run-hooks 'TeX-after-insert-macro-hook))
> @@ -6531,7 +6526,7 @@ NAME may be a package, a command, or a document."
>  	    ;; Give up.
>  	    (message "No documentation found")))
>        ;; Ask the user about the package, command, or document.
> -      (when (and (interactive-p)
> +      (when (and (called-interactively-p 'any)
>  		 (or (not name) (string= name "")))
>  	(let ((symbol (thing-at-point 'symbol))
>  	      contained completions doc)
> diff --git a/texmathp.el b/texmathp.el
> index 23e72f8e..a61b0ce4 100644
> --- a/texmathp.el
> +++ b/texmathp.el
> @@ -302,7 +302,7 @@ See the variable `texmathp-tex-commands' about which commands are checked."
>  
>      ;; Store info, show as message when interactive, and return
>      (setq texmathp-why match)
> -    (and (interactive-p)
> +    (and (called-interactively-p 'any)
>  	 (message "math-mode is %s: %s begins at buffer position %d"
>  		  (if math-on "on" "off")
>  		  (or (car match) "new paragraph")





Reply sent to Mosè Giordano <mose <at> gnu.org>:
You have taken responsibility. (Thu, 25 Jan 2018 17:34:02 GMT) Full text and rfc822 format available.

Notification sent to Alex Branham <alex.branham <at> gmail.com>:
bug acknowledged by developer. (Thu, 25 Jan 2018 17:34:02 GMT) Full text and rfc822 format available.

Message #22 received at 30149-done <at> debbugs.gnu.org (full text, mbox):

From: Mosè Giordano <mose <at> gnu.org>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 30149-done <at> debbugs.gnu.org
Subject: Re: bug#30149: [Patch] remove some obsolete functions
Date: Thu, 25 Jan 2018 18:33:02 +0100
Hi Alex,

2018-01-25 18:23 GMT+01:00 Alex Branham <alex.branham <at> gmail.com>:
> Helpful reminder email :-)

Thank you so much for the remainder!  I installed the patch.  I only
had to replace the path of preview.el, because that file is not
tracked under git, there is preview.el.in instead.

Thanks again for your contribution,
Mosè




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 23 Feb 2018 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 35 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.