texts: How to force Org to interpret Calc result as a column?

texts:
Here's an example:

| low | high | students | F(students) |
|-----+------+----------+-------------|
|   0 |   30 |       15 |          15 |
|  30 |   60 |       30 |          45 |
|  60 |   70 |       40 |          85 |
|  70 |   90 |       60 |         145 |
|  90 |  100 |       15 |         160 |
#+TBLFM: @2$4..@>$4=mcol(accum(add, @2$3..@>$3), @#-1)

I hoped to do away without mcol(). For a small table like this it doesn't really matter, but, in general, this will needlessly recalculate the values as many times as there are rows. How would I avoid it?


texts: When to split long elisp files to separate files?

texts:
Some Lisp programmers advocate keeping code mainly into one file, following the concepts of Literate Programming in the Large, (note: the video is more about the method than Axiom, an open source computer algebra system written mostly in Lisp).

There is also a tendency to split a long elisp file into related files.

Some believe this may be a matter of personal opinion. Doing some research, it seems, at least in Lisp, such issue is also a matter of proper coding style and proper code management.

Quite a few experienced Lisp programmers spent considerable time about this subject. There are whole books and online documents that speaks about style (for example, Molly Miller's "LISP: Style and Design").

I was wondering what approach in managing code is advisable when dealing with large elisp (and lisp) files?

Based on on that, which special tools (ie, unique to elisp programming) does Emacs offer to navigate either a long elisp file, or a collection of related lisp files?

I am especially interested in less widely know tools.  For example, there is code out there to help unbinding things or nuke and reevaluate an elisp buffer. It seems that kind of tools could be quite useful, but they would probably not make much sense for very large files?

Bonus question: Is there a criteria, like grouping into logical units, or other quantifiable values (like: LOC, number of functions, etc) that can help in deciding?


texts: How to create a new org-mode file everyday automatically with contents from the previous file?

texts:
I am learning emacs and trying to switch my note taking to org-mode from just using pen and paper. I came across an article on making Org create a new day page every day. I find that very interesting because it closely reflects what I do with my notepad today...

Could someone help me figure out how to configure Org to transfer all tasks (except for those marked as "DONE") to the new day page from the previous one when it creates it? Thanks!


texts: I was wondering if it is possible to run a substitue command in evil with a counter? For example, with query-replace-regexp you can use replace-count: (format "word-%d" (1+ replace-count)).


texts: Inserting unicode symbol for rational numbers ℚ using TeX input method

texts:
Hello good people of Emacs!

To insert unicode math symbols I use TeX input method. This way I get unicode character ℝ by typing \Bbb{R}, ℕ by typing \Bbb{N}, ℤ by typing \Bbb{Z}, etc...

I'm unable to get symbol ℚ, since typing \Bbb{Q} does not insert unicode character.

Any Ideas what can be the source of this error?


texts: How can I quit Emacs from within a term within Emacs?

texts:
I'm in a situation where I have to ssh into a machine and do all of my coding on there. For a while I would ssh in and then use tmux and emacs -nw mode. Recently, I discovered the term command. Now instead of using tmux, I open up normal Emacs on my desktop and use term to ssh in.

Once I'm in, I run emacs -nw from within term within Emacs on my desktop. This works great, and I have all of my pretty colors. The only problem is, I can't figure out how to cleanly close the emacs -nw within the Emacs on my desktop. C-x C-c does not work, as expected.

How can I close the innermost Emacs, and get back to term? Is there a better way to edit files via ssh?


texts: Function within a function produces side-effect but failes to deliver logic test

texts:
This is a simple logic test that makes use of down-list and asks if another nested pair of parenthesis exits or not.

  (not (eql (point)
        (progn (ignore-errors (down-list))
           (point))))

A weird thing occurred when this is re-written as a function that accepts another function as argument.

(defun next-pair-exists-in (func)
  "Check if inner or outer pair exists.
Function employs `(up-list)` or `(down-list)` as argument to work."
  (not (eql (point)
        (progn (ignore-errors (func))
           (point)))))

While the eql point test code returns t for positions to the left of 1, 2 and 3, the function, while moving the cursor inwards as expected, returns nil for all positions.

  (1(2(3)4)5)

How do we get the function to work?


texts: Is there any way to also show the title of the parent node in org-agenda?

texts:
In org-agenda the entries with SCHEDULED or DEADLINE properties are shown. However, sometimes I might want to distinguish between entries not only by their own names, but also the names of their parents.

For example, I might have an entry "Assignment 1" under one title, but also another "Assignment 1" for another course, both of which show up on the agenda with the same name.

What I might want instead would be "C1 -> Assignment 1" and "C2 -> Assignment 1" to be shown. Is there any configuration that would allow me to do this?


texts: How to delete word in next line with evil-mode?

texts:
I use evil-mode (from spacemacs) and I get a strange behaviour which I'm not sure if it is right or a bug. If I delete words (with dw, i think it calls evil-delete), it works until I arrive at the last word in the line, after that it starts to delete the last remaining character in the same line (backwards delete one char). Maybe the problem is the way auto-fill-mode is splitting the lines in a paragraph.

How to make dw delete words in the following line once it reached the last word in a line?


texts:
I have a GUI emacs running as the major working area,

When I reading articles from web, need to open a emacs  as a tool to keep note;

Web on the left and new emacs on the right,

Usually, get the prompts

Please answer y or n.  Warning: desktop file appears to be in use by PID 17861.
Using it may cause conflicts.  Use it anyway? (y or n)

I assure the conflicts are the buffer.

Should I ignore it to continue or actions could be taken to tackle the prompt?


texts: How to trust code in .dir.locals.el and pass the (is it safe) test?

texts:
I have this code in my .dir-locals.el file:

  (eval . (let ((root (projectile-project-root)))
            (setq-local company-clang-arguments
                        (list (concat "-I" root "headers")
                              (concat "-I" root "source/mon")
                  ))
            (setq-local flycheck-clang-include-path
                        (list (concat root "headers")
                              (concat root "source/mon")
                  ))))
  ))

But everytime I start emacs it asks to apply the code and if it is safe (multiple times) and even when choosing the ! option to save my selection it continues to ask these questions on each emacs startup.

How to trust everything in this file and not prompt for this safety warning?


texts: Painfully slow encoding popup with "temp file" when creating new file

