emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/pdf-tools 321e19ed59 08/16: Remove Emacs 24.4 guards for c


From: ELPA Syncer
Subject: [nongnu] elpa/pdf-tools 321e19ed59 08/16: Remove Emacs 24.4 guards for cua-mode
Date: Tue, 29 Nov 2022 01:59:30 -0500 (EST)

branch: elpa/pdf-tools
commit 321e19ed597483ec4b5bebc2de160ba3803f1a8b
Author: Vedang Manerikar <ved.manerikar@gmail.com>
Commit: Vedang Manerikar <ved.manerikar@gmail.com>

    Remove Emacs 24.4 guards for cua-mode
    
    Relates to: #26
---
 lisp/pdf-info.el |  4 +++-
 lisp/pdf-view.el | 27 +++++++++------------------
 2 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/lisp/pdf-info.el b/lisp/pdf-info.el
index 408dd3f54f..40dfc3d17f 100644
--- a/lisp/pdf-info.el
+++ b/lisp/pdf-info.el
@@ -305,7 +305,9 @@ error."
       (setq pdf-info--queue (tq-create proc))))
   pdf-info--queue)
 
-(when (< emacs-major-version 27) (advice-add 'tq-process-buffer :around 
#'pdf-info--tq-workaround))
+(when (< emacs-major-version 27)
+  (advice-add 'tq-process-buffer :around #'pdf-info--tq-workaround))
+
 (defun pdf-info--tq-workaround (orig-fun tq &rest args)
   "Fix a bug in trunk where the wrong callback gets called.
 
diff --git a/lisp/pdf-view.el b/lisp/pdf-view.el
index 21824ad804..981aa1be3a 100644
--- a/lisp/pdf-view.el
+++ b/lisp/pdf-view.el
@@ -374,14 +374,6 @@ PNG images in Emacs buffers."
   ;; Enable transient-mark-mode, so region deactivation when quitting
   ;; will work.
   (setq-local transient-mark-mode t)
-  ;; In Emacs >= 24.4, `cua-copy-region' should have been advised when
-  ;; loading pdf-view.el so as to make it work with
-  ;; pdf-view-mode. Disable cua-mode if that is not the case.
-  ;; FIXME: cua-mode is a global minor-mode, but setting cua-mode to
-  ;; nil seems to do the trick.
-  (when (and (bound-and-true-p cua-mode)
-             (version< emacs-version "24.4"))
-    (setq-local cua-mode nil))
 
   (add-hook 'window-configuration-change-hook
             'pdf-view-redisplay-some-windows nil t)
@@ -403,16 +395,15 @@ PNG images in Emacs buffers."
                             (pdf-view-check-incompatible-modes buffer)))
                  (current-buffer)))
 
-(unless (version< emacs-version "24.4")
-  (advice-add 'cua-copy-region
-                 :before-until
-                 #'cua-copy-region--pdf-view-advice)
-  (defun cua-copy-region--pdf-view-advice (&rest _)
-    "If the current buffer is in `pdf-view' mode, call
-`pdf-view-kill-ring-save'."
-    (when (eq major-mode 'pdf-view-mode)
-      (pdf-view-kill-ring-save)
-      t)))
+(advice-add 'cua-copy-region
+               :before-until
+               #'cua-copy-region--pdf-view-advice)
+
+(defun cua-copy-region--pdf-view-advice (&rest _)
+  "If the current buffer is in `pdf-view' mode, call 
`pdf-view-kill-ring-save'."
+  (when (eq major-mode 'pdf-view-mode)
+    (pdf-view-kill-ring-save)
+    t))
 
 (defun pdf-view-check-incompatible-modes (&optional buffer)
   "Check BUFFER for incompatible modes, maybe issue a warning."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]