It's more usual to have the newline at the end of the line, instead of the
beginning. This change avoids missing newline at the end of the file, an
empty line at the start and eventually a lot of empty lines when
`require-final-newline' is not nil.
* lisp/image-dired.el (image-dired-write-tags): Insert newline at the end
of the line, instead of the beginning.
(image-dired-remove-tag): Do not delete empty line at end of buffer.
(end-of-line)
(insert (format ";%s" tag))))
(goto-char (point-max))
- (insert (format "\n%s;%s" file tag))))
+ (insert (format "%s;%s\n" file tag))))
(save-buffer))))
(defun image-dired-remove-tag (files tag)
(setq end (point))
(beginning-of-line)
(when (not (search-forward ";" end t))
- (kill-line 1)
- ;; If on empty line at end of buffer
- (and (eobp)
- (looking-at "^$")
- (delete-char -1)))))))
+ (kill-line 1))))))
(save-buffer)))
(defun image-dired-list-tags (file)
(insert (format "comment:%s;" comment)))
;; File does not exist in database - add it.
(goto-char (point-max))
- (insert (format "\n%s;comment:%s" file comment))))
+ (insert (format "%s;comment:%s\n" file comment))))
(save-buffer))))
(defun image-dired-update-property (prop value)