texts: Trying to edit/save file with root privilege fails with "Copying directly failed, see buffer '*tramp/sudo root @HOST*'

texts:
I have done this a ton of times in the past 10 months or so that I have been using Emacs (which I have quickly come to love, by the way) and never had a problem.  No clue what I changed or how, but now this does not work at all.  As far as I know, I didn't change anything.  Haven't edited my init.el or similar, haven't changed any configurations on my host machine.  No clue what's going on here.
I have the below in my init.el to open dired and then opening files from there to edit when I need to edit with privileges.
(require 'tramp)
(defun sudired ()
(interactive)
(dired "/sudo::/"))
That has served me well for months.  Now, I open dired and open a file (say /boot/config.txt), do my edits, C-x C-s, and I get the message "Copying directly failed, see buffer 'tramp/sudo root@HOST' for details."  There buffer it mentions is empty.  My messages buffer has this:
Saving file /sudo:root@HOST:/boot/config.txt...
Renaming /sudo:root@HOST:/boot/config.txt to /sudo:root@HOST:/boot/config.txt~...done
Copying /tmp/tramp.eqRQkH.txt to /sudo:root@HOST:/boot/config.txt...
Copying directly failed, see buffer ‘tramp/sudo root@HOST’ for details.
I've searched around and found similar problems involving Tramp... Nothing that helps my issue though.  At least not that I can work out.
Same thing happens when I try to use C-x C-f and type out /sudo:root@HOST:/boot/config.txt, do my edits, and then C-x C-s.  I get those same error messages, etc.
Probably making a noob mistake here.  Someone school me please.


texts: Emacs/realgud/Python: How to display variables at each step?

texts:
Using emacs and realgud one can have a separate buffer that automatically shows where the program is currently stopped (by displaying that line of source code).

Is there an easy way to get realgud to display a list of variables/expressions (hopefully in a separate window) when the debugger stops?


texts: Can cursor jump back to the previous position?

texts:
Can I make my cursor in a buffer jump back to its last position? (preferrably without having to mark the previous position)

For example, C-a jumps to the beginning of the current line, can I jump back to where it was before?

For example, when C-x C-f to open a file in a different directory, i want to jump back to the previous position in the path name.

Thanks.


texts: What does {:} in columnview specification mean?

texts:
A columnview org-columns specification may look like this:

#+BEGIN: columnview :id local :format "%70ITEM(Task) %Effort{:} %CLOCKSUM{:}"
#+END:

Sometimes you can see variations without the {:} part.

What is the function of {:}?


texts: how to disable all the minor modes (when a specific major mode is enabled) with elisp

texts: Is there any function do disable all the minor modes if I enable a specific major mode (let's take the text-mode as an example)?


texts: How to push system clipboards to kill ring contents at real-time when I copy outside emacs?

texts:
I noticed that when I copy thing outside of Emacs, the thing does not appear to kill ring immediately except I yank it to Emacs. If I copy twice, only the last copy can be got by yank.

Sometimes, I would like to push the copys from system clipboards to kill ring once I do the copy. After that, I can select what I need in the kill ring to paste in Emacs. So How can I achieve that the copys can be pushed into kill ring many times?

I am on Windows 7.


texts:
The manual describes the regexp special characters ^ and $. Like in most regular expression dialects I know, they seem to match the start or end of a string. However, I've also discovered that there are ` and ' characters available. Based on the explanation found here, they seem to also match the start or end of strings. Could someone please explain the difference between these special characters, with an example and recommendation on when to use them?

When I look at the value of auto-mode-alist, they seem to be used interchangeably to match the end of strings:

(...
 ("\\.scss\\'" . scss-mode)
 ("\\.ya?ml$" . yaml-mode)
...)


texts:
I have a macro that intends to creates a closure:

; -*- lexical-binding: t -*-
(defmacro repro ()
  (let ((kmap-sym (gensym "kmap-")))
    `(let ((,kmap-sym (make-sparse-keymap)))
       (define-key ,kmap-sym "a"
         (lambda () (interactive) (message "kmap is %s" ,kmap-sym)))
       ,kmap-sym)))

;; only works when lexical-binding: t in the current file
(funcall (lookup-key (repro) "a"))

Although lexical-binding is t in the file where the macro is defined, (funcall (lookup-key (repro) "a")) fails with the error (void-variable kmap-30252) whenever it is evaluated in a different file where lexical-binding is nil.

Since I can't control where the macro will be used, I considered going back to using lexical-let for the inner let in the example, which does work regardless of where the macro is invoked.

(defmacro repro ()
  (let ((kmap-sym (gensym "kmap-")))
    `(lexical-let ((,kmap-sym (make-sparse-keymap)))
       (define-key ,kmap-sym "a"
         (lambda () (interactive) (message "kmap is %s" ,kmap-sym)))
       ,kmap-sym)))

;; this works in any file
(funcall (lookup-key (repro) "a"))

But lexical-let requires cl, which I would like to avoid, and unfortunately lexical-let is not defined in cl-lib.

What options do I have for creating a closure?

Should the macroexpansion of repro always expand into lexical bindings given that lexical-binding is t where the macro is defined?


texts: Is there a simple mode for the reading of wikipedia through Emacs?


texts:
In agenda view, tags are getting right-alingned at column 120! In org file, they are right-aligned at columnt 77.

What is happening? How do I get agenda view to follow org file setting?


texts: Is it possible to revert a hunk in diff-mode?

texts:
With viewing a diff for a modified working copy, is there a way to revert the hunk under the cursor?

That is, reverse the change shown in the diff, making the changes to source-file the diff refers to.

Ideally it would refresh the diff too, although I could handle that myself.

Currently I'm navigating to the hunk using diff-goto-source, then using git-gutter:revert-hunk from the git-gutter package, however I would like to perform this inside the diff.


texts: How center #+BEGIN_EXAMPLE on org-mode LaTeX export?

texts:
I have a verbatim/monospaced block that way:

#+BEGIN_EXAMPLE
                                   _
                                /     \
                               T       H
                             /   \   /   \
                            T     H T     H
#+END_EXAMPLE

On the LaTeX->PDF export I get:

I know that the spaces doesn't matter, but how center it on export? I tried wrap the content with #+BEGIN_CENTER but doesn't works. I tried set \centering before and doesn't works too.


texts: Configure mu4e for Gmail-style citation (reply quoting)

texts:
I want to configure mu4e citation style—the manner in which mu4e quotes the thread in a reply—so that it is compatible with Gmail's UI.

Note the triple-dot collapsed style in the second message, where I replied through the UI.

There are the message contents:

Content-Type: text/plain; charset="UTF-8"

This style does

On Wed, Oct 3, 2018 at 5:52 PM <matt@example.com> wrote:

>
> This style doesn't work
>
> matt@example.com writes:
>
> > test
>

I have tried setting (setq message-cite-style message-cite-style-gmail), but no luck.


texts: Making Dired work with FTP on OS X 10.13

texts:
So apparently Apple has (stupidly) dropped support for "insecure" Unix commands such as telnet, ftp, etc. in 10.13, or "High Sierra" (see these threads for more info). Unfortunately, I use Dired as an ftp client to lists.gnu.org. So, to compensate for the loss of BSD's ftp, I installed the GNU inetutils from homebrew:

brew install inetutils

However, GNU's ftp seems to behave quite differently. For starters, I now have to explicitly provide a username and "password" and turn on passive mode. For example:

C-x C-f /ftp:ftp@lists.gnu.org:
ftp> open lists.gnu.org
open lists.gnu.org
Connected to lists.gnu.org.
220 Welcome to lists.gnu.org MBOX FTP service.
ftp> ls
ls
530 Please login with USER and PASS.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
ftp> user ftp
user ftp
331 Please specify the password.
Password: my@email.com

230 Login successful.
ftp> ls
ls
500 Illegal PORT command.
500 Unknown command.
ftp> passive
passive
Passive mode on.
ftp> ls
ls
227 Entering Passive Mode (208,118,235,17,81,10).
150 Here comes the directory listing.
drwxr-xr-x    2 500      500          4096 Mar 08  2012 123tkshop-announce
drwxr-xr-x    2 500      500          4096 Jan 08  2007 123tkshop-bugs
drwxr-xr-x    2 500      500          4096 Jan 05  2007 123tkshop-devoloper
...
226 Directory send OK.
ftp>

Previously, with BSD's ftp, all of this login stuff would automatically happen when I tried to connect.

Yet even though ls now works in the ftp command prompt, I cannot get a Dired buffer for the remote host. Even after I've logged in (as above), when I try to run find-file on /ftp:ftp@lists.gnu.org: I get the following errors in *Messages*:

Getting PWD... [8 times]
tramp-file-name-handler: Unable to obtain CWD

And I see the following in the ftp command prompt:

ftp> pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
pwd
257 "/"
ftp> 257 "/"
ftp> 257 "/"
ftp> 257 "/"
ftp> 257 "/"
ftp> 257 "/"
ftp> 257 "/"
ftp> 257 "/"
ftp>

And I get no Dired buffer for the remote host.

So my question is: How can I use Dired to interact with ftp hosts on OS X 10.13?

PS:

I noticed that these issues do not occur in Emacs on Ubuntu. And for good measure, I copied BSD's ftp from another Mac and verified that none of these issues occur when I use that instead of GNU's ftp.

I am using Emacs 25.3 (on both my OS X and Ubuntu systems).


texts: emacs -nw mode, when you paste in some text from another application emacs sometimes misses parts or stops halfway. how can I mitigate it?

texts:
In macOS in emacs -nw mode, when you paste in some text from another application emacs sometimes misses parts or stops halfway.
Often I see a tilde as the last character entered, when there wasnt
even a tilde in the incoming text.

I read somewhere that switching to fundamental mode helps, but there's still some 10% of cases where even that doesn't help. Is there anything else one can try to mitigate this issue?


texts: Use lsp-mode for some projects and ggtags for others

texts:
Is there a way to configure Emacs to activate lsp-mode for some projects and ggtags for other projects? Maybe using .dir-locals.el?

I code C++ and the project I most often work on doesn't support lsp-mode (I'm unable to create a working compile_commands.json because of unusual project structure). In this project I use ggtags. But when I work on other C++-projects I would like to use lsp-mode instead. But all configurations I have seen all load lsp-mode or ggtags based on prog-mode (c++-mode etc) and not on specific project.


texts: How can I set default paths for INCLUDE blocks under each heading in orgmode?

texts:
I am writing a document where I have a collection of code for different topics. My document structure is as follows.
* Heading1

Some text
#+include: "Heading1/file11.py" src python

Test illustrating something else
#+include: "Heading1/file64.py" src python

* Heading2

Some text
#+include: "Heading2/file84.py" src python

Test illustrating something else
#+include: "Heading2/file96.py" src python

My directory structure is as below.
.
├── Heading1
│   ├── file11.py
│   └── file64.py
└── Heading2
    ├── file84.py
    └── file96.py

Is there a way I can do something like the following where I declare each base folder under each heading so that I don't have to repeatedly write the heading when I include the source file?
* Heading1
#+declare base foldername as Heading1

Some text
#+include: "file11.py" src python


texts: How to partially block user input while Emacs subprocess is running

texts: I have a custom function that updates the etags file before prompting the user to input a desired tag to be located.  Although I am pretty good about setting the current buffer to read-only before going about other activities, sometimes I forget and I start typing the name of the tag before the new tags file is fully populated.  As a result, I start typing the tag name to be searched and it gets inserted into the current buffer instead of the minibuffer -- because the tags creation process hasn't finished.  One option that came to mind is figuring out (with help from emacs.stachexchange.com) how to block user input until the tags file is updated and the minibuffer is opened, but I am open to other solutions that I may be unaware of.  How can I prevent myself from jumping the gun and typing the tag name into the current buffer instead of the minibuffer (before it openes when the tag file is complete)?


texts: Is there a version of lisp-interaction, à la *scratch* buffer, with asynchronous processing of evaluation?

texts:
While I develop some Emacs-Lisp code, I often test it in the *scratch* buffer, just to make sure that what I just wrote behaves like I believe it does.

But sometimes evaluating an expression takes several minutes and it is too bad that Emacs is frozen during this time. I'd love it if *scratch* behaved like the *shell* buffer with an interactive sub-shell. From the manual:

  While the subshell is waiting or running a command, you can switch windows or buffers and perform other editing in Emacs. Emacs inserts the output from the subshell into the Shell buffer whenever it has time to process it (e.g., while waiting for keyboard input).

Is there a package that provides such an interactive Emacs-Lisp eval-loop running asynchronously?

I understand that there are technical difficulties. E.g., I always assume that the environment Emacs is maintaining (defined functions, global variable values, ..) is the same for editing and for Lisp-interaction. If the evaluation of my code in *scratch* reveals a bug, I'll amend the code, eval-defun it, and try it again. So I expect that the eval-loop with which I am communicating in the *scratch* buffer is aware of the new definition.


texts: remove delimiter and comment typing from [Ljava.lang.String; in clojure-mode

texts:
Parsing parentheses: smie vs syntax table gives one example of how to use syntax-propertize-function but I wonder if someone could help me with another example.  I'm working with clojure-mode.  Here's a recipe to reproduce the problem:

;; load with emacs -Q -l clojure-init.el

(package-initialize nil)
(setq package-enable-at-startup nil)
(unless (assoc-default "melpa" package-archives)
  (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
  (package-refresh-contents))

(unless (package-installed-p 'use-package)
  (package-install 'use-package))

(setq use-package-verbose t)
(require 'use-package)

(use-package clojure-mode
  :ensure t :defer t)

Then M-x clojure-mode RET and insert

(["phonemes" java.lang.String] ["rhymingPair" [Ljava.lang.String;])

You'll see that backward-sexp / forward-sexp breaks in the viscinity of the [Ljava... and that the last few characters are understood as a comment.  More specifically, ["rhymingPair" [Ljava.lang.String;] should be understood as one valid sexp.


texts:
If I have something like:

(use-package X
  :defer t
  (add-hook 'some-mode 'package-x-function))

Will that work as expected given that I set :defer t and the package doesn't have any "built-in" autoloads and I'm not using any of the autoload-creating use-package functions? In other words, does registering a hook alone take care of loading package X given that I set :defer t?

If not, what is the minimal additional configuration I require to make the hook work? Would I have to do something like :commands package-x-function?


texts:
I'm asking for several tips to make editing lisp like languages in evil mode better. In particular there is one feature that I would really like but couldn't manage to get it to work. For example given the following code (cursor is indicated by |):

(line| of code
    (other line of code))

I would like to delete the whole expression with dd (which normally would delete only the line I'm in). Basically I would like to operate on expressions rather then on lines for all the evil commands that are working on lines normally.

Edit:
For anyone interested evil-cleverparens looks interesting, too and it has a list of other similar packages at the end of the README.


texts: How to get Powerline colours working in Emacs Shell/Term mode?

texts:
I have recently started using Spacemacs instead of VIM, because of great VHDL mode.

In vim (neovim) I used to use VIM as terminal emulator.
In Emacs I have encountered a bit of strange colour behaviour.
To be exact I don't mean different palette for "System colours",
that is not a problem.
Problem is missing colors in "Color cube" and completely discolored Powerline.

While I would expect this (KDE Konsole or neovim terminal):

Everything is set to xterm-256, so I don't know what is the problem. This occurs in both -nw (terminal) mode and GUI mode.

It seems that 256 color are somewhat degraded by emacs, see comparison of colortest-256 command in Emacs and Konsole and also notice how Powerline is not coloured anymore.

Also note that colours in Powerline are wrong for both background and letters...

How can I fix this strange colour behaviour and get the shell Powerline (github.com/powerline/powerline) working under Shell or Term mode in Emacs?


texts: Possible to Set a Frozen Row in Org-Mode Table?

texts:
I use a standard org-mode table to store a lot of my own personal data. However, the tables have gotten quite large.

I need a way to have the top row stay visible.

Can I set this with header-line-format or something similar?


texts: Is there any way of getting overview statistics for all checkboxes in a given org subtree?

texts:
I have an org document with the following structure
* Tasks
** First category
- [X] Task

** Second Category
- [ ] Task

And I'd like to get statistics for both the overall completion and each subheading. If my tasks were TODO headings, I could get what I wanted by giving each heading a statistics cookie and setting the recursive property on the cookie, (or by setting org-hierarchical-todo-statistics to nil). That works as follows, and gives the expected result after updating all cookies:
* Headings and TODOs [1/2]
  :PROPERTIES:
  :COOKIE_DATA: todo recursive
  :END:
** First category [1/1]
*** DONE Task 1
** Second Category [0/1]
*** TODO Task

If I try to do the same with the checkboxes, either by setting the recursive property on the cookie, or by looking at the variable org-checkbox-hierarchical-statistics, I get the following result
* Checkboxes [0/0]
  :PROPERTIES:
  :COOKIE_DATA: checkbox recursive
  :END:

** First category [1/2]
- [X] Task

** Second Category [0/1]
- [ ] Task

Where the first line says * Checkboxes [0/0] instead of the expected * Checkboxes [1/2]
I therefore have two questions:

Is this the intended behaviour, so that I'm misunderstanding how checkboxes and subheadings are supposed to interact? Does the "hierarchy" of hierarchical checkboxes only work in a single nested list and not across subheadings?

How do I get the behaviour I do want? As a last resort I know I can just convert my document entirely to subheadings, but I'd rather not have to do that


texts:
I am insert a external link to projects.org from os.org

* file:projects.org::[[Workflow]]

How  could hide the external file name and left only workflow


texts: Tangling non-code files to separate files

texts:
I have a number of parameter files that my code needs as inputs and I would like them all to be in the same org file in different blocks and have them all tangled to different files.

Can I somehow tangle #+BEGIN_EXAMPLE ... #+END_EXAMPLE blocks or some other block type? I tried this which didn't work:

#+BEGIN_EXAMPLE :tangle methanol.rtf

MASS     1 H      1.00800 H ! polar H
...
#+END_EXAMPLE

Alternatively can I define new languages for org-mode to recognize but not execute?


texts:
Q: what is the idiomatic way to map a function across a property list?

The various mapping functions (mapcar and family) map a function over a sequence such as a list.  How does one use these functions when dealing with a property list, i.e., when trying to map across each of the properties contained in the list (which would be every other element starting from the first one)?  It seems to me that the mapping function would need to access the list in pairs of elements rather than as individual elements.

As a toy example, how would one take a property list and collect all of the property values?  If it were an association list instead it would be pretty simple:

(mapcar #'cadr '((:prop1 a) (:prop2 b) (:prop3 c))) ;=> (a b c)

I'm sure this could be done with a loop, but it seems a little laborious and I'm wondering if there's a more idiomatic way to do it.


texts: I keep accidentally turning on fill mode; how am I doing this, and how do I undo it?

texts:
I must be hitting some combination of shortcut keys, because my Emacs keeps on switching all of its buffers to the minor mode 'fill'.

It's trivial to turn the mode off on each buffer individually, but I can't figure out how to do it globally in as simple a way as I seem to have turned it on globally.

What shortcut keys am I hitting, and how do I shortcut-key my way back?

I'm using:

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


texts:
This is my todo.org file:

* Personal [/]
 - [ ] Wash car
 - [ ] Take out trash

* Work
 - [ ] Call boss
 - [ ] Email client

Which renders on (spacemacs + osx) as:

I'd like to add a due date to each checkbox item, but every time I try to add a date, it gets added to work or personal, instead of each item.

How can I add due dates to each checkbox item?


texts: how to edit in the place highlighted by helm swoop

texts: helm swoop is very good, it could show me the lines matching some word, but I need to edit the lines around the matching line. How to do that? I can only view the them. I tried to use mouse to position the line I want to modify, but it doesn't work.


texts: Bringing a function into a lexical environment

texts:
I'm using a closure to keep track of some stuff to do with state; I want to be
able to ‘include’ a function into that closure, so it can access the state. The
only way this is possible is by creating that function inside the closure.

My idea is to have a function include, itself created inside that lexical
environment, which takes a quoted lambda form, and then returns the actual
function (which will have been created inside the closure).

Given that lambda is actually a macro which expands to another macro call

(function (lambda ...))

my best attempt has been

;;; -*- lexical-binding: t; -*-

(let ((x 0)) ;; to represent some state variable
  (defun include (quoted-lambda)
    (eval
     (macroexpand quoted-lambda)
     t))) ;; last `t' is to eval with lexical binding

and then

(defalias 'incx (include '(lambda ()
                            (incf x))))

(incx) ;; should get 1

but this just results in  (void-variable x)!

How can this be fixed?


texts: How to move by whole line rather than within a wrapped line (emacs 23.1+)

texts:
I think this is mostly just a question of how to word the question...

Prior to emacs 23.1, when pressing down-arrow or up-arrow the cursor would move up a whole line at a time even when that line was wrapped.

As of emacs 23.1, when pressing up or down-arrow at the head of a wrapped line, the cursor moves to the position within the same "line" which happens to fall beneath it's previous position. So instead of moving to the beginning of the next line, the cursor actually moves to character 81 (depending on the width of your buffer) within the same line.

I would like, very much, to restore the older behavior of always moving a whole line at a time.


texts:
Installed Spacemacs and opened a ruby file. It got this error:
Error (use-package): Cannot load ruby-test-mode

I have researched on this issue: https://github.com/syl20bnr/spacemacs/commit/91b8731b87ce888c8355b8aabcca368e423ac149
But didn't get idea for fixing it.


texts:
I know that I can hide the modebar for the current buffer using

M - : (setq mode-line-format nil)

However, I'd like to hide the mode-line for the 'MINIMAP' buffer created by the minimap package, which is never the "current" buffer since as soon as you click anywhere on the minimap, the cursor is automatically moved to the original buffer. So the previous method does not work in this case.

The perfect solution would be to put something into my .emacs file so that every time I open a minimap the mode-line is automatically hidden from the buffer. Is it possible?


texts: How to make eww default browser in Emacs?

texts: When I click on links in my org-mode buffer it opens up my external browser. How can I make Emacs default to eww (and let me open up an external browser from there if I wish)?


texts: Call an evil-delete > evil-motion operation from elisp?

texts:
I want to execute evil-delete and then call a motion command. A simple example which does not work because evil waits for input after calling evil-delete:

(defun does-not-work ()
  (call-interactively 'evil-delete)
  (call-interactively 'end-of-line))

EDIT:

The command after evil-delete is just in example. The real code I want to call expects additional input from the user.


texts: Changing default layout to not include all buffers

texts:
The default layout is fairly useless (for something effectively bound to the easily accessible '1' key all the time) due to the sheer number of buffers it can 'see'.

Is there any way to either:-

Make the default layout only see buffers which don't belong to any other layout.
Disable/hide the default layout (I can then create my own new layout which would work as above)


texts:
I am aware I can use mapcar to join 2 lists into pairs, however all the map functions seem to quit at the shortest list.

This for example

(cl-mapcar #'concat '("1" "2" "3" "4") '("a" "b" "c"))

returns

("1a" "2b" "3c")

I basically want the same but with "4" included so it looks like this:

("1a" "2b" "3c" "4")


texts: How to move point to an invisible line (to access an org property when heading is folded)?

texts:
I wrote some code to reschedule all headings under a subtree, but it was failing to get the scheduled date of heading in invisible lines, even though it could access other properties such as the name of the heading.

I debugged it with edebug and noticed that the value of (point) was always the same, even though different heading names were appearing in the *Messages* buffer.

I used a quick fix of showing the full buffer with (org-shifttab 3) and wrapping the last function inside a (org-save-outline-visibility t ...), but this seems inelegant and over the top.

I wonder if search-forward that I am using in org-get-scheduled-timestring-at-point does not move point to invisible lines, even though it forces lines with a match to become visible when used interactively.

Here is a minimal example with an Org-buffer:

* heading

** TODO task 1
SCHEDULED: [2019-12-26 Thu]

*** DONE task 0
SCHEDULED: [2019-12-09 Mon]

*** TODO sub task
SCHEDULED: [2019-12-01 Thu]

** TODO task 2
SCHEDULED: [2020-01-01 Wed]

and the code:

(defun my-org-get-end-of-subtree ()
  "Gets the index at the end of the subtree."
  (save-excursion
    (ignore-errors
      (outline-end-of-subtree)
      (point))))

(defun my-org-get-property ()
  "Returns whether the scheduled date of the heading at point is in the past."
  (interactive)
  (save-excursion
    (org-back-to-heading)
    (message "Point is at %d" (point))
    (search-forward (concat org-scheduled-string " ")) ; move point to the scheduled entry
    (buffer-substring (point) (line-end-position))))

(defun my-org-test-fails ()
  (interactive)
  (let ((end (my-org-get-end-of-subtree)))
    (when end
      (save-excursion
    (org-back-to-heading)
    (while (and (outline-next-heading)
            (< (point) end))
      (message (my-org-get-property)))))))

(defun my-org-test-works ()
  (interactive)
  (let ((end (my-org-get-end-of-subtree)))
    (when end
      (org-save-outline-visibility t
    (save-excursion
      (org-shifttab 3)
      (org-back-to-heading)
      (while (and (outline-next-heading)
              (< (point) end))
        (message (my-org-get-property))))))))

The result in the *Messages* buffer of running org-test-fails and then org-test-works is:

task 1
Point is at 68
[2019-12-26 Thu]
done task
Point is at 68
[2019-12-26 Thu]
sub task
Point is at 68
[2019-12-26 Thu]
task 2
Point is at 68
[2019-12-26 Thu]
...
task 1
Point is at 79
[2019-12-26 Thu]
done task
Point is at 123
[2019-12-09 Mon]
sub task
Point is at 171
[2019-12-01 Thu]
task 2
Point is at 218
[2020-01-01 Wed]

How can I move point to a line that matches text and is invisible? Or how can I get the text of the SCHEDULED property of an invisible heading just like I am able to get its heading text?


texts:
If I use a command that begin a new block (according to AUCTeX), e.g.:

\newcommand\Test{\begin{abstract}}

And then I start my document:

\begin{document}

AUCTeX will indent my code as if I typed:

\begin{abstract}
  \begin{document}

Is there a way to tell AUCTeX to not consider command in newcommand for indentation?

Note: It may looks silly to declare a new command for \begin{abstract} but my real code is not about such command (simplified for the example). Actually the problem occurred while using the algorithm packages, and I wanted to define a new command such as IfAny (\newcommand\IfAny[1]{\If{\textbf{any} #1}) which does not really involved an environment.

Full example code after C-x h M-x indent-region:

\documentclass{article}
\newcommand\Test{\begin{abstract}}

  \begin{document}
\end{document}

The exact command concerns the algorithm and algpseudocode packages:

\newcommand\IfAny[1]{\If{\textbf{any }#1}}

Use like:

\IfAny{}
  \State ...
\EndIf

Which cannot be made into an environment (\newenvironment) unfortunately.


texts: Why "set-face-attribute" needs to be executed twice when switching from a TTF font to a bitmap font?

texts:
I'm trying to write a function which switches between fonts in all
frames. In order to do this, I first wrote the following commands:
This font is a TTF font and is located in ~/.local/share/fonts/iosevka-ss04-light.ttf.
(set-face-attribute 'default nil :family "Iosevka SS04" :weight 'light :height 250)

This font is a bitmap font and is located in /usr/share/fonts/misc/5x7.pcf.gz.
(set-face-attribute 'default nil :family "Misc Fixed" :weight 'normal :height 60)

The problem is that when switching between Iosevka SS04 to Misc Fixed, I've to execute the second command twice. For a full
demostration, see gif below.
My question is: Is there any workaround to avoid executing the command twice?


texts: is there some sort of namespace(or filter) for files and buffers per frame available?

texts:
Using emacs in daemon mode is fine, because you only pay startup time once. But after a while the buffer and file list is getting filled. So is there a way to see only files which belong to the actual task (or project) I am working on?

Example:
I do some coding and I'm using Gnus to check mails.
When switching from one source code file to another source code file, I do not want to see Gnus buffers when having the buffer list.

Another example:
I'm working on a big Tex document consisting of foo-1.tex to foo-5.tex stored in directory blah. A coworker gave me a copy of his documents foo-1.tex to foo-5.tex stored in directory moo, which I consult for ideas. When I switch through document of moo I do not want to get bothered with files from blah and vice versa.

A last example:
Three students gave me their homework, where they implemented their part of a source code cloze (fill-in-the-blank-source-code). I check and comprehend their coding (which is not easily done by diff) so I have three times the same filenames (with different content) from different directories. When switching in one students work from file to file, I do not want to get it mixed up with the work of any of the other students.
Edit: I have to visit lots of work from students coding, approx. 400 small projects each year. This comes in clusters, checking approx. 200 works in 4 weeks, something like this. I open those files just 1 to 3 times per file, give a mark, do some tests and compare to other works, afterwards this stuff goes to an archive. (It would be of no use to store permanent bookmarks or create projects on this.)

Question:
For this work in those examples, the daemon mode is more a pain than a help.
My solution now is to start for every task (or project) a standalone emacs process.
But I would like to use the emacs server.
Is there some sort of namespacing, where I can just see the buffers and files which belong together, and suppress the buffers (and files) not belonging to this?
If It works together with ido, the better.

It would be ok to tell emacs manually to which namespace a file belongs.
(A completely different solution would also be welcome.)

Edit:
As it seems it is not clear from my question: I want to reduce the choice of buffers. Ideally a different filter setting(namespace) per frame (having multiple emacs frames open at a time).
Thanks to basils comment I had a look at ibuffer and Gnus-style grouping from emacs-wiki. This helps getting the correct buffer, but its not quite what I'm searching.
After knowing ibuffer I would say in this question I used namespace in the meaning of filter.


texts: selecting files with regular expression using ido-find-file

texts:
With regular find-file it's possible to supply *.[ch] to open all .c or .h files in a directory.  ido-find-file doesn't seem to support this behavior.

I know I can press C-f while ido-find-file is open to switch back to regular find-file, but is there a way to tell ido that I always want to use the regular  expression matching?

Help says that C-t toggles regular expression matching, but it doesn't seem to have any affect to me.


texts: setting inferior-R-args variable in init.el has no effect

texts:
I am trying to set a variable for ESS.  This is how I load ESS:

;; ess / try to not (require 'ess-site) as it slows down start-up
(autoload 'R-mode "ess-site.el" "Major mode for editing R source." t)
(autoload 'Rd-mode "ess-rd" "Major mode for editing R documentation." t)
(add-to-list 'auto-mode-alist '("\\.[rR]\\'" . R-mode))
(add-to-list 'auto-mode-alist '("\\.[Rr]out" . R-transcript-mode))
(add-to-list 'auto-mode-alist '("\\.Rd\\'" . Rd-mode))
(add-to-list 'interpreter-mode-alist '("Rscript" . R-mode))
(add-to-list 'interpreter-mode-alist '("r" . R-mode))

I tried

(eval-after-load "ess"
  '(progn
     (setq inferior-R-args "--no-save --quiet")))

(eval-after-load "ess-site"
  '(progn
     (setq inferior-R-args "--no-save --quiet")))

(add-hook 'ess-mode-hook
          (lambda ()
            (setq inferior-R-args "--no-save --quiet")))

(setq inferior-R-args "--no-save --quiet")

(setq-default inferior-R-args "--no-save --quiet")

But none works.  When ESS starts, the value of inferior-R-args is "".
Any ideas?


texts: How to display at the same time occurrences of two different words?

texts:
Thanks to helm-swoop, I know how to display occurrences of a single word. Now, I'd like to display at the same time occurrences of many different words (of a given, single buffer).

Let me be specific: say, I have a buffer containing multiple occurrences of the two words 'Hello' and 'Bye', and I'd like to check each 'Hello' is followed by a 'Bye' before any further 'Hello'. For this, I'd like to filter at the same time the occurrences of these two words. How could I achieve this?


texts: org-caldav synchronization freezes when using tags

texts:
I've finally decided to solely work in emacs, including my caldav-calendars, which I keep synchronized via my personal Nextcloud. I'm new to org-mode and trying to set things up.

So far I've managed to share the calendar and synchronization is working, as long as I don't include tags in my notes. I'd like to keep everything organized in a single file calendar.org and distribute all events to multiple calendars online based on tags.

Suppose I have two events in an otherwise empty calendar. I can synchronize these successfully, which I can confirm on the log and in the Nexcloud web-ui.

As soon as I include a tag in one of these events, the synchronization freezes and when I abort with C-g, the *org-caldav-debug* shows

========== Started sync.
Syncing first calendar entry:
(:calendar-id "personal" :inbox "~/.emacs.d/org-caldav-calendars/personal.org" :files ("~/calendar.org") :exclude-tags ("work"))
Check connection for https://my.nextcloud.com/remote.php/dav/calendars/user/personal/.
Generating ICS file /tmp/org-caldav-17359gqd.

As soon as I delete the tags from the file, synchronization works flawlessly again. The same behavior is shown when I add notes without timestamps, which are not synchronized at all to the calendar. Still synchronization freezes when tags are added.

I assume I have misconfigured something, so tags are not well processed in emacs. How can I use the tags to keep my calendars in sync?

Below is what I've added to my .emacs.

(use-package org-caldav
:init
(setq org-caldav-url "https://my.nextcloud.com/remote.php/dav/calendars/user")
(setq org-caldav-save-directory "~/.emacs.d/org-caldav-calendars")
(setq org-caldav-calendars
  '((:calendar-id "personal"
     :inbox "~/.emacs.d/org-caldav-calendars/personal.org"
     :files ("~/calendar.org")
     :exclude-tags ("work"))
    (:calendar-id "work"
     :inbox "~/.emacs.d/org-caldav-calendars/work.org"
     :files ("~/calendar.org")
     :select-tags ("work")) ))
:config
(setq org-icalendar-alarm-time 1)
(setq org-icalendar-include-todo t)
(setq org-icalendar-timezone "Europe/Berlin")
(setq org-icalendar-use-deadline '(event-if-todo event-if-not-todo todo-due))
(setq org-icalendar-use-scheduled '(todo-start event-if-todo event-if-not-todo))


texts: What do the spaces in the NEWENTRY parameter to modify-syntax-entry mean?

texts:
I am looking to set up a syntax table for a major mode, and many of the examples, such as lisp-mode-syntax-table have entries like the following:

(modify-syntax-entry ?\[ "_   " table)

My question that I cannot seem to find in the Info nor in the help text is this: What do the three (3) spaces after the _ mean?

I know that \[ is a symbol constituent ('_'). But what do the three (3) spaces in the string after the underscore mean?

How does the following code differ from the example in the Info manual and the value used in lisp-mode.el, given above?

(modify-syntax-entry ?\[ "_" table)


texts:
I'd like to sort objects by prop name, eg

const a = {
    method: "GET",
    url: "asd",
    headers: {
        Content: "application/json",
        Authorization: "token",
    },
}

then select only the object in the buffer, apply our function, and it would turn into

const a = {
    headers: {
        Authorization: "token",
        Content: "application/json",
    },
    method: "GET",
    url: "asd",
}

I know there's a sort-regexp-fields


texts: Where to get the list of org-mode commands as lisp variables?

texts:
After so much research, I managed to get alt + RET working. Learned so much!

I appended to my ~/.emacs:

(add-hook 'org-mode-hook
      (lambda ()
        (if window-system
            nil
          (progn
            (define-key org-mode-map "\C-\M-j" 'org-meta-return)
            (define-key org-mode-map "\C-j" 'org-insert-heading-respect-content\
)))))

I want to remap more things, like alt + right arrow. To do so, I could just add more (define-key org-mode-map ... blocks, but:

Where can I get the list of commands such as 'org-meta-return to create my mappings?


texts: Emacs wont reopen my files from recover session

texts:
I was working in emacs when had a power outage, so my computer was knocked offline. After I got the computer back up, I launched emacs and tried to restore the last session. Emacs then said: "No files can be recovered from this session now". All my files were saved, so all that needs to happen them opened from the .saves-pid-hostname~ file.
I'm not sure if this is even possible after researching the issues. I found this bug report about emacs session restores. It seemed to suggest that emacs didn't perceive the files as needing to be restored because all changes had been saved to them.
What I'm looking for is a way to have emacs open the files that are listed in the saves file. This should only apply to the normal file names and excludes the files that emacs makes in-between saves, like "#filename#".
Saves File:
/home/user/Documents/2019/document1.txt
/home/user/Documents/2019/#document1.txt#
/home/user/Documents/2019/document2.txt
/home/user/Documents/2019/#document2.txt#
/home/user/Documents/2019/document3.txt
/home/user/Documents/2019/#document3.txt#
/home/user/Documents/2019/document4.txt
/home/user/Documents/2019/#document4.txt#

How do I have emacs automatically open these files? I don't need my work in emacs to be persistence across restarts, so I think desktop save mode would be over kill for the situation.


texts: differences of shell-mode vs. shell-script-mode?

texts: What are the differences between shell-mode and shell-script-mode, or how/where would I read up the differences myself?


texts:
I get that there are different levels at which Header arguments in org mode, specifically LP can be defined and that the more specialized ones, i.e. deeper within the tree hierarchy, take precedence over the higher ones. So there are

- System-wide header arguments (usually in config files)

-File-wide header arguments

#+PROPERTY: header-args :dir "~/literate_test"

- Language-specific header arguments

- Header arguments in Org mode properties

  :PROPERTIES:
  :header-args: :results output :mkdirp yes
  :header-args+: :var image_name=not_finished
  :header-args+: :eval never-export
  :header-args+:elisp: :exports code
  :header-args+:dir: literate_test
  :header-args+:tag: 'test'
  :END:

- Language-specific header arguments in Org mode properties

- Code block specific header arguments

- Header arguments in function calls

and in order for arguments of the same kind to apply, I have to append them with +.

what confuses me though, is when do I have to use specific variables like below

* Header
:PROPERTIES:
:PRJ-DIR: ~/prj/dir/
:tangle: ~/dir/my/testfile.el
:END:

and when to use the :header-args: syntax

PROPERTIES:
  :header-args: :results output :mkdirp yes
  :END:

is there a rule to this?

Also, org seems to do some caching in the background when it comes to file local variables, header arguments etc. How does that work and how to refresh the entire buffer then?


texts:
Cursor does not show the bottom section such as _ or bottom part of character g. This is the case in emacs -q -nw file.py and also the case in my init.el file. I am not sure how can I fix this issue.
_g
_g

I am using emacs under iTerm, where it has smart-box setting it on. Smart-box should let cursor's color as: character's color to be the background color and character's color to be black.

Sometimes cursor's background and foreground color becomes the same, where I don't know how that happens


texts: In what order are Lisp files evaluated in this scenario?

texts:
Suppose I structure my Emacs (prelude) customizations like this guy:

https://github.com/NicholasKirchner/prelude/tree/master/personal

What is the load order of these files (for example)?

gnus-init.el
layouts.el
start.el

The load order is sometimes important, because often I'm trying
to invoke a function that hasn't been defined yet.


texts: When I press C-c C-e in org mode I get the export options. However I can not choose "Insert template" as when I try and type the # in mac os I need to press the option key and the 3 key. But Option is the meta key. How can I get to the insert template option.


texts:
I frequently use file-local variables, but after writing some minor modes I find the need to implement mode-based behavior.

Let's say I want to define a variable errors-list-regexp that varies depending on the major mode.

My first approach was to ask major modes to define such a variable by using a symbol-name convention, by prefixing the major mode name onto the variable name. Then, I would construct the appropriate symbol name, check whether it is bound and if so obtain its value (for example, java-mode-errors-list-regexp or "python-mode-errors-lisp-regexp")
But this is a bit cumbersome:

(let* (
       (sym (intern (concat (symbol-name major-mode) "-errors-list-regexp")))
       (errors-list-regexp (and (boundp sym) (symbol-value sym)))
       )
  ...
  )

Another solution might be to turn the variable into a (mode . value) alist, but this also is too cumbersome.

(let* (
       (errors-list-regexp-value (cdr (assoc major-mode errors-list-regexp)))
       )
  ...
  )

My current approach is to make errors-list-regexp buffer local, and to add a major-mode-hook (say, to java-mode-hook or python-mode-hook) that sets the appropriate mode-specific value.

I'm mostly satisfied with the latter solution but, is there a better way? Is this idiomatic?


texts: Possible to use emacs-undo/redo without keyboard-quit? (Ctrl-G)

texts:
Having run into a bug with undo-tree, I'd rather use emacs default undo.

Mapping undo to undo-only and redo to undo.

This requires pressing Ctrl-G then undo to effectively redo an operation.

Is there a way to make the Ctrl-G implicit, so I don't need to press it in cases I've just used undo-only?


texts: How to select (and copy) a column of an org table *without* rectangle selection?

texts:
It seems to me that the normal way to copy a column of an org table is by rectangle selection (see here). That is, first the column is selected by marking all of it by hand, and then it is copied with org-table-copy-region or the like.

What I would like to have is something more ergonomic in step one: The column gets selected based on the position of the cursor only.

How to do this?


texts: how to make all special symbols available in org latex?

texts:
once use the command below:

C-x RET C-\ TeX RET

I try to make some math formula:

\sqrt{}

but it can't be automatic translated to √,
then I check the symbol list:C-h I
and also can't find the \sqrt tex item,
so is there a config I have missed?


texts: Is there a way to specify that I want all tables in an org-mode file to have specific attributes?

texts: I have an org-mode file with a bunch of tables. In one tree I would like all the tables to have some specific HTML export attributes, but not in others. Is there a way I can do this without having to copy "#+ATTR_HTML: blah" to every table I want to affect?


texts: Automatically toggle external display profile

texts:
Apologies I know this will seem pedestrian -- please forgive me, I'm a newbie. I have low vision, so I'd like to automatically toggle different "display profiles" based on whether there is an external display connected.
I'm looking to have the following variables set when there is an external display connected:

;; ** Full-screen mode
(set-frame-parameter nil 'fullscreen 'fullboth)

;; ** Large font
(set-face-attribute 'default nil :height 1500)

And I would like the following if the external display is disconnected (or there is no external display detected):

;; ** Full-screen mode
(set-frame-parameter nil 'fullscreen 'fullboth)

;; ** Large font
(set-face-attribute 'default nil :height 1000)

(the full screen appears in both because I've found that often emacs will be demoted to a small window after a display switch.

I'm running emacs on Mac OS 10.13.6. If it isn't straightforward to have this done automatically, is there a way to tie each profile to a global key-binding to set the respective variables so display can be optimized manually? Right now I go into the init file and C-x C-e for each of these.


texts: advising two `synonyms.el` functions using `defadvice`

texts:
What's the best way to simplify this?

(defadvice synonyms (after synonyms-jump-to-window)
    (switch-to-buffer-other-window "*Synonyms*"))

(defadvice synonyms-no-read (after synonyms-jump-to-window)
    (switch-to-buffer-other-window "*Synonyms*"))

(ad-activate 'synonyms)
(ad-activate 'synonyms-no-read)

It works, but I don't like how code repeats with only minor difference,


texts:
Ediff interface has + button, but it doesn't seem to do anything (the minibuffer invariably shows "nil" when I press it), I thought this button was meant for using both variants in the result buffer.
Anyhow, the original question is: how do I make Ediff resolve a merge conflict by putting the content from both buffers A and B into buffer C (I know I can just edit C, but would hope this can be done more easily).
Suppose file A is this:

Same line
Different line
Same line

while file B is:

Same line
Another line
Same line

I want the file C, the result of merging A with B to look like this:

Same line
Different line
Another line
Same line


texts:
I'm using the Outline minor mode. (Or the major mode or Org mode, but in these modes the scenario in this question is rare.) I want to show all of the headings that have no parent, plus the text before the very first heading.

In simple cases, this just means showing level 1 headings. But when a file starts with a larger-level heading, I want to show this larger-level heading, and all headings at the same level until the first heading at a smaller level, and so on. If the file starts with a non-heading line, I want to show all the text up to the first heading. For example consider the following LaTeX file meant to be included in a larger document:

%% This file contains stuff.
%% It starts with a comment.
\section*{Introduction}
There's stuff here, then more stuff.
\chapter{One}
Hello.
\chapter{Two}
More.

I want a command that shows this and hides the rest:

%% This file contains stuff.
%% It starts with a comment.
\section*{Introduction}…
\chapter{One}…
\chapter{Two}…

This is different from hide-sublevels which shows headings up to a given level.

The idea is to show only the minimum set of headings such that the whole document is somewhere under one of the visible headings, except for the first entry before the first heading, which remains visible. All entries (except for that top entry) and all headings that have a parent should be hidden.

(I'll use this to replace hide-sublevels in outline-focus, so as to show parentless headings, plus all the headings on the path to the point, à la hide-other.)

Does this exist in Outline or Org, or do I need to roll my own?


texts: all-the-icons - weird icons after update

texts:
I recently updated my emacs packages, after this, all-the-icons change its icons. Now, that's how they look

Why a .md file icon is a wheater icon?

How I can go back to my previous icons?


texts: Electric behavior of dollar sign using AUCTeX

texts:
I'm trying to turn $...$ into an electric pair, just as say (...).
So I tried this solution, and it works fine on my older machine, running Emacs 24.3.1 and AUCTeX 11.87.
However, on a newer installation (Emacs 24.5.1, AUCTeX 12.1.1), it doesn't quite behave like it should.
When I type $x+y$, it should be giving me

$x+y$^,

where ^ denotes point. But instead I get

$x+y$^$$.

Obviously, Emacs fails to move over the automatically-inserted closing $ and instead inserts a new pair.
Here is the relevant part of my .emacs:

(electric-pair-mode 1)
(define-key LaTeX-mode-map (kbd "$") 'self-insert-command)
(push '(?\$ . ?\$) electric-pair-pairs)

The push line may be included or not, it doesn't make a difference.
I also tried the following .emacs, as suggested by the AUCTeX manual:

(electric-pair-mode 1)
(set (make-variable-buffer-local 'TeX-electric-math) (cons "$" "$"))

This gives me $x+y$^$, which is not much better.
How do I get the behavior I want?


texts: Github-flavored markdown mode: syntax highlight code blocks

texts:
For example, if I have a markdown file with the following:

###This is my markdown file
here is some text.
here is my code block:

``` js
var accountdown = require('accountdown');
var level = require('level');
var db = level('/tmp/users.db');

var users = accountdown(db, {
    login: { basic: require('accountdown-basic') }
});

var user = process.argv[2];
var pass = process.argv[3];
var bio = process.argv[4];

var opts = {
    login: { basic: { username: user, password: pass } },
    value: { bio: bio }
};
users.create(user, opts, function (err) {
    if (err) console.error(err);
});
```

How can I enable highlighting in the code block?

Perhaps it's unrelated, but org-mode can highlight source code blocks as follows:

(org-babel-do-load-languages
      'org-babel-load-languages
      '((python . t)
        (js . t)
        (R . t)))


texts: org-latex-preview on entering insert mode in spacemacs

texts:
I use Spacemacs and org mode for writing latexified notes.
There is no custom setup, just the default latex layer.
I usually toggle org-latex-preview by C-c C-x C-l. It is annoying, because I must press this combination before editing each formula.
I want it to behave like this: when I enter INSERT mode while on a previewed LaTeX image, it should de-preview only this formula.
How can I accomplish that?


texts: How to find a newline with a regular expression in query-replace-regexp?

texts:
I am trying to use find-name-dired and query-replace-regexp to find and replace some blocks of text across multiple HTML files.  (Just what is explained here in the Emacs Manual.)
query-replace-regexp fails to match anything containing a newline.
For example, I want to find all files containing the following:

It will find
 by itself, but not when concatenated with the newline as above.
I've tried coding the newline like so:

^J (inserted with C-q C-j)

\n

"\n".

The first fails with no matches.  The second and third cause the minibuffer to complain that \n and "\n" don't match newlines in this function.
I know the newlines in my files are line feeds and not carriage returns (as documented here in Xah Emacs), but I've also tried coding my regular expressions with ^M and \r for good measure.  No matches.
How can I get query-replace-regexp to match a newline?


texts: `user-emacs-directory' directory is inaccessible

texts:
I had recently started to get

Warning (initialization): Unable to access `user-emacs-directory' (~/.emacs.d/).

message upon startup.

I'm on

Windows 7 (X64)
using the latest x64 emacs-25.0.94.2 build
and .21 spacemacs.
My $HOME is set to C:\HOME (with the "normal" Windows environment variable way), and in which there is the .emacs.d directory and my not so tailored .spacemacs, which gets processed upon startup,
and I can access via dired ~ so I assume that it is set properly.

Could someone point me in the right direction what should I do with it?


texts:
I tried using ac-html recently since I'm an auto-complete user and I'd like to have HTML completion in html-mode and web-mode buffers. However, it has been acting somewhat strangely and throws an error whenever I type anything in an html-mode or web-mode buffer:

auto-complete error: (args-out-of-range <name-of-current-buffer> 0 2)

As a result of this error, auto-complete-mode is disabled in the current buffer. However, perhaps even more strangely, if I turn on auto-complete-mode after it was disabled by the error, everything works as expected and I get auto-completion. Yet, this only seems to happen in html-mode buffers; i.e., I do not get auto-completion after re-enabling auto-complete-mode in web-mode buffers.

I have ac-html set up for both html-mode and web-mode like so in my init files:

;; Better completion for html-mode
(defun setup-ac-for-html ()
  (require 'ac-html)
  (require 'ac-html-default-data-provider)
  (ac-html-enable-data-provider 'ac-html-default-data-provider)
  (ac-html-setup)
  (setq ac-sources '(ac-source-html-tag
                     ac-source-html-attr
                     ac-source-html-attrv)))

;; Better completion for web-mode
(defun setup-ac-for-web-mode ()
  (require 'ac-html)
  (require 'ac-html-default-data-provider)

  (add-to-list 'web-mode-ac-sources-alist
               '("html" . (ac-source-html-tag
                           ac-source-html-attr
                           ac-source-html-attrv))))

...

(add-hook 'html-mode-hook                      'setup-ac-for-html)
(add-hook 'web-mode-before-auto-complete-hooks 'setup-ac-for-web-mode)

How can I get this error to stop happening so that I don't have to re-enable auto-complete-mode after said error? Also, why does this re-enabling seemingly not work for web-mode?

I'm using Emacs 25.1.1 on OS X 10.11.6.


texts:
I am looking for an easy way to turn a list such as this:

one,
two,
three,
four,
five,
...

into something more like this:

one,      two,      three,   four,
five,     six,      seven,   eight,
nine,     ten,      eleven,  twelve,
thirteen, fourteen, fifteen, sixteen,

It seems relatively straight-forward to do "column-major" reshaping by using rectangles, but more often than not it is the "row-major" reshaping that I want, since many programming languages accept a list in this format.

I am a big fan of the multiple-cursors package, so I would gladly accept an answer which presents a clever usage of mc features. That is not a requirement though.  I find that multiple-cursors can get a bit laggy after >100 cursors, so there may be better ways to reshape a list when the list is long anyway.


texts: How can I add characters to an input method?

texts:
I often use the TeX input method to type Unicode characters like λ, which is quite handy. However, some of the characters I want to type are not supported like various subscripts (say ᵢ), script characters (like ) and other various symbols (like ⦅ and ⦆).

How can I extend the TeX input method to support some of these characters with custom input string (ie _i for ᵢ)?


texts:
This says that

  Noweb insertions now honor prefix characters that appear before <<reference>>.

And because of that trying to use

#+BEGIN_SRC clojure :noweb-ref dep-cljsbuild
[lein-figwheel "0.5.9"]
[lein-cljsbuild "1.1.5" :exclusions [[org.clojure/clojure]]]
#+END_SRC

with

:plugins [<<dep-cljsbuild>>]

gives me

:plugins [[lein-figwheel "0.5.9"]
:plugins [[lein-cljsbuild "1.1.5" :exclusions [[org.clojure/clojure]]]]

which is obviously not what I want. I can workaround issue by moving <<dep-cljsbuild>> to the new line, but it looks ugly.

Could you recommend any proper way to point org-mode that in particular place I don't want prefixes to be preserved? (Or at least how to disable it globally)


texts:
I am running Emacs mac ports (24.5) on a Macbook Air. I have the following code as an .el file to setup my own multilingual environment:

(require 'quail)

(quail-define-package "maatra"
                      "UTF-8" "m" t
                      "Input method for Roman transliteration of Devanāgarī using IAST scheme. E.g. aa -> ā"
                      nil t nil nil nil nil nil nil nil nil t)

(quail-define-rules ("aa" ?\ā)
                    ("AA" ?\Ā)
                    ("ii" ?\ī)
                    ("II" ?\Ī)
                    ("uu" ?\ū)
                    ("UU" ?\Ū)
                    (".r" ?\ṛ)
                    (".R" ?\Ṛ)
                    (".rr" ?\ṝ)
                    (".RR" ?\Ṝ)
                    (".l" ?\ḷ)
                    (".L" ?\Ḷ)
                    (".ll" ?\ḹ)
                    (".LL" ?\Ḹ)
                    (".M" ?\ṁ)
                    (".m" ?\ṃ)
                    (".h" ?\ḥ)
                    (".H" ?\Ḥ)
                    (";n" ?\ṅ)
                    (";N" ?\Ṅ)
                    ("~n" ?\ñ)
                    ("~N" ?\Ñ)
                    (".t" ?\ṭ)
                    (".T" ?\Ṭ)
                    (".d" ?\ḍ)
                    (".D" ?\Ḍ)
                    (".n" ?\ṇ)
                    (".N" ?\Ṇ)
                    (";s" ?\ś)
                    (";S" ?\Ś)
                    (".s" ?\ṣ)
                    (".S" ?\Ṣ)
                    ;;("dd" ?\d̤)
                    )

        (provide 'maatra)

I am facing two problems:

I receive the error 'Invalid read syntax: ?' only when I uncomment the last line above. Else the code works perfectly. Emacs has no problem with any other character except d̤.
Emacs is even unable to properly display the d̤ character except when I use the Monaco font. Other fonts like Dejavu Mono which perfectly display this character in other applications do not render it properly in Emacs. Typically, the adjacent characters overlap this character and the text becomes unreadable.

How do I fix the problem with the d̤ character?


texts: Function to open all Org files in a folder recursively

texts:
I am looking for a way to open all Org (or Fountain) files in a folder using one function.

Essentially, I am seeking to open all available files of a certain type (.org or .fountain) within a folder tree.


texts:
still have some problem to configure emacs:

I use orgmode to write principally in italian, but also in english. So i want to use flyspell to check either language. I google and i find this blog. After i launch brew install hunspell, downloaded the dictionary files and run hunspell -D, i modify my configuration.org file like this:

EDIT: i rewrite the code to include ispell-dictionary-alist

Enable spell-checking in Org-mode.

#+BEGIN_SRC emacs-lisp
   (add-hook 'org-mode-hook 'flyspell-mode)
#+END_SRC

setting flyspell in all my language by using hunspell

#+BEGIN_SRC emacs-lisp
 (require 'ispell)
 (setq-default ispell-program-name (executable-find "hunspell")
           ispell-dictionary "it_IT")
 (setq ispell-dictionary-alist
 (append '(("italian"
      "[AÀÁB-EÈÉF-IÌÍJ-OÒÓP-UÙÚV-Zaàáb-eèéf-iìíj-oòóp-uùúv-z]"
      "[^AÀÁB-EÈÉF-IÌÍJ-OÒÓP-UÙÚV-Zaàáb-eèéf-iìíj-oòóp-uùúv-z]"
      "[---']" t nil "~iso" iso-latin-1)
 ("english"
      "[A-Za-z]" "[^A-Za-z]" "[']" nil
      ("-d" "en_GB") nil utf-8))
 ispell-dictionary-alist))
 (setq ispell-menu-map nil)
 (load-library "ispell")
 (eval-after-load "ispell"
 (progn
 (setq ispell-dictionary "english"
      ispell-extra-args '("-a" "-i" "utf-8")
      ispell-silently-savep t)))

    (bind-key "C-c ì"
            (lambda ()
              (interactive)
              (ispell-change-dictionary "it_IT")
              (flyspell-buffer)))

  (bind-key "C-c è"
            (lambda ()
              (interactive)
              (ispell-change-dictionary "en_GB")
              (flyspell-buffer)))
#+END_SRC

But when i start emacs doesn't work flyspell, if i tipe C-c ì it say wrong type argument:stringp,nil and if i type C-c è it return Undefined dictionary: en_GB. Guesses?

EDIT: now the bind work, also code compile correctly, but when i change dictionary emacs say Undefine dictionary: yada_YADA with each of two dictionaries.


texts: Folding code between a literal "begin"/"end" block using Hideshow

texts:
A formatted input file (*.alm) often contains a large section of columned data. To fold this and improve navigation, I've tried to implement a hs-special-mode-alist entry from hideshow.el.

(setq hs-special-modes-alist
   '((alamo-mode "begin_data" "end_data" "#" alamo-forward-sexp nil)))

After executing the the bare bones mode in the footer  and opening `test.alm',

# Name: test.alm
# Long comments
# Like this will fold

BEGIN_DATA # This will not fold
1 2 3
1 2 3
1 2 3
END_DATA

running M-x hs-hide-all results in:

# Name: test.alm...

begin_data # This will not fold
1 2 3
1 2 3
1 2 3
end_data

Despite my list declaration including a begin_data / end_data pairing, the block is ignored. I expected the buffer to look like:

# Name: test.alm...

begin_data ... end_data

Is there a reason why hideshow.el doesn't recognize and hide the begin_data / end_data block or am I missing something in my usage or declarations?

To fold test.alm load the following file:

;;; Demo code
(defun alamo-forward-sexp (&optional arg)
  "Search forward to the next alamo option or begin/end of a data block.
ARG defines the forward or backwards count for the search."
  (interactive "p")
  (or arg (setq arg 1))
  (re-search-forward "\\<\\(\\(begin\\|end\\)_data\\)\\>" nil nil arg))

(setq hs-special-modes-alist
      '((alamo-mode "begin_data" "end_data" "#" alamo-forward-sexp nil)))

;;;###autoload
(add-to-list 'auto-mode-alist '("\\.alm\\'" . alamo-mode))

;;;###autoload
(define-derived-mode alamo-mode prog-mode "ALAMO"
  "A major mode for editing ALAMO input files. (*.alm)"
(setq-local comment-start "#") ; required for hs-minor-mode
(hs-minor-mode 1))

(provide 'alamo-mode)


texts: Each time I save a file, Spacemacs will try and parse my bibliography bibtex file. How can I stop that?

texts:
I use Spacemacs and it is great. But for some reason, each time I save a file--usually an org file, Spacemacs will try and parse my default bibtex file. And that file is relatively large, so it adds a weird amount of time either when saving or even when auto-saving. I am not sure where to look to fix this.
I use helm-bibtex which is again, wonderful. But each time I save a file, in the Messages I see:
Saving file /home/.../myfile.org...
Wrote /home/.../myfile.org
Parsing bibliography file ~/Dropbox/.../library.bib ...
forward-sexp: Scan error: "Unbalanced parentheses", 2702612, 6340258

And on each save it seems to find some parsing errors--so the save is triggering a validation or parsing of this large bibtex file.
I was looking in the after-save-hook and before-save-hook variables, but I did not see anything that immediately caught my attention. Is there something that could be causing this, either in the helm-bibtex settings or somewhere?
Any help is really appreciated. Thanks.


texts:
I'm a bit new to emacs and I'm trying to play with the idea of publishing some notes in org-mode as a blog. I've been reading the manual and writing the publish.el file. I understand I need to set the variable org-publish-project-alist. One of the things I want to do is to remove the css and js included in the export and use my own. There are two option in the manual to disable them :html-head-include-default-style and :html-head-include-scripts; so far so good. The problem is when I want to add my own, the manual says the option :html-head would do the job and indeed, if set it to a string it gives the desired result: It adds that string in the header of the resulting HTML file. Now, the header is far from finished so I thought of defining a variable to contain a longer and more complex string but for some reason with this, the publishing gives me the following error:
Publishing file /home/eduardo/Sites/org_blog/posts/index.org using ‘org-html-publish-to-html’ org-html-template: Wrong type argument: sequencep, org-blog-header

I'm aware I could just add the header to each org file with #+HTML_HEAD or the same using #+SETUPFILE and it could be perfectly functional, however I'd like to have a complete separation between writing and setup.
Edit: How can I use the variable to define the string in the option :html-head? And why is it rejecting it in one form and not in the other?

Here are the two parts on the publish.el file:
The definition of the variable containing the string for the header:
   (defvar org-blog-header
     "<link rel=\"stylesheet\" type=\"text/css\" href=\"index.css\" />
      <link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\">")

The definition of org-publish-project-alist:
   (setq org-publish-project-alist   '(

   ("org-posts"
   :base-directory "~/Sites/org_blog/posts/"
   :base-extension "org"
   :publishing-directory "~/Sites/org_blog/public/"
   :recursive t
   :exclude ".*\.draft\.org"
   :with-toc nil
   :with-title nil
   :section-numbers nil

   :auto-sitemap t
   :sitemap-filename "index.org"

   :html-head-include-default-style nil
   :html-head-include-scripts nil
   :html-head org-blog-header

   :publishing-function org-html-publish-to-html
   )

   ("org-static"
   :base-directory "~/Sites/org_blog/static/"
   :base-extension "css\\|js"
   :publishing-directory "~/Sites/org_blog/public/"
   :recursive t
   :publishing-function org-publish-attachment
   )

   ("org" :components ("org-posts" "org-static"))))


texts: Increment days / months / dates, etc. within buffer

texts:
In a text document, while editing, I often need to increment/ decrement calendar data. So, Friday will need to become Monday, December will need to become March, etc.
Or 28 Apr after adding 5 will become 03 May, and even 31 Dec 2017 after adding 15 will become 15 Jan 2018.
Is there a way to achieve this by placing cursor on the desired word/ number and hitting some keys so that it increments or decrements?
So, while on Friday, I hit something to say 'Add 3' and it becomes Monday, etc. While on 28 in 28 Apr, I hit something to say 'Add 5' and it becomes 03 May. But while on Apr in 28 Apr, I hit something to say 'Subtract 2', it becomes 28 Feb, etc.
Just so that you get an idea, vim has a speeddating plugin that does exactly what I am aiming at.


texts: Default font has no slant=italic but I want to show italic text

texts:
My preferred font is -*-fixed-*-*-*--14-*-*-*-*-*-*-* and it doesn't have slant=italic variation.

I also like -*-terminus-*-*-*-*-14-*-*-*-*-*-*-* font and under Debian there is special xfonts-terminus-oblique package to provide italic font variation.

How to tell Emacs to use terminus font for italic :slant?

I can't use terminus as default because it misses some glyphs.


texts: "Lisp error" when trying to append hash tables to a list

texts:
Q:  Is there a way to create one cache that consists of one cons cell and two hash tables?  If so, how, please.  If not, what is the best way to handle this scenario?

Background:

I'm working on a new feature for speedbar that creates a cache for:

nth 0:  a cons cell -- i.e., (cons speedbar-shown-directories (buffer-string))

nth 1:  a hash table [use line number to find absolute file name]

nth 2:  a hash table [use absolute file name to find line number].

The cache is speedbar-full-text-cache.  I thought it would be handy to create a list of three elements -- the regular last open directory is saved in its entirety for ultra-fast switching for the first element (i.e., nth 0), and then I wanted to add two hash tables.  So the thought was to create something like:

STEP 1:

(setq speedbar-full-text-cache
  (list (cons speedbar-shown-directories (buffer-string))))

STEP 2:  Try to append two hash tables.

(setq speedbar-full-text-cache
  (append speedbar-full-text-cache
    speedbar-line-to-node-table speedbar-node-to-line-table))

RESULT:  Debugger entered--Lisp error: (wrong-type-argument sequencep #s(hash-table size 97 test eql rehash-size 1.5 rehash-threshold 0.8 data . . .


texts:
This is my current Emacs workflow:

emacs --daemon
emacsclient -c

then editing few files and saving some of them (and keeping some of them unsaved and open on the server for later edit); then deleting the frame with C-x 5 0 (and later connecting again with emacsclient -c).

What is C-x # (server-edit) for? what does it do? how it can affect my workflow?


texts:
To instrument an elisp function means to set up Emacs in such a way that whenever the function gets executed, debug mode is entered so the function can be executed stepwise. To instrument a function, move point into the definition of the function and then do C-u C-M-x (as explained here).

How can I de-instrument an elisp function I have instrumented so that Emacs won't stop and enter into debug mode every time I execute this function?

According to the Emacs manual,

  To remove instrumentation from a definition, simply re-evaluate its definition in a way that does not instrument. There are two ways of evaluating forms that never instrument them: from a file with load, and from the minibuffer with eval-expression (M-:).

If I use the M-: then the function will get executed, right? I'd like to avoid this.

So this leaves me with the second option:

  from a file with load

But what does it mean? Does it mean reloading the file where the function is defined by executing C-x C-f (or, alternatively, M-x revert-buffer)?


texts: How can I get a sensible split-window policy?

texts:
Emacs is constantly making new windows and it's been ruining my day lately.  How can I tell emacs to use the following policy when creating windows?

Prefer vertical splits
Stop doing vertical splits when windows would be less than 80 columns.
Stop doing horizontal splits when window would be less than 60 rows.
When I reach this 6x6 grid, on my 27" monitor, start reusing windows!

Also, I'd prefer my windows to always be balanced, but every split leaves the widow sizes unbalanced.  I'd rather have 3 equally sized windows than 1 large and two which are too small! Is there a setting for this, or a sensible place to put a balance-windows advice?


texts: Version control: how to inhibit opening email buffer upon breaking lock

texts:
My work uses GNU RCS for our version control system, but I don't think the specific VCS is relevant here. (I know RCS isn't the most modern system but it suits our needs fine and has the advantage of relative simplicity. Anyway, that's not the question.)

When I steal the lock on a file using C-x v v, emacs opens up a buffer so I can email the person from whom I stole it. I never need to do this, so I have to go to the trouble of killing the buffer and then confirming that I want to do so. This is a hassle I'd rather avoid.

So, how can I make emacs not open that buffer in the first place?

EDIT As pointed out in the comments, I could have included more relevant info.

The package is vc, and the keybinding C-x v v calls the function vc-next-action, which is a smart command that attempts to figure out what you want to do next.

In this case, RCS is an "old-style locking-based VCS", somebody else has locked the file and the function is attempting to steal the lock, as outlined in the function's documentation.

FURTHER EDIT Digging a little more deeply, it seems that vc-next-action is calling vc-steal-lock (surprise, surprise). This function contains the following chunk of code at the end:

;; Write mail after actually stealing, because if the stealing
;; goes wrong, we don't want to send any mail.
(compose-mail owner (format "Stolen lock on %s" file-description))
(setq default-directory (expand-file-name "~/"))
(goto-char (point-max))
(insert
 (format "I stole the lock on %s, " file-description)
 (current-time-string)
 ".\n")
(message "Please explain why you stole the lock.  Type C-c C-c when done."))

I assume that if I comment this out, the email buffer won't open. I know that just commenting out this chunk in the source code isn't the right way to go about things. But what is the right way to modify a built-in function in a way that will survive if I upgrade, reinstall, etc?


texts: How can I add the pdflatex binary to my path to make it visible to emacs, specifically LaTeXPreviewPane?

texts:
Solved: See my answer below. It seems like emacs can't always see what you can see in the terminal. The package mentioned in my answer below solved this issue.

I'm trying to make LaTeXPreviewPane work on osx (Yosemite). When I try to use the pdf preview it never finishes loading, I see this message:

Error running timer `latex-preview-pane-update': (file-error "Searching for program" "no such file or directory" "pdflatex")

These are the requirements:

1: A installed copy of Emacs 24+ with a working packages system
2: The command pdflatex on your PATH
3: Access to the MELPA package repository

I know I have 1 and 3 and have tried to make sure pdflatex should be in my "PATH" as described below.

I tested the command pdflatex via the terminal, and it worked. It is expandable in the terminal, using bash. However I thought I may have to make sure it might still not be in the "PATH" so I found out where the pdflatex binary I installed via macports is, and added it to the .bashrc:

$ which pdflatex
/opt/local/bin/pdflatex

I then added this path to my .bashrc file like this:

PATH=$PATH:/opt/local/bin/pdflatex
export PATH

It still does not work, I'm thinking the problem could be that emacs does not see everything bash sees and that I may need to put a symlink to the binary somewhere, but I'm not sure. I'd really appreciate some advice on how to solve this.


texts: How to perform a modifying action without modifying buffer?

texts:
I want to add properties to text (make it read-only temporarily) and I don't
want “modification-status” change. In general, how do I perform some
modifying action without Emacs noticing it?


texts: Bookmarks relative to projectile-project-root?

texts:
Often, the git repos I work in have a similar layout (for example every python project has a setup.py with an install_requires line in it).
Is it possible to add a bookmark that points to a similar line in a file relative to (projectile-project-root)? Is it possible to have this only appear in the bookmark list if I am visiting a file in the right sort of repository?
Example:
We might have directories

/home/user/node-project1
/home/user/node-project2
/home/user/c-project1
/home/user/c-project2
/home/user/python-project1
/home/user/python-project1

In the c projects I might want to jump to (projectile-project-root)/Makefile but not in python or node projects. You might want to jump to the all: target.
In python projects I might want to jump (projectile-project-root)/setup.py but not in c or node projects. I might want to jump to the install_requires line.
In node projects I might want to jump to (projectile-project-root)/package.json, but not in c or python projects. I might want to jump to the "dependencies": { line.


texts: Prevent showing buffer reversion message while working in the minibuffer

texts:
Problem

When the file underlying buffer foo is changed, Emacs shows Reverting buffer 'foo'. in the echo area.

The problem is that it will do this even when I'm working in the minibuffer, and the message will simply overlay whatever I have there, making seeing what I'm working on impossible.

Question

Is there any way to change this behavior?

Steps to reproduce the behavior

Outside of emacs, create a file: echo test > foo
emacs -Q
M-: (global-auto-revert-mode)
M-: (find-file "foo")
M-x switch-to-buffer *scratch*
M-x to open the minibuffer, and keep it open.
Outside of Emacs, append something to the file: echo bar >> foo

At this point you should see the message in the minibuffer saying Reverting buffer 'foo'.


texts: Near-identical commands on multiple keys

texts:
Visual Studio has this nice feature where you can put the point on something, press C-f3 and it'll both find the next instance of the thing under the point and it'll remember it.  You can then press f3 to find the next instance, and S-f3 to search for that same thing, but backwards.

I can do the same thing in Emacs using some elisp that I wrote.  (It's bulky, and I'm sure bad, so I'll omit it).

What I would like to do is to enable similar functionality for, say, f2, f3, f4, and f5.  Thus, pressing C-f2 searches for the thing under the point by saving that thing into a variable / association array / symbol somewhere, pressing C-f3 on a different thing causes emacs to save that second thing to be saved in to a distinct variable, and so I can search for the first thing by pressing f2 in the future, and I can search for the second thing by pressing f3 in the future.

I'd love to create a single function for the Control-X, another for just plain X, and a third for Shift-X, but I'm not sure how to approach this.

Is it better to have to have the function ask for the current key press (a la this-single-command-keys), or to find a way to pass a parameter from to the interactive function (without prompting the user, since they've already pressed a key)?

How does one pass additional information into an interactive function?


texts: Searching a specific project sub-directory with projectile

texts:
I recently found Projectile and I am loving it. I really like the ivy/counsel integration as well. One thing is missing though:
I am working on a huge project of hundreds of files. This is stored in one big massive Git repository which projectile recognizes as the root of the project. I'd like to keep it recognizing this as the root, as there are some dependencies across the various folders.
How can I run projectile search (e.g. C-c p s r for using ripgrep) and limit results to a specific sub-directory in that project?
Update 2020-06-17
I just found the --iglob option for ripgrep. I'll keep looking for a way to use this along with counsel-projectile-rg, but if anyone knows I'd love to hear an answer!


texts: Why is electric-indent-mode adding extra indentation after pressing return twice in org source blocks?

texts:
When I try to write code in source block in Org mode, pressing return once acts as expected while hitting it a second time increases the indentation to two levels if it's currently less than that. Here's an example of how the cursor moves when I press return at various initial indentation levels:
#+begin_src python
def my_function():
    # Each "." shows where the cursor goes after pressing RET.
    .
        .
        .
        .

    def internal_function():
        # Same thing from here.
        .
        .
        .
        .

        def double_internal_function():
            # Same thing from here.
            .
            .
            .
            .

# Same thing from here.
.
        .
        .
        .

#+end_src

It is (org-return electric-indent-mode) that is being called when I press return, and I'm able to reproduce this behavior by calling this myself. Some other function calls that don't exhibit the same behavior are (org-return-and-maybe-indent), (org-return), (org-newline-and-indent), and (newline-and-indent). If I disable electric-indent-mode, then the second return eliminates all indentation entirely. Ideally, I would want repeatedly pressing return to maintain the same indentation level.


texts: Is there a function in emacs that centers an input text and fills the line with the comment symbol as one would use it for headings in a file?

texts:
I want to have a quick way of writing a heading in an arbitrary file. So in Emacs-lisp mode the selction of Heading in a file and a call of the function would result in:

;;;;;;;;;;;;;;;;;;;; Heading ;;;;;;;;;;;;;;;;;;;;

I.e. automatically filling the rest of the line with the comment symbol of the respective mode and the text being centered, surrounded by a space and the comment symbols. I am almost sure there is something alike, somewhere?

Edit:
Okay I found the file newcomment.el, which defines comment-styles such as plain, indent, aligned, box etc.  Where aligned should be what I am asking for. But how can I get it running?


texts: Org-capture-template which add a ID property

texts:
I set up the org-capture-template as

(setq org-capture-templates
      '(("d" "Diary" plain
         (file+function "~/Documents/OrgMode/ORG/src/todo.today.org"
                        my-org-goto-last-today-headline) "\n%?")
        ("p" "Procedure" item
         (file+function "~/Documents/OrgMode/ORG/src/todo.today.org"
                        my-org-goto-last-procedures-headline) "%i%?")
))

When insert a plan, it seems working properly.

Unfortunately, after strike "C-c C-c" to finalize the capturing, an ID property will be appended automatically to the heading as

** Procedures
:PROPERTIES:
:ID:       ea33d47e-db77-471a-b5d3-60546248272d
:END:
- Question about "How to delete the properties automatically inserted? "

I referenced the Capture-template for "template-elments", "template expansions" and "template in contexts", but did not find variables which define how to add a ID property.

I don't want the ID property, where could I cancel it from appending automatically?


texts: How can I work around json-encode error with key "t"

texts:
While working with JSON in Emacs Lisp, I got an error json-encode-key: Bad JSON object key: t. It made sense to me that the key was "t" but not necessarily why, or what I can do about it.
The following code sample reproduces this scenario:
(let ((foo (json-read-from-string "{\"t\":42}")))
  (message "%s" foo)                  ; ((t . 42))
  (message "%s" (json-encode foo)))   ; json-encode-key: Bad JSON object key: t

How can I work around this, given that the JSON in question involves a key of "t"?


texts:
If I insert an image into a latex file (via \includegraphics) auctex lets me select the file and inserts the filename.

However using this dialogue, I can only choose the filename and cannot see previews of images as in file chooser dialogues of usual GUI programs.

How can I get this in emacs too? I.e. have image thumbnail previews when selecting an image for my tex file.

Edit I just discovered icicles mode which generates thumbnails for find-file. However it doesn't seem to work with auctex and completion in \includegraphics out of the box.


texts: How to maintain a completion words source in a buffer?

texts:
I am planning to write a completion extension for Emacs. Is there any way to maintain a list of source words?

I found that a lot of completion helpers use regex to scan the buffer for the candidates. I was thinking about using inverted index to maintain the list, but Emacs has no concept of a line.

These come from my inverted list idea, line concept is that supposed Emacs buffer consists of a lot pieces of smaller buffer, each piece is a line, assumed that we organize the buffer using linked list, when we editing a line, we editing a node in linked list, as line content changing, I can update my completion table, so the updating cost is minimum, I don't need to rescan the whole buffer.

For more specific, my question is how a maintain a completion table with lowest cost during editing a buffer.

So I'm stuck. Any suggestions？


texts:
I have NeoTree  installed. When I navigate through folders and files in it and when I press enter, nothing happens. I don't get into a directory. I've tried TAB also -- nothing.

M-x describe-key Enter


texts: Where should I find init.el, if it is not in .emacs.d?

texts:
I do not find init.el in .emacs.d. Where should I put my configuration?
% ls -a .emacs.d
.           .session        auto-save-list      recentf
..          .uptimes.el     org-clock-save.el   var


texts: How to sort my todo's in org-agenda based on scheduled date?

texts:
I have a problem with my org-agendas. I have tried to sort my todo's
in each agenda view after their scheduled date, but that does not
function. I use the following code:

(setq org-agenda-custom-commands '(
     ("d" "daily "(
        (tags-todo "TODO={TODO}+SCHEDULED<=\"<today>\"+PRIORITY={B} "  (
        (org-agenda-sorting-strategy '(scheduled-down))
        ))
  ))))

The todo's does not get sorted after scheduled date, but are listen totally unrelated to it. Can anybody tell me why my code does not sort after scheduled date?

Thanks in advance :)


texts:
It's a very simple task, really. But all my google results come up with complex solutions. I must be blind or going about this wrong. Anyway...

Here's what I want:

I want to split up my emacs configuration in the following structure:

.emacs.d/
  init.el
  custom1/
  custom2/

I want init.el to be as minimal as possible, just something that says "load all .el files in custom1/ and custom2/, recursively". Whenever I put a new file in any of those two directories I want it to automatically be loaded when emacs is started.

It seems simple and easy to me. But I fail at finding a simple solution.


texts: Strange behavior of org-agenda-files initialization

texts:
I am using emacs-27.1 build 1 and org-mode 9.3.7 under Ubuntu 18.04 LTS.
Situation 1:
If I restart emacs and call org-agenda the 'Agenda for current week or day' shows only days of the week.  I ran emacs-25.1 prior to 27.1 and the behavior then was to load the agenda files and show the agenda, with the time-stamped journal entries, calendar entries, TODOs, etc.
The value of org-agenda-files is nil after start-up. Org-mode otherwise seems to be normal.
The following is the start of my org-configuration:
(use-package org
  :ensure t)

(setq org-agenda-files (quote ("~/org/todo.org"
                                 "~/org/journal.org"
                                 "~/org/calendar.org")))

Loading init.el and evaluating the buffer does not set org-agenda-files
Evaluating the s-expression itself (put cursor after the s-expression containing setq and C-x C-e) sets org-agenda-files and restores the normal behavior - calling org-agenda loads the agenda files and shows the proper agenda. I have tried putting the variable initiation inside the use-package (following :init)with the same result - the variable is not set on start-up, but is after evaluating the s-expression.
Situation 2
I use two themes a day: a light theme for daytime and a dark one for night.
After M-x disable-theme and M-x enable-theme org-agenda-files is set to nil and the above behavior pertains!  I have to eval the expression that sets org-agenda.  The reset happens after enable-theme.  It does not appear to matter what theme is enabled (I have tried three).
The manual adjustment for each case only requires a few seconds, but it is annoying and interrupts the work flow.  How can I avoid having to manually set org-agenda-files?


texts: What steps are necessary to start contributing to Emacs proper?

texts:
Now that Emacs is maintained in a git repository (AFAIK), this opens the door (at least for me) to intelligently explore Emacs as a F/OSS project to contribute to :)

Trouble is, I have no idea how to start doing so.  CONTRIBUTING instructs the developer to mail emacs-devel, but there are surely steps that are common to all contributors.


texts: How can I make Emacs use the first available font from a list I specify?

texts: I share my Emacs config across several machines, and I can't necessarily guarantee that they will all have the same fonts installed. For this reason, I would like to be able to give Emacs a list of acceptable fonts to use and have it select the first available font from that list at startup and set the default face to use that font. This should give me a reasonable-looking Emacs on any system. Is there a way to do this by default, or a package that implements it, or will I have to write my own code for this?


texts: Colorizing `functions/variables' within comments in `c-mode'

texts:
I am working with the C-source code of Emacs using the built-in c-mode, and would like Emacs to automatically highlight functions and variables within comments with a different color:  In the following example, how can I make pos-visible-in-window-p a different color?

/* See the doc-string for `pos-visible-in-window-p'.  */


texts: How to call another function, if one function gives an error message

texts:
Suppose I call a function which is named as foo.

Sometimes that function foo will give a message such as "Example of error message".  If that is the case, then something else should be executed.

This means that I need a way that to read the output of the messages buffer.
In particular, I want to define a function bar that calls foo and executes something when foo gives a error:

(defun bar ()
   (foo)
   (if (string-match `"Example of error message"` (minibuffer-output after calling foo))
           then do this)
      else do this thingy).

When I read the Emacs Documentation, I couldn't find anything that gives the functionality of reading the latest message from the minibuffer.

Any suggestion would be appreciated.

SITUATION FROM THE REAL WORLD:

It seems my post is not clear enough. I will detail it further from the actual situation here. I have the following:

(defun foo ()
   (interactive)
   (evil-goto-mark ?8)
)

Calling the function foo produces the error Marker 8' is not set in this buffer.

If I get that message after calling (evil-goto-mark ?8), I want to call (evil-set-marker ?8)  instead. The answer below didn't work in my case, unfortunately.


texts: Check whether a string is a date in a specific format, e.g. "%Y-%m-%d"

texts: I have a string and would like to check whether it contains a date in a given date format, e.g. "%Y-%m-%d", with format as for format-time-string.  This is for a package and users can configure the date format freely.  So I cannot just hard-code a regular expression.


texts:
I am trying to set up many windows with gdb for emacs to show the source code file while debugging, this is what I have in my init.el file;
(setq
  gdb-many-windows t
  gdb-show-main t)

The gdb-show-main part is supposed to keep the source code file from main of the program being ran open in a buffer but instead it just opens the buffer list

The 2nd down buffer should be showing the source code of var.c automatically on starting GDB but doesn't, how do I fix this so it will automatically open? Looking online the command gdb-show-main t should fix the issue but apparently not.


texts:
When in org-mode, how to move point to the beginning of the current item? (in similar fashion like back-to-indentation)

Example:
Imagine following org buffer content

* headline
  - [ ] Z this is an longer item | (Point) is here. And here is some more text.
  - [X] it should work with that line too!
  - and with that one also

With point at location |, in the middle of that item. .oO(or even at the beginning of that line)
How can I easily move point to right before the letter Z?

I always jump around that location before I finaly hit it (i.e C-a M-f M-b or even C-a M-f M-f M-b) this is somewhat cumbersome..


texts: I am looking for a way to write proper Czech quotation marks, e.g., „…“ ‚…‘ »…« ›…‹, in some text modes. I found typo.el and typopunct.el. But it seems I would have to make some modifications to either of them if I wanted Czech quotation marks. Is there any other package that would be useful to achieve this beside the two?


texts: How to switch back and forth between two locations in a buffer

texts:
Sometimes I find myself frequently alternating between two functions that I am editing in conjunction with each other. In these situations, it is tedious and painful to keep on doing a C-s <functionname> to switch to the other function and then to find the exact place I was editing previously.

How do I set markers and then jump back and forth between two locations in the buffer with ease?


texts: Get org-agenda toggle all agenda and todo below frame (similar to ivy list buffer)

texts:
I have this function:

(defun org-agenda-show-agenda-and-todo (&optional arg)
    (interactive "p")
    (org-agenda arg "n"))

When calls, it will toggle a window with all of my current agenda and todo, like the pic below:

As you can see, it defaults to open a new window in a new vertical split.  If i want to close this window, I can just press q.  The problem comes when I'm already working with 2 windows, like this:

| windows 1 |  windows 2 |
|           |            |

If I call the same function, the org agenda and todo window would occupy window 2. So, like this:

| windows 1 |  org-agenda list |
|           |                  |

When I press q, the org-agenda list window would close, and so does my window 2 split. In other words, I am left with a single window with only window 1.

Is there a way or an alternative to show all of my agenda and list without disrupting the current layout of my windows arrangement? I am thinking of something similar to ivy list bookmark, which you can see in the pic below:

Here, I can peek at my bookmark and just choose which one I want. If I want to stop peeking, I press Esc and it goes away and my window arrangement is kept.


texts: How can I write [0,1) in LaTeX mode without breaking indentation?

texts:
When writing LaTeX using latex-mode, I often want to write "half-open intervals" in my text.  For instance, [0,1), which refers to the set of all numbers x with 0 <= x < 1.

Unfortunately, these "unbalanced delimiters" seem to confuse the indentation parser, causing following text to be indented inappropriately, usually drifting to the right.

Here's an example document.  The text below is the result after doing C-x h M-x indent-region.  The correct behavior would be to have all of both paragraphs indented by 0 spaces.

\documentclass{article}
\begin{document}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam volutpat
at dui et mattis. Here is a half open interval $[0,1)$.  Proin
  fringilla lectus nec mi tincidunt aliquet. Vestibulum fermentum eu
  neque id egestas. Here is another $[1,2)$.  Nullam et lectus
    convallis, placerat neque non, vehicula nisi.  Fusce imperdiet
    dignissim ante, eget fringilla nisi.

    Integer fermentum nunc eget purus molestie commodo. Integer
    tristique tincidunt odio, vel rutrum diam commodo quis. Fusce a
    aliquet quam. Cras suscipit est et nisl sollicitudin
    iaculis. Aliquam erat volutpat. Phasellus sapien arcu, aliquet ut
    hendrerit in, lobortis nec ante.

\end{document}

Currently I am working around this with an ugly hack: I define a LaTeX macro that expands to nothing, and write the "matching" delimiters inside an invocation of this macro.  This gets the indenter back in sync.

\documentclass{article}
\newcommand{\ugh}[1]{}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam volutpat
at dui et mattis. Here is a half open interval $[0,1)$.  Proin
  fringilla lectus nec mi tincidunt aliquet. Vestibulum fermentum eu
  neque id egestas. \ugh{(]} Now on the next line we are back in sync.
Nullam et lectus convallis, placerat neque non, vehicula nisi.  Fusce
imperdiet dignissim ante, eget fringilla nisi.
\end{document}

But this is really unpleasant.  Is there a better solution?

I'm using GNU Emacs 24.4.1.


texts: flyspell does not start form the first try

texts:
I used flyspell-mode with aspell backend before, but now I want to make the transition to the hunspell so that I could use multiple dictionaries.

To do so, I added the following lines to the init.el:

(setq ispell-program-name "hunspell")
(setq ispell-local-dictionary "en_US")
(setq ispell-local-dictionary-alist '(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "en_US") nil utf-8)))

But when I enable flyspell-mode for the first time in sesstion, it throws error:

Error enabling Flyspell mode:
(stringp nil)

When I enabling it again, it works just fine.

If I comment out all but the first line, flyspell fails every time.

How can I fix this?

GNU Emacs 26.1;
Debian buster;
flyspell 20181205;