A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.
15

Such functionality is provied by packages: image-dired-thumbnail-mode With point in the thumbnail buffer, you can type RET (image-dired-display-thumbnail-original-image) to display a sized version of it in another window. This sizes the image to fit the window. It uses ImageMagick's convert command. You can also use image-dired-external-viewer to avoid ...


9

As someone who just had this problem, I found another solution: auto-image-file-mode. What it does is automatically make sure the file is in image mode instead of binary, so enable both that and auto-revert-mode and everything works as expected. Emacs 24.4.1 Source: http://osdir.com/ml/bug-gnu-emacs-gnu/2014-01/msg01061.html


8

It is possible with a little code. I would define a new link like this: #+BEGIN_SRC emacs-lisp (org-add-link-type "image-url" (lambda (path) (let ((img (expand-file-name (concat (md5 path) "." (file-name-extension path)) temporary-file-directory))) (if (file-exists-p img) (find-file img) (url-copy-file path img) ...


6

Based on what happens behind the scenes when you call iimage-mode, you can define a function that takes care of displaying images for you, and have Emacs run this function every time you issue an echo command in Eshell: (defun iimage-mode-refresh (command args) (when (string= command "echo") (let ((image-path (cons default-directory iimage-mode-image-...


6

Solution I used the source code in lisp/image-mode.el to write this up. Calling this function in any image buffer will resize it to fit to width or height depending on the image and window height/width ratios. You do need these 2 things for this function to work: Your emacs needs to have been compiled with Imagemagick. By default libjpeg loader is used to ...


5

This is controlled by the variable auto-mode-alist, which you can modify by adding the following line to your emacs init file: (add-to-list 'auto-mode-alist '("\\.pdb$" . text-mode)) The "\\.pdb$" part is a regular expression that matches files ending in pdb. The part after the period is the mode you want to use instead of the default.


4

Others will no doubt mention packages that are made specifically for handling images. This answer, about some more general features, might nevertheless help. Dired+ provides a few enhancements regarding image files. Most of these require standard library image-dired.el. One of them, command diredp-do-display-images, which displays all of the marked image ...


4

You don't provide much information about what you are doing or what you are seeing. Try to give a step-by-step recipe, preferably starting from emacs -Q, and say what you expect versus what you see. Does manually reverting the buffer work (M-x revert-buffer, after setting the current buffer to the image buffer)? If so, then investigate what is different ...


3

Based on itsjeyd's answer I advised eshell/cat to display images when an argument is the filename of an image file supported by iimage-mode. (defun my/iimage-mode-refresh--eshell/cat (orig-fun &rest args) "Display image when using cat on it." (let ((image-path (cons default-directory iimage-mode-image-search-path))) (dolist (arg args) (let ...


3

I tried opening a png in emacs, enabling auto-revert-mode and then from a shell, copying another image over it and then replacing that file with a copy of the original png. What I found is that the file is sometimes updated to the new files binary contents, but not the rendered content. If it opens the binary content, try using C-c C-c to convert it to an ...


3

Not within the Org buffer itself, as far as I know. If you export to HTML, however, links to images will be converted into images. If the description is a file name or URL that points to an image, HTML export (see HTML export) will inline the image as a clickable button. If there is no description at all and the link points to an image, that image will ...


2

I found the problem. It appeared to be broken (changing values had no effect) because image-dired caches its thumbnails in ~/.emacs.d/image-dired/. Clearing the cache makes the changes effective.


2

You're misinterpreting the STRING parameter here. The docs state it's a string used as the before-string property with an image on top of it. Therefore, if you do (put-image (create-image "image.gif") (point) "Some image"), "Some image" would be displayed before point weren't it for the image layered on top of it which visually replaces that text. You can ...


2

It is not possible AFAICT out of the box. I did something similar here: http://kitchingroup.cheme.cmu.edu/blog/2016/03/21/Displaying-image-overlays-on-image-filenames-in-Emacs/ and modified tooltips on a link here http://kitchingroup.cheme.cmu.edu/blog/2015/11/23/Improving-org-ref-cite-links-with-tooltips/. They might give you some hints on how to get what ...


2

Let bound coding-system-for-read to raw-text or no-conversion in function starting the process for getting png data. This will instruct emacs to treat the process output as raw bytes. Looking at your code in github it seems the puml-preview starts the planetuml process, change its definition as follows (defun puml-preview () "Preview diagram." (...


1

Two methods would be useful to you image-transform-fit-to-width and image-transform-set-scale, you can use these two functions inside a image-mode-hook to setup the display like you want based on the file. You can get the file extension by using file-name-extension on buffer-file-name. Here is an implementation: (defun my-image-mode-setup () (when (and (...


1

About your first question: What is the logic behind this remapping? If it's there, I'm guessing it must be somehow useful, despite that the original mapping to recenter is normally so sacred to emacs users. You should have a look at the description of iimage-recenter: Re-draw images and recenter. The "re-draw images" part is not covered by recenter-...


1

Resizing images only works for images types supported by the imagemagick-library. The function imagemagick-types returns a list of these types. EDIT: Input M-: (setq val (imagemagick-types)) RET and C-h v val RET to check what the function returns. If the value of val is nil imagemagick is not enabled and you are out of luck. If the value is a list look ...


1

diredp-toggle-find-file-reuse-dir does not prevent you from opening multiple Dired buffers for different directories (e.g. subdirs). It should be irrelevant here, but you might want to describe just what you are doing, step by step. With multiple Dired buffers open, you can mark files (and subdirs) in any of them. with Dired+ (which you are apparently using),...


1

Isn't the error message clear enough? The package is missing a program called convert which part of imagemagick. Just install imagemagick on your system.


1

The function in question is image-mode, and this seems to do what you want (if a little inelegantly): (defun my/image-unwanted-message-p (msg &rest objects) "Return non-nil if MSG is unwanted. For these purposes, a MSG is unwanted if (after formatting) it is exactly the string \"Type C-c C-c to view the image as text.\"." (let ((msg (apply #'format (...


1

image-transform-set-scale may be what you are looking for. However it requires Emacs to be compiled with Imagemagick support. There is also a commented out image-transform-mode in image-mode.el labeled "Not yet implemented."


Only top voted, non community-wiki answers of a minimum length are eligible