emacs+qpdf

  • Creatore
    Topic
  • #56015
    Up
    0
    Down
    ::


    qpdf
    http://qpdf.sourceforge.net/
    “QPDF is a command-line program that does structural, content-preserving transformations on PDF files.”

    Usare qpdf per editare pdf a volte è molto utile.
    Questo è uno banale qpdf-mode
    che serve solo per commentare sezioni del pdf
    (uso dwim, dovrebbe essere di default).
    `
    ;; qpdf-mode.el
    ;; the command to comment/uncomment text
    (defun qdf-comment-dwim (arg)
    “Comment or uncomment current line or region in a smart way.
    For detail, see `comment-dwim'.”
    (interactive “*P”)
    (require 'newcomment)
    (let ((deactivate-mark nil) (comment-start “%”) (comment-end “”))
    (comment-dwim arg)))

    ;; keywords for syntax coloring
    (setq myKeywords
    `(
    ;; ( ,(regexp-opt '(“Sin” “Cos” “Sum”) 'word) . font-lock-function-name-face)
    ;; ( ,(regexp-opt '(“Pi” “Infinity”) 'word) . font-lock-constant-face)
    )
    )

    ;; define the major mode.
    (define-derived-mode qdf-mode fundamental-mode
    “qdf-mode is a major mode for editing language qdf.”
    (setq font-lock-defaults '(myKeywords))

    ;; modify the keymap
    (define-key qdf-mode-map [remap comment-dwim] 'qdf-comment-dwim)

    (modify-syntax-entry ?% “< b" qdf-mode-syntax-table) (modify-syntax-entry ?\n "> b” qdf-mode-syntax-table)
    )
    `

  • Devi essere connesso per rispondere a questo topic.

Go to top