unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Joe Corneli <holtzermann17@gmail.com>
To: "Pascal J. Bourguignon" <pjb@informatimago.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: What are Emacs best uses?
Date: Tue, 13 Aug 2013 14:34:00 +0100	[thread overview]
Message-ID: <CAN+qofnmqNQRfx9j516nH3qDhrP2RLDoNppFK2EoN3W_Sf2PeA@mail.gmail.com> (raw)
In-Reply-To: <8761van5mv.fsf@informatimago.com>

On Mon, Aug 12, 2013 at 7:08 PM, Pascal J. Bourguignon
<pjb@informatimago.com> wrote:

> Ok, so let's see what other programs beside emacs I use, perhaps that'll
> give us a hint at what emacs is bad:

Nice!  And, going the other direction, here are a few files that I've
had a reason to use (or create, or customize) when working on my
thesis or day job, or just for fun, over the last year or so.  I hope
the titles are explanatory enough.  To concur with Pascal's point
about personal modifications: most of these aren't published anywhere.

"Miscellaneous" - quick coding for fun and profit

loccur.el litable.el cards.el toki-pona.el wc-mode.el hide-lines.el
randomize-region.el tex-mode.el calendar.el caps-mode.el mal-mode.el
dash.el extract-examples.el greek-mode.el toki-pona-hack.el
loop-throwaway.el monthly-mode.el power-laws.el

"Research" - programmatic and idiosyncratic text mangling as well as
interaction with external programs

premixx.el contributing-users.el alternate-formulation.el general-utilities.el
run-through-top-100-users.el apm-analysis.el
more-encyclopedia-analysis.el forum-analysis-client.el
convert-to-tims-format.el run-through-top-100-users-variant1.el
emacs-spine.el minimal-arxana.el authors-uniq.el linkwords-long.el
more-forum-analysis.el seconds-converter.el apm-terms.el
computing-entropy.el linked-words.el forum-analysis.el
emacs-spine-revised.el filter-data.el linkwords.el
extract-math-terms.el emacs-parse-preamble.el git-log-extractor.el
corrections-analysis.el top-100.el encyclopedia-analysis.el
committers.el ess.el

"Work" - more text mangling (e.g. tab-separated columns instead of spreadsheets)

recombinant.el recombinant2.el delete-stopwords.el swap-two-columns.el
freebaseize.el unique-fields.el delete-first-column.el
delete-doubles.el extractor2.el extractor3.el
turn-freebase-data-into-rdf.el postprocess.el extractor.el
zip-two-buffers-together.el

"General usability" - useful compatibility layer
magit.el markdown-mode.el all.el php-mode.el

... and to continue with an extract from my ~/.emacs -- I'm finding
the calendar quite useful, but only after relatively *extensive*
customizations (copied below).

(require 'diary-lib)
(require 'calendar)

(setq calendar-view-diary-initially-flag t
      ;; «This variable does not affect the diary display with the `d'
      ;; command from the calendar; in that case, the prefix argument
      ;; controls the number of days of diary entries displayed.»
      ;; -- description of `diary-number-of-entries'
      diary-number-of-entries 7)

;;; DIARY bindings
;; This lets you close the diary and redisplay changes
(define-key diary-mode-map (kbd "C-c C-c") '(lambda () (interactive)
                                              (widen)
                                              (quit-window)
                                              (calendar)))

(define-key diary-mode-map (kbd "C-c C-d") '(lambda () (interactive)
                                              (goto-char (line-end-position))
                                              (insert " DONE")
                                              ))

(define-key diary-mode-map (kbd "C-c C-w") '(lambda () (interactive)
                                              (widen)
                                              ))

(define-key diary-mode-map (kbd "C-o") '(lambda () (interactive)
                                          (goto-char (line-end-position))
                                          (open-line 1)
                                          (forward-line 1)
                                          (insert "  ")))

(define-key diary-mode-map (kbd "C-o") '(lambda () (interactive)
                                          (goto-char (line-end-position))
                                          (open-line 1)
                                          (forward-line 1)
                                          (insert "  ")))

