Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Changes to be compatible with melpa #3

Merged
merged 3 commits into from

2 participants

@expez

I'm not entirely happy with the summary in the header; you might want to edit this.

@rocky
Owner

What do you use for stripping blanks? Is there an emacs output-hook available?

@expez

Don't merge this just yet, the melpa recipe failed to build.

@rocky
Owner
@expez

cl (add-hook 'before-save-hook (lambda () (delete-trailing-whitespace))) is what I use to automagically remove whitespace. The commit makes it sound like I did something, but all I did was save the buffer :)

I also use have show-trailing-whitespace set to t when coding and I have whitespace-style set to '(face lines-tail) so text beyond the fill-column looks super ugly.

@expez

Ok. If you can elaborate on what you are not happy with perhaps that will help me address this.

My grammar and spelling are often a little weird (and I'm a native speaker), but I suspect you mean something more than that, right?

I wrote the summary myself, it's not taken from anything of yours. Here it is:

;;; loc-changes.el --- Helps the user keep track of positions even after change.

I believe this short description shows up in the package manager as a short description of what the package does. If we make it sound good odds increases that people will check out the package.

@expez

haha, I was testing the recipe and was surprised when emacs wouldn't let me load it. But it won't let me load it because the package is built form this repo and the changes aren't merged in yet.

/facepalm

Unless you want to update the summary; go ahead and merge :+1:

@rocky rocky merged commit 9425cc2 into rocky:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 43 additions and 7 deletions.
  1. +43 −7 loc-changes.el
View
50 loc-changes.el
@@ -1,3 +1,37 @@
+;;; loc-changes.el --- Helps the user keep track of positions even after change.
+
+;; Author: Rocky Bernstein
+;; Version: 0.1.0
+;; URL: http://github.com/rocky/emacs-loc-changes
+;; Compatibility: GNU Emacs 24.x
+
+;; Copyright (C) 2013 Rocky Bernstein <rocky@gnu.org>
+
+;; This program is free software: you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation, either version 3 of the
+;; License, or (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see
+;; <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; The intent of this package is to let a user to set marks in a buffer prior
+;; to changes so that we can track the original positions after the change.
+
+;; One common use is say when debugging a program. The debugger has its static
+;; notion of the file and positions inside that. However it may be convenient
+;; for a programmer to edit the program but not change execution of the program.
+
+;;; Code:
+
(make-variable-buffer-local 'loc-changes-alist)
(defvar loc-changes-alist '()
"A buffer-local association-list (alist) of line numbers and
@@ -12,7 +46,7 @@ COLUMN-NUMBER is given, position `point' at that column just
before that column number within the line. Note that the beginning of
the line starts at column 0, so the column number display will be one less
than COLUMN-NUMBER. For example COLUMN-NUMBER 1 will set before the first
-column on the line and show 0.
+column on the line and show 0.
The Emacs `goto-line' docstring says it is the wrong thing to use
that function in a Lisp program. So here is something that I
@@ -25,26 +59,26 @@ proclaim is okay to use in a Lisp program."
line-number))
(let ((last-line (line-number-at-pos (point-max))))
(unless (<= line-number last-line)
- (error
+ (error
"Line number %d should not exceed %d, the number of lines in the buffer"
line-number last-line))
(goto-char (point-min))
(forward-line (1- line-number))
(if column-number
- (let ((last-column
+ (let ((last-column
(save-excursion
(move-end-of-line 1)
(current-column))))
(cond ((not (wholenump column-number))
- (message
+ (message
"Column ignored. Expecting column-number parameter `%s' to be a whole number"
column-number))
((<= column-number 0)
- (message
+ (message
"Column ignored. Expecting column-number parameter `%d' to be a greater than 1"
column-number))
((>= column-number last-column)
- (message
+ (message
"Column ignored. Expecting column-number parameter `%d' to be a less than %d"
column-number last-column))
(t (forward-char (1- column-number)))))
@@ -80,7 +114,7 @@ marker association in `loc-changes-alist'."
)
(defun loc-changes-reset-position (&optional opt-buffer no-insert)
- "Update `loc-changes-alist' the line number of point is what is
+ "Update `loc-changes-alist' the line number of point is what is
so its line line number at point Take existing marks and use the current (updated) positions for each of those.
This may be useful for example in debugging if you save the
buffer and then cause the debugger to reread/reevaluate the file
@@ -117,3 +151,5 @@ NO-UPDATE is set, no mark is added."
)
(provide 'loc-changes)
+
+;;; loc-changes.el ends here
Something went wrong with that request. Please try again.