Skip to content

Instantly share code, notes, and snippets.

View myrjola's full-sized avatar

Martin Yrjölä myrjola

  • Netlight
  • Helsinki, Finland
View GitHub Profile
;; Doc-view reading
(defun other-frame-doc-view-next-page ()
(interactive)
(other-frame 1)
(case major-mode
;; The timer causes race-conditions
('pdf-view-mode (progn (pdf-view-next-page-command)
(when pdf-view--next-page-timer
(cancel-timer pdf-view--next-page-timer)
(defun my-org-screenshot (arg)
"Take a screenshot into a time stamped unique-named file in the
same directory as the org-buffer and insert a link to this file.
If arg is not nil scale down the image to fit to a smaller width"
(interactive "P")
(setq filename
(concat
(make-temp-name
(concat (buffer-file-name)
(setq org-html-postamble nil)
(setq org-html-head-extra "
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,400italic,700italic&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:400,700' rel='stylesheet' type='text/css'>
<style type='text/css'>
body {
font-family: 'Source Sans Pro', sans-serif;
}
pre, code {
;;; diminish.el --- Diminished modes are minor modes with no modeline display
;; Copyright (C) 1998 Free Software Foundation, Inc.
;; Author: Will Mengarini <seldon@eskimo.com>
;; URL: <http://www.eskimo.com/~seldon>
;; Created: Th 19 Feb 98
;; Version: 0.44, Sa 23 Jan 99
;; Keywords: extensions, diminish, minor, codeprose
(defun pdf-annot-markups-as-org-text (pdfpath &optional title level)
"Acquire highlight annotations as text"
(interactive "fPath to PDF: ")
(let* ((outputstring "") ;; the text to be return
(title (or title (replace-regexp-in-string "-" " " (file-name-base pdfpath ))))
(level (or level (1+ (org-current-level)))) ;; I guess if we're not in an org-buffer this will fail
(levelstring (make-string level ?*))
(pdf-image-buffer (get-buffer-create "*temp pdf image*"))
)