summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-10Add a byteclean target in the MakefileVedang Manerikar
Similar to the `bytecompile` target, this is for helping with testing.
2022-10-07Enable testing against MacOS in CI/CD!v0.99Vedang Manerikar
This is pretty cool, I hope it works! 🤞 It uses the `macos` orb provided by CircleCI, as documented here: https://circleci.com/docs/using-macos This commit also rewrites the older anchor style common steps into the newer command syntax, which is more readable. The command syntax is documented here: https://circleci.com/docs/configuration-reference#commands Installing pre-reqs on MacOS via `brew` was non-trivial. This is mainly because of the `sed` command used in the `Makefile`. It isn't a problem normally because it is only used for packaging, which is done on Melpa Relates to: #98
2022-10-06Add make targets to start / stop the podman VMVedang Manerikar
This is just a convenience wrapper for me
2022-10-06Speed up server testing by keeping the containers aroundVedang Manerikar
This allows re-using containers, saving a tremendous amount of time. The drawback here is that any environment change (on the docker / podman containers side) is not detected. The way to deal with this will be to create a process around major releases where I delete all the containers and re-test from scratch. Relates to: #130
2022-10-04Revert "Adds translattion of highlight annotations"Vedang Manerikar
This reverts commit 0107f80dcf268d08ac075b01729820062c0fbd67 The reason for doing this is explained by @vizs in #143, copying the message here: Andreas wrote the function `annotation_translate_quadrilateral`[^1][^2] to fix misplaced annotations due to the then bug in `glib`. This misplacement bug can be seen in the images posted in issue politza/pdf-tools#577, along with PDFs in which the bug can be reproduced. This lack of translation in the `glib` backend was fixed in `poppler 0.86.0` but the workaround was still left hanging in `epdfinfo.c` which brings us to today where this unneeded translation bites our back. I commented out the calls to `annotation_translate_quadrilateral` in `epdinfo.c` and to my surprise, there were no misplaced translations in files which displayed the misplacing behaviour and in files which did not have this behaviour. [1]: https://github.com/politza/pdf-tools/commit/0107f80dcf268d08ac075b01729820062c0fbd67 [2]: politza/pdf-tools#122 Closes: #143 Closes: #146
2022-10-03Add non-transparent text selection to known problemsorgtre
Including a function which implements a work-around.
2022-10-03Address some byte-compiler warningsVedang Manerikar
* lisp/pdf-annot.el (pdf-annot-run-modified-hooks): Use cl-case instead of cl-ecase, as the latter does not support t/otherwise clauses. Remove nil clause which never matches. See https://bugs.gnu.org/51368. (pdf-annot-edit-contents-finalize): * lisp/pdf-sync.el (pdf-sync-minor-mode): Mark up symbols `like-this', to avoid having the apostrophe interpreted as a closing single quote. Remove redundant backslashes. (pdf-sync-synctex-file-name): Use line-beginning-position in place of point-at-bol, which is deprecated in Emacs 29. * lisp/pdf-util.el: Autoload list-colors-duplicates before its use in pdf-util-color-completions, as facemenu is not preloaded since Emacs 28. (pdf-util-hexcolor): Use ash in place of lsh, which is deprecated in Emacs 29. (pdf-util-convert): Fix docstring markup and indentation. * lisp/pdf-virtual.el (pdf-virtual-define-adapter): Refill generated docstring to avoid exceeding 80 column warning threshold. Relates to: #26 Relates to: #80 Closes: #150
2022-10-03Fix nix-shell pkg-config dependency nameMario Rodas
Recently nixpkgs removed the `pkgconfig` alias[^1], which broke the build with `nix-shell`. [^1]: https://github.com/NixOS/nixpkgs/pull/192681 Closes: #153 Closes: #158
2022-10-03Fix: misuse of cl-ecaseİ. Göktuğ Kayaalp
The `cl-ecase` macro does not support default cases (‘otherwise’ or ‘t’), and the cl-case macro requires the default case to be the last clause, which a recent change to Emacs rendered a macro expansion error[^1], thus preventing the module from loading (and potentially signalling error in the init process). Furthermore, `cl-ecase` expands to a `cl-case` form with a trailing special flag clause, so the appearance of a ‘t’ or ‘otherwise’ clause in a `cl-ecase` call will always result in this error being triggered. I thus replace the apparently futile call to `cl-ecase` with an equivalent null check and a call to `cl-case`, which fixes both issues. I replaced `cl-ecase` with `cl-case` because the former form had both a t-check and a nil-check, which meant the error case was impossible to be triggered. [^1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51368 Closes: #159 Closes: #154 Closes: #157
2022-10-02Fix: Warnings and <26.1 codeVedang Manerikar
Fix warnings and remove code for supporting older versions of Emacs from the following files: 1. `pdf-annot.el` Relates to: #26
2022-08-23Revert "synctex_parser: fix vasprintf() not exists in non-GNU environment ↵Vedang Manerikar
(#134)" This reverts commit bea5ddb9fc234b48db6df3dcb66d75e76bec00c8 because `pdf-tools` compilation is broken. Closes: #141 Reopens: #134
2022-08-22synctex_parser: fix vasprintf() not exists in non-GNU environment (#134)lin.sun
The vasprintf() is a GNU extension function, missed in non-GNU build environment, so we define it. Without this change, there will have error message when we build with clang: ``` ./autogen.sh ./configure CC=clang make ``` We will get errors: ``` synctex_parser.c:8448:13: error: call to undeclared function 'vasprintf'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] if (vasprintf(&buffer, format, va) < 0) { ``` This change fixes the problem.
2022-08-22Don't depend on gcc when building with `nix-shell` (#135)Mario Rodas
* Use `--run` flag to execute nix-shell The `--command` flag is only required to spawn a interactive shell. * Do not require gcc to build with nix-shell `nix-shell` already sets CC with a C compiler, for instance Clang on darwin. * Remove outdated require in test-helper `f.el` is not needed anywhere.
2022-08-22Fix: remove execute permisions from temp filesZachary Newman
They aren't used. Fixes #138.
2022-07-23Change the default value of `pdf-annot-list-highlight-type`Vedang Manerikar
Use color when listing annotations by default, and allow users to turn it off if required (switching the default boolean value)
2022-07-23Fix: Handle nil return value from `image-scroll` functionsVedang Manerikar
*Note*: This is a temporary fix. What happened? When the `arg` to `image-scroll-up` is 0, the function disregards the argument (scrolling up 0 lines means not changing anything) and returns a `nil` value. This causes the equality check in this commit to fail (the check is to see if we have hit the top or bottom of the page, since in this case "moving the image" will do nothing and we will have to move the page). The current fix adds an explicit null check to ensure that we don't compare scroll positions. Unknowns: under what conditions is the argument to `pdf-view-scroll-up-or-next-page` 0? Things to do: Review the `= window-vscroll image-scroll` pattern all over the code-base and refactor it to deal with `arg = 0` problem. Fixes: #131
2022-07-22pdf-annot: Add function to sort the date fieldVisuwesh
Previously, the `date` field was sorted alphabetically, instead of according to date. Changes: * lisp/pdf-annot.el (pdf-annot--make-entry-formatter): Propertize string to include the lisp date. (pdf-annot-list-mode): Add function to sort date. Notes: - Why use `propertize` instead of parsing the string back? + Because there are annotations with no associated dates. In this case, we display the string "No date". Our parsing code would have to handle that, `propertize` is just simpler and covers all edge-cases correctly. - What can we do better? + Currently, the index of the field we are looking up is hard-coded. So any change in the fields will impact this code silently. We need to add tests to ensure this is caught. Closes: #75
2022-07-21Fix: Dockerfile for ubuntu-18/20 needs fix-missingVedang Manerikar
The output on the terminal suggested using fix-missing, which seems to fix the sources and find the packages :)
2022-07-20Disable pixel-scroll-precision-mode locally if enabledSebastian Hiebl
This change disables the emacs 29 `pixel-scroll-precision-mode` (if enabled) which interferes with the `pdf-tools` scrolling mechanism. I think the `pixel-scroll-precision-mode` does not make sense in the context of the `pdf-view` mode, which does pixel based scrolling anyways. After this change, scrolling in a `pdf-view` buffer should work again with `pixel-scroll-precision-mode` enabled. Closes: #56 Closes: #124
2022-07-20Fix `revert-buffer` for PDF files opened via TrampIllia Ostapyshyn
There are two issues with `revert-buffer` for remote files: - `revert-buffer` does not update the local temporary copy of the remote file (`pdf-view--buffer-file-name`). Since `revert-buffer--default` does in fact renew contents of the current buffer when visiting a remote file, the fix is the matter of flushing the buffer contents into the temporary file, exactly how it's done in `pdf-view-mode`: https://github.com/vedang/pdf-tools/blob/386dca5b2d078ba691eefe230478a440ee1f7b16/lisp/pdf-view.el#L321-L322 - `revert-buffer` relies on `pdf-info-close` to run `pdf-info-close-document-hook`, which clears the image and data caches, so they can be rebuilt from the new file. `pdf-info-close` first normalizes the file using `pdf-info--normalize-file-or-buffer`, which returns `pdf-view--buffer-file-name`, and then tries to run the hook in the buffer visiting that file. Since there is not going to be a buffer visiting the local temporary file (normally), no hooks are actually ran. Fixed by deriving the buffer directly from the `file-or-buffer` argument: ``` (cond ((not file-or-buffer) (current-buffer)) ((bufferp file-or-buffer) file-or-buffer) ((stringp file-or-buffer) (find-buffer-visiting file-or-buffer))) ``` Closes: #126, #128
2022-07-20Test and Documentation changes: dockerfiles and readmeVedang Manerikar
README changes: - Add documentation on how to test / add support for your favorite operating system. Dockerfile changes: - Rename Dockerfile.in to Dockerfile.common.in, to make the name clearer. - Add make as a prerequisite in the Dockerfile. + It is needed to run make commands and is not available in some of these images. - Add make targets for printing operating systems that are not yet supported in Docker testing. + This should help contributors with adding support for testing on these systems. + New targets are `server-test-supported` and `server-test-unsupported` at the top level. Related to: #130
2022-07-15Make sure autoconf is install on macOS so autoreconf may runJimmy Yuen Ho Wong
2022-06-19Minor README change: Remove instruction to install let-alistVedang Manerikar
`let-alist` is available by default in Emacs >=25.2
2022-06-19Remove Emacs 25 from CircleCI test jobsVedang Manerikar
`pdf-tools` supports Emacs versions 26, 27 and 28 as of this writing. This commit is a minor change moving towards milestone 1.0.0
2022-06-20fix: disable qt-workaround in Emacs 27>=Pi-Cla
The bug is fixed upstream in Emacs 27 https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19016 Fixes: #118
2022-05-21Add a Makefile target to clean docker containersVedang Manerikar
No point leaving dead containers lying around. Relates to: #98
2022-05-21Create named containers when running docker/podman testsVedang Manerikar
This simplifies container operations and ensures that we don't have dead containers hanging around. Relates to: #98
2022-05-21Update the current Dockerfile templatesVedang Manerikar
- Move all package installation to the autobuild file. The Dockerfile should simply start a container and make sure that all the package repositories are updated. - Dockerfiles should spin up containers for the latest (ish) releases of the major Linux operating systems. - Disable Dockerfiles for environments which are not working correctly. List of operating systems where `epdfinfo` server compilation is tested and working correctly: - Debian (9, 10, 11) - Ubuntu (18, 20, 22) - Fedora (34, 35, 36) List of operating systems where `epdfinfo` server compilation is failing inside the containers, for unknown reasons: - Gentoo - Centos - Archlinux List of operating systems that need to be added to containerized testing: - MacOSX - Windows via Msys2 (Mingw32, Mingw64) - OpenBSD - FreeBSD - NixOS - Void - OpenSuse Relates to: #98
2022-05-21Remove usage of all private poppler headers in pdf-toolsPi-Cla
This commit also removes C++ entirely, as it is not needed anymore for correct compilation of `epdfinfo`. The following changes are made: - Remove private headers from all the server code. This involves: - Replace private header functionality with the correct public functions provided by poppler. - Remove unneeded headers around date checks - Delete dead-code (headers, m4 macros) - Remove C++, g++ and similar aliases from all the code. Also: - Remove related information from the README - Remove related information from CI and Dockerfiles Work done by: @Pi-Cla Closes: #105, #103, #109, #114
2022-05-11Revert "Use mkstemp instead of tempnam"Vedang Manerikar
This reverts commit 37bbe861755bc60c7cc333359fee3e2a5d919c77. As explained by @ShuguangSun (re: testing the change on Windows) on > Sorry. It is my fault. The issue is still there. The different is > that the temp dir is created now. However, it reports "Unable to > create temporary file". Reopens: #110
2022-05-11Use mkstemp instead of tempnamVedang Manerikar
This reverts commit 8ee31220a6ae3e41549bfffca7a89c481d270004 and brings in @JunyuanChen's change once again. We modify the commit to fix the problem on Windows by changing the code as follows: --- a/server/epdfinfo.c +++ b/server/epdfinfo.c @@ -347,6 +347,6 @@ static char* mktempfile() { - char template[] = "/tmp/epdfinfoXXXXXX"; + char template[] = P_tmpdir "/epdfinfoXXXXXX"; char *filename = malloc(sizeof(template)); memcpy(filename, template, sizeof(template)); This works correctly for Windows (as confirmed by @ShuguangSun), Mac (tested by @vedang) and Linux (tested by @Junyuanchen) Relates to: #101, #94 Closes: #110
2022-05-09Add an FAQ on running tests locallyVedang Manerikar
This addresses the question of getting immediate feedback on the changes that a developer is making. Of course, the test-suite itself is not extensive and needs to be added to. We will get to it, slow and steady. Related to: #105
2022-05-09Revert "Use mkstemp instead of tempnam"Vedang Manerikar
This reverts commit d63a1e7d87f9b0a19209f2eeb170bcf64612aa2f. In d63a1e7, @JunyuanChen fixed a long standing compilation warning by replacing `tempnam` with `mkstemp` in `epdfinfo`. However, the `mkstemp` implementation does not work correctly on MS Windows (probably because the path template is "wrong" for Windows). I am reverting the commit and opening a new issue #110 to track the correct implementation of `mkstemp` (or equivalent) on MS Windows. It would also be great to add a test against Windows CI to open a PDF and check that the operation completes successfully. Closes: #101
2022-05-09Add FAQ explaining workaround for M1 Mac compilation problemsVedang Manerikar
In short, the problem is that many people are using Emacs compiled for x86_64 on the M1 Mac, which is an ARM64 architecture. There is nothing that `pdf-tools` can do here, but the "fix" is straightforward: Install Emacs from https://emacsformacosx.com/, which is compiled correctly. Related to: politza/pdf-tools#652, #70 Closes: #107
2022-05-09Add workaround for compilation using C++17 standard libraryVedang Manerikar
As explained in #102 by @Pi-Cla and @uliw, `pdf-tools` relies on private headers provided by `poppler`. In order to compile these correctly, we need the standard library provided by C++17. `pdf-tools` is built and tested against C++11. This workaround provides the correct CXXFLAGS to compile the library and fixes the immediate broken compilation problem. There should be two "correct" fixes to these: 1. Remove dependence on private `poppler` headers. This is being tracked in #103 and #105 2. Upgrade `pdf-tools` to build and run against new C++ versions. This is being tracked in #109. Closes: #70, #76, #102, #108, politza/pdf-tools#706.
2022-05-01Use org-mode as the default mode for annotation editsVedang Manerikar
This makes it simpler / more Emacs-y to take notes in annotations that can then be exported.
2022-04-26Add pkgconf to opensuse buildPi-Cla
Nearly forgot to add pkgconf.
2022-04-26Add support for openSUSE except MicroPi-Cla
I am not qualified to add support for the Micros versions of openSUSE, but this supports the most commonly used versions.
2022-04-26Add to PKG_CONFIG_PATH, instead of replacing it.Vedang Manerikar
This is a better solution as it takes into account paths that have already been set up by users. Potentially fixes: #70
2022-04-26Guard against dead buffers in pdf-tools-install-noverifyDaniel Nicolai
I am not sure how to 'consistently' reproduce the issue that this commit fixes. But I was experiencing the issue as reported at https://github.com/syl20bnr/spacemacs/issues/15106, where for some reason `pdf-view-mode` did not open in evil `evilified-state`. After (a long time of) hunting down the cause, I found that `pdf-tools` (silently) errors when the `buffer-list` contains killed buffers. The error occurs because `pdf-tools-install-noverify` calls `with-current-buffer` with the killed buffer. This commit simply adds the `buffer-live-p` check before the `with-current-buffer` form gets called. Closes: #93 Potentially Fixes: syl20bnr/spacemacs#15106 Author: @dalanicolai
2022-04-25Install automake on Mingw systemsVedang Manerikar
This fixes the `server/autobuild` installation on Windows, as mentioned in #86. Fixes: #86
2022-04-25Add FAQ on supporting pdf-tools on your favorite OSVedang Manerikar
Along with adding instructions to the README, I'd like people to make changes to the `autobuild` script. Adding this FAQ to help people learn how to do that. Relates to: #92
2022-04-25Update the Emacs minimum supported version in READMEVedang Manerikar
With the release of Emacs 28, we are dropping support for Emacs 24 and 25 (`pdf-tools` is adopting the policy to support on the latest 3 Emacs major versions). This commit simply changes the README file, no actual change in the code has been made yet. I'll make the code changes as part of work towards the 1.0.0 release milestone. Relates to: #26
2022-04-25Clarify Fedora prereqs in the READMEPi-Cla
Closes: #92
2022-04-25Add epdfinfo prereqs for openSUSE in the READMEPi-Cla
Capture requirements for openSUSE Tumbleweed, Leap and MicroOS.
2022-04-25Use mkstemp instead of tempnamJunyuanChen
Removes the following warning when compiling `epdfinfo`: ``` build/server/epdfinfo.c:354: warning: the use of `tempnam' is dangerous, better use `mkstemp' ```
2022-04-25Add Emacs 28 to CircleCI build matrixPiotr Kwiecinski
2022-04-18Fix build-directory locatingBasil L. Contovounesios
* lisp/pdf-tools.el (pdf-tools-locate-build-directory): Look for 'server' directory not only in default-directory, but also in pdf-tools-directory. Fixes #90.
2022-02-14Add functions for left/right aligning and centeringNicholas Harrison
Useful convenience functions for scrolling the pdf horizontally. Closes: #59
2022-02-13Minor improvements in the installation section of the READMEVedang Manerikar
This should ideally have been part of the previous section, but well, we can't have Gerrit everywhere unfortunately.