;;; CALENDAR bindings
;; This lets you insert entries into the diary directly from the
;; calendar in a nicer way than the usual i-d command, since it
;; collates with previously existing entries, by date.
(define-key calendar-mode-map "ie"
  (lambda () (interactive)
    (let ((date (calendar-date-string (calendar-cursor-to-date t) t t)))
      (other-window 1)
      (find-file diary-file)
      (widen)
      (goto-char (point-min))
      (if (search-forward date nil t)
          (when (search-forward-regexp "^[A-Z]" nil t)
            (backward-char 1)
            (insert "  \n")
            (backward-char 1))
        (goto-char (point-max))
        (backward-char 1)
        (if (looking-at "\n")
            (progn (forward-char)
                   (insert (concat date "\n  ")))
          (forward-char)
          (insert (concat "\n" date "\n  ")))))))

;;; DIARY DISPLAY binding
;; This lets you edit specific entries from the fancy diary display
(add-hook 'diary-fancy-display-mode-hook
          '(lambda ()
             (local-set-key  (kbd "e")
                             '(lambda () (interactive)
                                (let (date)
                                  (if (looking-at (diary-fancy-date-pattern))
                                      (setq date (match-string 0))
                                    (re-search-backward
                                     (diary-fancy-date-pattern))
                                    (setq date (match-string 0)))
                                  (find-file "~/diary")
                                  (widen)
                                  (goto-char (point-min))
                                  ;; needs some coding improvements in
case matches aren't found
                                  (when (search-forward
(replace-regexp-in-string
                                                   "^[^ ]* \\(...\\)[^ ]* "
                                                   "\\1 "
                                                   date)
                                                  nil t)
                                  (let* ((beg (line-beginning-position))
                                         (next (search-forward-regexp
"^[A-Z]" nil t))
                                         (end (if next
                                                  (- next 1)
                                                (point-max))))
                                    (narrow-to-region beg end)
                                    (goto-char (point-min)))))))))

; The alternative is: diary-simple-display, that can be used
alternately see below
(setq diary-display-function 'diary-fancy-display)

(define-key calendar-mode-map "n" (lambda () (interactive)
                                    (let ((diary-display-function
'diary-simple-display)
                                          ;; Setting this explicitly
was important
                                          ;; to get around what
otherwise looked like a bug
                                          (diary-number-of-entries 1))
                                      (diary-view-entries))))

(add-hook 'today-visible-calendar-hook 'calendar-mark-today)

(add-hook 'diary-fancy-display-mode-hook
       '(lambda ()
              (alt-clean-equal-signs)))

(add-hook 'diary-fancy-display-mode-hook
          '(lambda () (setq selective-display 3
                            selective-display-ellipses nil)))

(defface calendar-tag-face
  '((t (:foreground "red" :weight bold)))
  "Used for tags in the calendar.")

(defface calendar-keyword-face
  '((t (:foreground "Cyan1" :weight bold)))
  "Used for super special keywords in the calendar.")

;; display org-like tags in the diary (four or more capital letters in a row)
(add-hook 'diary-fancy-display-mode-hook
           '(lambda () (font-lock-add-keywords
                        nil
                        '(("\\<[A-Z]\\{4,\\}\\>" . 'calendar-tag-face)))))

(add-hook 'diary-mode-hook
          '(lambda () (font-lock-add-keywords
                       nil
                       '(("\\<[A-Z]\\{4,\\}\\>" . 'calendar-tag-face)))))

(add-hook 'diary-fancy-display-mode-hook
           '(lambda () (font-lock-add-keywords
                        nil
                        '(("\\<\\(DONE\\)\\>" 1 'calendar-keyword-face
prepend)))))

(add-hook 'diary-mode-hook
          '(lambda () (font-lock-add-keywords
                       nil
                       '(("\\<\\(DONE\\)\\>" 1 'calendar-keyword-face
prepend)))))