texts:
Around half the time (and I haven't established a solid repro that triggers it), opening a new file in emacs will trigger a big pause, then two windows appear: one showing *temp file* and one asking me to choose encoding for the temp file. This is on a beefy windows 10 machine with windows 25.1.1.

I'm running on prelude and mostly use projectile, but it happens outside of projectile and I've cleared projectile's file list. Emacs has been rebooted multiple times.

Anyone know how I can stop this? Maybe I need to manually clear this temp file, but where does it live?


texts: If I load a local file, I'd like eww to refresh when the source is changed. This would be similar to auto-revert mode. Is there any way to do this? Right now I have to manually refresh by hitting g in the *eww* buffer.


texts:
Is it possible to skip prompts in org-capture-templates?
Examlple: I would like to prompt for a DEADLLINE but sometimes there is no hard deadline or it is not yet known. I would like to just skip over the DEADLINE: %^t prompt.
Alternative: Can I enter a value like "nil", so deadline is not active?


texts: Dired search and replace is throwing no results

texts:
I am trying to quickly search and replace in multiple files using dired. The steps I follow are from this question (Chris Conway's and Frank Henard's answers), I am pretty sure the instructions are correct since it seems like I am the only person having this problem.

To simplify the problem, the steps I am doing are as follows:

Open a folder in dired
Mark a file with m
Q to search and replace in the marked file, this command will ask for two arguments, in the search query argument I type div, and in the replacement query argument I type foo (to replace div with foo).

After I do these simple steps, the search throws no results, the buffer says:

  No matches for: div

I know plenty divs are spreaded all over the file. Perhaps I am not entering the arguments in the correct format, I tryed many things, like enclosing the string in quotes or double quotes, and running emacs with the -q argument in the shell to disable my dotfile. The instructions looked pretty simple, I don't know what I am doing wrong.

Emacs version: 25.1.1


texts: Accented characters not showing correctly in org-mode HTML export

texts:
I have following basic HTML setup for org-mode

#+TITLE: Blog
#+AUTHOR: Burak Kaan Çopur

#+HTML_DOCTYPE: html5

and this gives me following head in generated HTML file

<!DOCTYPE html>
<html lang="en">
<head>
<!-- 2018-02-22 Thu 22:11 -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Blog</title>
<meta name="generator" content="Org mode">
<meta name="author" content="Burak Kaan Çopur">

You can see that charset is set to UTF-8 and language of the document is set to en. When I write HTML manually, I use these settings and my name which includes a Ç shows just fine. But org exported HTML files are not able to display them. What might be the problem here?

Here is what causing me the problem. I opened one of the .org files in Notepad++ and said convert to UTF-8. When I republish through emacs, this time it works but if I reopen the same file in emacs then it is messed up again. I have following in my configuration so I was thinking my emacs buffers are all encoded in UTF-8

;; UTF-8 as default encoding
(set-language-environment "UTF-8")

So what might be the reason for emacs to not use UTF-8 encoding?


texts: Separating state change log entries from other notes

texts:
Following Rainer König's example in this video, I've customized org-log-into-drawer to be LOGBOOK. I've also added timestamps for various state changes such as from DOING to DONE, so that when these events happen, entries are added to the :LOGBOOK: drawer. I'm also using org-add-note to add notes unrelated to state changes.

The problem with this approach is that the notes are intermingled with the state change entries. For example:

** DONE set up date-based plan files
   :LOGBOOK:
   - State "DONE"       from "DOING"      [2017-09-13 Wed 15:18]
   - Note taken on [2017-09-13 Wed 15:07] \\
     To add a timestamp, do ~C-c !~ (for inactive ones anyway) in insert mode.
   - State "DOING"      from "NEXT"       [2017-09-13 Wed 14:25]
   CLOCK: [2017-09-13 Wed 14:22]--[2017-09-13 Wed 15:00] =>  0:38
   - State "NEXT"       from "TODO"       [2017-09-12 Tue 15:45]
   :END:

It's not easy to visually pick out the notes (which are often more relevant) from the state change events and clock events.

So my question is: can I separate the notes from the other information? I'd prefer for notes to go into their own :NOTES: drawer, but I'd also accept an answer that added notes to the body of the headline, outside of a drawer.

(Note: I'm aware of this question, but as far as I can tell it controls the notes and other entries together, without distinction, so it won't suffice for my purposes.)


texts: Unable to initialize org agenda with log on Emacs startup

texts:
I have been able to initialize org agenda on Emacs startup with:

(add-hook 'emacs-startup-hook 'org-agenda-list)

However, now I want to initialize org agenda directly with log mode, and I haven't been able to figure out how to do it.

Attempting to write

(add-hook 'emacs-startup-hook 'org-agenda-start-with-log-mode '(closed clock))

resulted in an Emacs error about the symbol org-agenda-start-with-log-mode being void. I guess it's because org-mode related functions haven't been completely loaded yet on Emacs startup.

However, attempts to run it after org has been loaded have also failed:

(eval-after-load 'org-agenda
  '(org-agenda-start-with-log-mode '(closed clock)))

Is there a way to achieve what I want?


texts: Remove the verbose description in mode line

texts:
I started my Emacs Venture days ago with prelude.

but find that the mode line is verbose

  UUU:----F1  scratch      All of 144  (4,0)      (EL guru FlyC- company ivy EditorConfig ws Projectile super-save SP/s Pre WK (*)) 9:20AM 1.67 Mail

I want to remove the part with parenthesis (EL guru FlyC- company ivy EditorConfig ws Projectile super-save SP/s Pre WK (*))

How could I get it done?


texts: Unable to quit emacs with `Wrong type argument: hash-table-p, nil`

texts:
I have some customisations in ~/.emacs.el. Today I refactored a piece that used dolist, directory-files, and find-file. I am now unable to quit Emacs in the normal way and I get this from the mini-buffer:

Wrong type argument: hash-table-p, nil

I only have one kill hook, which calls a function mu4e-mark-execute-all defined in mu4e:

(require 'mu4e)
(defun mu4e-execute-marks ()
   (interactive)
   (mu4e-mark-execute-all t)
)
(add-hook 'kill-emacs-hook 'mu4e-execute-marks)

I understand that the LISP debugger is for evaluating expressions or functions. Can I set a stacktrace to see the cause of the error?


texts: What's the unfortunate historical accident to name 'kill' rather than 'clip'?

texts:
I am reading 8.Cutting-Storing-Text in elisp introduction

Which complain the word kill as

  (The use of the word “kill” in Emacs for processes which specifically
  do not destroy the values of the entities is an unfortunate historical
  accident. A much more appropriate word would be “clip” since that is
  what the kill commands do; they clip text out of a buffer and put it
  into storage from which it can be brought back. I have often been
  tempted to replace globally all occurrences of “kill” in the Emacs
  sources with “clip” and all occurrences of “killed” with “clipped”.)

The word "kill" here does not function literally it does to kill a process which do destroy it. It merely cut out text as clip.

The author "Robert J. Chassell" mentioned it as "an unfortunate historical accident", but did not elaborate it.

What's the historical accident?


texts: What EWW Emacs Web Brower Would Be Used For

texts:
Managed here to run eww, despite its requirements of libxml2-dev package BEFORE compiling and installing Emacs itself.

Have already browsed some websites, including some simple ones, only with basic Html an Css styling but coudn't find great utility in, once it renders quite strange browsing, finding w3m package much better for web browsing via command-line interface.

Anyway, what would eww be good for?


texts:
I am trying to define keymapping about %>% for ess R mode.
Code 1 is my init.el based on How to implement the piping operator %>% in ESS mode?. After evaluation of the code, I get the keybinding Code 2. I don't know why such a situation happen and RET does not work well. How do I fix it?
Code 1
(defun then_R_operator ()
  (interactive)
  (just-one-space 1)
  (insert "%>%"))

(define-key ess-mode-map (kbd "C-%") 'then_R_operator)
(define-key inferior-ess-mode-map (kbd "C-%") 'then_R_operator)

Code 2
key             binding
---             -------
RET     then_R_operator
C-%     then_R_operator

Update
I also try a different method as follows. But, I got the same result.
(define-key ess-mode-map (kbd "C-M") "%>%")
(define-key inferior-ess-mode-map (kbd "C-M") "%>%")


texts: Remove *.bak files from ido-mode minibuffer

texts:
I am using ido-mode to select files from Emacs. This works well for most cases, but for some cases I would like to modify the files that are shown in the completion buffer with ido-find-file.

In some folders I have a lot of *.bak files, and I would like to have the possiblity to remove them from the completion buffer by pressing the F1 key, for example. This is how far I got on this task:

(add-hook 'ido-minibuffer-setup-hook 'ido-my-keys)

(defun ido-my-keys ()
  (define-key ido-file-completion-map (kbd "<f1>") 'my-modify-files))

(defun my-modify-files ()
  (interactive)
  (message-box "Here I would like to delete the .bak files from the minibuffer"))


texts: Why doesn't "C-;" "C-,", or "C-." work in a terminal emulator? (OS X Terminal, Iterm2)

texts:
I have bound "C-;" to 'other-window in my config like so.

(global-set-key (kbd "C-;") 'other-window)

When I run emacs outside of a terminal, this keybinding works as I would expect. Inside Iterm2 and OS X terminal, however, emacs does not appear to distinguish it from ";". I can use the keybinding itself, however, by activating god-mode. I'm wondering if this is some limitation/"feature" of terminal emulators in general.


texts: Why does calling expand-file-name indirectly produce a different result?

texts:
Running the following in ielm in emacs -Q:

ELISP> (defun wh/expand-file-name (name &optional default-directory)
  (expand-file-name name default-directory))
wh/expand-file-name
ELISP> (expand-file-name "http://example.com" nil)
"/home/wilfred/http:/example.com"
ELISP> (wh/expand-file-name "http://example.com" nil)
#("/scp:http:/example.com" 1 4
  (tramp-default t))

Why do these two functions not return the same value?


texts: how can I change the number of cursors using multiple cursors mc/mark-next-lines?

texts:
I encounter many situations where I'd like to use mc/mark-next-lines but I don't know how to change the number of cursors. When I do C-u 2 mc/mark-next-lines I get 7 cursors instead of 3.

It would be neat if I could pass a two to this command to get 2 cursors. I don't see any sense in that bevhaviour.


texts: How to show the sticky(lock) window status in the mode line?

texts:
I got the following snippet in my init.el:

(define-minor-mode sticky-buffer-mode
  "Make the current window always display this buffer."
  nil " locked" nil
  (set-window-dedicated-p (selected-window) sticky-buffer-mode))
(global-set-key [f11] 'sticky-buffer-mode)

So, I can use F11 to lock one window, but the minor mode indicator "locked" shows in the mode line is not easy to see when more than one windows exist in one frame, so I wonder how can I change the color of mode-line-buffer-id or something like filename(locked) in mode line(change color would be better).

Note: the original version is able to toggle the status with the same key, so the modified version should be so. Since the minor mode is unnecessary, it would be better to modify define-minor-mode to defun.


texts: Why does this url package request receive a different response than the 'equivalent' curl request?

texts:
This is for sx.el, a StackExchange client for Emacs.
I'm trying to determine whether this issue is a bug in url or a bug in StackExchange's API.
If you need the API key, please get in touch with either myself or @Malabarba – we're on the Gitter chatroom for the project pretty regularly.

The following form evaluates to two different responses depending on whether curl is used or whether the url package is used.
Since API requests are time-sensitive (and to cut down on your time investment), I've included the responses I get for the two (as parsed by json-read-from-string for readability's sake).

(defconst tmp:access-token
  "YOUR ACCESS TOKEN")

(defconst tmp:key
  "YOUR API KEY")

(defun tmp:api-bug (use-curl access-token key)
  "Post a test answer to the formatting sandbox."
  (let ((random-body-1 (md5 (current-time-string)))
        (random-body-2 (md5 (md5 (current-time-string))))
        (method "https://api.stackexchange.com/2.2/questions/3122/answers/add")
        (args
         (mapconcat
          #'identity
          `(,(format "access_token=%s"
                     (replace-regexp-in-string
                      "%" "%%" (url-hexify-string access-token)))
            ,(format "key=%s"
                     (replace-regexp-in-string
                      "%" "%%" (url-hexify-string key)))
            "site=meta"
            "pagesize=100"
            "filter=%%21GoYr1we0U5inG5G7wBg4JBGpbgX%%29C7LDqpy-%%2AbfwPOujOr4SR4W%%29bLNSyYUpQDdTwTj.XChTFB0gfLaAJq0hv"
            "body=this-is-an-answer-test-for-sx.el--%s")
          "&")))

    (if use-curl
        (shell-command-to-string
         (format
          "curl --silent -X POST --data %S %s | gunzip"
          (format args random-body-2)
          method))
      (let ((url-automatic-caching t)
              (url-inhibit-uncompression t)
              (url-request-data (format args random-body-1))
              (url-request-method "post")
              (url-request-extra-headers
               '(("Content-Type" . "application/x-www-form-urlencoded"))))
          (with-current-buffer
              (url-retrieve-synchronously method)
            (goto-char (point-min))
            (search-forward "\n\n")
            (delete-region (point-min) (point))
            (buffer-string))))))

(require 'json)

(json-read-from-string (tmp:api-bug t tmp:access-token tmp:key))
((total . 1)
 (page_size . 100)
 (page . 1)
 (quota_remaining . 9979)
 (quota_max . 10000)
 (has_more . :json-false)
 (items .
        [((link . "http://meta.stackexchange.com/questions/3122//247295#247295")
          (body_markdown . "this-is-an-answer-test-for-sx.el--e3eeb6228ed9c2c58e5385b73493f0f0")
          (share_link . "http://meta.stackexchange.com/a/247295/188148")
          (answer_id . 247295)
          (creation_date . 1421684370)
          (last_activity_date . 1421684370)
          (score . 0)
          (upvoted . :json-false)
          (downvoted . :json-false)
          (owner
           (display_name . "Sean Allred")
           (reputation . 160)))]))

(json-read-from-string (tmp:api-bug nil tmp:access-token tmp:key))
((total . 1)
 (page_size . 100)
 (page . 1)
 (quota_remaining . 9977)
 (quota_max . 10000)
 (has_more . :json-false)
 (items .
        [((link . "http://meta.stackexchange.com/questions/3122//247297#247297")
          (share_link . "http://meta.stackexchange.com/a/247297/188148")
          (answer_id . 247297)
          (creation_date . 1421684555)
          (last_activity_date . 1421684555)
          (score . 0)
          (owner
           (display_name . "Sean Allred")
           (reputation . 160)))]))

Cross-reference: https://stackapps.com/q/6083/11299


texts: Completion in Org Mode differs slightly from what manual promises

texts:
I don't seem to be getting the completion behavior in Org Mode that the manual says I should get (or see (info "(org)Completion")). It says that M-<TAB> will offer various Org specific completions in certain locations, for example:

• At the beginning of a headline, complete TODO keywords.

• After \, complete TeX symbols supported by the exporter.

• After *, complete headlines in the current buffer.

And a few other things like that. And the manual then says that "When point is anywhere else, complete dictionary words using Ispell."

OK, so here is what I actually get:

Prior to Org 9.2 (I tried with 9.1.9), both M-<TAB> and C-M-i call pcomplete which does everything the manual says except the last thing about using Ispell!
On Org 9.2, M-<TAB> calls pcomplete which does everything the manual says except the last thing about Ispell; and C-M-i calls ispell-complete-word that, obviously, just does the Ispell thing.

Weirdly, I cannot figure out where C-M-i is being bound to ispell-complete-word (according to C-h k the binding is in org-mode-map, but the Org Mode source files don't seem to mention ispell-complete-word at all).

I've tested both Org 9.1.9 and Org 9.2 starting from emacs -Q, so this shouldn't be a problem with my configuration.

Is the manual just wrong about the behavior of completion? In which case I should file a bug, I guess.
The behavior described in the manual sounds pretty sweet! How do I get it? That is, a single keybinding to do the Org specific completions and if none are possible, then use Ispell.
Just out of curiosity: how the hell is Org Mode 9.2 binding C-M-i to ispell-complete-word and how could I have discovered where it happens?


texts:
The situation I have is this.  First, I run

(require 'prolog)

...which loads the system's default version of prolog.el, and makes the variable prolog-mode-version available.  It has value "1.22".

Now, I know that my personal copy of this package, in /path/to/my/own/private/prolog.el, starts with

(defvar prolog-mode-version "1.25"
  "Prolog mode version number")

So I run

(load "/path/to/my/own/private/prolog.el")

...expecting that, after doing so, prolog-mode-version will now have value "1.25".

This is not what happens, though: according to describe-variable at least, the value of prolog-mode-version is still "1.22".

What must I need to do to (re-)load 'prolog from /path/to/my/own/private/prolog.el?


texts: smartparens insert single versus paired character?

texts:
Q: how can I tweak smartparens's decision rules for when to
  insert a paired or single character?

smartparens seems to be mostly smart when inserting single
quotes (e.g., in text-mode or org-mode).  Hence, it default to
inserting a pair of 's and placing the cursor in between them,
but, when invoked at the end of a word, only inserts a single '
in anticipation of contractions.  So, e.g.:

' => '*' (where * is point)
can + ' => can'* (so I can continue to write "can't")

However, there's a hiccup I'm looking to fix.  I often use
abbreviations that end in a period, but would like to make them
possessive.  For example, I might write "s.o." as an abbreviation
for "someone," and therefore "s.o.'s" would be "someone's."  The
problem is that smartparens inserts a paired-' after a period:

what I want: s.o. + ' => s.o.'*
what I get: s.o. + ' => s.o.'*'

My specific quibble is with smartparens's behavior on ', but I
can imagine this being a more general issue with other characters
as well.

So: how can I tweak smartparens's decision rule to expand the
set of characters after which it only inserts a single '?

PS: amusingly, trying to type "`smartparens`'s" in emacs gives the same irritating behavior.


texts:
When one uses C-c C-e to insert an environment such as enumerate in AUCTeX , one is presented with the prompt (Optional) Options (k=v): in the minibuffer.

I know that this is asking for options for the environment, but could someone please explain what the (k=v) means? It appears in certain environments' options prompts (e.g. enumerate, itemize), but not in others (e.g. figure, tabular). I couldn't find any explanation online. My AUCTeX version is 11.89, if that's important.


texts:
I define an alist like this:

 (setq major-mode-list
  '(((emacs-lisp-mode inferior-emacs-lisp-mode) . ("Elisp" "Emacs"))
    ((haskell-mode) . ("Haskell" "Haskell"))
    ))

And match current major-mode with this function:

 (defun major-mode-icon-3 ()
   (let* ((match (assoc
                  (car (mapcar
                        (lambda (element)
                          (member (buffer-local-value 'major-mode (current-buffer))
                                  element))
                        (map-keys major-mode-list)))
                  major-mode-list))
          (name (car (cdr match)))
          (icon (car (cdr (cdr match)))))
     )
   )

Function works correct in ((emacs-lisp-mode inferior-emacs-lisp-mode) . ("Elisp" "Emacs")).

But not correct in ((haskell-mode) . ("Haskell" "Haskell")). The function will
return nil because of (car (haskell-mode)).

Question: How to correct this function?


texts: A compilation-mode conundrum - matching and highlighting

texts:
Whilst playing around with compilation-mode for running tests and using HIGHLIGHT faces for failed expectations I've encountered a bit of a conundrum.

Question: why does my compilation-errors-regexp-alist fail to match when the matching group/s are preceded by more than a certain number of characters. And how best to mitigate this given my matching requirements.

Let me try and demonstrate.

I'm using GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2017-01-14

Here's some minimal code that reproduces the issue:

(defface face-frame
  '((t :foreground "white" :background "black" :weight bold)) "frames out for a failing test")

(defface face-wrong
  '((t :foreground "white" :background "darkred" :weight bold)) "highlight incorrect output in red")

(defface face-expected
  '((t :foreground "white" :background "darkgreen" :weight bold)) "show expected output in green")

(defconst error-regexp-alist
  '(("^Received\n\\(\\(.\\|\n\\)+?\\)\nExpected\n\\(\\(.\\|\n\\)+?\\)\n\\(.*\\):\\([[:digit:]]+\\)\n--$"
     5 6 nil nil nil (0 'face-frame) (1 'face-wrong) (3 'face-expected))))

(define-derived-mode weird-compilation-mode compilation-mode "Fixture Compilation"
  (set (make-local-variable 'compilation-error-regexp-alist)
       error-regexp-alist))

(defun demonstrate-weirdness ()
  (interactive)
  (with-current-buffer (get-buffer-create "*weird-regexp-matching-issue*")
    (compilation-start "./fixture.sh" 'weird-compilation-mode (lambda (m) (buffer-name)))
    ))

To reproduce:

Clone https://github.com/codeasone/compile-mode-weirdness.git
cd compile-mode-weirdness
Load compile-mode-weirdness.el
Run M-x demonstrate-weirdness

A compilation-mode buffer should appear with the output of fixture.sh, which produces test output to match against.

Looks good to me and it's what I want; output Received in error is highlighted RED and Expected output is highlighted GREEN, for both error cases

BUT, add a single addition 1 (or any other character) to the start of fixture.sh (after the cat << HERE of course) then switch back to the *weird-regexp-matching-issue* buffer and hit g to (recompile)

I designed the regexp to group everything between Received and Expected including new-lines, and similarly between Expected and file:line information:

^Received\n\\(\\(.\\|\n\\)+?\\)\nExpected\n\\(\\(.\\|\n\\)+?\\)\n\\(.*\\):\\([[:digit:]]+\\)\n--$

Note: it's a shame Emacs doesn't support lookbehind and lookahead facilities as it would have made things easier...

It appears to work fine outside the context of compilation-mode. I've tested it using various input strings via regex-tool, helm-regex, and using (s-match ...) to check my own sanity.

Regular expressions can be such a wind up...

Why is the matching and highlighting failing when the "preamble" output is extended beyond a certain length?

Perhaps someone with more experience with Emacs regular expressions or compilation-mode internals can help me out. Hopefully the code + examples will help others who find themselves in a similar boat using compilation-mode in the future.


texts: setting an org mode property header doesn't work for the first one

texts:
I cannot seem to set #+PROPERTY: header-args:R as the first value and have it work the way I expect it to. This is used as an example for org-mode here.

Setting a language specific property for :exports works. (I've put in some emacs-lisp source blocks, and those results do not get shown.

Providing a name for the session does not change the output (i.e. :session *R*)

Changing the order just makes the first one not work.

(As an aside, how can I check what a #+PROPERTY is set to?)

org-mode 8.3.3 from elpa package. emacs-version 24.5.1 on OSX.

Some minimally working examples follow.

This works:

#+PROPERTY: header-args :session
#+PROPERTY: header-args:R :exports both

#+BEGIN_SRC R
x = 3
#+END_SRC

#+BEGIN_SRC R
x
#+END_SRC

resulting in:

x = 3
3
x
3

Also this works

#+PROPERTY: header-args :exports both
#+PROPERTY: header-args:R :session

#+BEGIN_SRC R
x = 3
#+END_SRC

#+BEGIN_SRC R
x
#+END_SRC

and results in the same results as above.

This does not work:

#+PROPERTY: header-args:R :session
#+PROPERTY: header-args:R :exports both

#+BEGIN_SRC R
x = 3
#+END_SRC

#+BEGIN_SRC R
x
#+END_SRC

resulting in:

x = 3
3
x

Also does not work

#+PROPERTY: header-args:R :exports both
#+PROPERTY: header-args:R :session

#+BEGIN_SRC R
x = 3
#+END_SRC

#+BEGIN_SRC R
x
#+END_SRC

resulting in:

x = 3
x


texts: What does (require 'package) mean for emacs and how does it differ from load-file?

texts: I just began using emacs a few days ago and I read somewhere that (require 'package-name) is not needed when the said package is installed using package-install. But why, what does (require 'package-name) actually do and how does it differ from load-file or load procedures ?


texts: How to show details initially in Dired mode?

texts:
windows 10, emacs 26.1

Here dired in summary mode:

If I want to show detail I press ( and here result:

Nice. But I want always to show dired in details.
So I set this variable:

 '(global-dired-hide-details-mode nil)

but it not help. It always show dired in summary mode.


texts: How to check if emacs shell buffer busy or not?

texts:
If I start a long-running process in an emacs shell create by (shell), the shell will be busy for a while.  How can I detect that programmatically (i.e., using elisp)?

I tried: get the process by (get-process "shell") and test (process-live-p proc), but it always return t.


texts: Aborting desktop save without aborting Emacs close

texts:
I have the following code in my init files for auto saving the desktop:

(desktop-save-mode 1)
(setq desktop-dirname             (concat user-emacs-directory "tmp/")
      desktop-base-file-name      "emacs-desktop"
      desktop-base-lock-name      "lock"
      desktop-path                (list desktop-dirname)
      desktop-save                t
      desktop-load-locked-desktop nil)
(add-to-list 'desktop-globals-to-save 'file-name-history)
(add-to-list 'desktop-modes-not-to-save 'dired-mode)
(add-to-list 'desktop-modes-not-to-save 'Info-mode)
(add-to-list 'desktop-modes-not-to-save 'info-lookup-mode)
(add-to-list 'desktop-modes-not-to-save 'fundamental-mode)

However, when by some mistake I open another session of Emacs (by running emacs24 and not emacsclient), and I want to close it, Emacs prompts me for a place to save the destop file:

  Directory of desktop file: ~/

The problem is that there is no way to abort and simply tell this Emacs session to end (I have to kill the task by force from the terminal).

Is there a way to avoid this behavior, say by instructing the new session not to bug me with the desktop file?


texts:
I am sure this is a trivial question, but I just started out and honestly can't solve it.

I have a plain org file. Where I created a couple of headlines, which I tagged. How do I list all headlines with a given tag? (org-tags-view) seems to be the right tool for that. But calling it with C-c a m does not work, because after the a it tells me that a is undefined.

Edit:
Lets say I have a simple file: test.org

header1          :tag1
header2          :tag2
header3          :tag1

Now I want to retrieve header1 and header3 and maybe its content. And I thought I can do that by typing C-c a m and "tag1". But C-c a gives me "a is undefined"


texts: Emacs freeze after selecting a org-capture template

texts:
I'm new to org-mode. I've tried to set up a simple TODO list by calling org-capture and when I select my [t] todo item on *Org Select*, Emacs freezes and I need to kill its process.
On the mini-buffer I can read the following error message:

Clipboard pasted as level 2 subtree
Error in post-command-hook (linum-update-current): (args-out-of-range 1 1)

I've updated all packages to the latest version, and reinstalled the latest Emacs 25, but the error persisted. Does anyone have an idea where this might be coming from? Am I overseeing something very simple?
Thanks a lot.
In case this is important..
on init.el:
(setq org-capture-templates
       '(("t" "todo" entry (file+headline "/Users/dgomez/todo.org" "Tasks")
          "* TODO [#A] %?")))

GNU Emacs 25.0.50.1 (x86_64-apple-darwin15.0.0, NS appkit-1404.13 Version 10.11.1 (Build 15B42)) of 2015-11-25


texts: PDFView: allow vertical scrolling till the last line becomes the top one

texts: I would like be able to link from an org buffer to a precise place in the PDF. When such a link is clicked, the PDF would be opened in a PDFView buffer on the required page and vertically scrolled so that the required line is the top one. The problem is that the PDFView buffer does not scroll if the last line already fits in the window, but goes to the next page. Is there a way to allow scrolling as far as making the last line the top one?


texts: How to create and traverse a multidimensional list

texts:
I have code like this:

(let* ((l1 '(1 2 3))
       (l2 '(4 5 6))
       (l3 '(7 8 9))
       (ml '(l1 l2 l3)))

  (dolist (l ml)
    (message "%s" l)
    (dolist (e l)
      (message "%s" e))))

But it does not work, why?


texts: How to include lines in a regular expression search which might not be present?

texts:
I'm using a regular expression search which is working as expected.

This searches for unified diff file entries and works as expected.

(re-search-forward
  (concat
    ;; Prefix '+++ '.
    "^"
    "\\-\\-\\-[[:blank:]]+.*\n"
    "\\+\\+\\+[[:blank:]]+.*\n"
    ;; May have trailing text which can be safely ignored.
    "@@[[:blank:]]+.*[[:blank:]]@@")
  nil t 1)

However some diffs have leading lines, eg:

 // some context text.
diff --git a/my_source.c b/my_source.c
index 43484a57f1c..5985d498606 100644
--- a/my_source.c
+++ b/my_source.c
 // some other context text.

My question is:

How can I include lines in the search which may or may not exist?

In this case: diff and index.

I tried this but it doesn't work, the \n literals prevent the following ^ from being detected.

(re-search-forward
  (concat
    ;; This fails :(
    "\\(\\|^diff[[:blank:]]+.*\n\\)"
    "\\(\\|^index[[:blank:]]+.*\n\\)"
    ;; Prefix '+++ '.
    "^"
    "\\-\\-\\-[[:blank:]]+.*\n"
    "\\+\\+\\+[[:blank:]]+.*\n"
    ;; May have trailing text which can be safely ignored.
    "@@[[:blank:]]+.*[[:blank:]]@@")
  nil t 1)

How can these lines be included in the search if they exist, otherwise left as empty groups if they aren't present?


texts:
This is a newbie question.
I'd like to have a red cursor with a width of 4. This code doesn't work:
(setf cursor-type '(bar . 4))
(set-cursor-color "#FF0000")

how can i correct this to display a red cursor with a width of 4?


texts: Is there an existing function to add docstrings, relevant to the current major mode?

texts:
In emacs is there a function that I can invoke to add a docstring template based on the current major mode?

eg:

If I'm working on javascript, insert a javascript docstring template "here", like:

/**
 * Docstring
 *
 */

If I'm working on python, insert a python docstring template "here", like:

"""Docstring"""


texts:
Why the following in emacs-lisp works as expected:

(set-difference '(1 2) '(1))
=> (2)

But if strings used it doesn't:

(set-difference '("foo" "bar") '("foo"))
=> ("foo" "bar")

How do can I calculate set difference for sets of strings?


texts: How to immediately resize the minibuffer window?

texts:
Suppose that I have this function, that inserts some stuff into the minibuffer:

(defun foobar ()
  (interactive)
  (minibuffer-with-setup-hook
      (lambda ()
        (let ((resize-mini-windows t))
          (save-excursion
            (insert "foo\nbar")
            (fit-window-to-buffer))))
    (read-from-minibuffer "string: ")))
(global-set-key (kbd "M-RET") 'foobar)

It works fine if I call it from any buffer, except when I'm already in the minibuffer.

For example, if I eval (read-from-minibuffer "test: "), and then press M-RET, my minibuffer becomes string: foo (note the 1 line height). After I press any character, I see that bar is also in the minibuffer.  The problem is that the minibuffer height won't update until I press any character.

Why does this happen and how to get around it?


texts: How to enlarge latex fragments in org mode at the same time as the buffer text?

texts:
I'm using org-mode in emacs, but I think the question is also relevant for auctex users.

In org-mode you can show latex fragments, as the manual demonstrates.

But: these fragments (mostly math formulae) seem to have constant size.  When I type C-x C-+ or C-x C-- only the buffer text size changes.  How can I change the fragments size from the buffer?

(I know I can make the fragments larger or smaller with org-format-latex-options, but this is permanent. I want to change the size of the fragments (the png files) like the text.)


texts: How to customize the line character length in elpy?

texts:
I am using elpy for my Python development, but I would like to set the per-line character limit to 120 instead of the default 80 used by PEP8. Any suggestions on how I can do this? Even better, it would be great if I can customize this setting on a per-project basis.

I have tried the following:

M-x customize-group elpy
M-x customize-mode elpy-mode
M-x customize-mode python-mode

but I can't seem to find the option that customizes the line character limit.


texts: How to clang-format the current buffer on save?

texts: Whats the best way to clang-format a C/C++/GLSL a buffer on save, that does nothing in the case there is no clang-format file found for a project?


texts: Convert old advise ad-set-arg to new advice

texts:
How would I convert the following old style advice to a new style advice?

(setq python--pdb-breakpoint-string "import pdb; pdb.set_trace()")

(defadvice compile (before ad-compile-smart activate)
  "Advises `compile' so it sets the argument COMINT to t
if breakpoints are present in `python-mode' files"
  (when (derived-mode-p major-mode 'python-mode)
    (save-excursion
      (save-match-data
        (goto-char (point-min))
        (if (re-search-forward (concat "^\\s-*" python--pdb-breakpoint-string "$")
                               (point-max) t)
            ;; set COMINT argument to `t'.
            (ad-set-arg 1 t))))))

Snippet from: https://masteringemacs.org/article/compiling-running-scripts-emacs

From Porting old advice, the recommendations are :around or :filter-args.

Using :filter-args, I'm at a loss for what to return for the first argument of compile.  The first argument is command.  I have no clue what that is, or might be, and don't know how to find it during advising/let it pass through.

(advice-add 'compile :filter-args
            (lambda ()
              (when (derived-mode-p major-mode 'python-mode)
                (save-excursion
                  (save-match-data
                    (goto-char (point-min))
                    (if (re-search-forward (concat "^\\s-*" python--pdb-breakpoint-string "$") (point-max) t)
                        ;; new arglist:
                        ;; (command t)
                        ))))))

Using :around, I think I have the same issue, but it's hard to tell.  I'm getting overwhelmed by the documentation.  It seems like I would need to call apply if the if passes and call the original compile otherwise:

(advice-add 'compile :around
            (lambda (oldcompile)
              (when (derived-mode-p major-mode 'python-mode)
                (save-excursion
                  (save-match-data
                    (goto-char (point-min))
                    (if (re-search-forward (concat "^\\s-*" my-python-break-string "$")
                                           (point-max) t)
                        (apply oldcompile command t)
                       oldcompile))))))


texts: bind Shift-; to execute-extended-command

texts:
What is the proper way to bind S-; to execute-extended-command?

I tried this (bind-key* "S-;" 'execute-extended-command) but doesn't work. bind-key is a function from use-package.

Update

I use evil mode.


texts: Value of confirm-kill-processes is ignored

texts:
When closing emacs, if I have unsaved buffers its a long process of having to read the questions (at first the logic is 'n' to not save and exit), then it changes to must type yes. Ideally there would be no 2nd question where one has to type out yes or no (it is redundant).

So I am trying to make it exit straight away with no questions (less ideal) with these lines in init.el:

;; Dont ask to save when quitting
(setq confirm-kill-processes nil)

But nothing of the behavior has changed. I still get asked all the same questions. If I read the help on the variable I can confirm its value has been changed to nil:

confirm-kill-processes is a variable defined in ‘files.el’.
Its value is nil
Original value was t

Documentation:
Non-nil if Emacs should confirm killing processes on exit.
If this variable is nil, the value of
‘process-query-on-exit-flag’ is ignored.  Otherwise, if there are
processes with a non-nil ‘process-query-on-exit-flag’, Emacs will
prompt the user before killing them.

You can customize this variable.

This variable was introduced, or its default value was changed, in
version 26.1 of Emacs.


texts: Relative path link to .xls file from org-mode

texts:
I want to be able to link to an .xls file from org-mode.

Reading up online this seems to be the way to get the links to open correctly, however even if I change the link type to `file+sys' the file still gets opened within Emacs, instead of in Excel.

[[file+sys:./foo/bar.xls]]


texts: How to add additional info manuals to emacs' collection

texts:
Is there an easy way to supplement emacs' info manual with additional nodes?

Or does one have to go through http://www.gnu.org/manual/manual.html to download manuals, and then manually insert them into emacs?
This seems pretty tedious, especially since there are numerous documents that I would like to add. (gdb, C, gcc, djvu package, etc.)

On the same line, I have installed gdb through homebrew (on OS X Yosemite) but still when I run the command "info gdb" in the terminal it brings me to the man pages. Shouldn't info pages come packaged with GNU installations by default?

EDIT

What I meant by "an easy way" was an interface through emacs or likewise such as that for packages (package-list-packages function in emacs).


texts: how do I customize spacemacs default buffer

texts:
I would like to make some change on  spacemacs's default buffer *spacemacs*,like
move recently files and projects to left and show my TODO list in the right or bottom from another file


texts:
How do I play Tetris inside Emacs?

I've done this a long time ago but I can't remember the commands.


texts: Can I instruct ispell to insert LocalWords in a different file?

texts: Sometimes my LocalWords can get very long.  In Org documents, it's awkward to have this 'appendix' of dictionary junk.  I'd like to move this to a separate file (.dir-locals.el if possible).


texts: Variant of read-regexp that shows matching string candidates upon TAB

texts: I'm looking for an extension of read-regexp, that given an additional parameter of completion candidates, shows the matching subset of these candidates in the minibuffer, when tab is pressed. Similar to how find-file *.el TAB shows list of files that match a path wildcard. One solution is to modify read-regexp to take an optional list of possible completions instead of the value of (read-regexp-suggestions).


texts:
Emacs version 26.1, compiled on CentOS 7.5 , running ada-mode 5.3.1.

The parser works correctly, but the problem is that keywords aren't being coloured. When I run describe font on the keyword, it is not reporting the word as a keyword. Any one know where to look to correct this? It's a new thing in my new installation; worked fine on 25.1 compiled on RedHat 7.2

Note I get correct behaviour when editting Python, but not Ada.


texts: ncurses-like based applications won't work in emacs terminals

texts:
No *curses applications (like top, htop, Linux kernel's make menuconfig and others) will work under emacs' different terms. However, the only one which seems to work is git add -i

It behaves the same under term, multi-term and ansi-term: output a lot of messy garbage. It does the same when not splitting frames and I reproduced this behavior without any configuration (moved .emacs and .emacs.d somewhere else).

I included a screenshot of when I tried a make menuconfig in Linux kernel's base directory.

I am running GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-17 on lgw01-04, modified by Debian in GUI on Ubuntu 16.04.

Is there a way of fixing this ? Is it just an isolated bug or related to emacs in general ?


texts:
I have a setup where I use EDE from CEDET for C projects development (among other things) and the real good flycheck on-the-fly syntax checking.

I have defined ede-cpp-root-project in my .emacs file for several projects where I have set project include-path variable to include the whole set of my project includes for each project. This works splendidly; auto-complete works and the all the includes are found by the semantic package for every project.

Now the question is how to set up this same include path for flycheck without heavy duplication?

Edit: I'm using gcc with flycheck, although I guess it doesn't make too much difference compare to clang.


texts: How do I resolve Ubuntu 16.04 emacs v46.1 default versus compiled v25.2-1 "downgrade"?

texts:
I'm working for the first time on an Ubuntu 16.04 LTS machine, and honestly I'm not sure if this is an emacs build/debian package question or if it's an Ubuntu 16.04 question. Please nudge me in the right direction.

When I got this new machine I installed emacs from the up-to-date apt repository and got emacs 24.5.1.

I wanted to get the latest/greatest, and so I used the information found at ubuntuhandbook.org/index.php/2016/09/install-gnu-emacs-25-1-in-ubuntu-16-04/ to get and build the source to a .deb file, and then install it using dpkg. That all seemed to work fine without error.

Having done that, I had /usr/bin/emacs pointing to 24.5.1 and /usr/local/bin/emacs pointing to 25.2-1. Both seem to execute fine.

When I look at the package information using "apt-cache show emacs" I see both:

Package: emacs
Version: 46.1
Section: editors
Depends: emacs24 | emacs24-lucid | emacs24-nox

Package: emacs
Version: 25.2-1
Section: checkinstalled
<no Depends>

When I installed the newly built 25.2-1 version, dpkg announced:

dpkg: warning: downgrading emacs from 46.1 to 25.2-1

Finally, when I got on the machine a day later, I found that my new emacs 25.2-1 was gone. This morning I learned about the unattended-upgrades package which is installed and has enabled auto upgrades of available packages. So, I think what is going on is that on a daily basis an upgrade is performed which "fixes" the "downgrade" that I manually performed.

Does anybody know how to resolve this? Can both coexist? Are there known issues with the instructions I used for building 25.2 for Ubuntu? Do I need to build emacs 25.2 differently so the package version is 46.2 (seems like a hack)? Is there something about my built package being in Section "checkinstalled" that impacts this? I'm not sure where to go.

What I'd like not to do is disable unattended upgrades if that can be avoided.

Thanks for your time.


texts: How to show all contents of current subtree and fold all the other subtrees?

texts: When using org build subtree navigation functions to move around, I want to show all the content of current one recursively, and hide any other subtrees that having a higher or same level of the current one. How to achieve this ? Thanks !


texts: How to know the first and second level heading above the cursor?

texts:
I'm editing a 4.7M pure-text document, the task is simple, every book have chapters, and every chapter have each of its lines enumerated at the begin of the line, what I'm doing it putting the name of the book, the chapter number next to the verse number of each line. Let me illustrate the text structure:

* A very important book

** The old part

*** BOOK ONE

**** Chapter 1
1 Lorem ipsum dolor sit amet, consectetur adipiscing elit.
2 Donec pharetra venenatis felis, non mollis ligula pharetra sit amet. Fusce sodales, arcu vel imperdiet rhoncus.

**** Chapter 2
1 nulla felis fermentum neque
2 at posuere urna quam et eros. Sed sed rhoncus felis

*** BOOK TWO

**** Chapter 1
1 a lacinia velit. Aliquam erat volutpat.
2 Donec at congue sapien.

**** Chapter 2
1 Integer arcu erat, luctus quis orci et,
2 feugiat placerat tortor.

and this is what I want to achieve:

* A very important book

** The old part

*** BOOK ONE

**** Chapter 1
Book one 1, 1: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Book one 1, 2: Donec pharetra venenatis felis, non mollis ligula pharetra sit amet. Fusce sodales, arcu vel imperdiet rhoncus.

**** Chapter 2
Book one 2, 1: nulla felis fermentum neque
Book one 2, 2: at posuere urna quam et eros. Sed sed rhoncus felis

*** BOOK TWO

**** Chapter 1
Book two 1, 1: a lacinia velit. Aliquam erat volutpat.
Book two 1, 2: Donec at congue sapien.

**** Chapter 2
Book two 2, 1: Integer arcu erat, luctus quis orci et,
Book two 2, 2: feugiat placerat tortor.

I'm looking to build a function that works over the entire buffer. What I want to know is: How can I get the information regarding the heading where the regular expression have a coincidence and is going to apply the replacement string? I need to know that to prepare the correct replacement string.


texts: emacs-snapshot from Ubuntu PPA is currently totally broken

texts:
I have updated emacs-snapshot earlier today and it broke my Emacs installation into pieces (it is Ubuntu 14.04).
It somehow removed whole emacs24 package so now I have no even emacs-client installed.

apt-cache policy emacs-snapshot

shows that latest version is installed but emacs-snapshot is not known command in bash and
find / -type f -name 'emacs-snapshot*'

can't find any binary.

How can this be fixed?

Proposed actions:

$ dpkg-query -L emacs-snapshot
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/emacs-snapshot
/usr/share/doc/emacs-snapshot/changelog.gz
/usr/share/doc/emacs-snapshot/copyright

It seems like just some docs are installed from here.


texts:
I'm having trouble using:

(add-hook ’before-save-hook #’gofmt-before-save)

This is supposed to format the go code before saving.  The error I get is:

Debugger entered--Lisp error: (invalid-read-syntax "#")
  read(#<buffer  *load*>)
  eval-buffer(#<buffer  *load*> nil "/home/bennett/.emacs" nil t)  ; Reading at buffer position 774
  load-with-code-conversion("/home/bennett/.emacs" "/home/bennett/.emacs" t t)
  load("~/.emacs" t t)
  #f(compiled-function () #<bytecode 0x258a41>)()
  command-line()
  normal-top-level()

The only "weird" thing I'm doing is using packages to load go-mode, rather than doing it manually.  The code is here:

(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
                         ("melpa" . "https://melpa.org/packages/")))

;; Broken.  Which is weird, since it came straight from the *Help* for go-mode

(add-hook ’before-save-hook #’gofmt-before-save)

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(diff-switches "-u")
 '(package-selected-packages (quote (go-mode)))
 '(send-mail-function (quote mailclient-send-it))
 '(show-paren-mode t))

;;; uncomment for CJK utf-8 support for non-Asian users
;; (require 'un-define)
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:family "DejaVu Sans Mono" :foundry "PfEd" :slant normal :weight normal :height 90 :width normal)))))

Any thoughts?  I'm pretty far out of my element, here.  I tried it without the # character, thinking it was a typo.  I get a different error, but it still doesn't work.


texts:
I'm getting this error when trying to run helm-git-grep. As soon as I start typing the first character of the pattern, I get this:

Error running timer: (error "Candidates function `helm-git-grep-process' should run a process")


texts: How do I open a non-readable file from inside emacs when I opened emacs as a regular user?

texts:
The question pretty much says it all.  I opened emacs as a regular user and am trying to edit something in the /etc/ folder (I know this is dangerous etc. etc.)

How can I do this?


texts: straight.el: confusion regarding emacsmirror and eldoc.el

texts:
I use straight.el to manage my packages and it usually works great.
Somehow recently I got the straight-managed package eldoc out of sync in ~/.emacs.d/straight/repos/eldoc; it had unresolved merge conflicts.
Digging into that, it seems straight.el was using a copy of eldoc.el from github.com/emacsmirror/eldoc; eldoc.el is also now part of emacs 27 (I'm using 27.1 on Mac).
As far as I can tell, when I start my emacs, it's still using the built-in eldoc.el and not the straight.el-managed copy.
So then I decided to delete my entire .emacs.d/straight dir and regenerate it, and now straight/eldoc/eldoc.el comes from github.com/emacs-straight.
My Emacs's built-in eldoc.el looks fairly old (doesn't have a version name in the source). The latest in Emacs's master branch is 1.10, and the version on github.com/emacsmirror is 1.8. The version in github.com/emacs-straight is 1.10, which seems good.
Could someone explain the interaction between straight.el, emacsmirror, and packages that are part of Emacs like eldoc.el? Why is there a slightly-outdated copy of eldoc.el in emacsmirror at all? Why did straight.el load it from there (especially if it's not going to be used)? I don't really understand straight's recipe discovery/loading system, I guess. I have read about why github.com/emacs-straight exists, and that seems like a good idea, but I still don't see how having eldoc.el there helps if it's built-in, unless it can override the built-in version.


texts: magit: how do I turn off the -S (--gpg-sign) argument when committing?

texts:
I forgot my GPG key at home and want to check in the code until I am home and can amend/resign the commits. Unfortunately I can't seem to figure out how to disable the --gpg-sign= argument in the magit commit popup, which is preventing me from committing.

I took a look in the manual and it says you can toggle these on and off, but doesn't specify how one toggles them.

Cheers!

Edit: In my magit popup the option appears as -S not =S. In the past I know that I could do just =S to disable it. I can't figure out how to do it with it now being prefixed with -.


texts: Auto-save buffers that aren't visiting files

texts:
I often do something like:

C-x b foobarbaz RET

to get a new buffer for taking notes, etc. I'd love for emacs to just snapshot and dump all open buffers to disk occasionally. There's lots of documentation out there for improving auto-save and backup functionality but those all relate to buffers that are currently visiting a file.

I'd like emacs to periodically snapshot/save ALL buffers to disk. This will surely cause some noisey 'output' buffers to get written to disk, but who cares? Disk space is cheap.

Is there anything built in to do this? Right now if my computer (or emacs) crashes, I often lose lots of notes that I've taken in various buffers.


texts:
I am trying to install elpy on my machine (ubuntu 14.04), but getting the following issue. any comment, hint?

Thanks.

Requirement already satisfied (use --upgrade to upgrade): elpy in ./work/software/anaconda3/lib/python3.5/site-packages
Requirement already satisfied (use --upgrade to upgrade): importmagic in ./work/software/anaconda3/lib/python3.5/site-packages (from elpy)
Requirement already satisfied (use --upgrade to upgrade): flake8>=2.0 in ./work/software/anaconda3/lib/python3.5/site-packages (from elpy)
Requirement already satisfied (use --upgrade to upgrade): setuptools>=0.6b1 in ./work/software/anaconda3/lib/python3.5/site-packages/setuptools-20.3-py3.5.egg (from importmagic->elpy)
Requirement already satisfied (use --upgrade to upgrade): pyflakes!=1.2.0,!=1.2.1,!=1.2.2,<1.3,>=0.8.1 in ./work/software/anaconda3/lib/python3.5/site-packages (from flake8>=2.0->elpy)
Requirement already satisfied (use --upgrade to upgrade): pycodestyle<2.1,>=2.0 in ./work/software/anaconda3/lib/python3.5/site-packages (from flake8>=2.0->elpy)
Requirement already satisfied (use --upgrade to upgrade): mccabe<0.6,>=0.2.1 in ./work/software/anaconda3/lib/python3.5/site-packages (from flake8>=2.0->elpy)


texts: Changing the way org-links behave on clicking only when it's a text file

texts:
I'd like to change the way org-links behave on clicking only when it's a text file etc.

i.e. I'd like to have org-links opens up a new frame with the buffer of the link in it only when it's the link of a .txt, .el, or .png file. I already found a snippet below that basically does this, but I can't figure out how to assign this command to the left click so that it runs the command only when it's on org-links. How can I do that?

(defun zin/org-open-other-frame ()
  "Jump to bookmark in another frame. See `bookmark-jump' for more."
  (interactive)
  (let ((org-link-frame-setup (acons 'file 'find-file-other-frame org-link-frame-setup)))
    (org-open-at-point)))


texts:
I'm using elpy for my python coding. I wanted to try ipython because of the nice built in profilers. So what I've done is to install ipython within my virtualenv. It works correctly. I then added the following line to my init.el

(elpy-use-ipython)

However after restarting emacs I get the error that command iypthon is not found. Is it possible to set ipython on a virtualenv basis? Or how can I fix the issue. I'm running linux debian 9.3 stretch


texts: Stop dired opening second window of already open directory

texts:
When I open a directory using dired and there is already the same directory opened in dired, a second one is opened with <2>. How can I inhibit this creation of the duplicate window and switch to the existing one?

I know that I can set dired to use only one window, but I just do not want to have two dired windows for the same directory.

Dired naturally does this when I open the same path twice. But I access the same directory via different paths (via symlinked paths), I seem to have the duplicates. How can I reuse the same window when I access the same directory through different paths because of symbolic links?


texts: How to search among all the commands / functions?

texts:
I often forget the names of many commands and always have to look up the internet or the manual but it would be good if i could search within emacs among all the commands / functions

For eg: I know there is a commands to export org file to html but do not know how it begins...so would be great if i could just search for 'export' in all available commands and get a list of all functions which have export in their name.

how can i do this?

I am still amateur so pardon for asking very simple question..


texts: How to migrate snippets of scripts into my own packages?

texts:
While there are many docs on how to write packages, mirror your own package git repo's ... etc. This seems quite a heavy solution.

What would be a good approach to having some local packages which can each be their own repository, without having to mirror MELPA for eg.

EDIT: I'm not so fussed exactly how this is setup, if it uses the package manager or not. However the items that are extracted into their own functionality should be packages - so if others find it useful, they can use it as a package too (otherwise this is no different from including files).

In VIM (VimPlug for eg) I can simply point to a git repo. I'm not necessarily looking for an exact equivalent to VimPlug in Emacs, just something better then including everything in my init.el ... or mirroring an entire package repo - would be handy.


texts: I have a big org file with lot of topics, and every topic have a books subheading. I would like write a function that can generate a list of all books in org-table. I was trying with (org-map-entries) but no luck so far ;)


texts:
I have:
(setq mode-line-end-spaces "string")

That displays string in the mode-line.
How can I get string in red there?


texts: Disable indenting on org-babel restclient edits

texts:
Despite I am not a new Emacs user, my elisp is nearly not existent.

I want to present some REST API stuff with epresent and org babel restclient. This is working fine until I want to edit a source block (request) inline during the presentation.

You can reproduce this by using the following org structure

* Testitem
#+begin_src restclient

#Get URL:
GET https://www.bing.com

#+end_src

I tried to disable electric indent mode in my init.el to check if this is the reason, but no luck.

(electric-indent-local-mode -1)

If I call the edit function (I need to change an URL param, due to preceding requests within the presentation) and confirm the edit with C-c ', the code is indented by 2 spaces and the source snippet is not shown/working anymore in epresent hereafter. It changed to:

* Testitem
#+begin_src restclient

  #Get URL:
  GET https://www.bing.com

#+end_src

Which is then not shown anymore and thus also not executable within epresent.

Can anyone point me to the reason for the indentation of the restclient source block and how to disably this?


texts: How to pass environment variables to org source BASH script block?

texts:
I have a BASH script in org-mode file as org-babel source block. I hope to pass value contains environment variable to it through :var.

something like these:

#+begin_src sh :var VAR1="~/foo"
  mkdir ${VAR1}/test

and

#+begin_src sh :var VAR1="${MY_ENV_VAR}/foo"
  mkdir ${VAR1}/test

When I run the code block with C-c C-c, they all complain about can't find that ${VAR1} directory.

I think inside the bash shell, ${VAR1} is not expended proper.

What's the right way to do it?


texts:
I have the following in my init file.

;; ======= Company mode set up ============
(use-package company
  :ensure t
  :defer t
  :init (add-hook 'after-init-hook 'global-company-mode)
  :config
  (use-package company-irony :ensure t :defer t)
  (define-key company-active-map (kbd "TAB") 'company-complete-common-or-cycle)
  (define-key company-active-map (kbd "<tab>") 'company-complete-common-or-cycle)
  (define-key company-active-map (kbd "S-TAB") 'company-select-previous)
  (define-key company-active-map (kbd "<backtab>") 'company-select-previous)
  (setq company-require-match 'never)
  (setq company-idle-delay              nil
        company-minimum-prefix-length   2
        company-show-numbers            t
        company-tooltip-limit           20
        company-dabbrev-downcase        nil
        company-backends                '((company-irony company-gtags)))
  :bind ("C-;" . company-complete-common))

I also use helm-flyspell like so:

(require 'helm-flyspell)
(define-key flyspell-mode-map (kbd "C-.") 'helm-flyspell-correct)

Now when I do C-. it gives me a helm buffer with the usual ability to select the correct spelling. The problem is when I want to do company-complete-common I do C-;. However, I have found that
C-; is bound to the variable flyspell-auto-correct-previous-word whenever I am in latex mode.

What I want is for C-; to be bound to company-complete-common at all times and flyspell-auto-correct-previous-word bound to some other key combination. Perhaps map it to f12. How can I do this without messing up what I already have? Thanks.


texts: Recommendations for eval on save workflow for projects?

texts:
I've started to write a package and excessive use of the interactive eval-* functions has become a pain point for me.

After I make a change re-evaluating entire file or package is almost always appropriate.  eval-buffer is usually sufficient and usually what I run.

Since I'm an emacser with the C-x C-s Tourette-esque tic eval'ing the buffer would be something I'd like to happen automatically on save.  I'm writing elisp, but I can imagine other circumstances where the same workflow would be useful.  Eval'ing the entire project (i.e. (require 'my-package)) would often also be sufficient in cases that the package is in load-path.

I've started to use .dir-locals.el files in these projects which add a buffer-local after-save-hook:

((emacs-lisp-mode
   (eval add-hook 'before-save-hook 'eval-buffer nil t)))

What would be a better way to accommodate this sort of workflow / What other ways have people implemented this workflow?

I'm wishing there's something in the realm of zero-configuration "Do what I mean" to figure out / track which projects/directories/files I want eval'd on save and do it.  I happen to use projectile, but am still curious about broader possibilities which may or may not be usable with projectile.

A few thoughts:

projectile-load-settings
global hook conditioned on a file ("Cask"?) existing in the project root


texts: Using different namespaces for repl and buffer: How to send s-expression to repl without leaving current buffer?

texts:
Basically I want to use this function. It takes the last s-expression before point, copies it into the repl, evaluates and prints the result, and then returns to the Clojure file.
(define-key cider-mode-map (kbd "C-c C-p")
  (lambda ()
    (interactive)
    (cider-insert-last-sexp-in-repl -1)
    (cider-switch-to-last-clojure-buffer)))

It works as long as the namespace in the Clojure file and the repl is the same, otherwise it breaks down. Everything I try to fix that messes up the output.
(define-key cider-mode-map (kbd "C-c C-p")
  (lambda ()
    (interactive)
    (let ((sexp (cider-last-sexp))
          (clj-ns (cider-current-ns))
          (repl-ns (with-current-buffer (cider-current-repl)
                     (cider-current-ns))))
      (when (not (equal repl-ns clj-ns))
        (cider-repl-set-ns clj-ns))
      (cider-insert-last-sexp-in-repl -1)
      (cider-switch-to-last-clojure-buffer))))

Preceding version produces this output. The namespace also reverts back which is suprising to me. Before the keybinding is used "firstns" is the namespace in the repl and "secondns" is the namespace in the clojure file. The s-expression before point in the Clojure file is (str "abc" "123").
[...]
firstns> (str "abc" "123")
"abc123"secondns>
firstns>

I want output like this:
[...]
firstns> (str "abc" "123")
"abc123"
secondns>

Or even better:
[...]
firstns>
secondns> (str "abc" "123")
"abc123"
secondns>

Or maybe:
[...]
firstns> (in-ns 'project.secondns)
secondns> (str "abc" "123")
"abc123"
secondns>


texts: Is it possible to use org-babel for periodic automated calls?

texts:
Is it possible to have an org-babel snippet that calls itself periodically e.g. every second and updates its RESULTS output?
#+BEGIN_SRC emacs-lisp
  (current-time-string)
#+END_SRC

The following snippet freezes my emacs:
#+BEGIN_SRC sh :async
  while true; do date; sleep 1 ; done
#+END_SRC

If possible, I was planning to use it for http & sql org-babel snippets, emacs-lisp example above is the simplest example.


texts: Thumbnails not displaying with image-dired

texts:
Background: I recently found out about image-dired, so I'm playing around with it and trying to get it to work. It seems to mostly work, but when I image-dired into a directory (we'll call it ~/Documents/Images) that has a handful of images it only shows the thumbnail for the first image in the directory, and in the minibuffer returns the error:
error in process sentinel: Wrong type argument: processp, [nil 24302 41099 85815 nil image-dired-thumb-queue-run nil nil 0]
What I've done so far: after reading this, I thought that maybe my problem could be triggered by not having imagemagick installed. However, after installing it (which was a pain) and confirming that emacs can see imagemagick by testing M-! convert, I get the same behavior. I've found (what I think is) the source code for image-dired here, and I can see that there is a function called image-dired-thumb-queue-run, but I don't know enough lisp to know what it's doing or if it's the function causing my problems.
Questions:

What is causing my error?
How can I get normal behavior from image-dired? (i.e., display all thumbnails for a given directory)

Notes: I'm using Emacs 26.3 (with built-in image-dired) on Mac OS Catalina.


texts: Override syntax highlighting with color of hex code.

texts:
From EmacsWiki: Hex Colour, it is explained how to get in-line syntax highlighting of hex code, and other formats of color. For instance with

(defvar hexcolour-keywords
  '(("#[abcdef[:digit:]]\\{6\\}"
      (0 (put-text-property (match-beginning 0)
                            (match-end 0)
                            'face (list :background
                                        (match-string-no-properties 0)))))))

But when I try this with some emacs-lisp such as

(set-face-attribute 'org-todo nil
                    :weight 'bold :box '(:line-width 1 :color "#D8ABA7")
                    :foreground "#D8ABA7" :background "#FFE6E4")

the hex is not given the color face. If I try M-x describe-face on these, I find face is org-block-background. Is there a good way to override this?


texts:
I have some code from "Writing GNU emacs extensions". It is merely a script that allows you to get back to the previous position, kinda like an undo for the buffer position:

(put 'scroll-up 'unscrollable t)
(put 'scroll-down 'unscrollable t)
(put 'scroll-left 'unscrollable t)
(put 'scroll-right 'unscrollable t)

(defvar unscroll-point (make-marker)
  "Text position for next call to 'unscroll'.")

(defvar unscroll-window-start nil
  "Window start for next call to unscroll.")

(defvar unscroll-hscroll nil
  "Hscroll for next call to 'unscroll'.")

(defadvice scroll-up (before remember-for-unscroll
                             activate compile)
  "Remember where we started from, for unscroll."
  (unscroll-maybe-remember))

(defadvice scroll-down (before remember-for-unscroll
                             activate compile)
  "Remember where we started from, for unscroll."
  (unscroll-maybe-remember))

(defun unscroll-maybe-remember ()
  (if (not (get last-command 'unscrollable))
      (progn
        (set-marker unscroll-point (point))
        (setq unscroll-window-start (window-start))
        (setq unscroll-hscroll (window-hscroll)))))

(defun unscroll ()
  (interactive)
  (goto-char unscroll-point)
  (set-window-start nil unscroll-window-start)
  (set-window-hscroll nil unscroll-hscroll))

Problem is, it does not work. When I try to use Ctrl-f and Ctrl-b* I get following error below the mode-line: wrong type argument markerp

If I change the lines using markers to use points it works.

(defvar unscroll-point nil
  "Text position for next call to 'unscroll'.")

and

(defun unscroll-maybe-remember ()
  (if (not (get last-command 'unscrollable))
      (progn
        (setq unscroll-point (point))
        (setq unscroll-window-start (window-start))
        (setq unscroll-hscroll (window-hscroll))))) ;; I know setq can take multiple arguments

I want to use markers since these are robust and are unaffected by buffer edits. How do I fix this code? The book is almost 20 years old, but all the code has worked so far. Dunno if this used to be correct, but isn't anymore.

*are these evil-commands or not? Can't remember...

Here is the debug-info:

Debugger entered--Lisp error: (wrong-type-argument markerp 8245)
  set-marker(8245 176)
  (progn (set-marker unscroll-point (point)) (setq unscroll-window-start (window-start)) (setq unscroll-hscroll (window-hscroll)))
  (if (not (get last-command (quote unscrollable))) (progn (set-marker unscroll-point (point)) (setq unscroll-window-start (window-start)) (setq unscroll-hscroll (window-hscroll))))
  unscroll-maybe-remember()
  ad-Advice-scroll-up(#<subr scroll-up> nil)
  apply(ad-Advice-scroll-up #<subr scroll-up> nil)
  scroll-up(nil)
  evil-scroll-page-down(1)
  funcall-interactively(evil-scroll-page-down 1)
  call-interactively(evil-scroll-page-down nil nil)
  command-execute(evil-scroll-page-down)


texts: Modification of Jim Blandy's `dired-tar` -- Emacs for MS Windows

texts:
I enjoy using Jim Blandy's dired-tar library for Emacs built on *nix systems:  https://www.emacswiki.org/emacs/DiredTar

I am seeking to modify that library to support both *nix and MS Windows -- i.e., when eq system-type 'windows-nt.  [Any assistance in adding that support would be greatly appreciated.]


texts: Can I yank the names of all marked files from a dired buffer?

texts: I'm working on several files in sequence and want to build a buffer of file names to log my progress.


texts:
One of the convenient features of in-browser inspectors like Firebug is that it is so easy to tweak CSS stylesheets.  As you type in the attribute position, all possible attributes are shown in a dropdown list and can be picked from.  On the right hand side of a declaration, input is restricted to only valid values (which for some attributes is really just a very small number of values).

I'm looking for a CSS mode that makes editing CSS stylesheets easier by offering sensible contextual completion suggestions, or that even restricts my inputs to only valid values.  Does anything like that already exist?


texts: How to get the column number of matching text?

texts:
In the help there is looking-at function which should populate match-data which could be accessed with match-end function.

So I have the text :

1. hello world

The cursor is on 1 and I issue the command M-: (looking-at "1\\. "), the result is t.

Now immediately I do M-: (match-end 0) and expect to get 3 but I get 7 (#o7, #x7, ?\C-g)

Is this approach incorrect? Should I use smth else to get the column number?

PS
If I use a little bit more fancy regex in looking-at then I get crazy numbers from match-end - 653 or even 1432. Which are definitely not a column numbers.

Update
if the text is a single line as above I get correct result.

1. hello world
1. hello world

On the first line I get 4
On the second line I get 19

Looks like char count + 1, not the column number.


texts:
I would like my minor mode to set the buffer font, but not the frame font (the font contains special characters I need, but the hinting is abysmal). I got to this point:

(define-minor-mode transcribe-mode
    "A minor mode for transkription of old prints and manuscripts."
    :light "Transcribe mode"
    :keymap (let
    ((map (make-sparse-keymap)))

    (define-key map (kbd "M-e") (kbd "ͤ"))  ;; superscript e
    (define-key map (kbd "M-n") (kbd "̃"))  ;; superscript tilde (for nasalization)
    (define-key map (kbd "M-r") (kbd "ꝛ"))  ;; r rotunda
    (define-key map (kbd "M-s") (kbd "ſ"))  ;; long s
    (define-key map (kbd "M-d n") (kbd ""))    ;; duplicate n
    (define-key map (kbd "M-d m") (kbd ""))    ;; duplicate m

    ;; map variants of German letters to their location on a German keyboard
    (define-key map (kbd "M-'") (kbd ""))  ;; a umlaut with superscript e
    (define-key map (kbd "M-;") (kbd ""))  ;; a umlaut with superscript e
    (define-key map (kbd "M-[") (kbd ""))  ;; a umlaut with superscript e
    (define-key map (kbd "M-u") (kbd "ů"))  ;; u with superscript o
    (define-key map (kbd "M--") (kbd "ß"))  ;; sharp s, sz ligature

    map)

    ;; turn on abbrev mode globally
    (setq-default abbrev-mode t)

    (setq-default auto-fill-function 'do-auto-fill)

    (visual-line-mode t)
    (setq-default word-wrap t)
)

(defun transcription-font-variable ()
        (interactive)
        (setq buffer-face-mode-face '(:family "Andron Scriptor Web" :height 100))
        (buffer-face-mode)
)

(add-hook 'transcribe-hook 'transcription-font-variable)

(add-hook 'text-mode-hook 'transcribe-mode)

(provide 'transcribe-mode)

Everything works fine except the font change, and no errors or warnings are being displayed. The font is installed, setting it globally works. I'm using Emacs 24.


texts:
I've accidentally run the following:

(unintern variable)

where variable's value was nil.

How do I get nil back without restarting Emacs?


texts: Changing or adding compiling options in cc-mode

texts:
In cc-mode, when we go to compile, M-x followed by compile, the default option is make -k. If I hit the down arrow, I am told no defaults available.

Is it possible to add the option g++ -Wall currentfile.cpp -o currentfile -std=c++14 to the default compile options where currentfile is filled in by the name of the .cpp program I am editing?

If it is too difficult to have the currentfile populate, would it be possible to have g++ -Wall -std=c++14 come up? Then I can fill in x.cpp -o x. However, option is one is the most desirable.


texts: Which image viewer for large image collections?

texts: From the built-in and MELPA available packages, which combination offers the easiest approach to managing a large collection of images (over 100K) in various formats (raw, jpg, tiff, png). I mainly want to view thumbnails, view full images to fit on screen, mark for deletion, copy, or move actual image files locally and sometimes to remote locations using tramp. Either Mac OS X or Linux compatibility is acceptable. I do not want to edit the actual images themselves (such as scaling, rotating, and similar image alterations).


texts: Org-mode: How to place a table left aligned on the paper?

texts:
I'm very new to Latex or PDF-export.
I try to export an Org-document with tables.
The problem is, that I cannot (or better: don't know how to) place them left aligned.
The problem seems to come from some default Latex command at the exported .tex:
\begin{center}
\begin{tabular}{lll}
...
\end{tabular}
\end{center}

Does anyone know how to override this 'center'ing w/o any time editing the generated .tex?
Best regards,
Chris.


texts: magit with tramp is not working with git correctly

texts:
I installed magit. I added the following lines to my .emacs:

(require 'tramp)
(push "/path/to/git/directory/" tramp-remote-path)

And when I am in tramp I run M-x magit-version here is the output:

Magit 20170808.1712, Git (unknown), Emacs 25.2.1, darwin

So despite being pointed at the right git it definitely isn't finding it. I checked magit-git-executable and it is "git" and the correct path is at the start of tramp-remote-path.

Time for option #2. I changed my .emacs, removing the previous two lines and adding this:

(setq magit-git-executable "/path/to/git/directory/git")

Now I can get magit to show the correct git version, I can open magit-status. But now I get

"Error in post-command-hook (magit-auto-revert-mode-check-buffers): (file-error "Searching for program" "No such file or directory" "/path/to/git/directory/git")

no matter what I do. I cannot switch buffers, I cannot close buffers, I cannot exit. I am forced to do a force quit from the OS.

Questions:

Why doesn't tramp-remote-path work at all?
Why does setting magit-git-executable screw things up so bad I can't even exit Emacs normally?
Why is it so hard to get Emacs, git, tramp and magit to play nice together?
What am I doing wrong?


texts: org-export: asynchronously export AND open/reread the pdf?

texts:
I tried C-c C-e C-a l o to asynchronously export an .org doc as LaTeX file, convert it to PDF, then open the PDF, but it won't be opened or reread (using pdf-tools). Is there a way to asynchronously export and open/reread the pdf in one shot? Thx in advance for your answers.
NB:
(setq revert-without-query '(".pdf"))
(add-hook 'pdf-view-mode-hook 'auto-revert-mode)

allows me to have the pdf re-read when I use C-c C-e C-a l p after I've modified the .org file. But I still need to first open the pdf using e.g. C-c  C-e l o (so, I have to export synchronously first).


texts: ERC, opening query messages in the same frame

texts: I use to have diferent frames for diferent tasks... I'd like to get new private message windows open in the same frame that the rest of the ERC stuff, not in the current focused frame. I'm searching for a long time, and I can't find any way to get this... Any idea?


texts: Org agenda hide empty sections (searches)

texts:
I have multiple sections in my agenda, and I have one that I want to see on top if it is not empty. But if it is empty its just taking up space and I'd like to hide it. I tried searching for this but couldn't find anything.

Does anyone know how to do this?


texts: Make the cursor stop at the last character of a line instead of the newline character

texts:
How to make cursor stop at the last character of a line instead of at the linefeed character? I use evil-mode.

Steps to reproduce the issue:

Start Emacs in shell via emacs -nw -Q.
Press C-e to move focus to the end of the line.
You can see the yellow cursor stops at the linefeed character instead of the { character.

UPDATE:
Thanks guys. It turns out it's not a bug but just default behavior of Emacs.

My issue is actually I'm using evil-mode and I mistakenly turn off a useful feature of evil.

Here is the CORRECT setup code to turn that flag on in evil-mode:

(setq evil-move-cursor-back t)


texts:
I have a project which is centralized in a directory. The directory contains the .dir-locals.el file with the following content, just a defun:

(defun pr--narrow-buffer ()
  "Narrow the current buffer from the start of the BODY section to the end of it."
  (interactive)
  (goto-char (point-min))
  (setq v-beg (search-forward-regexp "^@BODY$"))
  (setq v-end (search-forward-regexp "^@/BODY$"))
  (narrow-to-region v-beg v-end))

When I open a file in that directory I get the error: Error reading dir-locals: (wrong-type-argument listp defun) and the pr-narrow-buffer function cannot be used.

Where am I wrong?


texts:
when I use pdf-tools

the text in it can't be copy/paste as normal

I want to treat this pdf mode as a place where I get the information to use in emacs


texts: AUCTeX: Disable newline when electric-pairing braces in math mode

texts:
I am using AUCTeX for editing in LaTeX, with LaTeX-electric-left-right-brace enabled, so that when I press for example C-c C-m \left in a math environment, the right brace is also automatically put in my expression.

My problem is that this automatically inserts a newline after the left brace and before the right brace, so that it looks like this for example:

\left(

\right)

with the point inserted in the middle. But I don't want that. I couldn't find anything about it in the Info documentation. Could anyone please tell me how to disable this behavior? (i.e. have the same but on one single line)


texts: How to put boxes around quotes in Org mode

texts:
I am using Emacs' Org mode to scribble up some notes which all of which are being exported to HTML.

I often need to insert a lot of paragraphs verbatim while citing other research papers. The #+BEGIN_QUOTE ... #+END_QUOTE environment is perfect for that.

However, I would also like the quotes to be surrounded by a gray box snapped tight around the quote.

e.g. almost exactly like how the poem Twinkle Twinkle Little Star appears
below.

  Twinkle, twinkle, little star,

  How I wonder what you are!

  Up above the world so high,

  Like a diamond in the sky.


texts: Force function evaluation when setting variable value?

texts:
I have these functions defined in my early-init.el. I'm trying to change the location of where my backups are saved and keep getting a Wrong type argument stringp (djm/emacs-cache "backups/").

early-init.el

(Defconst user-emacs-cache "~/.cache/emacs/")

(eval-and-compile
  (defun djm/emacs-path (path)
    (expand-file-name path user-emacs-directory)))

(eval-and-compile
    (defun djm/emacs-cache (path)
           (expand-file-name path user-emacs-cache)))

init.el

(Use-package files
  :ensure nil
  :custom
  (auto-save-file-name-transforms '((".*" (djm/emacs-cache "backups/") t)))
  (backup-directory-alist '(("." . (djm/emacs-cache "backups/")))))

I change the place of a lot of files in my init file. How can I make something like this work without hardcoding it?


texts: Tramp/Dired transfers files inline over ssh instead of using scp externaly

texts:
I am using tramp via ssh to access remote files. For text files, this is working really well, but whenever I want to copy larger remote files to my local machine, tramp uses its slow inline method (encoding the file with gzip). This is much slower than using an external method like for example scp. How do I make emacs use scp when transfering large files?

Relevant information:

I use an ~/.ssh/config file to access the remote machine. The alias for that machine is hehi09 in the following. The access is password-less
Messages in message buffer when transferring:

Copying /ssh:hehi09:/home/christian/big_file.dat to /home/christian/big_file.dat'...
Tramp: Inserting `/ssh:hehi09:/home/christian/big_file.dat'...
Tramp: Encoding remote file `/ssh:hehi09:/home/christian/big_file.dat' with `(gzip <%s | base64)'...

Values of:

tramp-copy-size-limit's value is 10240  (much smaller than tested file size)
tramp-default-method's value is "scp"

$ scp hehi09:/home/christian/big_file.dat ~/ works as expected from the command line and is much faster than the transfer in emacs

Any ideas why emacs is not using scp to copy large files? Any help is greatly appreciated!


texts: How to connect to remote python with jedi.el?

texts: How can I connect to remote python with jedi.el? I need to use remote virtualenv for getting possible completions, docs, etc.


texts:
i want to add an abbrv for 2 lines (that is a 1st line, a break and then a 2nd line)
Anyone know the syntax for that?
here is the syntax i try

("8rt" "#+ATTR_HTML: :style color:green  *lets try it on your computer!*" nil 0)

i want the breakline to come right after the :green

any clue?


texts: Binding XF86Cut and XF86Copy to Emacs Commands

texts:
I have a keyboard with dedicated keys for XF86Cut, XF86Copy, XF86Paste. I want to bind these to Emacs commands. The goal is get the usual behavior for cut-and-paste between Emacs, my terminal, and my browser Firefox with a common set of keys.
FWIW, XF86Paste works seems to work just fine with zero configuration. However, Emacs cannot see the key presses for the other keys. I verified this using M-x describe-key followed by a key press. For XF86Copy and XF86Paste, Emacs behaves as if no key was pressed
Both XF86Copy and XF86Paste work in the terminal. (However, XF86Cut doesn't.) How can I bind XF86Cut and XF86Copy to commands within Emacs?
This is how I start Emacs:
emacsclient -a "" -t
I'm using:

Emacs 27.1
Alacritty 0.5.0 (a6681e3a)
xmonad 0.15
X.Org Server 1.20.9-2
Linux 5.9.1.arch1-1


texts: How can one restore buffers on startup in correct order?

texts: I use desktop-save-mode in order to restore buffers on startup.  However, the buffer which is visible immediately after startup is *scratch*, *Messages*, .bbdb, etc.  I am not interested in those.  Is there a way to have Emacs after a restart in the same buffer state, including ordering, as when it was closed?


texts:
Given an outline with arbitrary structure, how can one demote every single heading by one?

For example, starting from something like this

* Lorem ips
  um dolor sit ame
** t, consectetur a
   dipiscing elit. Vivamus ph
*** aretra diam lorem, e
** u consectetur urna m
   - alesuada sit amet. Donec turpis lacus, molestie id nunc et, laoreet
   - cursus ex Integer porttitor nisl neque, id f ermentum erat tincidun
   - t sit amet. Etiam in d
*** ignissim quam. D
* onec non

...what's the easiest way to get to this:

** Lorem ips
   um dolor sit ame
*** t, consectetur a
    dipiscing elit. Vivamus ph
**** aretra diam lorem, e
*** u consectetur urna m
    - alesuada sit amet. Donec turpis lacus, molestie id nunc et, laoreet
    - cursus ex Integer porttitor nisl neque, id f ermentum erat tincidun
    - t sit amet. Etiam in d
**** ignissim quam. D
** onec non

Of course, after this global demotion I'd add a new top-level header encompassing all the demoted headers in its subtree.


texts: helm-M-x fuzzy not working (only match if provide proper prefix)

texts:
I set helm-M-x-fuzzy-match to true, but it is not working as I want.

For example, if I type log:

I expect it to show clm/toggle-command-log-buffer as well.


texts: What are the advantages of building Emacs from source?

texts:
I use precompiled Emacs binaries (24.3) right now.  AFAIK, v24.4 is already available as binaries, so there is no incentive for me to compile Emacs myself to stay current.  I'm thinking, however, whether there are not other advantages of building Emacs myself, especially in terms of performance and/or learning (i.e., the possibility of inspecting C source code easily).

So: what do I gain if I compile Emacs myself?


texts: How can I install eww or shr in Emacs 23?

texts:
I am beginner using Emacs 23.4, and I wanted to try a web browser package. From Emacs wiki, I found eww. But when Emacs starts I get from *Warnings*:

File error: Cannot open load file, shr

I get the same thing when I do M-x load-library RET shr.

What I did for installing eww was saving the eww.el file in my ~/.emacs.d/ directory and added this:

(add-to-list 'load-path "~/.emacs.d/")
(require 'eww)

to my ~/.emacs file as well.

I didn't find the shr package to download on internet, and that is why I am lost. Thanks in advance.


texts: How do I convert .doc file to plain text on demand?

texts:
I would like to convert .doc files to plain text when opening them in Emacs.

The command line tool antiword can read Word files.

How do I pass them to antiword and then get the result in an emacs buffer?

Can this be done automatically so it happens each time i open a doc file in dired?


texts: Get emacsclient to reuse exising X-window, iff any

texts:
I'm trying to set my desktop environment to use emacsclient to open text files.

I would like only one emacs x-window to be opened. Yet I don't know which command can be used to have an x-window created if and only if no emacs x-window already exists.

The command emacsclient %F doesn't work when no x-window exists.
The command emacsclient -c %F always creates a new x-window.
I don't know how to check for the existence of an emacs x-window.

Which command / script should I use ?

By x-window I mean 'what a window is for the window-manager'


texts: Emacs as a CAT (Computer-Assisted Translation) tool

texts:
Getting tired of the poor editing capabilities of software like OmegaT, I would like to know if there is a way to turn Emacs into a CAT (Computer-Assisted Translation) tool. I was thinking about writing a major-mode, but feel free to share your ideas.

Basically, this is what I need:

Emacs must be able to identify a segment (i.e.: a sentence ending with a full stop) already translated and suggest the translation. This implies the creation of a translation memory (a .tmx file, for example) which contains all the original segments and the translated segments;
The translator must be able to create and edit a glossary of terms and Emacs should suggest the translation if the term is in the current segment;
Emacs should be able to recognize the formatting of the original file (i.e.: bold, italic, different fonts size, tables) in order to keep the formatting as close as possible to the original file when exporting the translation;
Emacs should ideally be able to export the translated document into the same format as the original.

Are any of these requirements actually possible or am I just hoping for something out of reach?


texts: Exporting custom dynamic org-mode blocks

texts:
I am currently writing a conversion from org-mode headline deadlines/schedules to pgf-gantt charts.
Ideally I would like to create a custom dynamic block that contains the result of my parsing, and then have a custom exporter for that dynamic block that creates the pgf-gantt code, so that I can later add exporters for other formats.

Q1: So, is there a mechanism similar to org-dblock-write: only for exporting dblocks? I cannot find any documentation on this.

Q2: If there is no such mechanism, what would be the best way of storing that pgf source code so that it gets integrated into latex export, but doesn't interfere with other exporters?


texts:
I'm curious if there's an equivalent for let-alist for plists.  Namely, a macro for accessing plists in the manner that alists may be accessed as:

(let-alist alist
  (if (and .title .body)
      .body
    .site
    .site.contents))

It would probably be necessary to translate keyword symbols, of course, so a plist like the following may be accessed:

(my/let-plist '(:foo "bar" :baz "bat")
  (if (equal .foo "bar")
      .baz
    "default"))


texts:
I am trying to construct a regexp for URLs (for grabbing them out quickly out of a paragraph, region, etc.). I don't need it advanced, but I am having some troubles with it. Here is my attempt, which doesn't work too well:

(re-search-forward (rx (minimal-match (and "http" (*? anything) (or ")" "\"" "[:blank:]")))))

This other question has some url regexps, but those aren't for emacs.

P.S. I also don't understand how match-beginning works as its description is a little bit mystic.


texts:
How I can indent code block to align it to the begining of #+BEGIN_SRC ?
Right now it looks like this  and I would like to be like this


texts:
I'd like to advise format-mode-line to collapse whitespace across the whole string. The following attempt does not work for me.

(advice-add 'format-mode-line :filter-return 'collapse-whitespace)

When I evaluate (format-mode-line mode-line-format), the output seems to be what I want, but the appearance of my mode line does not change.