[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#30149: [Patch] remove some obsolete functions
From: |
Alex Branham |
Subject: |
bug#30149: [Patch] remove some obsolete functions |
Date: |
Thu, 25 Jan 2018 11:23:33 -0600 |
User-agent: |
mu4e 0.9.18; emacs 26.0.91 |
Helpful reminder email :-)
On Wed 17 Jan 2018 at 18:22, Alex Branham <address@hidden> wrote:
> On Wed 17 Jan 2018 at 23:12, Mosè Giordano <address@hidden> 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 <address@hidden>:
>>> 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 <address@hidden>
> 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 <address@hidden>
> 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")