vedang / pdf-tools

Emacs support library for PDF files.
https://pdftools.wiki
GNU General Public License v3.0
643 stars 90 forks source link

Address some byte-compiler warnings #150

Closed basil-conto closed 2 years ago

basil-conto commented 2 years ago

Version

Emacs 29 configuration ``` In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars) of 2022-09-15 built on tia Repository revision: 3c1579697ff03d3991b41ead503211cffac0998f Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: Debian GNU/Linux bookworm/sid Configured using: 'configure 'CFLAGS=-Og -ggdb3' -C --prefix=/home/blc/.local --enable-checking=structs --with-file-notification=yes --with-x-toolkit=lucid --with-x' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XAW3D XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LANG: en_IE.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo x-toolkit xinput2 x multi-tty make-network-process emacs) ```

Warnings

Warnings before patch ``` -*- mode: compilation; default-directory: "~/.emacs.d/src/pdf-tools/" -*- Compilation started at Fri Sep 16 20:51:48 rm lisp/*.elc; emacs -Q -batch -f package-initialize -L lisp -f batch-byte-compile lisp/*.el In toplevel form: lisp/pdf-annot.el:76:12: Warning: defcustom for ‘pdf-annot-default-annotation-properties’ has syntactically odd type ‘...’ lisp/pdf-annot.el:527:24: Error: Misplaced t or ‘otherwise’ clause In pdf-sync-minor-mode: lisp/pdf-sync.el:111:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting) In pdf-sync-synctex-file-name: lisp/pdf-sync.el:761:35: Warning: ‘point-at-bol’ is an obsolete function (as of 29.1); use ‘line-beginning-position’ or ‘pos-bol’ instead. In pdf-util-hexcolor: lisp/pdf-util.el:651:35: Warning: avoid `lsh'; use `ash' instead In pdf-util-convert: lisp/pdf-util.el:1017:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting) In pdf-view-registerv-make: lisp/pdf-view.el:1652:4: Warning: ‘registerv-make’ is an obsolete function (as of 27.1); Use your own type with methods on register-val-(insert|describe|jump-to) In pdf-virtual-getattachment-from-annot: lisp/pdf-virtual.el:964:2: Warning: docstring wider than 80 characters In pdf-virtual-synctex-forward-search: lisp/pdf-virtual.el:987:2: Warning: docstring wider than 80 characters In pdf-virtual-synctex-backward-search: lisp/pdf-virtual.el:991:2: Warning: docstring wider than 80 characters Compilation exited abnormally with code 1 at Fri Sep 16 20:51:50 ```
Warnings after patch ``` -*- mode: compilation; default-directory: "~/.emacs.d/src/pdf-tools/" -*- Compilation started at Fri Sep 16 21:14:57 rm lisp/*.elc; emacs -Q -batch -f package-initialize -L lisp -f batch-byte-compile lisp/*.el In toplevel form: lisp/pdf-annot.el:76:12: Warning: defcustom for ‘pdf-annot-default-annotation-properties’ has syntactically odd type ‘...’ In pdf-annot-print-annotation-latex: lisp/pdf-annot.el:1374:19: Warning: ‘org-latex-create-formula-image-program’ is an obsolete variable (as of 9.0); use ‘org-preview-latex-default-process’ instead. In pdf-view-registerv-make: lisp/pdf-view.el:1652:4: Warning: ‘registerv-make’ is an obsolete function (as of 27.1); Use your own type with methods on register-val-(insert|describe|jump-to) Compilation finished at Fri Sep 16 21:14:59 ```

ChangeLog

Address some byte-compiler warnings

vedang commented 2 years ago

Thank you for the contribution!

Re: replacing deprecated functions, pdf-tools supports all versions of Emacs >= 26.1, so we cannot replace functions with newer variants.

I will apply as much of this patch as possible and close the PR.

basil-conto commented 2 years ago

Re: replacing deprecated functions, pdf-tools supports all versions of Emacs >= 26.1, so we cannot replace functions with newer variants.

I have not used any new variants; line-beginning-position and lsh have been with us since well before Emacs 26.

I will apply as much of this patch as possible and close the PR.

Thanks. The entire patch should be compatible with all supported Emacs versions.

vedang commented 2 years ago

:thumbsup: I was just confirming that for the last 25 minutes. Should have just checked your prompt response.

basil-conto commented 2 years ago

Thanks!

BTW, I see that I was removed as the author in the final commit. Personally I don't care at all about attribution, but I'm pointing this detail out in case it resulted from a mistaken process that may require attention (copyright issues, etc.).

vedang commented 2 years ago

Apologies @basil-conto , this is a mistake on my end.

I use magit-forge for managing PRs and Issues and I generally touch up commit messages and commit content. This means that the original contributor remains the author of the commit and I get added as a committer, which is an accepted git workflow. In this case, it seems like I messed up my workflow somehow and applied your commit as a patch instead of cherry-picking it -- likely an effect of the fact that there was a conflict.

I wouldn't have liked it if a contribution I made was merged without any callback to me, and I should have double-checked. Sorry!

basil-conto commented 2 years ago

No need to apologise! Like I said I don't mind in the slightest and just pointed it out in case it was something suspicious or worth investigating :). Thanks again!