(Emacs+Org-Mode) Why Not Bind `delete-forward-char'?

Thank you Greg for the big correction here <2018-01-12 Fri>

The documentation for delete-char suggests that delete-forward-char ought to be used for interactive use instead of delete-char

(global-set-key (kbd "C-d") #'delete-forward-char)

Find All Locations Of A Binary Using `type’ not `which’

I can’t find the git 2.10 binary so I run

which git

/usr/local/bin/git

Excellent, found it.

And then I check it’s version to verify I am looking at the right version

/usr/local/bin/git –version

git version 2.21.0

Oops that isn’t what I wanted.

There must be another git getting loaded earlier in the search path.

Here is how to find out where all copies of git live

type -a git

git is /usr/local/bin/git
git is /usr/local/bin/git
git is /usr/bin/git

Look for the right git at version 2.10

/usr/local/bin/git –version
/usr/bin/git –version

git version 2.21.0
git version 2.14.3 (Apple Git-98)

I want the second one.

That is how to track down the location of a binary file on macOS that appears multiple times in the search path.

(PDF) Re-OCR A PDF Using PDFPenPro

Sometimes I want to recreate the OCR layer in a PDF using PDFPenPro but the menu item is greyed out.

Here is how force a re-scan:

  1. Hold down COMMAND+OPTION
  2. And then click Edit → OCR Document

If you open the menu first like I did, then the menu item remains greyed out, oops 😮😢.

PDFPenPro is in the top five list of best software that I’ve ever used. Check it out.

(Emacs+Org-Mode) Make Eval Expression A Little Easier

Once you’ve been using Emacs for a while you end up using eval-expression a lot. 99% of the time I use it to make function calls. I never noticed before that it is kind of tedious to reach for S-M-; and then () despite using it so much. Here is a binding and a function definition that make it easier to use binding it close to home and inserting the round parentheses.

(global-set-key (kbd "M-;") #'my-eval-expression)
(define-key org-mode-map (kbd "M-;") nil)
(progn
  (defvar my-read-expression-map
    (let ((map (make-sparse-keymap)))
      (set-keymap-parent map read-expression-map)
      (define-key map [(control ?g)] #'minibuffer-keyboard-quit)
      (define-key map [up]   nil)
      (define-key map [down] nil)
      map))
  (defun my-read--expression (prompt &optional initial-contents)
    (let ((minibuffer-completing-symbol t))
      (minibuffer-with-setup-hook
          (lambda ()
            (emacs-lisp-mode)
            (use-local-map my-read-expression-map)
            (setq font-lock-mode t)
            (funcall font-lock-function 1)
            (insert "()")
            (backward-char))
        (read-from-minibuffer prompt initial-contents
                              my-read-expression-map nil
                              'read-expression-history))))
  (defun my-eval-expression (expression &optional arg)
    "Attribution: URL `https://lists.gnu.org/archive/html/help-gnu-emacs/2014-07/msg00135.html'."
    (interactive (list (read (my-read--expression ""))
                       current-prefix-arg))
    (if arg
        (insert (pp-to-string (eval expression lexical-binding)))
      (pp-display-expression (eval expression lexical-binding)
                             "*Pp Eval Output*"))))