Commit graph

281 commits

Author SHA1 Message Date
Stefan Kangas
dda7502e0a image-dired: Print command when debugging
* lisp/image/image-dired-external.el (image-dired-create-thumb-1):
Display command and arguments when debugging.
* lisp/image/image-dired-util.el (image-dired-debug): Rename from
'image-dired-debug-message'.
2022-09-16 21:36:10 +02:00
Stefan Kangas
f8c5a82ba1 ; Add myself as image-dired maintainer
* lisp/image/image-dired-dired.el:
* lisp/image/image-dired-external.el:
* lisp/image/image-dired-tags.el:
* lisp/image/image-dired-util.el:
* lisp/image/image-dired.el: Add myself as maintainer.
2022-09-16 17:08:24 +02:00
Eli Zaretskii
e485734151 ; * lisp/image/image-crop.el (image-cut): Doc fix. 2022-09-16 14:23:41 +03:00
Lars Ingebrigtsen
e0ab4e3612 Rename image-elide' to image-cut' and add more bindings
* doc/lispref/display.texi (Showing Images): Update.
* lisp/image.el (image-map): Move binding to mirror Gimp bindings.

* lisp/image/image-crop.el (image-crop-cut-command): Rename.
(image-cut-color): New user option.
(image-cut): Rename and remove prefix.
(image-crop): Remove prefix.
(image-crop--crop-image-update): Add commands to switch to
move/square modes.
2022-09-16 11:03:42 +02:00
Peter Münster
7ec31d3222 image-dired: Fix thumbnail options for gm
* lisp/image/image-dired-external.el
(image-dired-cmd-create-standard-thumbnail-options): Fix options for
"gm" (GraphicsMagick).  (Bug#52200)
2022-09-16 02:23:35 +02:00
Stefan Kangas
89084a193e Improve image-dired-display-properties-format
* lisp/image/image-dired.el
(image-dired-display-properties-format): Change default format,
improve docstring and add :safe property
2022-09-16 00:08:56 +02:00
Stefan Kangas
c3828d47dd image-dired: Show header line on start
* lisp/image/image-dired.el (image-dired-show-all-from-dir): Update
header line, to ensure that it is immediately visible on start.
2022-09-15 23:36:25 +02:00
Stefan Kangas
bb76ab015a image-dired: Fix performance bug with mouse click
* lisp/image/image-dired.el
(image-dired--on-file-in-dired-buffer): Move call to
'image-dired-thumb-update-marks' from here...
(image-dired--do-mark-command): ...to here.  Add new optional
argument UPDATE to control calling it.  Update callers.
(image-dired-mouse-toggle-mark-1): Fix performance bug by setting
above new optional argument to nil.  (Bug#53599)
2022-09-15 22:19:00 +02:00
Stefan Kangas
c6fc00f5d7 Make image-dired-toggle-mark-thumb-original-file obsolete
* lisp/image/image-dired.el
(image-dired-toggle-mark-thumb-original-file): Make obsolete.
(image-dired-mouse-toggle-mark-1): Don't use above obsolete
function.
2022-09-15 22:08:19 +02:00
Mattias Engdegård
bfc4393040 Include nil as valid wallpaper-commmand
* lisp/image/wallpaper.el (wallpaper-command):
Include nil in the type since that is a valid value for the variable,
and may be the default value.  This should fix test-custom-opts.
2022-09-15 22:04:26 +02:00
Stefan Kangas
3c1579697f ; Fix wallpaper-set on TTY
* lisp/image/wallpaper.el (wallpaper-set): Don't check for
'display-graphic-p', to allow setting the wallpaper from a TTY.
2022-09-15 19:25:09 +02:00
Stefan Kangas
4907859ee0 Document MS-Windows support in wallpaper.el
* lisp/image/wallpaper.el: Add MS-Windows to Commentary.
(wallpaper-command, wallpaper-command-args, wallpaper-set):
Document MS-Windows support.
2022-09-15 19:14:38 +02:00
Stefan Kangas
3ba47a0782 Improve error when wallpaper-command is nil
* lisp/image/wallpaper.el (wallpaper-set): Improve the error message
when 'wallpaper-command' is nil.
2022-09-15 18:48:41 +02:00
Stefan Kangas
2e0cde244a Support macOS in wallpaper.el
* lisp/image/wallpaper.el (wallpaper--default-commands)
(wallpaper-command): Support macOS using "osascript".
(wallpaper-set): Display image name when wallpaper-debug is t.
2022-09-15 18:34:35 +02:00
Stefan Kangas
99bb6de7e1 ; Silence byte-compiler in wallpaper.el
* lisp/image/wallpaper.el (w32-set-wallpaper): Declare.
2022-09-15 15:44:27 +02:00
Eli Zaretskii
09e93c4daf Implement support for 'wallpaper-set' on MS-Windows
* src/w32fns.c (Fw32_set_wallpaper): New primitive.
(syms_of_w32fns): Defsubr it.
(globals_of_w32fns): Attempt to load SystemParametersInfoW from
its DLL at run time.

* lisp/image/wallpaper.el (wallpaper-set): Support MS-Windows by
calling 'w32-set-wallpaper'.

* etc/NEWS: Update and simplify wording of the 'wallpaper-set'
entry.
2022-09-15 14:51:31 +03:00
Stefan Kangas
5798c4aa2a Support fbsetbg in wallpaper.el
* lisp/image/wallpaper.el (wallpaper--default-commands)
(wallpaper-command): Add "fbsetbg".
2022-09-15 00:55:16 +02:00
Eli Zaretskii
7e69230171 ; * lisp/image/image-crop.el (image-elide, image-crop): Doc fixes. 2022-09-14 21:37:50 +03:00
Lars Ingebrigtsen
b525f201ba Allow specifying the color to use in image-elide
* lisp/image/image-crop.el (image-crop-elide-command): Adjust to
allow specifying the color.
(image-elide): Prompt for a color.
(image-crop--crop-image-update): Pass the color along.
2022-09-14 20:21:54 +02:00
Lars Ingebrigtsen
0df76e3e71 Make image-crop variables into user options
* lisp/image/image-crop.el (image-crop): New group.
(image-crop-crop-command, image-crop-resize-command)
(image-crop-elide-command, image-crop-crop-command): Make into
defcustoms.
2022-09-14 18:33:33 +02:00
Stefan Kangas
9148892768 Support hsetroot in wallpaper.el
* lisp/image/wallpaper.el (wallpaper--default-commands)
(wallpaper-command): Add "hsetroot".
2022-09-14 18:17:42 +02:00
Stefan Kangas
80c516bbc8 ; Fix typo in wallpaper--default-commands
* lisp/image/wallpaper.el (wallpaper--default-commands): Fix typo.
2022-09-14 18:13:06 +02:00
Lars Ingebrigtsen
15f42f193b Fix image-mode.el compilation
* lisp/image/image-crop.el (text-property-search): Require.
2022-09-14 16:04:52 +02:00
Lars Ingebrigtsen
997284d2a5 Don't alter the buffer contents in image-crop by default
* lisp/image/image-crop.el (image-crop-buffer-text-function):
Allow modes to alter the textual representation.
(image-crop): Delete the complete image data without assuming it's
all on one line (which isn't the case in image-mode, for instance).
(image-crop--crop-image-update, image-crop--insert-image-data):
Use image-crop-buffer-text-function.
(image-crop--default-buffer-text): New default action -- don't
alter the buffer contents (bug#57793).
2022-09-14 16:04:52 +02:00
Stefan Kangas
37fe0cd358 Rename image transform commands to be less confusing
* lisp/image-mode.el
(image-transform-original): Rename from this...
(image-transform-reset-to-original): ...to this.  Make old name
into an obsolete function alias and update all callers.
(image-transform-reset): Rename from this...
(image-transform-reset-to-initial): ...to this.  Make old name
into an obsolete function alias and update all callers.
(Bug#51451)
* doc/emacs/files.texi (Image Mode): Update for above change.
2022-09-14 15:43:39 +02:00
Stefan Kangas
37e1c896a0 ; * lisp/image/wallpaper.el: Minor doc fixes. 2022-09-14 15:01:37 +02:00
Stefan Kangas
4e207423eb Add :type to wallpaper-command
* lisp/image/wallpaper.el (wallpaper-command): Make it easier to
customize by adding a :type declaration covering all supported values.
2022-09-14 15:01:37 +02:00
Stefan Kangas
8c3b40254b Make it easier to customize wallpaper command
* lisp/image/wallpaper.el
(wallpaper--default-commands): New defvar.
(wallpaper--find-command): Use above new defvar.
(wallpaper--find-command-arguments): New defun.
(wallpaper-command): Rename from 'wallpaper-commands' and change
type to string.  Use 'wallpaper--find-command' to set it.
(wallpaper-command-args): New defcustom.  Use
'wallpaper--find-command-arguments' to set it.
(wallpaper--set-wallpaper-command): New defun.  Use as :set property
for 'wallpaper-command'.
(wallpaper-set): Use above new defcustoms to set the wallpaper.
Suggested by Eli Zaretskii <eliz@gnu.org>.
2022-09-14 12:57:09 +02:00
Stefan Kangas
41a3155319 Improve wallpaper.el docs for recent changes
* lisp/image/wallpaper.el: Fix documentation to better reflect that no
external command is needed on Haiku.
* etc/NEWS: Update entry on wallpaper.el.
2022-09-14 11:19:00 +02:00
Stefan Kangas
bfafe4aacc Allow setting wallpaper from TTY
* lisp/image/wallpaper.el (wallpaper-set): Allow setting wallpaper
when 'display-graphic-p' is nil.
(wallpaper-default-width, wallpaper-default-height):
New variables.
(wallpaper--get-height-or-width): New helper function.
2022-09-14 11:00:29 +02:00
Stefan Kangas
ac479598f1 * lisp/image/wallpaper.el (wallpaper-commands): Add xwallpaper. 2022-09-14 10:41:07 +02:00
Stefan Kangas
6f06353290 Support recent KDE Plasma in wallpaper.el
* lisp/image/wallpaper.el (wallpaper-commands): Support recent KDE
Plasma.
(wallpaper--check-command): New cl-defmethod.
2022-09-14 10:31:46 +02:00
Stefan Kangas
d537e4c102 Fix desktop environment check on Ubuntu
* lisp/image/wallpaper.el (xdg): Require.
(wallpaper--check-command): Use xdg-current-desktop instead of reading
XDG_CURRENT_DESKTOP directly.  This fixes things on e.g. Ubuntu, where
XDG_CURRENT_DESKTOP might contain a string like "ubuntu:GNOME".
2022-09-14 10:31:46 +02:00
Stefan Kangas
d0b2eee278 Improve messages in image-crop.el
* lisp/image/image-crop.el (image-crop)
(image-crop--crop-image-1): Improve messages and include the name
of the current operation.
2022-09-14 08:45:45 +02:00
Po Lu
b9ca1a8e4f Implement wallpaper.el support for Haiku
* lisp/image/wallpaper.el (haiku-set-wallpaper, wallpaper-set):
Use `haiku-set-wallpaper' on Haiku.
* lisp/term/haiku-win.el (haiku-write-node-attribute)
(haiku-send-message, haiku-set-wallpaper): New function.
* src/haiku_support.cc (be_write_node_message, be_send_message):
New functions.
* src/haiku_support.h: Update prototypes.
* src/haikuselect.c (haiku_message_to_lisp)
(haiku_lisp_to_message): Fix CSTR type handling to include NULL
byte.
(haiku_report_system_error, Fhaiku_write_node_attribute)
(Fhaiku_send_message): New functions.
(syms_of_haikuselect): Add defsubrs.
2022-09-14 06:25:11 +00:00
Stefan Kangas
f0798ac13d Support wbg in wallpaper.el (Bug#57781)
* lisp/image/wallpaper.el (wallpaper-commands): Add "wbg".
(wallpaper--check-command): New cl-defmethod for "wbg".
2022-09-14 07:20:47 +02:00
Stefan Kangas
439a3cd29d ; Prefer string-join in image-dired
* lisp/image/image-dired-dired.el (subr-x): Require.
(image-dired-dired-display-properties): Prefer string-join.
* lisp/image/image-dired.el (subr-x): Require.
(image-dired-update-header-line): Prefer string-join.
2022-09-14 04:48:05 +02:00
Lars Ingebrigtsen
0b6793b5e3 Fix wallpaper.el build warning
* lisp/image/wallpaper.el (require): Fix build warning.
2022-09-13 18:28:14 +02:00
Stefan Kangas
535adb96f6 Add new command image-dired-set-wallpaper
* lisp/image/image-dired.el (wallpaper): Require.
(image-dired-set-wallpaper): New command.
(image-dired-thumbnail-mode-map): Bind above new command to "W".
2022-09-13 18:25:21 +02:00
Stefan Kangas
32b7aaa9f1 Add new library wallpaper.el
* lisp/image/wallpaper.el: New file.
2022-09-13 18:25:21 +02:00
Stefan Kangas
2984b752f1 ; image-dired: Delete unnecessary :group arg
* lisp/image/image-dired.el (image-dired-db-file): Delete unnecessary
:group arg.
2022-09-13 18:25:21 +02:00
Lars Ingebrigtsen
ef0c2e9940 Fix some misleading quoting in cl-case
* lisp/progmodes/compile.el (compilation-auto-jump):
* lisp/image/image-crop.el (image-crop--crop-image-1):
(image-crop--crop-image-1):
* lisp/image/exif.el (exif--process-value):
* lisp/image-mode.el (image-mode--next-file):
* lisp/dnd.el (dnd-begin-text-drag):
(dnd-begin-file-drag):
(dnd-begin-drag-files): Fix misleading quoting in cl-case (bug#51368).
2022-09-13 18:19:26 +02:00
Lars Ingebrigtsen
07c0e090bd Add new commands 'image-crop' and 'image-elide'
* doc/lispref/display.texi (Showing Images): Document it.

* lisp/image.el (image-map): Bind commands.

* lisp/image/image-crop.el: New file (bug#51331).
2022-09-13 15:53:42 +02:00
Lars Ingebrigtsen
fc5a421892 Fix --without-x compilation warnings
* lisp/image/image-dired.el (clear-image-cache):
* lisp/image/image-dired-external.el (clear-image-cache): Fix
compilation warning (bug#57695).
2022-09-09 18:09:36 +02:00
Morgan Smith
ffe50d41d9 image-dired: Fix moving forward when marking files
* lisp/image/image-dired.el (image-dired--do-mark-command): Make
movement consistent regardless of the value of
image-dired-marking-shows-next.  (Bug#57651)
2022-09-08 02:15:22 +02:00
Morgan Smith
c6b25b55b3 Make image-dired-rotate-original-{left,right} respect marks
* lisp/image/image-dired.el (image-dired-rotate-original-left)
(image-dired-rotate-original-right): Rotate all marked
files.  (Bug#57651)
2022-09-08 02:15:14 +02:00
Stefan Kangas
db2f8b8415 Increase image-dired-show-all-from-dir-max-files to 1000
* lisp/image/image-dired.el
(image-dired-show-all-from-dir-max-files): Increase to 1000.
2022-09-03 11:26:34 +02:00
Lars Ingebrigtsen
01534a2d31 Fix image-dired-util.el compile warning
* lisp/image/image-dired-util.el (require): Require for cl-case.
2022-09-03 11:07:12 +02:00
Stefan Kangas
ec331e172d Add new defgroup image-dired-dired
* lisp/image/image-dired-dired.el
(image-dired-dired-append-when-browsing): Rename from
'image-dired-append-when-browsing'.  Update all uses.
(image-dired-dired): New defgroup.
(image-dired-dired-append-when-browsing)
(image-dired-dired-disp-props): Use above new defgroup.
2022-09-03 10:44:45 +02:00
Stefan Kangas
504d5c2da8 image-dired: Minor cleanups
* lisp/image/image-dired-dired.el
(image-dired-dired-after-readin-hook, image-dired-minor-mode):
Minor doc fixes.
(image-dired-dired-display-image): Don't accept ineffectual prefix
argument.
* lisp/image/image-dired-util.el
(image-dired-file-name-at-point): Use when-let.
(image-dired-display-thumb-properties): Redefine as obsolete function
alias for 'image-dired-update-header-line'.

* lisp/image/image-dired-util.el
(image-dired-window-width-pixels): Make obsolete in favor of
window-body-width.
* lisp/image/image-dired.el (image-dired-line-up-dynamic)
(image-dired-display-window-width): Don't use above obsolete function.
2022-09-03 10:44:04 +02:00