(defun alt-clean-equal-signs ()
   "This function makes lines of = signs invisible."
   (goto-char (point-min))
   (let ((state buffer-read-only))
     (when state (setq buffer-read-only nil))
     (while (not (eobp))
       (search-forward-regexp "^=+$" nil 'move)
       (add-text-properties (match-beginning 0)
                        (match-end 0)
                '(invisible t)))
     (when state (setq buffer-read-only t))))

;; As far as I can tell, sorting doesn't actually work - is this a bug?
;; jac July 31, 2013
(add-hook 'diary-list-entries-hook 'diary-sort-entries t)
(setq diary-list-include-blanks t)

;;; Start it on load - but after thing are properly set up
(setq inhibit-startup-screen t)
(add-hook 'after-init-hook (lambda () (progn (calendar)
                                             (diary-mark-entries))))

(add-hook 'diary-list-entries-hook 'diary-include-other-diary-files)
; (add-hook 'diary-mark-entries-hook 'diary-mark-included-diary-files)

(defun calendar-view-all ()
  (interactive)
  (add-hook 'diary-mark-entries-hook 'diary-mark-included-diary-files)
  (save-window-excursion (find-file "~/diary")
                         (goto-char (point-min))
                         (insert "&"))
  (calendar)
  (remove-hook 'diary-mark-entries-hook 'diary-mark-included-diary-files)
  (save-window-excursion (find-file "~/diary")
                         (goto-char (point-min))
                         (delete-char 1)))

(setq diary-comment-start "¡")
(setq diary-comment-end "!")

(require 'appt)
(appt-activate 1)
;; See also: appt-warning-time-regexp
(setq appt-message-warning-time 10)
(setq appt-display-format 'echo)
(setq appt-display-mode-line t)



  parent reply	other threads:[~2013-08-13 13:34 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3062.1376327401.12400.help-gnu-emacs@gnu.org>
2013-08-12 18:08 ` What are Emacs best uses? Pascal J. Bourguignon
2013-08-12 18:45   ` Andreas Röhler
2013-08-13 13:34   ` Joe Corneli [this message]
2013-08-13  1:52 ` Emanuel Berg
2013-08-13  3:29 ` Rustom Mody
2013-08-13 11:52 ` Dan Espen
2013-08-13 12:27   ` Filipp Gunbin
     [not found]   ` <mailman.3116.1376396894.12400.help-gnu-emacs@gnu.org>
2013-08-13 12:33     ` Dan Espen
2013-08-12 17:05 Jorge
2013-08-12 18:52 ` Peter Dyballa
2013-08-13  4:04 ` Charles Philip Chan
2013-08-17 14:11   ` Jorge
2013-08-17 20:20     ` Charles Philip Chan
2013-08-18 10:31       ` Jorge
2013-08-19 11:09         ` Phillip Lord
2013-08-19 20:21         ` Charles Philip Chan
2013-08-19  2:46     ` Eric Abrahamsen
2013-08-13 11:30 ` Phillip Lord
2013-08-13 14:43   ` Drew Adams
2013-08-13 16:05 ` W. Greenhouse
2013-08-14  8:21   ` Thomas Shannon
2013-08-15 14:41     ` W. Greenhouse
2013-08-16  9:49       ` Thomas Shannon
2013-08-14 14:51 ` Ken Goldman
2013-08-14 19:04 ` Nikolay Kudryavtsev
2013-08-19 13:52 ` Luca Ferrari
     [not found] ` <mailman.340.1376920365.10748.help-gnu-emacs@gnu.org>
2013-08-19 14:04   ` Sebastien Vauban
2013-08-19 14:35     ` Luca Ferrari
     [not found]     ` <mailman.342.1376922920.10748.help-gnu-emacs@gnu.org>
2013-08-20  8:25       ` Sebastien Vauban
2013-08-20 10:56         ` Luca Ferrari
     [not found]         ` <mailman.401.1376996210.10748.help-gnu-emacs@gnu.org>
2013-08-20 12:44           ` Sebastien Vauban
2013-08-21  1:58       ` Jason Rumney
2013-08-21  6:25         ` Luca Ferrari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAN+qofnmqNQRfx9j516nH3qDhrP2RLDoNppFK2EoN3W_Sf2PeA@mail.gmail.com \
    --to=holtzermann17@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=pjb@informatimago.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).